| 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 "base/time/time.h" |
| 8 #include "media/base/cdm_context.h" | 9 #include "media/base/cdm_context.h" |
| 9 #include "media/base/demuxer_stream.h" | 10 #include "media/base/demuxer_stream.h" |
| 11 #include "media/base/moving_average.h" |
| 10 #include "media/base/pipeline_status.h" | 12 #include "media/base/pipeline_status.h" |
| 11 #include "media/base/video_decoder_config.h" | 13 #include "media/base/video_decoder_config.h" |
| 12 #include "media/filters/audio_timestamp_validator.h" | 14 #include "media/filters/audio_timestamp_validator.h" |
| 13 | 15 |
| 14 namespace media { | 16 namespace media { |
| 15 | 17 |
| 16 class AudioBuffer; | 18 class AudioBuffer; |
| 17 class AudioDecoder; | 19 class AudioDecoder; |
| 18 class CdmContext; | 20 class CdmContext; |
| 19 class DecryptingAudioDecoder; | 21 class DecryptingAudioDecoder; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 typedef DecryptingVideoDecoder DecryptingDecoderType; | 70 typedef DecryptingVideoDecoder DecryptingDecoderType; |
| 69 typedef base::Callback<void(bool success)> InitCB; | 71 typedef base::Callback<void(bool success)> InitCB; |
| 70 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; | 72 typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; |
| 71 | 73 |
| 72 static std::string ToString(); | 74 static std::string ToString(); |
| 73 static bool NeedsBitstreamConversion(DecoderType* decoder); | 75 static bool NeedsBitstreamConversion(DecoderType* decoder); |
| 74 static void ReportStatistics(const StatisticsCB& statistics_cb, | 76 static void ReportStatistics(const StatisticsCB& statistics_cb, |
| 75 int bytes_decoded); | 77 int bytes_decoded); |
| 76 static scoped_refptr<OutputType> CreateEOSOutput(); | 78 static scoped_refptr<OutputType> CreateEOSOutput(); |
| 77 | 79 |
| 78 explicit DecoderStreamTraits(const scoped_refptr<MediaLog>& media_log) {} | 80 explicit DecoderStreamTraits(const scoped_refptr<MediaLog>& media_log); |
| 79 | 81 |
| 80 void InitializeDecoder(DecoderType* decoder, | 82 void InitializeDecoder(DecoderType* decoder, |
| 81 DemuxerStream* stream, | 83 DemuxerStream* stream, |
| 82 CdmContext* cdm_context, | 84 CdmContext* cdm_context, |
| 83 const InitCB& init_cb, | 85 const InitCB& init_cb, |
| 84 const OutputCB& output_cb); | 86 const OutputCB& output_cb); |
| 85 void OnDecode(const scoped_refptr<DecoderBuffer>& buffer) {} | 87 void OnDecode(const scoped_refptr<DecoderBuffer>& buffer); |
| 86 void OnDecodeDone(const scoped_refptr<OutputType>& buffer) {} | 88 void OnDecodeDone(const scoped_refptr<OutputType>& buffer) {} |
| 87 void OnStreamReset(DemuxerStream* stream) {} | 89 void OnStreamReset(DemuxerStream* stream); |
| 90 |
| 91 private: |
| 92 void ResetMetrics(); |
| 93 |
| 94 MovingAverage keyframe_distance_average_; |
| 95 base::TimeDelta last_keyframe_timestamp_; |
| 96 base::TimeDelta max_average_; |
| 88 }; | 97 }; |
| 89 | 98 |
| 90 } // namespace media | 99 } // namespace media |
| 91 | 100 |
| 92 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ | 101 #endif // MEDIA_FILTERS_DECODER_STREAM_TRAITS_H_ |
| OLD | NEW |