Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1325)

Side by Side Diff: content/common/media/media_stream_options.h

Issue 7192007: Adding error signalling from device to VideocaptureManager to relay up to MediaStream and WebKit. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // 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.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #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
6 #define CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_
7
8 #include <string>
9 #include <vector>
10
11 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.
12
13 // GenerateStreamOptions is a Chromium representation of WebKits
14 // WebGenerateStreamOptionFlags. It describes the components in a request for a
15 // new media stream.
16 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'.
17 enum VideoOptionFlags {
18 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.
19 kVideoFacingUser = 1,
20 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
21 };
22
23 typedef unsigned VideoOptions;
24
25 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
26 GenerateStreamOptions(bool audio, VideoOptions options)
27 : audio(audio), video_options(options) {}
28
29 // True if the stream shall contain an audio input stream.
30 bool audio;
31
32 // Describes if a / which type of video capture device is requested.
33 VideoOptions video_options;
34 };
35
36 // Type of media stream.
37 enum MediaStreamType {
38 kNoService = 0,
39 kAudioCapture,
40 kVideoCapture
41 };
42
43 // StreamDeviceInfo describes information about a device.
44 struct StreamDeviceInfo {
45 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
46 StreamDeviceInfo(MediaStreamType service_param,
47 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.
48 const std::string device_param,
scherkus (not reviewing) 2011/06/17 03:03:52 ditto
mflodman1 2011/06/20 19:48:03 Done.
49 bool opened);
50
51 enum { kNoId = -1};
scherkus (not reviewing) 2011/06/17 03:03:52 nit: space before }
mflodman1 2011/06/20 19:48:03 Done.
52
53 // Describes the capture type.
54 MediaStreamType stream_type;
55 // Friendly name of the device.
56 std::string name;
57 // Unique name of a device. Even if there are multiple devices with the same
58 // friendly name connected to the computer, this will be unique.
59 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
60 // Set to true if the device has been opened, false otherwise.
61 bool in_use;
62 // Id for this capture session. Unique for all sessions of the same type.
63 int session_id;
64 };
65
66 typedef std::vector<StreamDeviceInfo> StreamDeviceInfoArray;
67
68 } // namespace media_stream
69
70 #endif // CONTENT_COMMON_MEDIA_MEDIA_STREAM_OPTIONS_H_
71
scherkus (not reviewing) 2011/06/17 03:03:52 nit: get rid of blank line
mflodman1 2011/06/20 19:48:03 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698