OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, | 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, |
6 // potential deadlocks, etc... | 6 // potential deadlocks, etc... |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/condition_variable.h" | 10 #include "base/condition_variable.h" |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 DCHECK_EQ(MessageLoop::current(), message_loop_); | 1044 DCHECK_EQ(MessageLoop::current(), message_loop_); |
1045 DCHECK(IsPipelineOk()); | 1045 DCHECK(IsPipelineOk()); |
1046 | 1046 |
1047 scoped_refptr<DemuxerStream> stream = | 1047 scoped_refptr<DemuxerStream> stream = |
1048 FindDemuxerStream(demuxer, mime_type::kMajorTypeVideo); | 1048 FindDemuxerStream(demuxer, mime_type::kMajorTypeVideo); |
1049 | 1049 |
1050 if (!stream) | 1050 if (!stream) |
1051 return false; | 1051 return false; |
1052 | 1052 |
1053 scoped_refptr<VideoDecoder> video_decoder; | 1053 scoped_refptr<VideoDecoder> video_decoder; |
1054 filter_collection_->SelectVideoDecoder(&video_decoder); | 1054 int codec_id; |
| 1055 stream->media_format().GetAsInteger(MediaFormat::kFFmpegCodecID, &codec_id); |
| 1056 filter_collection_->SelectVideoDecoder(&video_decoder, codec_id); |
1055 | 1057 |
1056 if (!video_decoder) { | 1058 if (!video_decoder) { |
1057 SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING); | 1059 SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING); |
1058 return false; | 1060 return false; |
1059 } | 1061 } |
| 1062 VLOG(1) << "video decoder selected: " << video_decoder->filter_name(); |
1060 | 1063 |
1061 if (!PrepareFilter(video_decoder)) | 1064 if (!PrepareFilter(video_decoder)) |
1062 return false; | 1065 return false; |
1063 | 1066 |
1064 pipeline_init_state_->video_decoder_ = video_decoder; | 1067 pipeline_init_state_->video_decoder_ = video_decoder; |
1065 video_decoder->Initialize( | 1068 video_decoder->Initialize( |
1066 stream, | 1069 stream, |
1067 NewCallback(this, &PipelineImpl::OnFilterInitialize)); | 1070 NewCallback(this, &PipelineImpl::OnFilterInitialize)); |
1068 return true; | 1071 return true; |
1069 } | 1072 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 this, &PipelineImpl::OnFilterStateTransition)); | 1156 this, &PipelineImpl::OnFilterStateTransition)); |
1154 } | 1157 } |
1155 } else { | 1158 } else { |
1156 state_ = kStopped; | 1159 state_ = kStopped; |
1157 message_loop_->PostTask(FROM_HERE, | 1160 message_loop_->PostTask(FROM_HERE, |
1158 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); | 1161 NewRunnableMethod(this, &PipelineImpl::FinishDestroyingFiltersTask)); |
1159 } | 1162 } |
1160 } | 1163 } |
1161 | 1164 |
1162 } // namespace media | 1165 } // namespace media |
OLD | NEW |