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 AudioOutputDevice. | 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 kDeviceChange, |
27 }; | 28 }; |
28 | 29 |
29 // Called when state of an audio stream has changed. | 30 // Called when state of an audio stream has changed. |
30 virtual void OnStateChanged(State state) = 0; | 31 virtual void OnStateChanged(State state) = 0; |
31 | 32 |
32 // Called when an audio stream has been created. | 33 // Called when an audio stream has been created. |
33 // The shared memory |handle| points to a memory section that's used to | 34 // The shared memory |handle| points to a memory section that's used to |
34 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 35 // transfer audio buffers from the AudioOutputIPCDelegate back to the |
35 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. | 36 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. |
36 // The |socket_handle| is used by AudioRendererHost to signal requests for | 37 // The |socket_handle| is used by AudioRendererHost to signal requests for |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Sets the volume of the audio stream. | 98 // Sets the volume of the audio stream. |
98 virtual void SetVolume(int stream_id, double volume) = 0; | 99 virtual void SetVolume(int stream_id, double volume) = 0; |
99 | 100 |
100 protected: | 101 protected: |
101 virtual ~AudioOutputIPC(); | 102 virtual ~AudioOutputIPC(); |
102 }; | 103 }; |
103 | 104 |
104 } // namespace media | 105 } // namespace media |
105 | 106 |
106 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 107 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
OLD | NEW |