| 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/renderer/media/media_stream_impl.h" | 5 #include "content/renderer/media/media_stream_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "content/public/common/desktop_media_id.h" | |
| 14 #include "content/renderer/media/media_stream_audio_renderer.h" | 13 #include "content/renderer/media/media_stream_audio_renderer.h" |
| 15 #include "content/renderer/media/media_stream_dependency_factory.h" | 14 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 16 #include "content/renderer/media/media_stream_dispatcher.h" | 15 #include "content/renderer/media/media_stream_dispatcher.h" |
| 17 #include "content/renderer/media/media_stream_extra_data.h" | 16 #include "content/renderer/media/media_stream_extra_data.h" |
| 18 #include "content/renderer/media/media_stream_source_extra_data.h" | 17 #include "content/renderer/media/media_stream_source_extra_data.h" |
| 19 #include "content/renderer/media/rtc_video_renderer.h" | 18 #include "content/renderer/media/rtc_video_renderer.h" |
| 20 #include "content/renderer/media/webrtc_audio_capturer.h" | 19 #include "content/renderer/media/webrtc_audio_capturer.h" |
| 21 #include "content/renderer/media/webrtc_audio_renderer.h" | 20 #include "content/renderer/media/webrtc_audio_renderer.h" |
| 22 #include "content/renderer/media/webrtc_local_audio_renderer.h" | 21 #include "content/renderer/media/webrtc_local_audio_renderer.h" |
| 23 #include "content/renderer/media/webrtc_logging.h" | 22 #include "content/renderer/media/webrtc_logging.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (options->video_type != content::MEDIA_NO_SERVICE) { | 66 if (options->video_type != content::MEDIA_NO_SERVICE) { |
| 68 std::string video_stream_source = GetStreamConstraint( | 67 std::string video_stream_source = GetStreamConstraint( |
| 69 user_media_request.videoConstraints(), kMediaStreamSource, true); | 68 user_media_request.videoConstraints(), kMediaStreamSource, true); |
| 70 if (video_stream_source == kMediaStreamSourceTab) { | 69 if (video_stream_source == kMediaStreamSourceTab) { |
| 71 options->video_type = content::MEDIA_TAB_VIDEO_CAPTURE; | 70 options->video_type = content::MEDIA_TAB_VIDEO_CAPTURE; |
| 72 options->video_device_id = GetStreamConstraint( | 71 options->video_device_id = GetStreamConstraint( |
| 73 user_media_request.videoConstraints(), | 72 user_media_request.videoConstraints(), |
| 74 kMediaStreamSourceId, true); | 73 kMediaStreamSourceId, true); |
| 75 } else if (video_stream_source == kMediaStreamSourceScreen) { | 74 } else if (video_stream_source == kMediaStreamSourceScreen) { |
| 76 options->video_type = content::MEDIA_DESKTOP_VIDEO_CAPTURE; | 75 options->video_type = content::MEDIA_DESKTOP_VIDEO_CAPTURE; |
| 77 options->video_device_id = | 76 // Set empty video device ID when screen capture is requested. |
| 78 DesktopMediaID(DesktopMediaID::TYPE_SCREEN, 0).ToString(); | 77 options->video_device_id.clear(); |
| 79 } else if (video_stream_source == kMediaStreamSourceDesktop) { | 78 } else if (video_stream_source == kMediaStreamSourceDesktop) { |
| 80 options->video_type = content::MEDIA_DESKTOP_VIDEO_CAPTURE; | 79 options->video_type = content::MEDIA_DESKTOP_VIDEO_CAPTURE; |
| 81 options->video_device_id = GetStreamConstraint( | 80 options->video_device_id = GetStreamConstraint( |
| 82 user_media_request.videoConstraints(), | 81 user_media_request.videoConstraints(), |
| 83 kMediaStreamSourceId, true); | 82 kMediaStreamSourceId, true); |
| 84 } | 83 } |
| 85 } | 84 } |
| 86 } | 85 } |
| 87 | 86 |
| 88 static int g_next_request_id = 0; | 87 static int g_next_request_id = 0; |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 enable_automatic_output_device_selection( | 894 enable_automatic_output_device_selection( |
| 896 enable_automatic_output_device_selection), | 895 enable_automatic_output_device_selection), |
| 897 frame(frame), | 896 frame(frame), |
| 898 request(request) { | 897 request(request) { |
| 899 } | 898 } |
| 900 | 899 |
| 901 MediaStreamImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { | 900 MediaStreamImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { |
| 902 } | 901 } |
| 903 | 902 |
| 904 } // namespace content | 903 } // namespace content |
| OLD | NEW |