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

Side by Side Diff: media/base/pipeline_impl.cc

Issue 2552493002: [Media] Record time it takes to start rendering audio and video (Closed)
Patch Set: Use RestartPlaybackStream and OnFirstFrameRender Created 4 years 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 | « no previous file | media/base/renderer_client.h » ('j') | media/renderers/renderer_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/pipeline_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 // RendererClient implementation. 108 // RendererClient implementation.
109 void OnError(PipelineStatus error) final; 109 void OnError(PipelineStatus error) final;
110 void OnEnded() final; 110 void OnEnded() final;
111 void OnStatisticsUpdate(const PipelineStatistics& stats) final; 111 void OnStatisticsUpdate(const PipelineStatistics& stats) final;
112 void OnBufferingStateChange(BufferingState state) final; 112 void OnBufferingStateChange(BufferingState state) final;
113 void OnWaitingForDecryptionKey() final; 113 void OnWaitingForDecryptionKey() final;
114 void OnVideoNaturalSizeChange(const gfx::Size& size) final; 114 void OnVideoNaturalSizeChange(const gfx::Size& size) final;
115 void OnVideoOpacityChange(bool opaque) final; 115 void OnVideoOpacityChange(bool opaque) final;
116 void OnDurationChange(base::TimeDelta duration) final; 116 void OnDurationChange(base::TimeDelta duration) final;
117 void OnFirstFrameRender() final;
117 118
118 // TextRenderer tasks and notifications. 119 // TextRenderer tasks and notifications.
119 void OnTextRendererEnded(); 120 void OnTextRendererEnded();
120 void AddTextStreamTask(DemuxerStream* text_stream, 121 void AddTextStreamTask(DemuxerStream* text_stream,
121 const TextTrackConfig& config); 122 const TextTrackConfig& config);
122 void RemoveTextStreamTask(DemuxerStream* text_stream); 123 void RemoveTextStreamTask(DemuxerStream* text_stream);
123 124
124 // Common handlers for notifications from renderers and demuxer. 125 // Common handlers for notifications from renderers and demuxer.
125 void OnPipelineError(PipelineStatus error); 126 void OnPipelineError(PipelineStatus error);
126 void OnCdmAttached(const CdmAttachedCB& cdm_attached_cb, 127 void OnCdmAttached(const CdmAttachedCB& cdm_attached_cb,
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 main_task_runner_->PostTask( 673 main_task_runner_->PostTask(
673 FROM_HERE, 674 FROM_HERE,
674 base::Bind(&PipelineImpl::OnVideoOpacityChange, weak_pipeline_, opaque)); 675 base::Bind(&PipelineImpl::OnVideoOpacityChange, weak_pipeline_, opaque));
675 } 676 }
676 677
677 void PipelineImpl::RendererWrapper::OnDurationChange(base::TimeDelta duration) { 678 void PipelineImpl::RendererWrapper::OnDurationChange(base::TimeDelta duration) {
678 DCHECK(media_task_runner_->BelongsToCurrentThread()); 679 DCHECK(media_task_runner_->BelongsToCurrentThread());
679 SetDuration(duration); 680 SetDuration(duration);
680 } 681 }
681 682
683 void PipelineImpl::RendererWrapper::OnFirstFrameRender() {
684 DCHECK(media_task_runner_->BelongsToCurrentThread());
685 NOTREACHED();
686 }
687
682 void PipelineImpl::RendererWrapper::OnTextRendererEnded() { 688 void PipelineImpl::RendererWrapper::OnTextRendererEnded() {
683 DCHECK(media_task_runner_->BelongsToCurrentThread()); 689 DCHECK(media_task_runner_->BelongsToCurrentThread());
684 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::TEXT_ENDED)); 690 media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::TEXT_ENDED));
685 691
686 if (state_ != kPlaying) 692 if (state_ != kPlaying)
687 return; 693 return;
688 694
689 DCHECK(!text_renderer_ended_); 695 DCHECK(!text_renderer_ended_);
690 text_renderer_ended_ = true; 696 text_renderer_ended_ = true;
691 CheckPlaybackEnded(); 697 CheckPlaybackEnded();
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 void PipelineImpl::OnSuspendDone() { 1314 void PipelineImpl::OnSuspendDone() {
1309 DVLOG(3) << __func__; 1315 DVLOG(3) << __func__;
1310 DCHECK(thread_checker_.CalledOnValidThread()); 1316 DCHECK(thread_checker_.CalledOnValidThread());
1311 DCHECK(IsRunning()); 1317 DCHECK(IsRunning());
1312 1318
1313 DCHECK(!suspend_cb_.is_null()); 1319 DCHECK(!suspend_cb_.is_null());
1314 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 1320 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
1315 } 1321 }
1316 1322
1317 } // namespace media 1323 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/renderer_client.h » ('j') | media/renderers/renderer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698