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_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_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 // MediaStreamRequester must be implemented by the class requesting a new media | 15 // MediaStreamRequester must be implemented by the class requesting a new media |
16 // stream to be opened. MediaStreamManager will use this interface to signal | 16 // stream to be opened. MediaStreamManager will use this interface to signal |
17 // success and error for a request. | 17 // success and error for a request. |
18 class CONTENT_EXPORT MediaStreamRequester { | 18 class CONTENT_EXPORT MediaStreamRequester { |
19 public: | 19 public: |
20 // Called as a reply of a successful call to GenerateStream. | 20 // Called as a reply of a successful call to GenerateStream. |
21 virtual void StreamGenerated(int render_view_id, | 21 virtual void StreamGenerated(int render_frame_id, |
22 int page_request_id, | 22 int page_request_id, |
23 const std::string& label, | 23 const std::string& label, |
24 const StreamDeviceInfoArray& audio_devices, | 24 const StreamDeviceInfoArray& audio_devices, |
25 const StreamDeviceInfoArray& video_devices) = 0; | 25 const StreamDeviceInfoArray& video_devices) = 0; |
26 // Called if GenerateStream failed. | 26 // Called if GenerateStream failed. |
27 virtual void StreamGenerationFailed( | 27 virtual void StreamGenerationFailed( |
28 int render_view_id, | 28 int render_frame_id, |
29 int page_request_id, | 29 int page_request_id, |
30 content::MediaStreamRequestResult result) = 0; | 30 content::MediaStreamRequestResult result) = 0; |
31 // Called if a device has been stopped by a user from UI or the device | 31 // Called if a device has been stopped by a user from UI or the device |
32 // has become unavailable. |render_view_id| is the render view that requested | 32 // has become unavailable. |render_frame_id| is the render frame that |
33 // the device and |label| is the label of the request|. | 33 // requested the device and |label| is the label of the request. |
34 virtual void DeviceStopped(int render_view_id, | 34 virtual void DeviceStopped(int render_frame_id, |
35 const std::string& label, | 35 const std::string& label, |
36 const StreamDeviceInfo& device) = 0; | 36 const StreamDeviceInfo& device) = 0; |
37 // Called as a reply of a successful call to EnumerateDevices. | 37 // Called as a reply of a successful call to EnumerateDevices. |
38 virtual void DevicesEnumerated(int render_view_id, | 38 virtual void DevicesEnumerated(int render_frame_id, |
39 int page_request_id, | 39 int page_request_id, |
40 const std::string& label, | 40 const std::string& label, |
41 const StreamDeviceInfoArray& devices) = 0; | 41 const StreamDeviceInfoArray& devices) = 0; |
42 // Called as a reply of a successful call to OpenDevice. | 42 // Called as a reply of a successful call to OpenDevice. |
43 virtual void DeviceOpened(int render_view_id, | 43 virtual void DeviceOpened(int render_frame_id, |
44 int page_request_id, | 44 int page_request_id, |
45 const std::string& label, | 45 const std::string& label, |
46 const StreamDeviceInfo& device_info) = 0; | 46 const StreamDeviceInfo& device_info) = 0; |
47 | 47 |
48 protected: | 48 protected: |
49 virtual ~MediaStreamRequester() { | 49 virtual ~MediaStreamRequester() { |
50 } | 50 } |
51 }; | 51 }; |
52 | 52 |
53 } // namespace content | 53 } // namespace content |
54 | 54 |
55 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ | 55 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ |
OLD | NEW |