| 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 <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 enum State { | 129 enum State { |
| 130 STATE_UNINITIALIZED, | 130 STATE_UNINITIALIZED, |
| 131 STATE_INITIALIZING, | 131 STATE_INITIALIZING, |
| 132 STATE_NORMAL, // Includes idle, pending decoder decode/reset. | 132 STATE_NORMAL, // Includes idle, pending decoder decode/reset. |
| 133 STATE_FLUSHING_DECODER, | 133 STATE_FLUSHING_DECODER, |
| 134 STATE_REINITIALIZING_DECODER, | 134 STATE_REINITIALIZING_DECODER, |
| 135 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads. | 135 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads. |
| 136 STATE_ERROR, | 136 STATE_ERROR, |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 void SelectDecoder(CdmContext* cdm_context); | 139 void SelectDecoder(); |
| 140 | 140 |
| 141 // Called when |decoder_selector| selected the |selected_decoder|. | 141 // Called when |decoder_selector| selected the |selected_decoder|. |
| 142 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream | 142 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream |
| 143 // is created to help decrypt the encrypted stream. | 143 // is created to help decrypt the encrypted stream. |
| 144 void OnDecoderSelected( | 144 void OnDecoderSelected( |
| 145 std::unique_ptr<Decoder> selected_decoder, | 145 std::unique_ptr<Decoder> selected_decoder, |
| 146 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream); | 146 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream); |
| 147 | 147 |
| 148 // Satisfy pending |read_cb_| with |status| and |output|. | 148 // Satisfy pending |read_cb_| with |status| and |output|. |
| 149 void SatisfyRead(Status status, | 149 void SatisfyRead(Status status, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 StatisticsCB statistics_cb_; | 194 StatisticsCB statistics_cb_; |
| 195 InitCB init_cb_; | 195 InitCB init_cb_; |
| 196 base::Closure waiting_for_decryption_key_cb_; | 196 base::Closure waiting_for_decryption_key_cb_; |
| 197 | 197 |
| 198 ReadCB read_cb_; | 198 ReadCB read_cb_; |
| 199 base::Closure reset_cb_; | 199 base::Closure reset_cb_; |
| 200 | 200 |
| 201 DemuxerStream* stream_; | 201 DemuxerStream* stream_; |
| 202 | 202 |
| 203 CdmContext* cdm_context_; |
| 204 |
| 203 std::unique_ptr<DecoderSelector<StreamType>> decoder_selector_; | 205 std::unique_ptr<DecoderSelector<StreamType>> decoder_selector_; |
| 204 | 206 |
| 205 std::unique_ptr<Decoder> decoder_; | 207 std::unique_ptr<Decoder> decoder_; |
| 206 // When falling back from H/W decoding to S/W decoding, destructing the | 208 // When falling back from H/W decoding to S/W decoding, destructing the |
| 207 // GpuVideoDecoder too early results in black frames being displayed. | 209 // GpuVideoDecoder too early results in black frames being displayed. |
| 208 // |previous_decoder_| is used to keep it alive. It is destroyed once we've | 210 // |previous_decoder_| is used to keep it alive. It is destroyed once we've |
| 209 // decoded at least media::limits::kMaxVideoFrames frames after fallback. | 211 // decoded at least media::limits::kMaxVideoFrames frames after fallback. |
| 210 int decoded_frames_since_fallback_; | 212 int decoded_frames_since_fallback_; |
| 211 std::unique_ptr<Decoder> previous_decoder_; | 213 std::unique_ptr<Decoder> previous_decoder_; |
| 212 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; | 214 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 260 |
| 259 template <> | 261 template <> |
| 260 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; | 262 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; |
| 261 | 263 |
| 262 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 264 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
| 263 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 265 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
| 264 | 266 |
| 265 } // namespace media | 267 } // namespace media |
| 266 | 268 |
| 267 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 269 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
| OLD | NEW |