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

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

Issue 155608: Adding callback support to media filter Initialize() and Seek(). (Closed)
Patch Set: Full patch Created 11 years, 5 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 | « media/base/pipeline_impl_unittest.cc ('k') | media/filters/audio_renderer_base.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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // AudioRendererBase takes care of the tricky queuing work and provides simple 5 // AudioRendererBase takes care of the tricky queuing work and provides simple
6 // methods for subclasses to peek and poke at audio data. In addition to 6 // methods for subclasses to peek and poke at audio data. In addition to
7 // AudioRenderer interface methods this classes doesn't implement, subclasses 7 // AudioRenderer interface methods this classes doesn't implement, subclasses
8 // must also implement the following methods: 8 // must also implement the following methods:
9 // OnInitialized 9 // OnInitialized
10 // OnStop 10 // OnStop
(...skipping 14 matching lines...) Expand all
25 #include "media/base/factory.h" 25 #include "media/base/factory.h"
26 #include "media/base/filters.h" 26 #include "media/base/filters.h"
27 27
28 namespace media { 28 namespace media {
29 29
30 class AudioRendererBase : public AudioRenderer { 30 class AudioRendererBase : public AudioRenderer {
31 public: 31 public:
32 // MediaFilter implementation. 32 // MediaFilter implementation.
33 virtual void Stop(); 33 virtual void Stop();
34 34
35 virtual void Seek(base::TimeDelta time); 35 virtual void Seek(base::TimeDelta time, FilterCallback* callback);
36 36
37 // AudioRenderer implementation. 37 // AudioRenderer implementation.
38 virtual bool Initialize(AudioDecoder* decoder); 38 virtual void Initialize(AudioDecoder* decoder, FilterCallback* callback);
39 39
40 protected: 40 protected:
41 // The default maximum size of the queue. 41 // The default maximum size of the queue.
42 static const size_t kDefaultMaxQueueSize; 42 static const size_t kDefaultMaxQueueSize;
43 43
44 // Only allow a factory to create this class. 44 // Only allow a factory to create this class.
45 explicit AudioRendererBase(size_t max_queue_size); 45 explicit AudioRendererBase(size_t max_queue_size);
46 virtual ~AudioRendererBase(); 46 virtual ~AudioRendererBase();
47 47
48 // Called by Initialize(). |media_format| is the format of the AudioDecoder. 48 // Called by Initialize(). |media_format| is the format of the AudioDecoder.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // Whether or not we're initialized. 109 // Whether or not we're initialized.
110 bool initialized_; 110 bool initialized_;
111 111
112 // Whether or not we've stopped. 112 // Whether or not we've stopped.
113 bool stopped_; 113 bool stopped_;
114 114
115 // Audio time at end of last call to FillBuffer(). 115 // Audio time at end of last call to FillBuffer().
116 // TODO(ralphl): Update this value after seeking. 116 // TODO(ralphl): Update this value after seeking.
117 base::TimeDelta last_fill_buffer_time_; 117 base::TimeDelta last_fill_buffer_time_;
118 118
119 // Filter callbacks.
120 scoped_ptr<FilterCallback> initialize_callback_;
121
119 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); 122 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase);
120 }; 123 };
121 124
122 } // namespace media 125 } // namespace media
123 126
124 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ 127 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_
OLDNEW
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698