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; | |
32 | 31 |
33 static std::string ToString(); | 32 static std::string ToString(); |
34 static void Initialize(DecoderType* decoder, | 33 static void Initialize(DecoderType* decoder, |
35 const DecoderConfigType& config, | 34 const DecoderConfigType& config, |
36 bool low_delay, | 35 bool low_delay, |
37 const PipelineStatusCB& status_cb, | 36 const PipelineStatusCB& status_cb); |
38 const OutputCB& output_cb); | |
39 static bool FinishInitialization(const StreamInitCB& init_cb, | 37 static bool FinishInitialization(const StreamInitCB& init_cb, |
40 DecoderType* decoder, | 38 DecoderType* decoder, |
41 DemuxerStream* stream); | 39 DemuxerStream* stream); |
42 static void ReportStatistics(const StatisticsCB& statistics_cb, | 40 static void ReportStatistics(const StatisticsCB& statistics_cb, |
43 int bytes_decoded); | 41 int bytes_decoded); |
44 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); | 42 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); |
45 }; | 43 }; |
46 | 44 |
47 template <> | 45 template <> |
48 struct DecoderStreamTraits<DemuxerStream::VIDEO> { | 46 struct DecoderStreamTraits<DemuxerStream::VIDEO> { |
49 typedef VideoFrame OutputType; | 47 typedef VideoFrame OutputType; |
50 typedef VideoDecoder DecoderType; | 48 typedef VideoDecoder DecoderType; |
51 typedef VideoDecoderConfig DecoderConfigType; | 49 typedef VideoDecoderConfig DecoderConfigType; |
52 typedef DecryptingVideoDecoder DecryptingDecoderType; | 50 typedef DecryptingVideoDecoder DecryptingDecoderType; |
53 typedef base::Callback<void(bool success)> StreamInitCB; | 51 typedef base::Callback<void(bool success)> StreamInitCB; |
54 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; | |
55 | 52 |
56 static std::string ToString(); | 53 static std::string ToString(); |
57 static void Initialize(DecoderType* decoder, | 54 static void Initialize(DecoderType* decoder, |
58 const DecoderConfigType& config, | 55 const DecoderConfigType& config, |
59 bool low_delay, | 56 bool low_delay, |
60 const PipelineStatusCB& status_cb, | 57 const PipelineStatusCB& status_cb); |
61 const OutputCB& output_cb); | |
62 static bool FinishInitialization(const StreamInitCB& init_cb, | 58 static bool FinishInitialization(const StreamInitCB& init_cb, |
63 DecoderType* decoder, | 59 DecoderType* decoder, |
64 DemuxerStream* stream); | 60 DemuxerStream* stream); |
65 static void ReportStatistics(const StatisticsCB& statistics_cb, | 61 static void ReportStatistics(const StatisticsCB& statistics_cb, |
66 int bytes_decoded); | 62 int bytes_decoded); |
67 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); | 63 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream); |
68 }; | 64 }; |
69 | 65 |
70 } // namespace media | 66 } // namespace media |
71 | 67 |
72 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ | 68 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ |
OLD | NEW |