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"
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
);
27 const int StreamDeviceInfo::kNoId
= -1;
29 StreamDeviceInfo::StreamDeviceInfo()
33 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param
,
34 const std::string
& name_param
,
35 const std::string
& device_param
,
37 : device(service_param
, device_param
, name_param
),
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