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 // TODO: PASS SCOPED PTR HERE | |
DaleCurtis
2016/06/20 18:40:33
?
chcunningham
2016/06/21 00:31:59
Fixed. Just a reminder to make this api take a con
| |
103 audio_ts_validator_->RecordOutputDuration(buffer.get()); | |
104 } | |
105 | |
106 DecoderStreamTraits<DemuxerStream::VIDEO>::DecoderStreamTraits( | |
107 const scoped_refptr<MediaLog>& media_log) {} | |
108 | |
109 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnStreamReset( | |
110 ConfigType config) {} | |
111 | |
112 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnDecode( | |
113 const scoped_refptr<DecoderBuffer>& buffer) {} | |
114 | |
115 void DecoderStreamTraits<DemuxerStream::VIDEO>::OnDecodeDone( | |
116 const scoped_refptr<OutputType>& buffer) {} | |
117 | |
118 template class DecoderStreamTraits<DemuxerStream::VIDEO>; | |
119 template class DecoderStreamTraits<DemuxerStream::AUDIO>; | |
120 | |
84 } // namespace media | 121 } // namespace media |
OLD | NEW |