| 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" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 67 virtual void RemoveDelegate(int stream_id) = 0; | 67 virtual void RemoveDelegate(int stream_id) = 0; |
| 68 | 68 |
| 69 // Sends a request to create an AudioOutputController object in the peer | 69 // Sends a request to create an AudioOutputController object in the peer |
| 70 // process, identify it by |stream_id| and configure it to use the specified | 70 // process, identify it by |stream_id| and configure it to use the specified |
| 71 // audio |params|. Once the stream has been created, the implementation must | 71 // audio |params| and number of synchronized input channels. |
| 72 // Once the stream has been created, the implementation must |
| 72 // generate a notification to the AudioOutputIPCDelegate and call | 73 // generate a notification to the AudioOutputIPCDelegate and call |
| 73 // OnStreamCreated(). | 74 // OnStreamCreated(). |
| 74 virtual void CreateStream(int stream_id, const AudioParameters& params) = 0; | 75 virtual void CreateStream(int stream_id, |
| 76 const AudioParameters& params, |
| 77 int input_channels) = 0; |
| 75 | 78 |
| 76 // Starts playing the stream. This should generate a call to | 79 // Starts playing the stream. This should generate a call to |
| 77 // AudioOutputController::Play(). | 80 // AudioOutputController::Play(). |
| 78 virtual void PlayStream(int stream_id) = 0; | 81 virtual void PlayStream(int stream_id) = 0; |
| 79 | 82 |
| 80 // Pauses an audio stream. This should generate a call to | 83 // Pauses an audio stream. This should generate a call to |
| 81 // AudioOutputController::Pause(). | 84 // AudioOutputController::Pause(). |
| 82 virtual void PauseStream(int stream_id) = 0; | 85 virtual void PauseStream(int stream_id) = 0; |
| 83 | 86 |
| 84 // "Flushes" the audio device. This should generate a call to | 87 // "Flushes" the audio device. This should generate a call to |
| 85 // AudioOutputController::Flush(). | 88 // AudioOutputController::Flush(). |
| 86 // TODO(tommi): This is currently neither implemented nor called. Remove? | 89 // TODO(tommi): This is currently neither implemented nor called. Remove? |
| 87 virtual void FlushStream(int stream_id) = 0; | 90 virtual void FlushStream(int stream_id) = 0; |
| 88 | 91 |
| 89 // Closes the audio stream and deletes the matching AudioOutputController | 92 // Closes the audio stream and deletes the matching AudioOutputController |
| 90 // instance. Prior to deleting the AudioOutputController object, a call to | 93 // instance. Prior to deleting the AudioOutputController object, a call to |
| 91 // AudioOutputController::Close must be made. | 94 // AudioOutputController::Close must be made. |
| 92 virtual void CloseStream(int stream_id) = 0; | 95 virtual void CloseStream(int stream_id) = 0; |
| 93 | 96 |
| 94 // Sets the volume of the audio stream. | 97 // Sets the volume of the audio stream. |
| 95 virtual void SetVolume(int stream_id, double volume) = 0; | 98 virtual void SetVolume(int stream_id, double volume) = 0; |
| 96 | 99 |
| 97 protected: | 100 protected: |
| 98 virtual ~AudioOutputIPC(); | 101 virtual ~AudioOutputIPC(); |
| 99 }; | 102 }; |
| 100 | 103 |
| 101 } // namespace media | 104 } // namespace media |
| 102 | 105 |
| 103 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 106 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
| OLD | NEW |