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

Side by Side Diff: media/audio/audio_device_ipc.h

Issue 10790121: First step towards moving AudioDevice from content/ to media/audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary #include Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_AUDIO_AUDIO_DEVICE_IPC_H_
6 #define MEDIA_AUDIO_AUDIO_DEVICE_IPC_H_
7
8 #include "base/shared_memory.h"
9 #include "base/sync_socket.h"
10 #include "media/audio/audio_parameters.h"
11
12 namespace media {
13
14 // Current status of the audio output stream in the browser process. Browser
15 // sends information about the current playback state and error to the
16 // renderer process using this type.
17 enum AudioStreamState {
scherkus (not reviewing) 2012/07/23 22:57:51 define inside Delegate as "State" and drop kAudioS
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
18 kAudioStreamPlaying,
19 kAudioStreamPaused,
20 kAudioStreamError
21 };
22
23 class AudioDeviceIPCDelegate {
scherkus (not reviewing) 2012/07/23 22:57:51 any thoughts as to replacing this interface with t
tommi (sloooow) - chröme 2012/07/24 09:49:44 I thought about that but decided not to do that ri
24 public:
25
scherkus (not reviewing) 2012/07/23 22:57:51 remove blank line
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
26 // Called when state of an audio stream has changed in the browser process.
scherkus (not reviewing) 2012/07/23 22:57:51 nit: I'd drop the "in the browser process" bit --
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
27 virtual void OnStateChanged(AudioStreamState state) = 0;
28
29 // Called when an audio stream has been created in the browser process.
scherkus (not reviewing) 2012/07/23 22:57:51 ditto
scherkus (not reviewing) 2012/07/23 22:57:51 can we get docs on what these handles and params m
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
30 virtual void OnStreamCreated(base::SharedMemoryHandle handle,
31 base::SyncSocket::Handle socket_handle,
32 uint32 length) = 0;
33 protected:
34 virtual ~AudioDeviceIPCDelegate() {}
scherkus (not reviewing) 2012/07/23 22:57:51 even this it's OK to inline ctor/dtor in this part
tommi (sloooow) - chröme 2012/07/24 09:49:44 ah, wasn't aware of that. Thanks for the heads up.
35 };
36
37 class AudioDeviceIPC {
scherkus (not reviewing) 2012/07/23 22:57:51 needs docs
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
38 public:
39 // Registers an AudioDeviceIPCDelegate and returns a stream_id that must
scherkus (not reviewing) 2012/07/23 22:57:51 |stream_id|
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
40 // be used with all other IPC functions in this interface.
41 virtual int AddDelegate(AudioDeviceIPCDelegate* sink) = 0;
scherkus (not reviewing) 2012/07/23 22:57:51 s/sink/delegate?
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
42
43 // Remove a delegate referenced by |stream_id| from the map.
scherkus (not reviewing) 2012/07/23 22:57:51 map? what map!? (update docs :))
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
44 virtual void RemoveDelegate(int stream_id) = 0;
45
46 virtual void CreateStream(int stream_id, const AudioParameters& params) = 0;
scherkus (not reviewing) 2012/07/23 22:57:51 docs?
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
47 virtual void PlayStream(int stream_id) = 0;
48 virtual void PauseStream(int stream_id) = 0;
49 virtual void FlushStream(int stream_id) = 0;
50 virtual void CloseStream(int stream_id) = 0;
51 virtual void SetVolume(int stream_id, double volume) = 0;
52
53 protected:
54 virtual ~AudioDeviceIPC() {}
scherkus (not reviewing) 2012/07/23 22:57:51 ditto
tommi (sloooow) - chröme 2012/07/24 09:49:44 Done.
55 };
56
57 } // namespace media
58
59 #endif // MEDIA_AUDIO_AUDIO_DEVICE_IPC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698