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

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

Issue 240123004: Simplify AudioSplicer logic which slots buffers before or after a splice point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/audio_renderer_impl_unittest.cc ('k') | 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 "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
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().
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
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_
OLDNEW
« no previous file with comments | « media/filters/audio_renderer_impl_unittest.cc ('k') | media/filters/decoder_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698