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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_
10 #include "content/common/content_export.h"
11 #include "content/common/media/media_stream_options.h"
15 // MediaStreamRequester must be implemented by the class requesting a new media
16 // stream to be opened. MediaStreamManager will use this interface to signal
17 // success and error for a request.
18 class CONTENT_EXPORT MediaStreamRequester
{
20 // Called as a reply of a successful call to GenerateStream.
21 virtual void StreamGenerated(int render_frame_id
,
23 const std::string
& label
,
24 const StreamDeviceInfoArray
& audio_devices
,
25 const StreamDeviceInfoArray
& video_devices
) = 0;
26 // Called if GenerateStream failed.
27 virtual void StreamGenerationFailed(
30 content::MediaStreamRequestResult result
) = 0;
31 // Called if a device has been stopped by a user from UI or the device
32 // has become unavailable. |render_frame_id| is the render frame that
33 // requested the device and |label| is the label of the request.
34 virtual void DeviceStopped(int render_frame_id
,
35 const std::string
& label
,
36 const StreamDeviceInfo
& device
) = 0;
37 // Called as a reply of a successful call to EnumerateDevices.
38 virtual void DevicesEnumerated(int render_frame_id
,
40 const std::string
& label
,
41 const StreamDeviceInfoArray
& devices
) = 0;
42 // Called as a reply of a successful call to OpenDevice.
43 virtual void DeviceOpened(int render_frame_id
,
45 const std::string
& label
,
46 const StreamDeviceInfo
& device_info
) = 0;
49 virtual ~MediaStreamRequester() {
53 } // namespace content
55 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_