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 namespace content { | 13 namespace content { |
14 | 14 |
15 class CONTENT_EXPORT MediaStreamDispatcherEventHandler { | 15 class CONTENT_EXPORT MediaStreamDispatcherEventHandler { |
16 public: | 16 public: |
17 // A new media stream have been created. | 17 // A new media stream have been created. |
18 virtual void OnStreamGenerated( | 18 virtual void OnStreamGenerated( |
19 int request_id, | 19 int request_id, |
20 const std::string& label, | 20 const std::string& label, |
21 const StreamDeviceInfoArray& audio_device_array, | 21 const StreamDeviceInfoArray& audio_device_array, |
22 const StreamDeviceInfoArray& video_device_array) = 0; | 22 const StreamDeviceInfoArray& video_device_array) = 0; |
23 | 23 |
24 // Creation of a new media stream failed. The user might have denied access | 24 // Creation of a new media stream failed. The user might have denied access |
25 // to the requested devices or no device is available. | 25 // to the requested devices or no device is available. |
26 virtual void OnStreamGenerationFailed(int request_id) = 0; | 26 virtual void OnStreamGenerationFailed( |
| 27 int request_id, |
| 28 content::MediaStreamRequestResult result) = 0; |
27 | 29 |
28 // A device has been stopped in the browser processes. | 30 // A device has been stopped in the browser processes. |
29 virtual void OnDeviceStopped( | 31 virtual void OnDeviceStopped( |
30 const std::string& label, | 32 const std::string& label, |
31 const StreamDeviceInfo& device_info) = 0; | 33 const StreamDeviceInfo& device_info) = 0; |
32 | 34 |
33 // A new list of devices have been enumerated. | 35 // A new list of devices have been enumerated. |
34 virtual void OnDevicesEnumerated( | 36 virtual void OnDevicesEnumerated( |
35 int request_id, | 37 int request_id, |
36 const StreamDeviceInfoArray& device_array) = 0; | 38 const StreamDeviceInfoArray& device_array) = 0; |
37 | 39 |
38 // A device has been opened. | 40 // A device has been opened. |
39 virtual void OnDeviceOpened( | 41 virtual void OnDeviceOpened( |
40 int request_id, | 42 int request_id, |
41 const std::string& label, | 43 const std::string& label, |
42 const StreamDeviceInfo& device_info) = 0; | 44 const StreamDeviceInfo& device_info) = 0; |
43 | 45 |
44 // Failed to open the device. | 46 // Failed to open the device. |
45 virtual void OnDeviceOpenFailed(int request_id) = 0; | 47 virtual void OnDeviceOpenFailed(int request_id) = 0; |
46 | 48 |
47 protected: | 49 protected: |
48 virtual ~MediaStreamDispatcherEventHandler() {} | 50 virtual ~MediaStreamDispatcherEventHandler() {} |
49 }; | 51 }; |
50 | 52 |
51 } // namespace content | 53 } // namespace content |
52 | 54 |
53 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ | 55 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_ |
OLD | NEW |