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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 // it is stopped. This method can be called at any time but not during another | 80 // it is stopped. This method can be called at any time but not during another |
81 // pending Stop(). | 81 // pending Stop(). |
82 void Stop(const base::Closure& closure); | 82 void Stop(const base::Closure& closure); |
83 | 83 |
84 // Returns true if the decoder currently has the ability to decode and return | 84 // Returns true if the decoder currently has the ability to decode and return |
85 // an Output. | 85 // an Output. |
86 // TODO(rileya): Remove the need for this by refactoring Decoder queueing | 86 // TODO(rileya): Remove the need for this by refactoring Decoder queueing |
87 // behavior. | 87 // behavior. |
88 bool CanReadWithoutStalling() const; | 88 bool CanReadWithoutStalling() const; |
89 | 89 |
90 // Returns true if one more decode request can be submitted to the decoder. | |
91 bool CanDecodeAnotherBuffer() const; | |
92 | |
90 // Allows callers to register for notification of splice buffers from the | 93 // Allows callers to register for notification of splice buffers from the |
91 // demuxer. I.e., DecoderBuffer::splice_timestamp() is not kNoTimestamp(). | 94 // demuxer. I.e., DecoderBuffer::splice_timestamp() is not kNoTimestamp(). |
92 typedef base::Callback<void(base::TimeDelta)> SpliceObserverCB; | 95 typedef base::Callback<void(base::TimeDelta)> SpliceObserverCB; |
93 void set_splice_observer(const SpliceObserverCB& splice_observer) { | 96 void set_splice_observer(const SpliceObserverCB& splice_observer) { |
94 splice_observer_cb_ = splice_observer; | 97 splice_observer_cb_ = splice_observer; |
95 } | 98 } |
96 | 99 |
97 // Allows callers to register for notification of config changes; this is | 100 // Allows callers to register for notification of config changes; this is |
98 // called immediately after recieving the 'kConfigChanged' status from the | 101 // called immediately after recieving the 'kConfigChanged' status from the |
99 // DemuxerStream, before any action is taken to handle the config change. | 102 // DemuxerStream, before any action is taken to handle the config change. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 | 176 |
174 scoped_ptr<DecoderSelector<StreamType> > decoder_selector_; | 177 scoped_ptr<DecoderSelector<StreamType> > decoder_selector_; |
175 | 178 |
176 // These two will be set by DecoderSelector::SelectDecoder(). | 179 // These two will be set by DecoderSelector::SelectDecoder(). |
177 scoped_ptr<Decoder> decoder_; | 180 scoped_ptr<Decoder> decoder_; |
178 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; | 181 scoped_ptr<DecryptingDemuxerStream> decrypting_demuxer_stream_; |
179 | 182 |
180 SpliceObserverCB splice_observer_cb_; | 183 SpliceObserverCB splice_observer_cb_; |
181 ConfigChangeObserverCB config_change_observer_cb_; | 184 ConfigChangeObserverCB config_change_observer_cb_; |
182 | 185 |
186 // Decoded buffers that haven't been read yet. Used when the decode supports | |
Ami GONE FROM CHROMIUM
2014/04/16 01:00:00
decode -> decoder
Sergey Ulanov
2014/04/16 01:44:14
Done.
| |
187 // parallel decoding. | |
188 std::list<scoped_refptr<Output> > ready_output_buffers_; | |
189 int pending_decode_requests_; | |
190 | |
183 // NOTE: Weak pointers must be invalidated before all other member variables. | 191 // NOTE: Weak pointers must be invalidated before all other member variables. |
184 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; | 192 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; |
185 | 193 |
186 // This is required so the VideoFrameStream can access private members in | 194 // This is required so the VideoFrameStream can access private members in |
187 // FinishInitialization() and ReportStatistics(). | 195 // FinishInitialization() and ReportStatistics(). |
188 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); | 196 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); |
189 }; | 197 }; |
190 | 198 |
191 template <> | 199 template <> |
192 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; | 200 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; |
193 | 201 |
202 template <> | |
203 bool DecoderStream<DemuxerStream::AUDIO>::CanDecodeAnotherBuffer() const; | |
204 | |
194 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 205 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
195 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 206 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
196 | 207 |
197 } // namespace media | 208 } // namespace media |
198 | 209 |
199 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 210 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
OLD | NEW |