OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/media/cma/pipeline/video_pipeline_impl.h" | 5 #include "chromecast/media/cma/pipeline/video_pipeline_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chromecast/media/cma/backend/video_pipeline_device.h" | 8 #include "chromecast/media/cma/backend/video_pipeline_device.h" |
9 #include "chromecast/media/cma/base/buffering_defs.h" | 9 #include "chromecast/media/cma/base/buffering_defs.h" |
10 #include "chromecast/media/cma/base/cma_logging.h" | 10 #include "chromecast/media/cma/base/cma_logging.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 VideoPipelineImpl::VideoPipelineImpl(VideoPipelineDevice* video_device) | 22 VideoPipelineImpl::VideoPipelineImpl(VideoPipelineDevice* video_device) |
23 : video_device_(video_device), | 23 : video_device_(video_device), |
24 weak_factory_(this) { | 24 weak_factory_(this) { |
25 weak_this_ = weak_factory_.GetWeakPtr(); | 25 weak_this_ = weak_factory_.GetWeakPtr(); |
26 av_pipeline_impl_ = new AvPipelineImpl( | 26 av_pipeline_impl_ = new AvPipelineImpl( |
27 video_device_, | 27 video_device_, |
28 base::Bind(&VideoPipelineImpl::OnUpdateConfig, base::Unretained(this))); | 28 base::Bind(&VideoPipelineImpl::OnUpdateConfig, base::Unretained(this))); |
29 } | 29 } |
30 | 30 |
31 VideoPipelineImpl::~VideoPipelineImpl() { | 31 VideoPipelineImpl::~VideoPipelineImpl() { |
| 32 av_pipeline_impl_->Finalize(); |
32 } | 33 } |
33 | 34 |
34 void VideoPipelineImpl::SetCodedFrameProvider( | 35 void VideoPipelineImpl::SetCodedFrameProvider( |
35 scoped_ptr<CodedFrameProvider> frame_provider) { | 36 scoped_ptr<CodedFrameProvider> frame_provider) { |
36 av_pipeline_impl_->SetCodedFrameProvider( | 37 av_pipeline_impl_->SetCodedFrameProvider( |
37 frame_provider.Pass(), kAppVideoBufferSize, kMaxVideoFrameSize); | 38 frame_provider.Pass(), kAppVideoBufferSize, kMaxVideoFrameSize); |
38 } | 39 } |
39 | 40 |
40 bool VideoPipelineImpl::StartPlayingFrom( | 41 bool VideoPipelineImpl::StartPlayingFrom( |
41 base::TimeDelta time, | 42 base::TimeDelta time, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 delta_stats.video_frames_dropped = | 166 delta_stats.video_frames_dropped = |
166 current_stats.video_frames_dropped - previous_stats_.video_frames_dropped; | 167 current_stats.video_frames_dropped - previous_stats_.video_frames_dropped; |
167 | 168 |
168 previous_stats_ = current_stats; | 169 previous_stats_ = current_stats; |
169 | 170 |
170 video_client_.av_pipeline_client.statistics_cb.Run(delta_stats); | 171 video_client_.av_pipeline_client.statistics_cb.Run(delta_stats); |
171 } | 172 } |
172 | 173 |
173 } // namespace media | 174 } // namespace media |
174 } // namespace chromecast | 175 } // namespace chromecast |
OLD | NEW |