Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1403)

Side by Side Diff: media/filters/decoder_stream.h

Issue 2110463003: Remove pending demuxer read state, prefer flag, it's not stable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use expect. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/filters/decoder_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 int get_fallback_buffers_size_for_testing() const { 134 int get_fallback_buffers_size_for_testing() const {
135 return fallback_buffers_.size(); 135 return fallback_buffers_.size();
136 } 136 }
137 137
138 private: 138 private:
139 enum State { 139 enum State {
140 STATE_UNINITIALIZED, 140 STATE_UNINITIALIZED,
141 STATE_INITIALIZING, 141 STATE_INITIALIZING,
142 STATE_NORMAL, // Includes idle, pending decoder decode/reset. 142 STATE_NORMAL, // Includes idle, pending decoder decode/reset.
143 STATE_FLUSHING_DECODER, 143 STATE_FLUSHING_DECODER,
144 STATE_PENDING_DEMUXER_READ,
145 STATE_REINITIALIZING_DECODER, 144 STATE_REINITIALIZING_DECODER,
146 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads. 145 STATE_END_OF_STREAM, // End of stream reached; returns EOS on all reads.
147 STATE_ERROR, 146 STATE_ERROR,
148 }; 147 };
149 148
150 void SelectDecoder(CdmContext* cdm_context); 149 void SelectDecoder(CdmContext* cdm_context);
151 150
152 // Called when |decoder_selector| selected the |selected_decoder|. 151 // Called when |decoder_selector| selected the |selected_decoder|.
153 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream 152 // |decrypting_demuxer_stream| was also populated if a DecryptingDemuxerStream
154 // is created to help decrypt the encrypted stream. 153 // is created to help decrypt the encrypted stream.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 249
251 // Stores buffers that are guaranteed to be fed to the decoder before fetching 250 // Stores buffers that are guaranteed to be fed to the decoder before fetching
252 // more from the demuxer stream. All buffers in this queue first were in 251 // more from the demuxer stream. All buffers in this queue first were in
253 // |pending_buffers_|. 252 // |pending_buffers_|.
254 std::deque<scoped_refptr<DecoderBuffer>> fallback_buffers_; 253 std::deque<scoped_refptr<DecoderBuffer>> fallback_buffers_;
255 254
256 // TODO(tguilbert): support config changes during decoder fallback, see 255 // TODO(tguilbert): support config changes during decoder fallback, see
257 // crbug.com/603713 256 // crbug.com/603713
258 bool received_config_change_during_reinit_; 257 bool received_config_change_during_reinit_;
259 258
260 // Used to track read requests in case the STATE_PENDIND_DEMUXER_READ get 259 // Used to track read requests; not rolled into |state_| since that is
261 // overwritten by an error. 260 // overwritten in many cases.
262 bool pending_demuxer_read_; 261 bool pending_demuxer_read_;
263 262
264 // NOTE: Weak pointers must be invalidated before all other member variables. 263 // NOTE: Weak pointers must be invalidated before all other member variables.
265 base::WeakPtrFactory<DecoderStream<StreamType>> weak_factory_; 264 base::WeakPtrFactory<DecoderStream<StreamType>> weak_factory_;
266 265
267 // Used to invalidate pending decode requests and output callbacks when 266 // Used to invalidate pending decode requests and output callbacks when
268 // falling back to a new decoder (on first decode error). 267 // falling back to a new decoder (on first decode error).
269 base::WeakPtrFactory<DecoderStream<StreamType>> fallback_weak_factory_; 268 base::WeakPtrFactory<DecoderStream<StreamType>> fallback_weak_factory_;
270 }; 269 };
271 270
272 template <> 271 template <>
273 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; 272 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const;
274 273
275 template <> 274 template <>
276 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; 275 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const;
277 276
278 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; 277 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream;
279 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; 278 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream;
280 279
281 } // namespace media 280 } // namespace media
282 281
283 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ 282 #endif // MEDIA_FILTERS_DECODER_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/decoder_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698