Roll src/breakpad/src 3ea146d:57c3d7c (svn 1405:1407)
[chromium-blink-merge.git] / media / filters / decoder_stream_traits.h
blob707ff1ca27fca0bbb8f49d68e16474d0fdd52890
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_
6 #define MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_
8 #include "media/base/demuxer_stream.h"
9 #include "media/base/pipeline_status.h"
11 namespace media {
13 class AudioBuffer;
14 class AudioDecoder;
15 class DecryptingAudioDecoder;
16 class DecryptingVideoDecoder;
17 class DemuxerStream;
18 class VideoDecoder;
19 class VideoFrame;
21 template <DemuxerStream::Type StreamType>
22 struct DecoderStreamTraits {};
24 template <>
25 struct DecoderStreamTraits<DemuxerStream::AUDIO> {
26 typedef AudioBuffer OutputType;
27 typedef AudioDecoder DecoderType;
28 typedef DecryptingAudioDecoder DecryptingDecoderType;
29 typedef base::Callback<void(bool success)> StreamInitCB;
30 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB;
32 static std::string ToString();
33 static void InitializeDecoder(DecoderType* decoder,
34 DemuxerStream* stream,
35 const PipelineStatusCB& status_cb,
36 const OutputCB& output_cb);
37 static bool NeedsBitstreamConversion(DecoderType* decoder) { return false; }
38 static void ReportStatistics(const StatisticsCB& statistics_cb,
39 int bytes_decoded);
40 static scoped_refptr<OutputType> CreateEOSOutput();
43 template <>
44 struct DecoderStreamTraits<DemuxerStream::VIDEO> {
45 typedef VideoFrame OutputType;
46 typedef VideoDecoder DecoderType;
47 typedef DecryptingVideoDecoder DecryptingDecoderType;
48 typedef base::Callback<void(bool success)> StreamInitCB;
49 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB;
51 static std::string ToString();
52 static void InitializeDecoder(DecoderType* decoder,
53 DemuxerStream* stream,
54 const PipelineStatusCB& status_cb,
55 const OutputCB& output_cb);
56 static bool NeedsBitstreamConversion(DecoderType* decoder);
57 static void ReportStatistics(const StatisticsCB& statistics_cb,
58 int bytes_decoded);
59 static scoped_refptr<OutputType> CreateEOSOutput();
62 } // namespace media
64 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_