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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <cctype> | 10 #include <cctype> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 return label; | 92 return label; |
93 } | 93 } |
94 | 94 |
95 void ParseStreamType(const StreamControls& controls, | 95 void ParseStreamType(const StreamControls& controls, |
96 MediaStreamType* audio_type, | 96 MediaStreamType* audio_type, |
97 MediaStreamType* video_type) { | 97 MediaStreamType* video_type) { |
98 *audio_type = MEDIA_NO_SERVICE; | 98 *audio_type = MEDIA_NO_SERVICE; |
99 *video_type = MEDIA_NO_SERVICE; | 99 *video_type = MEDIA_NO_SERVICE; |
100 const bool audio_support_flag_for_desktop_share = | 100 const bool audio_support_flag_for_desktop_share = |
101 base::CommandLine::ForCurrentProcess()->HasSwitch( | 101 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
102 switches::kEnableAudioSupportForDesktopShare); | 102 switches::kDisableAudioSupportForDesktopShare); |
103 if (controls.audio.requested) { | 103 if (controls.audio.requested) { |
104 if (!controls.audio.stream_source.empty()) { | 104 if (!controls.audio.stream_source.empty()) { |
105 // This is tab or screen capture. | 105 // This is tab or screen capture. |
106 if (controls.audio.stream_source == kMediaStreamSourceTab) { | 106 if (controls.audio.stream_source == kMediaStreamSourceTab) { |
107 *audio_type = content::MEDIA_TAB_AUDIO_CAPTURE; | 107 *audio_type = content::MEDIA_TAB_AUDIO_CAPTURE; |
108 } else if (controls.audio.stream_source == kMediaStreamSourceSystem) { | 108 } else if (controls.audio.stream_source == kMediaStreamSourceSystem) { |
109 *audio_type = content::MEDIA_DESKTOP_AUDIO_CAPTURE; | 109 *audio_type = content::MEDIA_DESKTOP_AUDIO_CAPTURE; |
110 } else if (audio_support_flag_for_desktop_share && | 110 } else if (audio_support_flag_for_desktop_share && |
111 controls.audio.stream_source == kMediaStreamSourceDesktop) { | 111 controls.audio.stream_source == kMediaStreamSourceDesktop) { |
112 *audio_type = content::MEDIA_DESKTOP_AUDIO_CAPTURE; | 112 *audio_type = content::MEDIA_DESKTOP_AUDIO_CAPTURE; |
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 const std::string& device_guid, | 2107 const std::string& device_guid, |
2108 const std::string& raw_unique_id) { | 2108 const std::string& raw_unique_id) { |
2109 DCHECK(security_origin.is_valid()); | 2109 DCHECK(security_origin.is_valid()); |
2110 DCHECK(!raw_unique_id.empty()); | 2110 DCHECK(!raw_unique_id.empty()); |
2111 std::string guid_from_raw_device_id = | 2111 std::string guid_from_raw_device_id = |
2112 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); | 2112 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); |
2113 return guid_from_raw_device_id == device_guid; | 2113 return guid_from_raw_device_id == device_guid; |
2114 } | 2114 } |
2115 | 2115 |
2116 } // namespace content | 2116 } // namespace content |
OLD | NEW |