OLD | NEW |
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/public/common/media_stream_request.h" | 5 #include "content/public/common/media_stream_request.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 15 matching lines...) Expand all Loading... |
26 type == MEDIA_TAB_VIDEO_CAPTURE || | 26 type == MEDIA_TAB_VIDEO_CAPTURE || |
27 type == MEDIA_DESKTOP_AUDIO_CAPTURE || | 27 type == MEDIA_DESKTOP_AUDIO_CAPTURE || |
28 type == MEDIA_DESKTOP_VIDEO_CAPTURE); | 28 type == MEDIA_DESKTOP_VIDEO_CAPTURE); |
29 } | 29 } |
30 | 30 |
31 MediaStreamDevice::MediaStreamDevice() | 31 MediaStreamDevice::MediaStreamDevice() |
32 : type(MEDIA_NO_SERVICE), | 32 : type(MEDIA_NO_SERVICE), |
33 video_facing(MEDIA_VIDEO_FACING_NONE) { | 33 video_facing(MEDIA_VIDEO_FACING_NONE) { |
34 } | 34 } |
35 | 35 |
36 MediaStreamDevice::MediaStreamDevice( | 36 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, |
37 MediaStreamType type, | 37 const std::string& id, |
38 const std::string& id, | 38 const std::string& name, |
39 const std::string& name) | 39 const std::string& group_id) |
40 : type(type), | 40 : type(type), |
41 id(id), | 41 id(id), |
42 video_facing(MEDIA_VIDEO_FACING_NONE), | 42 video_facing(MEDIA_VIDEO_FACING_NONE), |
43 name(name) { | 43 name(name), |
| 44 group_id(group_id) { |
44 #if defined(OS_ANDROID) | 45 #if defined(OS_ANDROID) |
45 if (name.find("front") != std::string::npos) { | 46 if (name.find("front") != std::string::npos) { |
46 video_facing = MEDIA_VIDEO_FACING_USER; | 47 video_facing = MEDIA_VIDEO_FACING_USER; |
47 } else if (name.find("back") != std::string::npos) { | 48 } else if (name.find("back") != std::string::npos) { |
48 video_facing = MEDIA_VIDEO_FACING_ENVIRONMENT; | 49 video_facing = MEDIA_VIDEO_FACING_ENVIRONMENT; |
49 } | 50 } |
50 #endif | 51 #endif |
51 } | 52 } |
52 | 53 |
53 MediaStreamDevice::MediaStreamDevice( | 54 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, |
54 MediaStreamType type, | 55 const std::string& id, |
55 const std::string& id, | 56 const std::string& name) |
56 const std::string& name, | 57 : MediaStreamDevice(type, id, name, std::string()) {} |
57 int sample_rate, | 58 |
58 int channel_layout, | 59 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, |
59 int frames_per_buffer) | 60 const std::string& id, |
| 61 const std::string& name, |
| 62 const std::string& group_id, |
| 63 int sample_rate, |
| 64 int channel_layout, |
| 65 int frames_per_buffer) |
60 : type(type), | 66 : type(type), |
61 id(id), | 67 id(id), |
62 video_facing(MEDIA_VIDEO_FACING_NONE), | 68 video_facing(MEDIA_VIDEO_FACING_NONE), |
63 name(name), | 69 name(name), |
64 input(sample_rate, channel_layout, frames_per_buffer) { | 70 group_id(group_id), |
65 } | 71 input(sample_rate, channel_layout, frames_per_buffer) {} |
66 | 72 |
67 MediaStreamDevice::MediaStreamDevice(const MediaStreamDevice& other) = default; | 73 MediaStreamDevice::MediaStreamDevice(const MediaStreamDevice& other) = default; |
68 | 74 |
69 MediaStreamDevice::~MediaStreamDevice() {} | 75 MediaStreamDevice::~MediaStreamDevice() {} |
70 | 76 |
71 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { | 77 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { |
72 const AudioDeviceParameters& input_second = second.input; | 78 const AudioDeviceParameters& input_second = second.input; |
73 return type == second.type && | 79 return type == second.type && |
74 name == second.name && | 80 name == second.name && |
75 id == second.id && | 81 id == second.id && |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 video_type(video_type), | 139 video_type(video_type), |
134 all_ancestors_have_same_origin(false) { | 140 all_ancestors_have_same_origin(false) { |
135 } | 141 } |
136 | 142 |
137 MediaStreamRequest::MediaStreamRequest(const MediaStreamRequest& other) = | 143 MediaStreamRequest::MediaStreamRequest(const MediaStreamRequest& other) = |
138 default; | 144 default; |
139 | 145 |
140 MediaStreamRequest::~MediaStreamRequest() {} | 146 MediaStreamRequest::~MediaStreamRequest() {} |
141 | 147 |
142 } // namespace content | 148 } // namespace content |
OLD | NEW |