Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 2326623003: Make SystemMonitor report all audio device changes instead of just audio capture. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <algorithm> 10 #include <algorithm>
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 } 2033 }
2034 2034
2035 void MediaStreamManager::OnDevicesChanged( 2035 void MediaStreamManager::OnDevicesChanged(
2036 base::SystemMonitor::DeviceType device_type) { 2036 base::SystemMonitor::DeviceType device_type) {
2037 DCHECK_CURRENTLY_ON(BrowserThread::IO); 2037 DCHECK_CURRENTLY_ON(BrowserThread::IO);
2038 2038
2039 // NOTE: This method is only called in response to physical audio/video device 2039 // NOTE: This method is only called in response to physical audio/video device
2040 // changes (from the operating system). 2040 // changes (from the operating system).
2041 2041
2042 MediaStreamType stream_type; 2042 MediaStreamType stream_type;
2043 if (device_type == base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE) { 2043 if (device_type == base::SystemMonitor::DEVTYPE_AUDIO) {
2044 stream_type = MEDIA_DEVICE_AUDIO_CAPTURE; 2044 stream_type = MEDIA_DEVICE_AUDIO_CAPTURE;
2045 } else if (device_type == base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE) { 2045 } else if (device_type == base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE) {
2046 stream_type = MEDIA_DEVICE_VIDEO_CAPTURE; 2046 stream_type = MEDIA_DEVICE_VIDEO_CAPTURE;
2047 } else { 2047 } else {
2048 return; // Uninteresting device change. 2048 return; // Uninteresting device change.
2049 } 2049 }
2050 2050
2051 // Always do enumeration even though some enumeration is in progress, because 2051 // Always do enumeration even though some enumeration is in progress, because
2052 // those enumeration commands could be sent before these devices change. 2052 // those enumeration commands could be sent before these devices change.
2053 ++active_enumeration_ref_count_[stream_type]; 2053 ++active_enumeration_ref_count_[stream_type];
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 if (device_info.session_id == session_id && 2185 if (device_info.session_id == session_id &&
2186 device_info.device.type == type) { 2186 device_info.device.type == type) {
2187 request->SetCapturingLinkSecured(is_secure); 2187 request->SetCapturingLinkSecured(is_secure);
2188 return; 2188 return;
2189 } 2189 }
2190 } 2190 }
2191 } 2191 }
2192 } 2192 }
2193 2193
2194 } // namespace content 2194 } // namespace content
OLDNEW
« no previous file with comments | « chromeos/audio/cras_audio_handler.cc ('k') | content/browser/renderer_host/media/media_stream_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698