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