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 #ifndef MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ | 5 #ifndef MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ |
6 #define MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ | 6 #define MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ |
7 | 7 |
8 #include "media/base/demuxer_stream.h" | 8 #include "media/base/demuxer_stream.h" |
9 #include "media/base/pipeline_status.h" | 9 #include "media/base/pipeline_status.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 template <DemuxerStream::Type StreamType> | 21 template <DemuxerStream::Type StreamType> |
22 struct DecoderStreamTraits {}; | 22 struct DecoderStreamTraits {}; |
23 | 23 |
24 template <> | 24 template <> |
25 struct DecoderStreamTraits<DemuxerStream::AUDIO> { | 25 struct DecoderStreamTraits<DemuxerStream::AUDIO> { |
26 typedef AudioBuffer OutputType; | 26 typedef AudioBuffer OutputType; |
27 typedef AudioDecoder DecoderType; | 27 typedef AudioDecoder DecoderType; |
28 typedef AudioDecoderConfig DecoderConfigType; | 28 typedef AudioDecoderConfig DecoderConfigType; |
29 typedef DecryptingAudioDecoder DecryptingDecoderType; | 29 typedef DecryptingAudioDecoder DecryptingDecoderType; |
30 typedef base::Callback<void(bool success)> StreamInitCB; | 30 typedef base::Callback<void(bool success)> StreamInitCB; |
| 31 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; |
31 | 32 |
32 static std::string ToString(); | 33 static std::string ToString(); |
33 static void Initialize(DecoderType* decoder, | 34 static void Initialize(DecoderType* decoder, |
34 const DecoderConfigType& config, | 35 const DecoderConfigType& config, |
35 bool low_delay, | 36 bool low_delay, |
36 const PipelineStatusCB& status_cb); | 37 const PipelineStatusCB& status_cb, |
| 38 const OutputCB& output_cb); |
37 static bool FinishInitialization(const StreamInitCB& init_cb, | 39 static bool FinishInitialization(const StreamInitCB& init_cb, |
38 DecoderType* decoder, | 40 DecoderType* decoder, |
39 DemuxerStream* stream); | 41 DemuxerStream* stream); |
40 static void ReportStatistics(const StatisticsCB& statistics_cb, | 42 static void ReportStatistics(const StatisticsCB& statistics_cb, |
41 int bytes_decoded); | 43 int bytes_decoded); |
42 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); | 44 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); |
43 }; | 45 }; |
44 | 46 |
45 template <> | 47 template <> |
46 struct DecoderStreamTraits<DemuxerStream::VIDEO> { | 48 struct DecoderStreamTraits<DemuxerStream::VIDEO> { |
47 typedef VideoFrame OutputType; | 49 typedef VideoFrame OutputType; |
48 typedef VideoDecoder DecoderType; | 50 typedef VideoDecoder DecoderType; |
49 typedef VideoDecoderConfig DecoderConfigType; | 51 typedef VideoDecoderConfig DecoderConfigType; |
50 typedef DecryptingVideoDecoder DecryptingDecoderType; | 52 typedef DecryptingVideoDecoder DecryptingDecoderType; |
51 typedef base::Callback<void(bool success)> StreamInitCB; | 53 typedef base::Callback<void(bool success)> StreamInitCB; |
| 54 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; |
52 | 55 |
53 static std::string ToString(); | 56 static std::string ToString(); |
54 static void Initialize(DecoderType* decoder, | 57 static void Initialize(DecoderType* decoder, |
55 const DecoderConfigType& config, | 58 const DecoderConfigType& config, |
56 bool low_delay, | 59 bool low_delay, |
57 const PipelineStatusCB& status_cb); | 60 const PipelineStatusCB& status_cb, |
| 61 const OutputCB& output_cb); |
58 static bool FinishInitialization(const StreamInitCB& init_cb, | 62 static bool FinishInitialization(const StreamInitCB& init_cb, |
59 DecoderType* decoder, | 63 DecoderType* decoder, |
60 DemuxerStream* stream); | 64 DemuxerStream* stream); |
61 static void ReportStatistics(const StatisticsCB& statistics_cb, | 65 static void ReportStatistics(const StatisticsCB& statistics_cb, |
62 int bytes_decoded); | 66 int bytes_decoded); |
63 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); | 67 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); |
64 }; | 68 }; |
65 | 69 |
66 } // namespace media | 70 } // namespace media |
67 | 71 |
68 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ | 72 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ |
OLD | NEW |