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

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

Issue 10928043: Media Related changes for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 8 years, 2 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/media/media_stream_options.h" 5 #include "content/common/media/media_stream_options.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media_stream { 9 namespace media_stream {
10 10
11 const char kMediaStreamSource[] = "chromeMediaSource";
12 const char kMediaStreamSourceId[] = "chromeMediaSourceId";
13 const char kMediaStreamSourceTab[] = "tab";
14
11 StreamOptions::StreamOptions() 15 StreamOptions::StreamOptions()
12 : audio_type(content::MEDIA_NO_SERVICE), 16 : audio_type(content::MEDIA_NO_SERVICE),
13 video_type(content::MEDIA_NO_SERVICE) {} 17 video_type(content::MEDIA_NO_SERVICE) {}
14 18
15 StreamOptions::StreamOptions(bool user_audio, bool user_video) 19 StreamOptions::StreamOptions(bool user_audio, bool user_video)
16 : audio_type(user_audio ? 20 : audio_type(user_audio ?
17 content::MEDIA_DEVICE_AUDIO_CAPTURE : 21 content::MEDIA_DEVICE_AUDIO_CAPTURE :
18 content::MEDIA_NO_SERVICE), 22 content::MEDIA_NO_SERVICE),
19 video_type(user_video ? 23 video_type(user_video ?
20 content::MEDIA_DEVICE_VIDEO_CAPTURE : 24 content::MEDIA_DEVICE_VIDEO_CAPTURE :
21 content::MEDIA_NO_SERVICE) {} 25 content::MEDIA_NO_SERVICE) {}
22 26
23 StreamOptions::StreamOptions(MediaStreamType audio_type, 27 StreamOptions::StreamOptions(MediaStreamType audio_type,
24 MediaStreamType video_type) 28 MediaStreamType video_type)
25 : audio_type(audio_type), video_type(video_type) { 29 : audio_type(audio_type), video_type(video_type) {
26 DCHECK(IsAudioMediaType(audio_type) || 30 DCHECK(IsAudioMediaType(audio_type) ||
27 audio_type == content::MEDIA_NO_SERVICE); 31 audio_type == content::MEDIA_NO_SERVICE);
28 DCHECK(IsVideoMediaType(video_type) || 32 DCHECK(IsVideoMediaType(video_type) ||
29 video_type == content::MEDIA_NO_SERVICE); 33 video_type == content::MEDIA_NO_SERVICE);
30 } 34 }
31 35
36 StreamOptions::StreamOptions(MediaStreamType audio_type,
37 std::string audio_device_id,
38 MediaStreamType video_type,
39 std::string video_device_id)
40 : audio_type(audio_type),
41 audio_device_id(audio_device_id),
42 video_type(video_type),
43 video_device_id(video_device_id) {
44 }
45
32 // static 46 // static
33 const int StreamDeviceInfo::kNoId = -1; 47 const int StreamDeviceInfo::kNoId = -1;
34 48
35 StreamDeviceInfo::StreamDeviceInfo() 49 StreamDeviceInfo::StreamDeviceInfo()
36 : stream_type(content::MEDIA_NO_SERVICE), 50 : stream_type(content::MEDIA_NO_SERVICE),
37 in_use(false), 51 in_use(false),
38 session_id(kNoId) {} 52 session_id(kNoId) {}
39 53
40 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param, 54 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
41 const std::string& name_param, 55 const std::string& name_param,
42 const std::string& device_param, 56 const std::string& device_param,
43 bool opened) 57 bool opened)
44 : stream_type(service_param), 58 : stream_type(service_param),
45 name(name_param), 59 name(name_param),
46 device_id(device_param), 60 device_id(device_param),
47 in_use(opened), 61 in_use(opened),
48 session_id(kNoId) {} 62 session_id(kNoId) {}
49 63
50 // static 64 // static
51 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, 65 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first,
52 const StreamDeviceInfo& second) { 66 const StreamDeviceInfo& second) {
53 return first.stream_type == second.stream_type && 67 return first.stream_type == second.stream_type &&
54 first.name == second.name && 68 first.name == second.name &&
55 first.device_id == second.device_id && 69 first.device_id == second.device_id &&
56 first.in_use == second.in_use && 70 first.in_use == second.in_use &&
57 first.session_id == second.session_id; 71 first.session_id == second.session_id;
58 } 72 }
59 73
60 } // namespace media_stream 74 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698