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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // Allows callers to register for notification of splice buffers from the | 90 // Allows callers to register for notification of splice buffers from the |
91 // demuxer. I.e., DecoderBuffer::splice_timestamp() is not kNoTimestamp(). | 91 // demuxer. I.e., DecoderBuffer::splice_timestamp() is not kNoTimestamp(). |
92 // | |
93 // The observer will be notified of all buffers with a splice_timestamp() and | |
94 // the first buffer after which has a splice_timestamp() of kNoTimestamp(). | |
wolenetz
2014/04/17 18:24:03
Clarification of my understanding: Is the intent h
DaleCurtis
2014/04/17 20:03:18
I'll fix the comment in StreamParserBuffer() to do
| |
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. |
100 typedef base::Closure ConfigChangeObserverCB; | 103 typedef base::Closure ConfigChangeObserverCB; |
101 void set_config_change_observer( | 104 void set_config_change_observer( |
(...skipping 71 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 // If a splice_timestamp() has been seen, this is true until a | |
187 // splice_timestamp() of kNoTimestamp() is encountered. | |
188 bool active_splice_; | |
189 | |
183 // NOTE: Weak pointers must be invalidated before all other member variables. | 190 // NOTE: Weak pointers must be invalidated before all other member variables. |
184 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; | 191 base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_; |
185 | 192 |
186 // This is required so the VideoFrameStream can access private members in | 193 // This is required so the VideoFrameStream can access private members in |
187 // FinishInitialization() and ReportStatistics(). | 194 // FinishInitialization() and ReportStatistics(). |
188 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); | 195 DISALLOW_IMPLICIT_CONSTRUCTORS(DecoderStream); |
189 }; | 196 }; |
190 | 197 |
191 template <> | 198 template <> |
192 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; | 199 bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const; |
193 | 200 |
194 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; | 201 typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream; |
195 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; | 202 typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream; |
196 | 203 |
197 } // namespace media | 204 } // namespace media |
198 | 205 |
199 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ | 206 #endif // MEDIA_FILTERS_DECODER_STREAM_H_ |
OLD | NEW |