| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/filters/decoder_stream_traits.h" | 5 #include "media/filters/decoder_stream_traits.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/base/audio_decoder.h" | 8 #include "media/base/audio_decoder.h" |
| 9 #include "media/base/audio_decoder_config.h" | 9 #include "media/base/audio_decoder_config.h" |
| 10 #include "media/base/video_decoder.h" | 10 #include "media/base/video_decoder.h" |
| 11 #include "media/base/video_decoder_config.h" | 11 #include "media/base/video_decoder_config.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 std::string DecoderStreamTraits<DemuxerStream::AUDIO>::ToString() { | 15 std::string DecoderStreamTraits<DemuxerStream::AUDIO>::ToString() { |
| 16 return "Audio"; | 16 return "Audio"; |
| 17 } | 17 } |
| 18 | 18 |
| 19 void DecoderStreamTraits<DemuxerStream::AUDIO>::Initialize( | 19 void DecoderStreamTraits<DemuxerStream::AUDIO>::Initialize( |
| 20 DecoderType* decoder, | 20 DecoderType* decoder, |
| 21 const DecoderConfigType& config, | 21 const DecoderConfigType& config, |
| 22 bool low_delay, | 22 bool low_delay, |
| 23 const PipelineStatusCB& status_cb, | 23 const PipelineStatusCB& status_cb) { |
| 24 const OutputCB& output_cb) { | 24 decoder->Initialize(config, status_cb); |
| 25 decoder->Initialize(config, status_cb, output_cb); | |
| 26 } | 25 } |
| 27 | 26 |
| 28 bool DecoderStreamTraits<DemuxerStream::AUDIO>::FinishInitialization( | 27 bool DecoderStreamTraits<DemuxerStream::AUDIO>::FinishInitialization( |
| 29 const StreamInitCB& init_cb, | 28 const StreamInitCB& init_cb, |
| 30 DecoderType* decoder, | 29 DecoderType* decoder, |
| 31 DemuxerStream* stream) { | 30 DemuxerStream* stream) { |
| 32 DCHECK(stream); | 31 DCHECK(stream); |
| 33 if (!decoder) { | 32 if (!decoder) { |
| 34 init_cb.Run(false); | 33 init_cb.Run(false); |
| 35 return false; | 34 return false; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 53 } | 52 } |
| 54 | 53 |
| 55 std::string DecoderStreamTraits<DemuxerStream::VIDEO>::ToString() { | 54 std::string DecoderStreamTraits<DemuxerStream::VIDEO>::ToString() { |
| 56 return "Video"; | 55 return "Video"; |
| 57 } | 56 } |
| 58 | 57 |
| 59 void DecoderStreamTraits<DemuxerStream::VIDEO>::Initialize( | 58 void DecoderStreamTraits<DemuxerStream::VIDEO>::Initialize( |
| 60 DecoderType* decoder, | 59 DecoderType* decoder, |
| 61 const DecoderConfigType& config, | 60 const DecoderConfigType& config, |
| 62 bool low_delay, | 61 bool low_delay, |
| 63 const PipelineStatusCB& status_cb, | 62 const PipelineStatusCB& status_cb) { |
| 64 const OutputCB& output_cb) { | 63 decoder->Initialize(config, low_delay, status_cb); |
| 65 decoder->Initialize(config, low_delay, status_cb, output_cb); | |
| 66 } | 64 } |
| 67 | 65 |
| 68 bool DecoderStreamTraits<DemuxerStream::VIDEO>::FinishInitialization( | 66 bool DecoderStreamTraits<DemuxerStream::VIDEO>::FinishInitialization( |
| 69 const StreamInitCB& init_cb, | 67 const StreamInitCB& init_cb, |
| 70 DecoderType* decoder, | 68 DecoderType* decoder, |
| 71 DemuxerStream* stream) { | 69 DemuxerStream* stream) { |
| 72 DCHECK(stream); | 70 DCHECK(stream); |
| 73 if (!decoder) { | 71 if (!decoder) { |
| 74 init_cb.Run(false); | 72 init_cb.Run(false); |
| 75 return false; | 73 return false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 statistics_cb.Run(statistics); | 86 statistics_cb.Run(statistics); |
| 89 } | 87 } |
| 90 | 88 |
| 91 DecoderStreamTraits<DemuxerStream::VIDEO>::DecoderConfigType | 89 DecoderStreamTraits<DemuxerStream::VIDEO>::DecoderConfigType |
| 92 DecoderStreamTraits<DemuxerStream::VIDEO>::GetDecoderConfig( | 90 DecoderStreamTraits<DemuxerStream::VIDEO>::GetDecoderConfig( |
| 93 DemuxerStream& stream) { | 91 DemuxerStream& stream) { |
| 94 return stream.video_decoder_config(); | 92 return stream.video_decoder_config(); |
| 95 } | 93 } |
| 96 | 94 |
| 97 } // namespace media | 95 } // namespace media |
| OLD | NEW |