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

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

Issue 591203003: media: Pass DemuxerStreamProvider in Renderer::Initialize(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 6 years, 2 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 | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
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.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 { 684 {
685 base::AutoLock auto_lock(lock_); 685 base::AutoLock auto_lock(lock_);
686 renderer_.reset(); 686 renderer_.reset();
687 } 687 }
688 OnError(PIPELINE_ERROR_COULD_NOT_RENDER); 688 OnError(PIPELINE_ERROR_COULD_NOT_RENDER);
689 return; 689 return;
690 } 690 }
691 691
692 base::WeakPtr<Pipeline> weak_this = weak_factory_.GetWeakPtr(); 692 base::WeakPtr<Pipeline> weak_this = weak_factory_.GetWeakPtr();
693 renderer_->Initialize( 693 renderer_->Initialize(
694 demuxer_,
694 done_cb, 695 done_cb,
695 base::Bind(&Pipeline::OnUpdateStatistics, weak_this), 696 base::Bind(&Pipeline::OnUpdateStatistics, weak_this),
696 base::Bind(&Pipeline::OnRendererEnded, weak_this), 697 base::Bind(&Pipeline::OnRendererEnded, weak_this),
697 base::Bind(&Pipeline::OnError, weak_this), 698 base::Bind(&Pipeline::OnError, weak_this),
698 base::Bind(&Pipeline::BufferingStateChanged, weak_this)); 699 base::Bind(&Pipeline::BufferingStateChanged, weak_this));
699 } 700 }
700 701
701 void Pipeline::ReportMetadata() { 702 void Pipeline::ReportMetadata() {
702 DCHECK(task_runner_->BelongsToCurrentThread()); 703 DCHECK(task_runner_->BelongsToCurrentThread());
703 PipelineMetadata metadata; 704 PipelineMetadata metadata;
704 metadata.has_audio = renderer_->HasAudio(); 705 metadata.has_audio = renderer_->HasAudio();
705 metadata.has_video = renderer_->HasVideo(); 706 metadata.has_video = renderer_->HasVideo();
706 metadata.timeline_offset = demuxer_->GetTimelineOffset(); 707 metadata.timeline_offset = demuxer_->GetTimelineOffset();
707 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); 708 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO);
708 if (stream) { 709 if (stream) {
709 metadata.natural_size = stream->video_decoder_config().natural_size(); 710 metadata.natural_size = stream->video_decoder_config().natural_size();
710 metadata.video_rotation = stream->video_rotation(); 711 metadata.video_rotation = stream->video_rotation();
711 } 712 }
712 metadata_cb_.Run(metadata); 713 metadata_cb_.Run(metadata);
713 } 714 }
714 715
715 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { 716 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) {
716 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 717 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
717 DCHECK(task_runner_->BelongsToCurrentThread()); 718 DCHECK(task_runner_->BelongsToCurrentThread());
718 buffering_state_cb_.Run(new_buffering_state); 719 buffering_state_cb_.Run(new_buffering_state);
719 } 720 }
720 721
721 } // namespace media 722 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_filters.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698