Chromium Code Reviews| 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_H_ | 5 #ifndef MEDIA_FILTERS_DECODER_STREAM_H_ |
| 6 #define MEDIA_FILTERS_DECODER_STREAM_H_ | 6 #define MEDIA_FILTERS_DECODER_STREAM_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
|
ddorwin
2016/04/21 22:54:54
<memory>?
| |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "media/base/audio_decoder.h" | 15 #include "media/base/audio_decoder.h" |
| 16 #include "media/base/demuxer_stream.h" | 16 #include "media/base/demuxer_stream.h" |
| 17 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
| 18 #include "media/base/media_log.h" | 18 #include "media/base/media_log.h" |
| 19 #include "media/base/moving_average.h" | 19 #include "media/base/moving_average.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads. | 133 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads. |
| 134 STATE_ERROR | 134 STATE_ERROR |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 void SelectDecoder(CdmContext* cdm_context); | 137 void SelectDecoder(CdmContext* cdm_context); |
| 138 | 138 |
| 139 // Called when |decoder_selector| selected the |selected_decoder|. | 139 // Called when |decoder_selector| selected the |selected_decoder|. |
| 140 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream | 140 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream |
| 141 // is created to help decrypt the encrypted stream. | 141 // is created to help decrypt the encrypted stream. |
| 142 void OnDecoderSelected( | 142 void OnDecoderSelected( |
| 143 scoped_ptr<Decoder> selected_decoder, | 143 std::unique_ptr<Decoder> selected_decoder, |
| 144 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream); | 144 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream); |
| 145 | 145 |
| 146 // Satisfy pending |read_cb_| with |status| and |output|. | 146 // Satisfy pending |read_cb_| with |status| and |output|. |
| 147 void SatisfyRead(Status status, | 147 void SatisfyRead(Status status, |
| 148 const scoped_refptr<Output>& output); | 148 const scoped_refptr<Output>& output); |
| 149 | 149 |
| 150 // Decodes |buffer| and returns the result via OnDecodeOutputReady(). | 150 // Decodes |buffer| and returns the result via OnDecodeOutputReady(). |
| 151 void Decode(const scoped_refptr<DecoderBuffer>& buffer); | 151 void Decode(const scoped_refptr<DecoderBuffer>& buffer); |
| 152 | 152 |
| 153 // Flushes the decoder with an EOS buffer to retrieve internally buffered | 153 // Flushes the decoder with an EOS buffer to retrieve internally buffered |
| 154 // decoder output. | 154 // decoder output. |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 185 | 185 |
| 186 StatisticsCB statistics_cb_; | 186 StatisticsCB statistics_cb_; |
| 187 InitCB init_cb_; | 187 InitCB init_cb_; |
| 188 base::Closure waiting_for_decryption_key_cb_; | 188 base::Closure waiting_for_decryption_key_cb_; |
| 189 | 189 |
| 190 ReadCB read_cb_; | 190 ReadCB read_cb_; |
| 191 base::Closure reset_cb_; | 191 base::Closure reset_cb_; |
| 192 | 192 |
| 193 DemuxerStream* stream_; | 193 DemuxerStream* stream_; |
| 194 | 194 |
| 195 scoped_ptr<DecoderSelector<StreamType> > decoder_selector_; | 195 std::unique_ptr<DecoderSelector<StreamType>> decoder_selector_; |
| 196 | 196 |
| 197 scoped_ptr<Decoder> decoder_; | 197 std::unique_ptr<Decoder> decoder_; |
| 198 // When falling back from H/W decoding to S/W decoding, destructing the | 198 // When falling back from H/W decoding to S/W decoding, destructing the |
| 199 // GpuVideoDecoder too early results in black frames being displayed. | 199 // GpuVideoDecoder too early results in black frames being displayed. |
| 200 // |previous_decoder_| is used to keep it alive. It is destroyed once we've | 200 // |previous_decoder_| is used to keep it alive. It is destroyed once we've |
| 201 // decoded at least media::limits::kMaxVideoFrames frames after fallback. | 201 // decoded at least media::limits::kMaxVideoFrames frames after fallback. |
| 202 int decoded_frames_since_fallback_; | 202 int decoded_frames_since_fallback_; |
| 203 scoped_ptr<Decoder> previous_decoder_; | 203 std::unique_ptr<Decoder> previous_decoder_; |
| 204 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; | 204 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; |
| 205 | 205 |
| 206 SpliceObserverCB splice_observer_cb_; | 206 SpliceObserverCB splice_observer_cb_; |
| 207 ConfigChangeObserverCB config_change_observer_cb_; | 207 ConfigChangeObserverCB config_change_observer_cb_; |
| 208 | 208 |
| 209 // If a splice_timestamp() has been seen, this is true until a | 209 // If a splice_timestamp() has been seen, this is true until a |
| 210 // splice_timestamp() of kNoTimestamp() is encountered. | 210 // splice_timestamp() of kNoTimestamp() is encountered. |
| 211 bool active_splice_; | 211 bool active_splice_; |
| 212 | 212 |
| 213 // An end-of-stream buffer has been sent for decoding, no more buffers should | 213 // An end-of-stream buffer has been sent for decoding, no more buffers should |
| 214 // be sent for decoding until it completes. | 214 // be sent for decoding until it completes. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 234 | 234 |
| 235 template <> | 235 template <> |
| 236 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; | 236 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; |
| 237 | 237 |
| 238 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 238 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
| 239 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 239 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
| 240 | 240 |
| 241 } // namespace media | 241 } // namespace media |
| 242 | 242 |
| 243 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 243 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
| OLD | NEW |