| 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> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 50 // transfer audio buffers from the AudioOutputIPCDelegate back to the |
| 51 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. | 51 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. |
| 52 // The |socket_handle| is used by AudioRendererHost to signal requests for | 52 // The |socket_handle| is used by AudioRendererHost to signal requests for |
| 53 // audio data to be written into the shared memory. The AudioOutputIPCDelegate | 53 // audio data to be written into the shared memory. The AudioOutputIPCDelegate |
| 54 // must read from this socket and provide audio whenever data (search for | 54 // must read from this socket and provide audio whenever data (search for |
| 55 // "pending_bytes") is received. | 55 // "pending_bytes") is received. |
| 56 virtual void OnStreamCreated(base::SharedMemoryHandle handle, | 56 virtual void OnStreamCreated(base::SharedMemoryHandle handle, |
| 57 base::SyncSocket::Handle socket_handle, | 57 base::SyncSocket::Handle socket_handle, |
| 58 int length) = 0; | 58 int length) = 0; |
| 59 | 59 |
| 60 // Called when an attempt to switch the output device has been completed |
| 61 virtual void OnOutputDeviceSwitched(int request_id, |
| 62 SwitchOutputDeviceResult result) = 0; |
| 63 |
| 60 // Called when the AudioOutputIPC object is going away and/or when the IPC | 64 // Called when the AudioOutputIPC object is going away and/or when the IPC |
| 61 // channel has been closed and no more ipc requests can be made. | 65 // channel has been closed and no more ipc requests can be made. |
| 62 // Implementations should delete their owned AudioOutputIPC instance | 66 // Implementations should delete their owned AudioOutputIPC instance |
| 63 // immediately. | 67 // immediately. |
| 64 virtual void OnIPCClosed() = 0; | 68 virtual void OnIPCClosed() = 0; |
| 65 | 69 |
| 66 protected: | 70 protected: |
| 67 virtual ~AudioOutputIPCDelegate(); | 71 virtual ~AudioOutputIPCDelegate(); |
| 68 }; | 72 }; |
| 69 | 73 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 92 // Pauses an audio stream. This should generate a call to | 96 // Pauses an audio stream. This should generate a call to |
| 93 // AudioOutputController::Pause(). | 97 // AudioOutputController::Pause(). |
| 94 virtual void PauseStream() = 0; | 98 virtual void PauseStream() = 0; |
| 95 | 99 |
| 96 // Closes the audio stream which should shut down the corresponding | 100 // Closes the audio stream which should shut down the corresponding |
| 97 // AudioOutputController in the peer process. | 101 // AudioOutputController in the peer process. |
| 98 virtual void CloseStream() = 0; | 102 virtual void CloseStream() = 0; |
| 99 | 103 |
| 100 // Sets the volume of the audio stream. | 104 // Sets the volume of the audio stream. |
| 101 virtual void SetVolume(double volume) = 0; | 105 virtual void SetVolume(double volume) = 0; |
| 106 |
| 107 // Switches the output device of the audio stream. |
| 108 virtual void SwitchOutputDevice(const std::string& device_id, |
| 109 const GURL& security_origin, |
| 110 int request_id) = 0; |
| 102 }; | 111 }; |
| 103 | 112 |
| 104 } // namespace media | 113 } // namespace media |
| 105 | 114 |
| 106 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 115 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
| OLD | NEW |