During App Launcher install, install V2 App if instructed to do so via environment...
[chromium-blink-merge.git] / content / common / media / media_stream_options.cc
blob95ced6fde1ba78538be55c6cf14cad24e140883e
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 #include "content/common/media/media_stream_options.h"
7 #include "base/logging.h"
9 namespace content {
11 const char kMediaStreamSource[] = "chromeMediaSource";
12 const char kMediaStreamSourceId[] = "chromeMediaSourceId";
13 const char kMediaStreamSourceTab[] = "tab";
15 StreamOptions::StreamOptions()
16 : audio_type(MEDIA_NO_SERVICE),
17 video_type(MEDIA_NO_SERVICE) {}
19 StreamOptions::StreamOptions(MediaStreamType audio_type,
20 MediaStreamType video_type)
21 : audio_type(audio_type), video_type(video_type) {
22 DCHECK(IsAudioMediaType(audio_type) || audio_type == MEDIA_NO_SERVICE);
23 DCHECK(IsVideoMediaType(video_type) || video_type == MEDIA_NO_SERVICE);
26 // static
27 const int StreamDeviceInfo::kNoId = -1;
29 StreamDeviceInfo::StreamDeviceInfo()
30 : in_use(false),
31 session_id(kNoId) {}
33 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
34 const std::string& name_param,
35 const std::string& device_param,
36 bool opened)
37 : device(service_param, device_param, name_param),
38 in_use(opened),
39 session_id(kNoId) {}
41 // static
42 bool StreamDeviceInfo::IsEqual(const StreamDeviceInfo& first,
43 const StreamDeviceInfo& second) {
44 return first.device.type == second.device.type &&
45 first.device.name == second.device.name &&
46 first.device.id == second.device.id &&
47 first.in_use == second.in_use &&
48 first.session_id == second.session_id;
51 } // namespace content