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

Side by Side Diff: media/base/audio_renderer_sink.h

Issue 11878032: Plumb |input_channels| all the way to AudioManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/audio/win/audio_manager_win.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BASE_AUDIO_RENDERER_SINK_H_ 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_
7 7
8 #include <vector> 8 #include <vector>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 23 matching lines...) Expand all
34 34
35 // Signals an error has occurred. 35 // Signals an error has occurred.
36 virtual void OnRenderError() = 0; 36 virtual void OnRenderError() = 0;
37 37
38 protected: 38 protected:
39 virtual ~RenderCallback() {} 39 virtual ~RenderCallback() {}
40 }; 40 };
41 41
42 // Sets important information about the audio stream format. 42 // Sets important information about the audio stream format.
43 // It must be called before any of the other methods. 43 // It must be called before any of the other methods.
44 // For clients wishing to have synchronized input and output,
45 // |params| may specify |input_channels| > 0, representing a
46 // number of input channels which will be at the same sample-rate
47 // and buffer-size as the output as specified in |params|.
48 // In this case, the callback's RenderIO() method will be called instead
49 // of Render(), providing the synchronized input data at the same time as
50 // when new output data is to be rendered.
44 virtual void Initialize(const AudioParameters& params, 51 virtual void Initialize(const AudioParameters& params,
45 RenderCallback* callback) = 0; 52 RenderCallback* callback) = 0;
46 53
47 // InitializeIO() may be called instead of Initialize() for clients who wish
48 // to have synchronized input and output. |input_channels| specifies the
49 // number of input channels which will be at the same sample-rate
50 // and buffer-size as the output as specified in |params|.
51 // The callback's RenderIO() method will be called instead of Render(),
52 // providing the synchronized input data at the same time as when new
53 // output data is to be rendered.
54 virtual void InitializeIO(const AudioParameters& params,
55 int input_channels,
56 RenderCallback* callback) {}
57
58 // Starts audio playback. 54 // Starts audio playback.
59 virtual void Start() = 0; 55 virtual void Start() = 0;
60 56
61 // Stops audio playback. 57 // Stops audio playback.
62 virtual void Stop() = 0; 58 virtual void Stop() = 0;
63 59
64 // Pauses playback. 60 // Pauses playback.
65 virtual void Pause(bool flush) = 0; 61 virtual void Pause(bool flush) = 0;
66 62
67 // Resumes playback after calling Pause(). 63 // Resumes playback after calling Pause().
68 virtual void Play() = 0; 64 virtual void Play() = 0;
69 65
70 // Sets the playback volume, with range [0.0, 1.0] inclusive. 66 // Sets the playback volume, with range [0.0, 1.0] inclusive.
71 // Returns |true| on success. 67 // Returns |true| on success.
72 virtual bool SetVolume(double volume) = 0; 68 virtual bool SetVolume(double volume) = 0;
73 69
74 protected: 70 protected:
75 friend class base::RefCountedThreadSafe<AudioRendererSink>; 71 friend class base::RefCountedThreadSafe<AudioRendererSink>;
76 virtual ~AudioRendererSink() {} 72 virtual ~AudioRendererSink() {}
77 }; 73 };
78 74
79 } // namespace media 75 } // namespace media
80 76
81 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 77 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698