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 CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/common/media/media_stream_options.h" | 11 #include "content/common/media/media_stream_options.h" |
12 | 12 |
13 class CONTENT_EXPORT MediaStreamDispatcherEventHandler { | 13 class CONTENT_EXPORT MediaStreamDispatcherEventHandler { |
14 public: | 14 public: |
15 // A new media stream have been created. | 15 // A new media stream have been created. |
16 virtual void OnStreamGenerated( | 16 virtual void OnStreamGenerated( |
17 int request_id, | 17 int request_id, |
18 const std::string& label, | 18 const std::string& label, |
19 const media_stream::StreamDeviceInfoArray& audio_device_array, | 19 const media_stream::StreamDeviceInfoArray& audio_device_array, |
20 const media_stream::StreamDeviceInfoArray& video_device_array) = 0; | 20 const media_stream::StreamDeviceInfoArray& video_device_array) = 0; |
21 | 21 |
22 // Creation of a new media stream failed. The user might have denied access | 22 // Creation of a new media stream failed. The user might have denied access |
23 // to the requested devices or no device is available. | 23 // to the requested devices or no device is available. |
24 virtual void OnStreamGenerationFailed(int request_id) = 0; | 24 virtual void OnStreamGenerationFailed(int request_id) = 0; |
25 | 25 |
26 // An error have occurred on a video device. This is called if a runtime | |
27 // error occurs. | |
28 virtual void OnVideoDeviceFailed(const std::string& label, | |
29 int index) = 0; | |
30 | |
31 // An error have occurred on an audio device. This is called if a runtime | |
32 // error occurs. | |
33 virtual void OnAudioDeviceFailed(const std::string& label, | |
34 int index) = 0; | |
35 | |
36 // A new list of devices have been enumerated. | 26 // A new list of devices have been enumerated. |
37 virtual void OnDevicesEnumerated( | 27 virtual void OnDevicesEnumerated( |
38 int request_id, | 28 int request_id, |
39 const media_stream::StreamDeviceInfoArray& device_array) = 0; | 29 const media_stream::StreamDeviceInfoArray& device_array) = 0; |
40 | 30 |
41 // Failed to enumerate devices. | 31 // Failed to enumerate devices. |
42 virtual void OnDevicesEnumerationFailed(int request_id) = 0; | 32 virtual void OnDevicesEnumerationFailed(int request_id) = 0; |
43 | 33 |
44 // A device has been opened. | 34 // A device has been opened. |
45 virtual void OnDeviceOpened( | 35 virtual void OnDeviceOpened( |
46 int request_id, | 36 int request_id, |
47 const std::string& label, | 37 const std::string& label, |
48 const media_stream::StreamDeviceInfo& device_info) = 0; | 38 const media_stream::StreamDeviceInfo& device_info) = 0; |
49 | 39 |
50 // Failed to open the device. | 40 // Failed to open the device. |
51 virtual void OnDeviceOpenFailed(int request_id) = 0; | 41 virtual void OnDeviceOpenFailed(int request_id) = 0; |
52 | 42 |
53 protected: | 43 protected: |
54 virtual ~MediaStreamDispatcherEventHandler() {} | 44 virtual ~MediaStreamDispatcherEventHandler() {} |
55 }; | 45 }; |
56 | 46 |
57 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ | 47 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ |
OLD | NEW |