Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / filters / decoder_stream_traits.h
blob918f4ac1a28cac889cb3c9d69b05af58267ef956
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 AudioDecoderConfig DecoderConfigType;
29 typedef DecryptingAudioDecoder DecryptingDecoderType;
30 typedef base::Callback<void(bool success)> StreamInitCB;
32 static std::string ToString();
33 static void Initialize(DecoderType* decoder,
34 const DecoderConfigType& config,
35 bool low_delay,
36 const PipelineStatusCB& status_cb);
37 static bool FinishInitialization(const StreamInitCB& init_cb,
38 DecoderType* decoder,
39 DemuxerStream* stream);
40 static void ReportStatistics(const StatisticsCB& statistics_cb,
41 int bytes_decoded);
42 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream);
45 template <>
46 struct DecoderStreamTraits<DemuxerStream::VIDEO> {
47 typedef VideoFrame OutputType;
48 typedef VideoDecoder DecoderType;
49 typedef VideoDecoderConfig DecoderConfigType;
50 typedef DecryptingVideoDecoder DecryptingDecoderType;
51 typedef base::Callback<void(bool success)> StreamInitCB;
53 static std::string ToString();
54 static void Initialize(DecoderType* decoder,
55 const DecoderConfigType& config,
56 bool low_delay,
57 const PipelineStatusCB& status_cb);
58 static bool FinishInitialization(const StreamInitCB& init_cb,
59 DecoderType* decoder,
60 DemuxerStream* stream);
61 static void ReportStatistics(const StatisticsCB& statistics_cb,
62 int bytes_decoded);
63 static DecoderConfigType GetDecoderConfig(DemuxerStream& stream);
66 } // namespace media
68 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_