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_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_
6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_
11 #include "content/common/content_export.h"
12 #include "content/public/common/media_stream_request.h"
16 // MediaStreamConstraint keys for constraints that are passed to getUserMedia.
17 CONTENT_EXPORT extern const char kMediaStreamSource[];
18 CONTENT_EXPORT extern const char kMediaStreamSourceId[];
19 CONTENT_EXPORT extern const char kMediaStreamSourceInfoId[];
20 CONTENT_EXPORT extern const char kMediaStreamSourceTab[];
21 CONTENT_EXPORT extern const char kMediaStreamSourceScreen[];
22 CONTENT_EXPORT extern const char kMediaStreamSourceDesktop[];
23 CONTENT_EXPORT extern const char kMediaStreamSourceSystem[];
25 // Experimental constraint to do device matching. When this optional constraint
26 // is set, WebRTC audio renderer will render audio from media streams to an
27 // output device that belongs to the same hardware as the requested source
29 CONTENT_EXPORT extern const char kMediaStreamRenderToAssociatedSink[];
31 // StreamOptions is a Chromium representation of WebKit's
32 // WebUserMediaRequest Options. It describes the components
33 // in a request for a new media stream.
34 struct CONTENT_EXPORT StreamOptions {
36 StreamOptions(MediaStreamType audio_type, MediaStreamType video_type);
38 // If not NO_SERVICE, the stream shall contain an audio input stream.
39 MediaStreamType audio_type;
40 std::string audio_device_id;
42 // If not NO_SERVICE, the stream shall contain a video input stream.
43 MediaStreamType video_type;
44 std::string video_device_id;
47 // StreamDeviceInfo describes information about a device.
48 struct CONTENT_EXPORT StreamDeviceInfo {
49 static const int kNoId;
52 StreamDeviceInfo(MediaStreamType service_param,
53 const std::string& name_param,
54 const std::string& device_param);
55 StreamDeviceInfo(MediaStreamType service_param,
56 const std::string& name_param,
57 const std::string& device_param,
60 int frames_per_buffer);
61 static bool IsEqual(const StreamDeviceInfo& first,
62 const StreamDeviceInfo& second);
64 MediaStreamDevice device;
66 // Id for this capture session. Unique for all sessions of the same type.
70 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray;
72 } // namespace content
74 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_