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. | 26 // Called when state of an audio stream has changed. |
35 virtual void OnStateChanged(AudioOutputIPCDelegateState state) = 0; | 27 virtual void OnStateChanged(mojom::AudioOutputStreamState state) = 0; |
36 | 28 |
37 // Called when an authorization request for an output device has been | 29 // Called when an authorization request for an output device has been |
38 // completed | 30 // completed |
39 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, | 31 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, |
40 const media::AudioParameters& output_params, | 32 const media::AudioParameters& output_params, |
41 const std::string& matched_device_id) = 0; | 33 const std::string& matched_device_id) = 0; |
42 | 34 |
43 // Called when an audio stream has been created. | 35 // Called when an audio stream has been created. |
44 // The shared memory |handle| points to a memory section that's used to | 36 // The shared memory |handle| points to a memory section that's used to |
45 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 37 // transfer audio buffers from the AudioOutputIPCDelegate back to the |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // AudioOutputController in the peer process. | 102 // AudioOutputController in the peer process. |
111 virtual void CloseStream() = 0; | 103 virtual void CloseStream() = 0; |
112 | 104 |
113 // Sets the volume of the audio stream. | 105 // Sets the volume of the audio stream. |
114 virtual void SetVolume(double volume) = 0; | 106 virtual void SetVolume(double volume) = 0; |
115 }; | 107 }; |
116 | 108 |
117 } // namespace media | 109 } // namespace media |
118 | 110 |
119 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 111 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
OLD | NEW |