Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chromecast/media/cma/pipeline/video_pipeline_impl.cc

Issue 974623002: Chromecast: mitigate threading issue between AvPipeline/MediaKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes some bugs Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromecast/media/cma/pipeline/video_pipeline_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chromecast/media/cma/base/coded_frame_provider.h" 11 #include "chromecast/media/cma/base/coded_frame_provider.h"
12 #include "chromecast/media/cma/pipeline/av_pipeline_impl.h" 12 #include "chromecast/media/cma/pipeline/av_pipeline_impl.h"
13 #include "media/base/video_decoder_config.h" 13 #include "media/base/video_decoder_config.h"
14 14
15 namespace chromecast { 15 namespace chromecast {
16 namespace media { 16 namespace media {
17 17
18 namespace { 18 namespace {
19 const size_t kMaxVideoFrameSize = 1024 * 1024; 19 const size_t kMaxVideoFrameSize = 1024 * 1024;
20 } 20 }
21 21
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_.reset(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 } 32 }
33 33
34 void VideoPipelineImpl::SetCodedFrameProvider( 34 void VideoPipelineImpl::SetCodedFrameProvider(
35 scoped_ptr<CodedFrameProvider> frame_provider) { 35 scoped_ptr<CodedFrameProvider> frame_provider) {
36 av_pipeline_impl_->SetCodedFrameProvider( 36 av_pipeline_impl_->SetCodedFrameProvider(
37 frame_provider.Pass(), kAppVideoBufferSize, kMaxVideoFrameSize); 37 frame_provider.Pass(), kAppVideoBufferSize, kMaxVideoFrameSize);
38 } 38 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 delta_stats.video_frames_dropped = 165 delta_stats.video_frames_dropped =
166 current_stats.video_frames_dropped - previous_stats_.video_frames_dropped; 166 current_stats.video_frames_dropped - previous_stats_.video_frames_dropped;
167 167
168 previous_stats_ = current_stats; 168 previous_stats_ = current_stats;
169 169
170 video_client_.av_pipeline_client.statistics_cb.Run(delta_stats); 170 video_client_.av_pipeline_client.statistics_cb.Run(delta_stats);
171 } 171 }
172 172
173 } // namespace media 173 } // namespace media
174 } // namespace chromecast 174 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/video_pipeline_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698