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

Unified Diff: media/renderers/audio_renderer_impl.h

Issue 2684103005: Allow media track switching. (Closed)
Patch Set: Fixed comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/renderers/audio_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl.h
diff --git a/media/renderers/audio_renderer_impl.h b/media/renderers/audio_renderer_impl.h
index f7915d31a607bdc512ac96704a1ddc7085c8d5cf..93d19898dc9f74a2d5e0876ac322c2ea672d27b3 100644
--- a/media/renderers/audio_renderer_impl.h
+++ b/media/renderers/audio_renderer_impl.h
@@ -36,6 +36,7 @@
#include "media/base/time_source.h"
#include "media/filters/audio_renderer_algorithm.h"
#include "media/filters/decoder_stream.h"
+#include "media/renderers/default_renderer_factory.h"
namespace base {
class SingleThreadTaskRunner;
@@ -62,7 +63,7 @@ class MEDIA_EXPORT AudioRendererImpl
AudioRendererImpl(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
AudioRendererSink* sink,
- ScopedVector<AudioDecoder> decoders,
+ const CreateAudioDecodersCB& create_audio_decoders_cb,
const scoped_refptr<MediaLog>& media_log);
~AudioRendererImpl() override;
@@ -96,16 +97,18 @@ class MEDIA_EXPORT AudioRendererImpl
// Important detail: being in kPlaying doesn't imply that audio is being
// rendered. Rather, it means that the renderer is ready to go. The actual
// rendering of audio is controlled via Start/StopRendering().
+ // Audio renderer can be reinitialized completely by calling Initialize again
+ // when it is in a kFlushed state.
//
// kUninitialized
- // | Initialize()
- // |
- // V
- // kInitializing
- // | Decoders initialized
- // |
- // V Decoders reset
- // kFlushed <------------------ kFlushing
+ // +----> | Initialize()
+ // | |
+ // | V
+ // | kInitializing
+ // | | Decoders initialized
+ // | |
+ // | V Decoders reset
+ // +- kFlushed <------------------ kFlushing
// | StartPlaying() ^
// | |
// | | Flush()
@@ -253,6 +256,10 @@ class MEDIA_EXPORT AudioRendererImpl
// Simple state tracking variable.
State state_;
+ // TODO(servolk): Consider using DecoderFactory here instead of the
+ // CreateAudioDecodersCB.
+ CreateAudioDecodersCB create_audio_decoders_cb_;
+
BufferingState buffering_state_;
// Keep track of whether or not the sink is playing and whether we should be
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/renderers/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698