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

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

Issue 2835203006: media: Refactor VideoFrameStreamTest (Closed)
Patch Set: Created 3 years, 7 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') | media/filters/fake_video_decoder.h » ('J')
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 // Allows callers to register for notification of config changes; this is 106 // Allows callers to register for notification of config changes; this is
107 // called immediately after receiving the 'kConfigChanged' status from the 107 // called immediately after receiving the 'kConfigChanged' status from the
108 // DemuxerStream, before any action is taken to handle the config change. 108 // DemuxerStream, before any action is taken to handle the config change.
109 typedef base::Closure ConfigChangeObserverCB; 109 typedef base::Closure ConfigChangeObserverCB;
110 void set_config_change_observer( 110 void set_config_change_observer(
111 const ConfigChangeObserverCB& config_change_observer) { 111 const ConfigChangeObserverCB& config_change_observer) {
112 config_change_observer_cb_ = config_change_observer; 112 config_change_observer_cb_ = config_change_observer;
113 } 113 }
114 114
115 // Allows tests to keep track the currently selected decoder.
116 typedef base::RepeatingCallback<void(Decoder*)> DecoderChangeObserverCB;
DaleCurtis 2017/04/26 19:41:14 using.
xhwang 2017/04/27 21:11:14 Done.
117 void set_decoder_change_observer_for_testing(
118 const DecoderChangeObserverCB& decoder_change_observer_cb) {
DaleCurtis 2017/04/26 19:41:14 I believe std::move() is preferred now.
xhwang 2017/04/27 21:11:14 Done.
119 decoder_change_observer_cb_ = decoder_change_observer_cb;
120 }
121
115 int get_pending_buffers_size_for_testing() const { 122 int get_pending_buffers_size_for_testing() const {
116 return pending_buffers_.size(); 123 return pending_buffers_.size();
117 } 124 }
118 125
119 int get_fallback_buffers_size_for_testing() const { 126 int get_fallback_buffers_size_for_testing() const {
120 return fallback_buffers_.size(); 127 return fallback_buffers_.size();
121 } 128 }
122 129
123 private: 130 private:
124 enum State { 131 enum State {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 std::unique_ptr<DecoderSelector<StreamType>> decoder_selector_; 207 std::unique_ptr<DecoderSelector<StreamType>> decoder_selector_;
201 208
202 std::unique_ptr<Decoder> decoder_; 209 std::unique_ptr<Decoder> decoder_;
203 210
204 // Whether |decoder_| has produced a frame yet. Reset on fallback. 211 // Whether |decoder_| has produced a frame yet. Reset on fallback.
205 bool decoder_produced_a_frame_; 212 bool decoder_produced_a_frame_;
206 213
207 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; 214 std::unique_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_;
208 215
209 ConfigChangeObserverCB config_change_observer_cb_; 216 ConfigChangeObserverCB config_change_observer_cb_;
217 DecoderChangeObserverCB decoder_change_observer_cb_;
210 218
211 // An end-of-stream buffer has been sent for decoding, no more buffers should 219 // An end-of-stream buffer has been sent for decoding, no more buffers should
212 // be sent for decoding until it completes. 220 // be sent for decoding until it completes.
213 // TODO(sandersd): Turn this into a State. http://crbug.com/408316 221 // TODO(sandersd): Turn this into a State. http://crbug.com/408316
214 bool decoding_eos_; 222 bool decoding_eos_;
215 223
216 // Decoded buffers that haven't been read yet. Used when the decoder supports 224 // Decoded buffers that haven't been read yet. Used when the decoder supports
217 // parallel decoding. 225 // parallel decoding.
218 std::list<scoped_refptr<Output> > ready_outputs_; 226 std::list<scoped_refptr<Output> > ready_outputs_;
219 227
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 261
254 template <> 262 template <>
255 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const; 263 int DecoderStream<DemuxerStream::AUDIO>::GetMaxDecodeRequests() const;
256 264
257 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; 265 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream;
258 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; 266 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream;
259 267
260 } // namespace media 268 } // namespace media
261 269
262 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ 270 #endif // MEDIA_FILTERS_DECODER_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/decoder_stream.cc » ('j') | media/filters/fake_video_decoder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698