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 media_stream { | 13 namespace media_stream { |
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 or |
| 21 // GenerateStreamForDevice. |
21 virtual void StreamGenerated(const std::string& label, | 22 virtual void StreamGenerated(const std::string& label, |
22 const StreamDeviceInfoArray& audio_devices, | 23 const StreamDeviceInfoArray& audio_devices, |
23 const StreamDeviceInfoArray& video_devices) = 0; | 24 const StreamDeviceInfoArray& video_devices) = 0; |
24 // Called if GenerateStream failed. | 25 // Called if GenerateStream failed. |
25 virtual void StreamGenerationFailed(const std::string& label) = 0; | 26 virtual void StreamGenerationFailed(const std::string& label) = 0; |
26 // AudioDeviceFailed is called if an already opened audio device encounters | 27 // AudioDeviceFailed is called if an already opened audio device encounters |
27 // an error. | 28 // an error. |
28 virtual void AudioDeviceFailed(const std::string& label, int index) = 0; | 29 virtual void AudioDeviceFailed(const std::string& label, int index) = 0; |
29 // VideoDeviceFailed is called if an already opened video device encounters | 30 // VideoDeviceFailed is called if an already opened video device encounters |
30 // an error. | 31 // an error. |
31 virtual void VideoDeviceFailed(const std::string& label, int index) = 0; | 32 virtual void VideoDeviceFailed(const std::string& label, int index) = 0; |
32 | 33 |
33 // Called as a reply of a successful call to EnumerateDevices. | 34 // Called as a reply of a successful call to EnumerateDevices. |
34 virtual void DevicesEnumerated(const std::string& label, | 35 virtual void DevicesEnumerated(const std::string& label, |
35 const StreamDeviceInfoArray& devices) = 0; | 36 const StreamDeviceInfoArray& devices) = 0; |
36 // Called as a reply of a successful call to OpenDevice. | 37 // Called as a reply of a successful call to OpenDevice. |
37 virtual void DeviceOpened(const std::string& label, | 38 virtual void DeviceOpened(const std::string& label, |
38 const StreamDeviceInfo& device_info) = 0; | 39 const StreamDeviceInfo& device_info) = 0; |
39 | 40 |
40 protected: | 41 protected: |
41 virtual ~MediaStreamRequester() { | 42 virtual ~MediaStreamRequester() { |
42 } | 43 } |
43 }; | 44 }; |
44 | 45 |
45 } // namespace media_stream | 46 } // namespace media_stream |
46 | 47 |
47 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ | 48 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ |
OLD | NEW |