Index: content/common/media/media_stream_options.h |
=================================================================== |
--- content/common/media/media_stream_options.h (revision 0) |
+++ content/common/media/media_stream_options.h (revision 0) |
@@ -0,0 +1,71 @@ |
+// Copyright (c) 20101 The Chromium Authors. All rights reserved. |
John Knottenbelt
2011/06/16 15:20:43
nit: 20101 => 2011
mflodman1
2011/06/20 19:48:03
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
scherkus (not reviewing)
2011/06/17 03:03:52
sanity check... does this have to be inside of con
mflodman1
2011/06/20 19:48:03
The structs in this file will be used to requestin
|
+#define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+namespace media_stream { |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: content/ doesn't typically use namespaces, bu
mflodman1
2011/06/20 19:48:03
Good to know, noted and we'll look at this later.
|
+ |
+// GenerateStreamOptions is a Chromium representation of WebKits |
+// WebGenerateStreamOptionFlags. It describes the components in a request for a |
+// new media stream. |
+struct GenerateStreamOptions { |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: the name of this struct is rather confusing a
mflodman1
2011/06/20 19:48:03
Changed to only 'StreamOptions'.
|
+ enum VideoOptionFlags { |
+ kVideoNoCamera = 0, |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: "Video" prefix is redundant considering this
mflodman1
2011/06/20 19:48:03
Done.
|
+ kVideoFacingUser = 1, |
+ kVideoFacingEnvironment = 1 << 1, |
scherkus (not reviewing)
2011/06/17 03:03:52
considering the amount of flags is relatively smal
mflodman1
2011/06/20 19:48:03
I tried changing but ran into IPC issues when buil
|
+ }; |
+ |
+ typedef unsigned VideoOptions; |
+ |
+ GenerateStreamOptions() : audio(false), video_options(kVideoNoCamera) {} |
scherkus (not reviewing)
2011/06/17 03:03:52
does having a default ctor make sense or will all
mflodman1
2011/06/20 19:48:03
We don't explicitly call this ctor and I tried to
scherkus (not reviewing)
2011/06/21 00:27:46
Ahh I wasn't aware this ended up getting used in I
|
+ GenerateStreamOptions(bool audio, VideoOptions options) |
+ : audio(audio), video_options(options) {} |
+ |
+ // True if the stream shall contain an audio input stream. |
+ bool audio; |
+ |
+ // Describes if a / which type of video capture device is requested. |
+ VideoOptions video_options; |
+}; |
+ |
+// Type of media stream. |
+enum MediaStreamType { |
+ kNoService = 0, |
+ kAudioCapture, |
+ kVideoCapture |
+}; |
+ |
+// StreamDeviceInfo describes information about a device. |
+struct StreamDeviceInfo { |
+ StreamDeviceInfo(); |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: in general if you all callees properly initia
mflodman1
2011/06/20 19:48:03
Same as for removing StreamOptions ctor above, I'l
|
+ StreamDeviceInfo(MediaStreamType service_param, |
+ const std::string name_param, |
scherkus (not reviewing)
2011/06/17 03:03:52
make const-ref
mflodman1
2011/06/20 19:48:03
Done.
|
+ const std::string device_param, |
scherkus (not reviewing)
2011/06/17 03:03:52
ditto
mflodman1
2011/06/20 19:48:03
Done.
|
+ bool opened); |
+ |
+ enum { kNoId = -1}; |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: space before }
mflodman1
2011/06/20 19:48:03
Done.
|
+ |
+ // Describes the capture type. |
+ MediaStreamType stream_type; |
+ // Friendly name of the device. |
+ std::string name; |
+ // Unique name of a device. Even if there are multiple devices with the same |
+ // friendly name connected to the computer, this will be unique. |
+ std::string device_id; |
scherkus (not reviewing)
2011/06/17 03:03:52
these two parameters seem similar to what's define
mflodman1
2011/06/20 19:48:03
Yes. This struct will be used to signal name/id fo
|
+ // Set to true if the device has been opened, false otherwise. |
+ bool in_use; |
+ // Id for this capture session. Unique for all sessions of the same type. |
+ int session_id; |
+}; |
+ |
+typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray; |
+ |
+} // namespace media_stream |
+ |
+#endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_ |
+ |
scherkus (not reviewing)
2011/06/17 03:03:52
nit: get rid of blank line
mflodman1
2011/06/20 19:48:03
Done.
|