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.h" |
15 #include "url/origin.h" | 16 #include "url/origin.h" |
16 | 17 |
17 namespace media { | 18 namespace media { |
18 | 19 |
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 | 20 // Contains IPC notifications for the state of the server side |
30 // (AudioOutputController) audio state changes and when an AudioOutputController | 21 // (AudioOutputController) audio state changes and when an AudioOutputController |
31 // has been created. Implemented by AudioOutputDevice. | 22 // has been created. Implemented by AudioOutputDevice. |
32 class MEDIA_EXPORT AudioOutputIPCDelegate { | 23 class MEDIA_EXPORT AudioOutputIPCDelegate { |
33 public: | 24 public: |
34 // Called when state of an audio stream has changed. | 25 // Called when state of an audio stream has changed. |
35 virtual void OnStateChanged(AudioOutputIPCDelegateState state) = 0; | 26 virtual void OnStateChanged(mojom::AudioOutputStreamState state) = 0; |
36 | 27 |
37 // Called when an authorization request for an output device has been | 28 // Called when an authorization request for an output device has been |
38 // completed | 29 // completed |
39 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, | 30 virtual void OnDeviceAuthorized(OutputDeviceStatus device_status, |
40 const media::AudioParameters& output_params, | 31 const media::AudioParameters& output_params, |
41 const std::string& matched_device_id) = 0; | 32 const std::string& matched_device_id) = 0; |
42 | 33 |
43 // Called when an audio stream has been created. | 34 // Called when an audio stream has been created. |
44 // The shared memory |handle| points to a memory section that's used to | 35 // The shared memory |handle| points to a memory section that's used to |
45 // transfer audio buffers from the AudioOutputIPCDelegate back to the | 36 // 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. | 101 // AudioOutputController in the peer process. |
111 virtual void CloseStream() = 0; | 102 virtual void CloseStream() = 0; |
112 | 103 |
113 // Sets the volume of the audio stream. | 104 // Sets the volume of the audio stream. |
114 virtual void SetVolume(double volume) = 0; | 105 virtual void SetVolume(double volume) = 0; |
115 }; | 106 }; |
116 | 107 |
117 } // namespace media | 108 } // namespace media |
118 | 109 |
119 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ | 110 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_IPC_H_ |
OLD | NEW |