OLD | NEW |
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_AUDIO_AUDIO_OUTPUT_IPC_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
7 | 7 |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "base/sync_socket.h" | 9 #include "base/sync_socket.h" |
10 #include "media/audio/audio_parameters.h" | 10 #include "media/audio/audio_parameters.h" |
11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 // Contains IPC notifications for the state of the server side | 15 // Contains IPC notifications for the state of the server side |
16 // (AudioOutputController) audio state changes and when an AudioOutputController | 16 // (AudioOutputController) audio state changes and when an AudioOutputController |
17 // has been created. Implemented by AudioDevice. | 17 // has been created. Implemented by AudioOutputDevice. |
18 class MEDIA_EXPORT AudioOutputIPCDelegate { | 18 class MEDIA_EXPORT AudioOutputIPCDelegate { |
19 public: | 19 public: |
20 // Current status of the audio output stream in the browser process. Browser | 20 // Current status of the audio output stream in the browser process. Browser |
21 // sends information about the current playback state and error to the | 21 // sends information about the current playback state and error to the |
22 // renderer process using this type. | 22 // renderer process using this type. |
23 enum State { | 23 enum State { |
24 kPlaying, | 24 kPlaying, |
25 kPaused, | 25 kPaused, |
26 kError | 26 kError |
27 }; | 27 }; |
(...skipping 16 matching lines...) Expand all Loading... |
44 // Called when the AudioOutputIPC object is going away and/or when the IPC | 44 // Called when the AudioOutputIPC object is going away and/or when the IPC |
45 // channel has been closed and no more ipc requests can be made. | 45 // channel has been closed and no more ipc requests can be made. |
46 // Implementations must clear any references to the AudioOutputIPC object | 46 // Implementations must clear any references to the AudioOutputIPC object |
47 // at this point. | 47 // at this point. |
48 virtual void OnIPCClosed() = 0; | 48 virtual void OnIPCClosed() = 0; |
49 | 49 |
50 protected: | 50 protected: |
51 virtual ~AudioOutputIPCDelegate(); | 51 virtual ~AudioOutputIPCDelegate(); |
52 }; | 52 }; |
53 | 53 |
54 // Provides IPC functionality for an AudioDevice. The implementation should | 54 // Provides IPC functionality for an AudioOutputDevice. The implementation |
55 // asynchronously deliver the messages to an AudioOutputController object (or | 55 // should asynchronously deliver the messages to an AudioOutputController object |
56 // create one in the case of CreateStream()), that may live in a separate | 56 // (or create one in the case of CreateStream()), that may live in a separate |
57 // process. | 57 // process. |
58 class MEDIA_EXPORT AudioOutputIPC { | 58 class MEDIA_EXPORT AudioOutputIPC { |
59 public: | 59 public: |
60 // Registers an AudioOutputIPCDelegate and returns a |stream_id| that must | 60 // Registers an AudioOutputIPCDelegate and returns a |stream_id| that must |
61 // be used with all other IPC functions in this interface. | 61 // be used with all other IPC functions in this interface. |
62 virtual int AddDelegate(AudioOutputIPCDelegate* delegate) = 0; | 62 virtual int AddDelegate(AudioOutputIPCDelegate* delegate) = 0; |
63 | 63 |
64 // Unregisters a delegate that was previously registered via a call to | 64 // Unregisters a delegate that was previously registered via a call to |
65 // AddDelegate(). The audio stream should be in a closed state prior to | 65 // AddDelegate(). The audio stream should be in a closed state prior to |
66 // calling this function. | 66 // calling this function. |
(...skipping 27 matching lines...) Expand all Loading... |
94 // Sets the volume of the audio stream. | 94 // Sets the volume of the audio stream. |
95 virtual void SetVolume(int stream_id, double volume) = 0; | 95 virtual void SetVolume(int stream_id, double volume) = 0; |
96 | 96 |
97 protected: | 97 protected: |
98 virtual ~AudioOutputIPC(); | 98 virtual ~AudioOutputIPC(); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace media | 101 } // namespace media |
102 | 102 |
103 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 103 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
OLD | NEW |