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

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

Issue 10912004: Begin adding support for tab mirroring via the MediaStream audio/video capturing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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"
8
7 namespace media_stream { 9 namespace media_stream {
8 10
11 StreamOptions::StreamOptions()
12 : audio_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE),
13 video_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE) {}
14
15 StreamOptions::StreamOptions(bool user_audio, bool user_video)
16 : audio_type(user_audio ?
17 content::MEDIA_STREAM_DEVICE_TYPE_USER_AUDIO_CAPTURE :
18 content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE),
19 video_type(user_video ?
20 content::MEDIA_STREAM_DEVICE_TYPE_USER_VIDEO_CAPTURE :
21 content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE) {}
22
23 StreamOptions::StreamOptions(MediaStreamType audio_type,
24 MediaStreamType video_type,
25 const std::string& opt_device_id)
26 : audio_type(audio_type), video_type(video_type),
27 opt_device_id(opt_device_id) {
28 DCHECK(IsAudioMediaStreamDeviceType(audio_type) ||
29 audio_type == content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE);
30 DCHECK(IsVideoMediaStreamDeviceType(video_type) ||
31 video_type == content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE);
32 }
33
9 // static 34 // static
10 const int StreamDeviceInfo::kNoId = -1; 35 const int StreamDeviceInfo::kNoId = -1;
11 36
12 StreamDeviceInfo::StreamDeviceInfo() 37 StreamDeviceInfo::StreamDeviceInfo()
13 : stream_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE), 38 : stream_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE),
14 in_use(false), 39 in_use(false),
15 session_id(kNoId) {} 40 session_id(kNoId) {}
16 41
17 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param, 42 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
18 const std::string& name_param, 43 const std::string& name_param,
19 const std::string& device_param, 44 const std::string& device_param,
20 bool opened) 45 bool opened)
21 : stream_type(service_param), 46 : stream_type(service_param),
22 name(name_param), 47 name(name_param),
23 device_id(device_param), 48 device_id(device_param),
24 in_use(opened), 49 in_use(opened),
25 session_id(kNoId) {} 50 session_id(kNoId) {}
26 51
27 // static 52 // static
28 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first, 53 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first,
29 const StreamDeviceInfo& second) { 54 const StreamDeviceInfo& second) {
30 return first.stream_type == second.stream_type && 55 return first.stream_type == second.stream_type &&
31 first.name == second.name && 56 first.name == second.name &&
32 first.device_id == second.device_id && 57 first.device_id == second.device_id &&
33 first.in_use == second.in_use && 58 first.in_use == second.in_use &&
34 first.session_id == second.session_id; 59 first.session_id == second.session_id;
35 } 60 }
36 61
37 } // namespace media_stream 62 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698