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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 909 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
910 | 910 |
911 PipelineMetadata metadata; | 911 PipelineMetadata metadata; |
912 std::vector<DemuxerStream*> streams; | 912 std::vector<DemuxerStream*> streams; |
913 | 913 |
914 switch (demuxer_->GetType()) { | 914 switch (demuxer_->GetType()) { |
915 case MediaResource::Type::STREAM: | 915 case MediaResource::Type::STREAM: |
916 metadata.timeline_offset = demuxer_->GetTimelineOffset(); | 916 metadata.timeline_offset = demuxer_->GetTimelineOffset(); |
917 // TODO(servolk): What should we do about metadata for multiple streams? | 917 // TODO(servolk): What should we do about metadata for multiple streams? |
918 streams = demuxer_->GetAllStreams(); | 918 streams = demuxer_->GetAllStreams(); |
919 for (auto* stream : streams) { | 919 for (const auto& stream : streams) { |
920 if (stream->type() == DemuxerStream::VIDEO && !metadata.has_video) { | 920 if (stream->type() == DemuxerStream::VIDEO && !metadata.has_video) { |
921 metadata.has_video = true; | 921 metadata.has_video = true; |
922 metadata.natural_size = GetRotatedVideoSize( | 922 metadata.natural_size = GetRotatedVideoSize( |
923 stream->video_rotation(), | 923 stream->video_rotation(), |
924 stream->video_decoder_config().natural_size()); | 924 stream->video_decoder_config().natural_size()); |
925 metadata.video_rotation = stream->video_rotation(); | 925 metadata.video_rotation = stream->video_rotation(); |
926 metadata.video_decoder_config = stream->video_decoder_config(); | 926 metadata.video_decoder_config = stream->video_decoder_config(); |
927 } | 927 } |
928 if (stream->type() == DemuxerStream::AUDIO && !metadata.has_audio) { | 928 if (stream->type() == DemuxerStream::AUDIO && !metadata.has_audio) { |
929 metadata.has_audio = true; | 929 metadata.has_audio = true; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 void PipelineImpl::OnSuspendDone() { | 1357 void PipelineImpl::OnSuspendDone() { |
1358 DVLOG(3) << __func__; | 1358 DVLOG(3) << __func__; |
1359 DCHECK(thread_checker_.CalledOnValidThread()); | 1359 DCHECK(thread_checker_.CalledOnValidThread()); |
1360 DCHECK(IsRunning()); | 1360 DCHECK(IsRunning()); |
1361 | 1361 |
1362 DCHECK(!suspend_cb_.is_null()); | 1362 DCHECK(!suspend_cb_.is_null()); |
1363 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); | 1363 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); |
1364 } | 1364 } |
1365 | 1365 |
1366 } // namespace media | 1366 } // namespace media |
OLD | NEW |