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

Side by Side Diff: chromecast/renderer/media/video_pipeline_proxy.cc

Issue 1083883003: Move BindToCurrentLoop from media/base/ to base/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix media/base/callback_holder.h compile Created 5 years, 8 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
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/renderer/media/video_pipeline_proxy.h" 5 #include "chromecast/renderer/media/video_pipeline_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_to_current_loop.h"
8 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
9 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
11 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
12 #include "chromecast/common/media/cma_ipc_common.h" 13 #include "chromecast/common/media/cma_ipc_common.h"
13 #include "chromecast/common/media/cma_messages.h" 14 #include "chromecast/common/media/cma_messages.h"
14 #include "chromecast/common/media/shared_memory_chunk.h" 15 #include "chromecast/common/media/shared_memory_chunk.h"
15 #include "chromecast/media/cma/base/buffering_defs.h" 16 #include "chromecast/media/cma/base/buffering_defs.h"
16 #include "chromecast/media/cma/base/cma_logging.h" 17 #include "chromecast/media/cma/base/cma_logging.h"
17 #include "chromecast/media/cma/base/coded_frame_provider.h" 18 #include "chromecast/media/cma/base/coded_frame_provider.h"
18 #include "chromecast/media/cma/ipc/media_message_fifo.h" 19 #include "chromecast/media/cma/ipc/media_message_fifo.h"
19 #include "chromecast/media/cma/ipc_streamer/av_streamer_proxy.h" 20 #include "chromecast/media/cma/ipc_streamer/av_streamer_proxy.h"
20 #include "chromecast/renderer/media/cma_message_filter_proxy.h" 21 #include "chromecast/renderer/media/cma_message_filter_proxy.h"
21 #include "chromecast/renderer/media/media_channel_proxy.h" 22 #include "chromecast/renderer/media/media_channel_proxy.h"
22 #include "media/base/bind_to_current_loop.h"
23 #include "media/base/pipeline_status.h" 23 #include "media/base/pipeline_status.h"
24 24
25 namespace chromecast { 25 namespace chromecast {
26 namespace media { 26 namespace media {
27 27
28 namespace { 28 namespace {
29 29
30 void IgnoreResult() { 30 void IgnoreResult() {
31 } 31 }
32 32
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 // Release the underlying object on the right thread. 212 // Release the underlying object on the right thread.
213 io_message_loop_proxy_->PostTask( 213 io_message_loop_proxy_->PostTask(
214 FROM_HERE, 214 FROM_HERE,
215 base::Bind(&VideoPipelineProxyInternal::Release, base::Passed(&proxy_))); 215 base::Bind(&VideoPipelineProxyInternal::Release, base::Passed(&proxy_)));
216 } 216 }
217 217
218 void VideoPipelineProxy::SetClient( 218 void VideoPipelineProxy::SetClient(
219 const VideoPipelineClient& video_client) { 219 const VideoPipelineClient& video_client) {
220 DCHECK(thread_checker_.CalledOnValidThread()); 220 DCHECK(thread_checker_.CalledOnValidThread());
221 base::Closure pipe_read_cb = 221 base::Closure pipe_read_cb =
222 ::media::BindToCurrentLoop( 222 base::BindToCurrentLoop(
223 base::Bind(&VideoPipelineProxy::OnPipeRead, weak_this_)); 223 base::Bind(&VideoPipelineProxy::OnPipeRead, weak_this_));
224 FORWARD_ON_IO_THREAD(SetClient, pipe_read_cb, video_client); 224 FORWARD_ON_IO_THREAD(SetClient, pipe_read_cb, video_client);
225 } 225 }
226 226
227 void VideoPipelineProxy::Initialize( 227 void VideoPipelineProxy::Initialize(
228 const ::media::VideoDecoderConfig& config, 228 const ::media::VideoDecoderConfig& config,
229 scoped_ptr<CodedFrameProvider> frame_provider, 229 scoped_ptr<CodedFrameProvider> frame_provider,
230 const ::media::PipelineStatusCB& status_cb) { 230 const ::media::PipelineStatusCB& status_cb) {
231 CMALOG(kLogControl) << "VideoPipelineProxy::Initialize"; 231 CMALOG(kLogControl) << "VideoPipelineProxy::Initialize";
232 DCHECK(thread_checker_.CalledOnValidThread()); 232 DCHECK(thread_checker_.CalledOnValidThread());
233 video_streamer_->SetCodedFrameProvider(frame_provider.Pass()); 233 video_streamer_->SetCodedFrameProvider(frame_provider.Pass());
234 234
235 VideoPipelineProxyInternal::SharedMemCB shared_mem_cb = 235 VideoPipelineProxyInternal::SharedMemCB shared_mem_cb =
236 ::media::BindToCurrentLoop(base::Bind( 236 base::BindToCurrentLoop(base::Bind(
237 &VideoPipelineProxy::OnAvPipeCreated, weak_this_, 237 &VideoPipelineProxy::OnAvPipeCreated, weak_this_,
238 config, status_cb)); 238 config, status_cb));
239 FORWARD_ON_IO_THREAD(CreateAvPipe, shared_mem_cb); 239 FORWARD_ON_IO_THREAD(CreateAvPipe, shared_mem_cb);
240 } 240 }
241 241
242 void VideoPipelineProxy::OnAvPipeCreated( 242 void VideoPipelineProxy::OnAvPipeCreated(
243 const ::media::VideoDecoderConfig& config, 243 const ::media::VideoDecoderConfig& config,
244 const ::media::PipelineStatusCB& status_cb, 244 const ::media::PipelineStatusCB& status_cb,
245 scoped_ptr<base::SharedMemory> shared_memory) { 245 scoped_ptr<base::SharedMemory> shared_memory) {
246 CMALOG(kLogControl) << "VideoPipelineProxy::OnAvPipeCreated"; 246 CMALOG(kLogControl) << "VideoPipelineProxy::OnAvPipeCreated";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 FORWARD_ON_IO_THREAD(NotifyPipeWrite); 289 FORWARD_ON_IO_THREAD(NotifyPipeWrite);
290 } 290 }
291 291
292 void VideoPipelineProxy::OnPipeRead() { 292 void VideoPipelineProxy::OnPipeRead() {
293 DCHECK(thread_checker_.CalledOnValidThread()); 293 DCHECK(thread_checker_.CalledOnValidThread());
294 if (video_streamer_) 294 if (video_streamer_)
295 video_streamer_->OnFifoReadEvent(); 295 video_streamer_->OnFifoReadEvent();
296 } 296 }
297 297
298 } // namespace media 298 } // namespace media
299 } // namespace chromecast 299 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/renderer/media/audio_pipeline_proxy.cc ('k') | content/browser/media/capture/content_video_capture_device_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698