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 #include "media/filters/decoder_stream_traits.h" | 5 #include "media/filters/decoder_stream_traits.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/audio_buffer.h" | 8 #include "media/base/audio_buffer.h" |
9 #include "media/base/audio_decoder.h" | 9 #include "media/base/audio_decoder.h" |
10 #include "media/base/audio_decoder_config.h" | 10 #include "media/base/audio_decoder_config.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 PipelineStatistics statistics; | 74 PipelineStatistics statistics; |
75 statistics.video_bytes_decoded = bytes_decoded; | 75 statistics.video_bytes_decoded = bytes_decoded; |
76 statistics_cb.Run(statistics); | 76 statistics_cb.Run(statistics); |
77 } | 77 } |
78 | 78 |
79 scoped_refptr<DecoderStreamTraits<DemuxerStream::VIDEO>::OutputType> | 79 scoped_refptr<DecoderStreamTraits<DemuxerStream::VIDEO>::OutputType> |
80 DecoderStreamTraits<DemuxerStream::VIDEO>::CreateEOSOutput() { | 80 DecoderStreamTraits<DemuxerStream::VIDEO>::CreateEOSOutput() { |
81 return OutputType::CreateEOSFrame(); | 81 return OutputType::CreateEOSFrame(); |
82 } | 82 } |
83 | 83 |
| 84 DecoderStreamTraits<DemuxerStream::AUDIO>::DecoderStreamTraits( |
| 85 const scoped_refptr<MediaLog>& media_log) |
| 86 : media_log_(media_log) {} |
| 87 |
| 88 void DecoderStreamTraits<DemuxerStream::AUDIO>::OnStreamReset( |
| 89 ConfigType config) { |
| 90 // Stream is likely being seeked to a new timestamp, so make new validator to |
| 91 // build new timestamp expectations. |
| 92 audio_ts_validator_.reset(new AudioTimestampValidator(config, media_log_)); |
| 93 } |
| 94 |
| 95 void DecoderStreamTraits<DemuxerStream::AUDIO>::OnDecode( |
| 96 const scoped_refptr<DecoderBuffer>& buffer) { |
| 97 audio_ts_validator_->CheckForTimestampGap(buffer); |
| 98 } |
| 99 |
| 100 void DecoderStreamTraits<DemuxerStream::AUDIO>::OnDecodeDone( |
| 101 const scoped_refptr<OutputType>& buffer) { |
| 102 audio_ts_validator_->RecordOutputDuration(buffer); |
| 103 } |
| 104 |
| 105 DecoderStreamTraits<DemuxerStream::VIDEO>::DecoderStreamTraits( |
| 106 const scoped_refptr<MediaLog>& media_log) {} |
| 107 |
| 108 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnStreamReset( |
| 109 ConfigType config) {} |
| 110 |
| 111 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnDecode( |
| 112 const scoped_refptr<DecoderBuffer>& buffer) {} |
| 113 |
| 114 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnDecodeDone( |
| 115 const scoped_refptr<OutputType>& buffer) {} |
| 116 |
| 117 template class DecoderStreamTraits<DemuxerStream::VIDEO>; |
| 118 template class DecoderStreamTraits<DemuxerStream::AUDIO>; |
| 119 |
84 } // namespace media | 120 } // namespace media |
OLD | NEW |