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

Side by Side Diff: media/renderers/renderer_impl.cc

Issue 1053113002: Prime the landing pad for the new video rendering pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cc_unittests 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 "media/renderers/renderer_impl.h" 5 #include "media/renderers/renderer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT); 54 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_ABORT);
55 else if (!flush_cb_.is_null()) 55 else if (!flush_cb_.is_null())
56 base::ResetAndReturn(&flush_cb_).Run(); 56 base::ResetAndReturn(&flush_cb_).Run();
57 } 57 }
58 58
59 void RendererImpl::Initialize( 59 void RendererImpl::Initialize(
60 DemuxerStreamProvider* demuxer_stream_provider, 60 DemuxerStreamProvider* demuxer_stream_provider,
61 const PipelineStatusCB& init_cb, 61 const PipelineStatusCB& init_cb,
62 const StatisticsCB& statistics_cb, 62 const StatisticsCB& statistics_cb,
63 const BufferingStateCB& buffering_state_cb, 63 const BufferingStateCB& buffering_state_cb,
64 const PaintCB& paint_cb,
65 const base::Closure& ended_cb, 64 const base::Closure& ended_cb,
66 const PipelineStatusCB& error_cb, 65 const PipelineStatusCB& error_cb,
67 const base::Closure& waiting_for_decryption_key_cb) { 66 const base::Closure& waiting_for_decryption_key_cb) {
68 DVLOG(1) << __FUNCTION__; 67 DVLOG(1) << __FUNCTION__;
69 DCHECK(task_runner_->BelongsToCurrentThread()); 68 DCHECK(task_runner_->BelongsToCurrentThread());
70 DCHECK_EQ(state_, STATE_UNINITIALIZED); 69 DCHECK_EQ(state_, STATE_UNINITIALIZED);
71 DCHECK(!init_cb.is_null()); 70 DCHECK(!init_cb.is_null());
72 DCHECK(!statistics_cb.is_null()); 71 DCHECK(!statistics_cb.is_null());
73 DCHECK(!buffering_state_cb.is_null()); 72 DCHECK(!buffering_state_cb.is_null());
74 DCHECK(!paint_cb.is_null());
75 DCHECK(!ended_cb.is_null()); 73 DCHECK(!ended_cb.is_null());
76 DCHECK(!error_cb.is_null()); 74 DCHECK(!error_cb.is_null());
77 DCHECK(demuxer_stream_provider->GetStream(DemuxerStream::AUDIO) || 75 DCHECK(demuxer_stream_provider->GetStream(DemuxerStream::AUDIO) ||
78 demuxer_stream_provider->GetStream(DemuxerStream::VIDEO)); 76 demuxer_stream_provider->GetStream(DemuxerStream::VIDEO));
79 77
80 demuxer_stream_provider_ = demuxer_stream_provider; 78 demuxer_stream_provider_ = demuxer_stream_provider;
81 statistics_cb_ = statistics_cb; 79 statistics_cb_ = statistics_cb;
82 buffering_state_cb_ = buffering_state_cb; 80 buffering_state_cb_ = buffering_state_cb;
83 paint_cb_ = paint_cb;
84 ended_cb_ = ended_cb; 81 ended_cb_ = ended_cb;
85 error_cb_ = error_cb; 82 error_cb_ = error_cb;
86 init_cb_ = init_cb; 83 init_cb_ = init_cb;
87 waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb; 84 waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb;
88 85
89 state_ = STATE_INITIALIZING; 86 state_ = STATE_INITIALIZING;
90 InitializeAudioRenderer(); 87 InitializeAudioRenderer();
91 } 88 }
92 89
93 void RendererImpl::SetCdm(CdmContext* cdm_context, 90 void RendererImpl::SetCdm(CdmContext* cdm_context,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK)); 297 task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK));
301 return; 298 return;
302 } 299 }
303 300
304 video_renderer_->Initialize( 301 video_renderer_->Initialize(
305 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO), done_cb, 302 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO), done_cb,
306 base::Bind(&RendererImpl::SetDecryptorReadyCallback, weak_this_), 303 base::Bind(&RendererImpl::SetDecryptorReadyCallback, weak_this_),
307 base::Bind(&RendererImpl::OnUpdateStatistics, weak_this_), 304 base::Bind(&RendererImpl::OnUpdateStatistics, weak_this_),
308 base::Bind(&RendererImpl::OnBufferingStateChanged, weak_this_, 305 base::Bind(&RendererImpl::OnBufferingStateChanged, weak_this_,
309 &video_buffering_state_), 306 &video_buffering_state_),
310 base::ResetAndReturn(&paint_cb_),
311 base::Bind(&RendererImpl::OnVideoRendererEnded, weak_this_), 307 base::Bind(&RendererImpl::OnVideoRendererEnded, weak_this_),
312 base::Bind(&RendererImpl::OnError, weak_this_), 308 base::Bind(&RendererImpl::OnError, weak_this_),
313 base::Bind(&RendererImpl::GetWallClockTime, base::Unretained(this)), 309 base::Bind(&RendererImpl::GetWallClockTime, base::Unretained(this)),
314 waiting_for_decryption_key_cb_); 310 waiting_for_decryption_key_cb_);
315 } 311 }
316 312
317 void RendererImpl::OnVideoRendererInitializeDone(PipelineStatus status) { 313 void RendererImpl::OnVideoRendererInitializeDone(PipelineStatus status) {
318 DVLOG(1) << __FUNCTION__ << ": " << status; 314 DVLOG(1) << __FUNCTION__ << ": " << status;
319 DCHECK(task_runner_->BelongsToCurrentThread()); 315 DCHECK(task_runner_->BelongsToCurrentThread());
320 316
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 567 }
572 568
573 // After OnError() returns, the pipeline may destroy |this|. 569 // After OnError() returns, the pipeline may destroy |this|.
574 base::ResetAndReturn(&error_cb_).Run(error); 570 base::ResetAndReturn(&error_cb_).Run(error);
575 571
576 if (!flush_cb_.is_null()) 572 if (!flush_cb_.is_null())
577 base::ResetAndReturn(&flush_cb_).Run(); 573 base::ResetAndReturn(&flush_cb_).Run();
578 } 574 }
579 575
580 } // namespace media 576 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698