| OLD | NEW |
| 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 void PipelineImpl::RendererWrapper::ReportMetadata() { | 846 void PipelineImpl::RendererWrapper::ReportMetadata() { |
| 847 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 847 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 848 | 848 |
| 849 PipelineMetadata metadata; | 849 PipelineMetadata metadata; |
| 850 metadata.timeline_offset = demuxer_->GetTimelineOffset(); | 850 metadata.timeline_offset = demuxer_->GetTimelineOffset(); |
| 851 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); | 851 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); |
| 852 if (stream) { | 852 if (stream) { |
| 853 metadata.has_video = true; | 853 metadata.has_video = true; |
| 854 metadata.natural_size = stream->video_decoder_config().natural_size(); | 854 metadata.natural_size = stream->video_decoder_config().natural_size(); |
| 855 metadata.video_rotation = stream->video_rotation(); | 855 metadata.video_rotation = stream->video_rotation(); |
| 856 metadata.video_decoder_config = stream->video_decoder_config(); |
| 856 } | 857 } |
| 857 if (demuxer_->GetStream(DemuxerStream::AUDIO)) { | 858 stream = demuxer_->GetStream(DemuxerStream::AUDIO); |
| 859 if (stream) { |
| 858 metadata.has_audio = true; | 860 metadata.has_audio = true; |
| 861 metadata.audio_decoder_config = stream->audio_decoder_config(); |
| 859 } | 862 } |
| 860 | 863 |
| 861 main_task_runner_->PostTask(FROM_HERE, base::Bind(&PipelineImpl::OnMetadata, | 864 main_task_runner_->PostTask(FROM_HERE, base::Bind(&PipelineImpl::OnMetadata, |
| 862 weak_pipeline_, metadata)); | 865 weak_pipeline_, metadata)); |
| 863 } | 866 } |
| 864 | 867 |
| 865 PipelineImpl::PipelineImpl( | 868 PipelineImpl::PipelineImpl( |
| 866 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 869 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
| 867 MediaLog* media_log) | 870 MediaLog* media_log) |
| 868 : media_task_runner_(media_task_runner), | 871 : media_task_runner_(media_task_runner), |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 void PipelineImpl::OnSuspendDone() { | 1256 void PipelineImpl::OnSuspendDone() { |
| 1254 DVLOG(3) << __func__; | 1257 DVLOG(3) << __func__; |
| 1255 DCHECK(thread_checker_.CalledOnValidThread()); | 1258 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1256 DCHECK(IsRunning()); | 1259 DCHECK(IsRunning()); |
| 1257 | 1260 |
| 1258 DCHECK(!suspend_cb_.is_null()); | 1261 DCHECK(!suspend_cb_.is_null()); |
| 1259 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); | 1262 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); |
| 1260 } | 1263 } |
| 1261 | 1264 |
| 1262 } // namespace media | 1265 } // namespace media |
| OLD | NEW |