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