| 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/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/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 | 207 |
| 208 VideoPipelineProxy::~VideoPipelineProxy() { | 208 VideoPipelineProxy::~VideoPipelineProxy() { |
| 209 DCHECK(thread_checker_.CalledOnValidThread()); | 209 DCHECK(thread_checker_.CalledOnValidThread()); |
| 210 // Release the underlying object on the right thread. | 210 // Release the underlying object on the right thread. |
| 211 io_task_runner_->PostTask( | 211 io_task_runner_->PostTask( |
| 212 FROM_HERE, | 212 FROM_HERE, |
| 213 base::Bind(&VideoPipelineProxyInternal::Release, base::Passed(&proxy_))); | 213 base::Bind(&VideoPipelineProxyInternal::Release, base::Passed(&proxy_))); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void VideoPipelineProxy::SetClient( | 216 void VideoPipelineProxy::SetClient(const VideoPipelineClient& video_client) { |
| 217 const VideoPipelineClient& video_client) { | |
| 218 DCHECK(thread_checker_.CalledOnValidThread()); | 217 DCHECK(thread_checker_.CalledOnValidThread()); |
| 219 base::Closure pipe_read_cb = | 218 base::Closure pipe_read_cb = |
| 220 ::media::BindToCurrentLoop( | 219 ::media::BindToCurrentLoop( |
| 221 base::Bind(&VideoPipelineProxy::OnPipeRead, weak_this_)); | 220 base::Bind(&VideoPipelineProxy::OnPipeRead, weak_this_)); |
| 222 FORWARD_ON_IO_THREAD(SetClient, pipe_read_cb, video_client); | 221 FORWARD_ON_IO_THREAD(SetClient, pipe_read_cb, video_client); |
| 223 } | 222 } |
| 224 | 223 |
| 225 void VideoPipelineProxy::Initialize( | 224 void VideoPipelineProxy::Initialize( |
| 226 const std::vector<::media::VideoDecoderConfig>& configs, | 225 const std::vector<::media::VideoDecoderConfig>& configs, |
| 227 scoped_ptr<CodedFrameProvider> frame_provider, | 226 scoped_ptr<CodedFrameProvider> frame_provider, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 FORWARD_ON_IO_THREAD(NotifyPipeWrite); | 286 FORWARD_ON_IO_THREAD(NotifyPipeWrite); |
| 288 } | 287 } |
| 289 | 288 |
| 290 void VideoPipelineProxy::OnPipeRead() { | 289 void VideoPipelineProxy::OnPipeRead() { |
| 291 DCHECK(thread_checker_.CalledOnValidThread()); | 290 DCHECK(thread_checker_.CalledOnValidThread()); |
| 292 if (video_streamer_) | 291 if (video_streamer_) |
| 293 video_streamer_->OnFifoReadEvent(); | 292 video_streamer_->OnFifoReadEvent(); |
| 294 } | 293 } |
| 295 | 294 |
| 296 } // namespace media | 295 } // namespace media |
| 297 } // namespace chromecast | 296 } // namespace chromecast |
| OLD | NEW |