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" |
11 #include "base/sync_socket.h" | 11 #include "base/sync_socket.h" |
12 #include "media/base/audio_parameters.h" | 12 #include "media/base/audio_parameters.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "media/base/output_device_info.h" | 14 #include "media/base/output_device_info.h" |
| 15 #include "media/mojo/interfaces/audio_output.mojom-shared.h" |
| 16 #include "media/mojo/interfaces/audio_output.mojom.h" |
15 #include "url/origin.h" | 17 #include "url/origin.h" |
16 | 18 |
17 namespace media { | 19 namespace media { |
18 | 20 |
19 // Current status of the audio output stream in the browser process. Browser | |
20 // sends information about the current playback state and error to the | |
21 // renderer process using this type. | |
22 enum AudioOutputIPCDelegateState { | |
23 AUDIO_OUTPUT_IPC_DELEGATE_STATE_PLAYING, | |
24 AUDIO_OUTPUT_IPC_DELEGATE_STATE_PAUSED, | |
25 AUDIO_OUTPUT_IPC_DELEGATE_STATE_ERROR, | |
26 AUDIO_OUTPUT_IPC_DELEGATE_STATE_LAST = AUDIO_OUTPUT_IPC_DELEGATE_STATE_ERROR | |
27 }; | |
28 | |
29 // Contains IPC notifications for the state of the server side | 21 // Contains IPC notifications for the state of the server side |
30 // (AudioOutputController) audio state changes and when an AudioOutputController | 22 // (AudioOutputController) audio state changes and when an AudioOutputController |
31 // has been created. Implemented by AudioOutputDevice. | 23 // has been created. Implemented by AudioOutputDevice. |
32 class MEDIA_EXPORT AudioOutputIPCDelegate { | 24 class MEDIA_EXPORT AudioOutputIPCDelegate { |
33 public: | 25 public: |
34 // Called when state of an audio stream has changed. | |
35 virtual void OnStateChanged(AudioOutputIPCDelegateState state) = 0; | |
36 | |
37 // Called when an authorization request for an output device has been | 26 // Called when an authorization request for an output device has been |
38 // completed | 27 // completed |
39 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, | 28 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, |
40 const media::AudioParameters& output_params, | 29 const media::AudioParameters& output_params, |
41 const std::string& matched_device_id) = 0; | 30 const std::string& matched_device_id) = 0; |
42 | 31 |
43 // Called when an audio stream has been created. | 32 // Called when an audio stream has been created. |
44 // The shared memory |handle| points to a memory section that's used to | 33 // The shared memory |handle| points to a memory section that's used to |
45 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 34 // transfer audio buffers from the AudioOutputIPCDelegate back to the |
46 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. | 35 // AudioRendererHost. The implementation of OnStreamCreated takes ownership. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // AudioOutputController in the peer process. | 99 // AudioOutputController in the peer process. |
111 virtual void CloseStream() = 0; | 100 virtual void CloseStream() = 0; |
112 | 101 |
113 // Sets the volume of the audio stream. | 102 // Sets the volume of the audio stream. |
114 virtual void SetVolume(double volume) = 0; | 103 virtual void SetVolume(double volume) = 0; |
115 }; | 104 }; |
116 | 105 |
117 } // namespace media | 106 } // namespace media |
118 | 107 |
119 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 108 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
OLD | NEW |