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/browser/renderer_host/media/media_stream_manager.h" | 5 #include "content/browser/renderer_host/media/media_stream_manager.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 std::string audio_stream_source; | 86 std::string audio_stream_source; |
87 bool mandatory = false; | 87 bool mandatory = false; |
88 if (options.GetFirstAudioConstraintByName(kMediaStreamSource, | 88 if (options.GetFirstAudioConstraintByName(kMediaStreamSource, |
89 &audio_stream_source, | 89 &audio_stream_source, |
90 &mandatory)) { | 90 &mandatory)) { |
91 DCHECK(mandatory); | 91 DCHECK(mandatory); |
92 // This is tab or screen capture. | 92 // This is tab or screen capture. |
93 if (audio_stream_source == kMediaStreamSourceTab) { | 93 if (audio_stream_source == kMediaStreamSourceTab) { |
94 *audio_type = content::MEDIA_TAB_AUDIO_CAPTURE; | 94 *audio_type = content::MEDIA_TAB_AUDIO_CAPTURE; |
95 } else if (audio_stream_source == kMediaStreamSourceSystem) { | 95 } else if (audio_stream_source == kMediaStreamSourceSystem) { |
96 *audio_type = content::MEDIA_LOOPBACK_AUDIO_CAPTURE; | 96 *audio_type = content::MEDIA_DESKTOP_AUDIO_CAPTURE; |
97 } | 97 } |
98 } else { | 98 } else { |
99 // This is normal audio device capture. | 99 // This is normal audio device capture. |
100 *audio_type = MEDIA_DEVICE_AUDIO_CAPTURE; | 100 *audio_type = MEDIA_DEVICE_AUDIO_CAPTURE; |
101 } | 101 } |
102 } | 102 } |
103 if (options.video_requested) { | 103 if (options.video_requested) { |
104 std::string video_stream_source; | 104 std::string video_stream_source; |
105 bool mandatory = false; | 105 bool mandatory = false; |
106 if (options.GetFirstVideoConstraintByName(kMediaStreamSource, | 106 if (options.GetFirstVideoConstraintByName(kMediaStreamSource, |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1326 |
1327 DVLOG(3) << "SetupTabCaptureRequest " | 1327 DVLOG(3) << "SetupTabCaptureRequest " |
1328 << ", {capture_device_id = " << capture_device_id << "}" | 1328 << ", {capture_device_id = " << capture_device_id << "}" |
1329 << ", {target_render_process_id = " << target_render_process_id | 1329 << ", {target_render_process_id = " << target_render_process_id |
1330 << "}" | 1330 << "}" |
1331 << ", {target_render_frame_id = " << target_render_frame_id << "}"; | 1331 << ", {target_render_frame_id = " << target_render_frame_id << "}"; |
1332 return true; | 1332 return true; |
1333 } | 1333 } |
1334 | 1334 |
1335 bool MediaStreamManager::SetupScreenCaptureRequest(DeviceRequest* request) { | 1335 bool MediaStreamManager::SetupScreenCaptureRequest(DeviceRequest* request) { |
1336 DCHECK(request->audio_type() == MEDIA_LOOPBACK_AUDIO_CAPTURE || | 1336 DCHECK(request->audio_type() == MEDIA_DESKTOP_AUDIO_CAPTURE || |
1337 request->video_type() == MEDIA_DESKTOP_VIDEO_CAPTURE); | 1337 request->video_type() == MEDIA_DESKTOP_VIDEO_CAPTURE); |
1338 | 1338 |
1339 // For screen capture we only support two valid combinations: | 1339 // For screen capture we only support two valid combinations: |
1340 // (1) screen video capture only, or | 1340 // (1) screen video capture only, or |
1341 // (2) screen video capture with loopback audio capture. | 1341 // (2) screen video capture with loopback audio capture. |
1342 if (request->video_type() != MEDIA_DESKTOP_VIDEO_CAPTURE || | 1342 if (request->video_type() != MEDIA_DESKTOP_VIDEO_CAPTURE || |
1343 (request->audio_type() != MEDIA_NO_SERVICE && | 1343 (request->audio_type() != MEDIA_NO_SERVICE && |
1344 request->audio_type() != MEDIA_LOOPBACK_AUDIO_CAPTURE)) { | 1344 request->audio_type() != MEDIA_DESKTOP_AUDIO_CAPTURE)) { |
1345 LOG(ERROR) << "Invalid screen capture request."; | 1345 LOG(ERROR) << "Invalid screen capture request."; |
1346 return false; | 1346 return false; |
1347 } | 1347 } |
1348 | 1348 |
1349 std::string video_device_id; | 1349 std::string video_device_id; |
1350 if (request->video_type() == MEDIA_DESKTOP_VIDEO_CAPTURE) { | 1350 if (request->video_type() == MEDIA_DESKTOP_VIDEO_CAPTURE) { |
1351 std::string video_stream_source; | 1351 std::string video_stream_source; |
1352 bool mandatory = false; | 1352 bool mandatory = false; |
1353 if (!request->options.GetFirstVideoConstraintByName( | 1353 if (!request->options.GetFirstVideoConstraintByName( |
1354 kMediaStreamSource, | 1354 kMediaStreamSource, |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2131 } | 2131 } |
2132 } | 2132 } |
2133 | 2133 |
2134 void MediaStreamManager::SetKeyboardMicOnDeviceThread() { | 2134 void MediaStreamManager::SetKeyboardMicOnDeviceThread() { |
2135 DCHECK(device_task_runner_->BelongsToCurrentThread()); | 2135 DCHECK(device_task_runner_->BelongsToCurrentThread()); |
2136 audio_manager_->SetHasKeyboardMic(); | 2136 audio_manager_->SetHasKeyboardMic(); |
2137 } | 2137 } |
2138 #endif | 2138 #endif |
2139 | 2139 |
2140 } // namespace content | 2140 } // namespace content |
OLD | NEW |