| 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 17 matching lines...) Expand all Loading... |
| 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(MediaStreamType type, | 36 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, |
| 37 const std::string& id, | 37 const std::string& id, |
| 38 const std::string& name, | 38 const std::string& name) |
| 39 const std::string& group_id) | 39 : type(type), id(id), video_facing(MEDIA_VIDEO_FACING_NONE), name(name) { |
| 40 : type(type), | |
| 41 id(id), | |
| 42 video_facing(MEDIA_VIDEO_FACING_NONE), | |
| 43 name(name), | |
| 44 group_id(group_id) { | |
| 45 #if defined(OS_ANDROID) | 40 #if defined(OS_ANDROID) |
| 46 if (name.find("front") != std::string::npos) { | 41 if (name.find("front") != std::string::npos) { |
| 47 video_facing = MEDIA_VIDEO_FACING_USER; | 42 video_facing = MEDIA_VIDEO_FACING_USER; |
| 48 } else if (name.find("back") != std::string::npos) { | 43 } else if (name.find("back") != std::string::npos) { |
| 49 video_facing = MEDIA_VIDEO_FACING_ENVIRONMENT; | 44 video_facing = MEDIA_VIDEO_FACING_ENVIRONMENT; |
| 50 } | 45 } |
| 51 #endif | 46 #endif |
| 52 } | 47 } |
| 53 | 48 |
| 54 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, | 49 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, |
| 55 const std::string& id, | 50 const std::string& id, |
| 56 const std::string& name) | |
| 57 : MediaStreamDevice(type, id, name, std::string()) {} | |
| 58 | |
| 59 MediaStreamDevice::MediaStreamDevice(MediaStreamType type, | |
| 60 const std::string& id, | |
| 61 const std::string& name, | 51 const std::string& name, |
| 62 const std::string& group_id, | |
| 63 int sample_rate, | 52 int sample_rate, |
| 64 int channel_layout, | 53 int channel_layout, |
| 65 int frames_per_buffer) | 54 int frames_per_buffer) |
| 66 : type(type), | 55 : type(type), |
| 67 id(id), | 56 id(id), |
| 68 video_facing(MEDIA_VIDEO_FACING_NONE), | 57 video_facing(MEDIA_VIDEO_FACING_NONE), |
| 69 name(name), | 58 name(name), |
| 70 group_id(group_id), | |
| 71 input(sample_rate, channel_layout, frames_per_buffer) {} | 59 input(sample_rate, channel_layout, frames_per_buffer) {} |
| 72 | 60 |
| 73 MediaStreamDevice::MediaStreamDevice(const MediaStreamDevice& other) = default; | 61 MediaStreamDevice::MediaStreamDevice(const MediaStreamDevice& other) = default; |
| 74 | 62 |
| 75 MediaStreamDevice::~MediaStreamDevice() {} | 63 MediaStreamDevice::~MediaStreamDevice() {} |
| 76 | 64 |
| 77 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { | 65 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { |
| 78 const AudioDeviceParameters& input_second = second.input; | 66 const AudioDeviceParameters& input_second = second.input; |
| 79 return type == second.type && | 67 return type == second.type && |
| 80 name == second.name && | 68 name == second.name && |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 video_type(video_type), | 128 video_type(video_type), |
| 141 disable_local_echo(disable_local_echo), | 129 disable_local_echo(disable_local_echo), |
| 142 all_ancestors_have_same_origin(false) {} | 130 all_ancestors_have_same_origin(false) {} |
| 143 | 131 |
| 144 MediaStreamRequest::MediaStreamRequest(const MediaStreamRequest& other) = | 132 MediaStreamRequest::MediaStreamRequest(const MediaStreamRequest& other) = |
| 145 default; | 133 default; |
| 146 | 134 |
| 147 MediaStreamRequest::~MediaStreamRequest() {} | 135 MediaStreamRequest::~MediaStreamRequest() {} |
| 148 | 136 |
| 149 } // namespace content | 137 } // namespace content |
| OLD | NEW |