Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / renderer / media / media_stream_dispatcher_eventhandler.h
blobf5595ac247c5657035f7ad8455c9bf415a55154e
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_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_
8 #include <string>
10 #include "content/common/content_export.h"
11 #include "content/common/media/media_stream_options.h"
13 namespace content {
15 class CONTENT_EXPORT MediaStreamDispatcherEventHandler {
16 public:
17 // A new media stream have been created.
18 virtual void OnStreamGenerated(
19 int request_id,
20 const std::string& label,
21 const StreamDeviceInfoArray& audio_device_array,
22 const StreamDeviceInfoArray& video_device_array) = 0;
24 // Creation of a new media stream failed. The user might have denied access
25 // to the requested devices or no device is available.
26 virtual void OnStreamGenerationFailed(
27 int request_id,
28 content::MediaStreamRequestResult result) = 0;
30 // A device has been stopped in the browser processes.
31 virtual void OnDeviceStopped(
32 const std::string& label,
33 const StreamDeviceInfo& device_info) = 0;
35 // A new list of devices have been enumerated.
36 virtual void OnDevicesEnumerated(
37 int request_id,
38 const StreamDeviceInfoArray& device_array) = 0;
40 // A device has been opened.
41 virtual void OnDeviceOpened(
42 int request_id,
43 const std::string& label,
44 const StreamDeviceInfo& device_info) = 0;
46 // Failed to open the device.
47 virtual void OnDeviceOpenFailed(int request_id) = 0;
49 protected:
50 virtual ~MediaStreamDispatcherEventHandler() {}
53 } // namespace content
55 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_EVENTHANDLER_H_