Chromium Code Reviews| 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 <string> | |
| 9 | |
| 8 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 9 #include "base/sync_socket.h" | 11 #include "base/sync_socket.h" |
| 10 #include "media/audio/audio_parameters.h" | 12 #include "media/audio/audio_parameters.h" |
| 11 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 14 #include "url/gurl.h" | |
| 12 | 15 |
| 13 namespace media { | 16 namespace media { |
| 14 | 17 |
| 15 // Contains IPC notifications for the state of the server side | 18 // Contains IPC notifications for the state of the server side |
| 16 // (AudioOutputController) audio state changes and when an AudioOutputController | 19 // (AudioOutputController) audio state changes and when an AudioOutputController |
| 17 // has been created. Implemented by AudioOutputDevice. | 20 // has been created. Implemented by AudioOutputDevice. |
| 18 class MEDIA_EXPORT AudioOutputIPCDelegate { | 21 class MEDIA_EXPORT AudioOutputIPCDelegate { |
| 19 public: | 22 public: |
| 20 // Current status of the audio output stream in the browser process. Browser | 23 // Current status of the audio output stream in the browser process. Browser |
| 21 // sends information about the current playback state and error to the | 24 // sends information about the current playback state and error to the |
| 22 // renderer process using this type. | 25 // renderer process using this type. |
| 23 enum State { | 26 enum State { |
| 24 kPlaying, | 27 kPlaying, |
| 25 kPaused, | 28 kPaused, |
| 26 kError, | 29 kError, |
| 27 kStateLast = kError | 30 kStateLast = kError |
| 28 }; | 31 }; |
| 29 | 32 |
| 33 // Result of an audio output device switch operation | |
| 34 enum SwitchOutputDeviceResult { | |
| 35 kSuccess = 0, | |
| 36 kNotFoundError, | |
| 37 kSecurityError, | |
| 38 kObsoleteError, | |
| 39 kNotSupportedError, | |
| 40 kOtherError, | |
|
miu
2015/06/09 19:49:25
The naming "kOtherError" is vague; and, if you go
Guido Urdaneta
2015/06/10 09:44:55
Done.
The idea was to use kOtherError for other (
| |
| 41 kSwitchOutputDeviceResultLast = kOtherError | |
| 42 }; | |
| 43 | |
| 30 // Called when state of an audio stream has changed. | 44 // Called when state of an audio stream has changed. |
| 31 virtual void OnStateChanged(State state) = 0; | 45 virtual void OnStateChanged(State state) = 0; |
| 32 | 46 |
| 33 // Called when an audio stream has been created. | 47 // Called when an audio stream has been created. |
| 34 // The shared memory |handle| points to a memory section that's used to | 48 // The shared memory |handle| points to a memory section that's used to |
| 35 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 49 // transfer audio buffers from the AudioOutputIPCDelegate back to the |
| 36 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. | 50 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. |
| 37 // The |socket_handle| is used by AudioRendererHost to signal requests for | 51 // The |socket_handle| is used by AudioRendererHost to signal requests for |
| 38 // audio data to be written into the shared memory. The AudioOutputIPCDelegate | 52 // audio data to be written into the shared memory. The AudioOutputIPCDelegate |
| 39 // must read from this socket and provide audio whenever data (search for | 53 // must read from this socket and provide audio whenever data (search for |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 // AudioOutputController in the peer process. | 96 // AudioOutputController in the peer process. |
| 83 virtual void CloseStream() = 0; | 97 virtual void CloseStream() = 0; |
| 84 | 98 |
| 85 // Sets the volume of the audio stream. | 99 // Sets the volume of the audio stream. |
| 86 virtual void SetVolume(double volume) = 0; | 100 virtual void SetVolume(double volume) = 0; |
| 87 }; | 101 }; |
| 88 | 102 |
| 89 } // namespace media | 103 } // namespace media |
| 90 | 104 |
| 91 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 105 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
| OLD | NEW |