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

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

Issue 2296393004: Revert of Add groupid for media devices. Group audio devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 void MediaStreamManager::AudioOutputDevicesEnumerated( 760 void MediaStreamManager::AudioOutputDevicesEnumerated(
761 const AudioOutputDeviceEnumeration& device_enumeration) { 761 const AudioOutputDeviceEnumeration& device_enumeration) {
762 DCHECK_CURRENTLY_ON(BrowserThread::IO); 762 DCHECK_CURRENTLY_ON(BrowserThread::IO);
763 DVLOG(1) << "AudioOutputDevicesEnumerated()"; 763 DVLOG(1) << "AudioOutputDevicesEnumerated()";
764 StreamDeviceInfoArray device_infos; 764 StreamDeviceInfoArray device_infos;
765 765
766 if (device_enumeration.has_actual_devices) { 766 if (device_enumeration.has_actual_devices) {
767 for (const auto& entry : device_enumeration.devices) { 767 for (const auto& entry : device_enumeration.devices) {
768 StreamDeviceInfo device_info(MEDIA_DEVICE_AUDIO_OUTPUT, entry.device_name, 768 StreamDeviceInfo device_info(MEDIA_DEVICE_AUDIO_OUTPUT, entry.device_name,
769 entry.unique_id); 769 entry.unique_id);
770 device_info.device.group_id =
Guido Urdaneta 2016/09/02 09:16:36 The problem with the failed test is that you are c
771 audio_manager_->GetGroupIDOutput(device_info.device.id);
772 device_infos.push_back(device_info); 770 device_infos.push_back(device_info);
773 } 771 }
774 } 772 }
775 773
776 const std::string log_message = 774 const std::string log_message =
777 "New device enumeration result:\n" + 775 "New device enumeration result:\n" +
778 GetLogMessageString(MEDIA_DEVICE_AUDIO_OUTPUT, device_infos); 776 GetLogMessageString(MEDIA_DEVICE_AUDIO_OUTPUT, device_infos);
779 SendMessageToNativeLog(log_message); 777 SendMessageToNativeLog(log_message);
780 778
781 // Publish the result for all requests waiting for device list(s). 779 // Publish the result for all requests waiting for device list(s).
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } 1033 }
1036 1034
1037 void MediaStreamManager::TranslateDeviceIdToSourceId( 1035 void MediaStreamManager::TranslateDeviceIdToSourceId(
1038 DeviceRequest* request, 1036 DeviceRequest* request,
1039 MediaStreamDevice* device) { 1037 MediaStreamDevice* device) {
1040 if (request->audio_type() == MEDIA_DEVICE_AUDIO_CAPTURE || 1038 if (request->audio_type() == MEDIA_DEVICE_AUDIO_CAPTURE ||
1041 request->audio_type() == MEDIA_DEVICE_AUDIO_OUTPUT || 1039 request->audio_type() == MEDIA_DEVICE_AUDIO_OUTPUT ||
1042 request->video_type() == MEDIA_DEVICE_VIDEO_CAPTURE) { 1040 request->video_type() == MEDIA_DEVICE_VIDEO_CAPTURE) {
1043 device->id = GetHMACForMediaDeviceID(request->salt, 1041 device->id = GetHMACForMediaDeviceID(request->salt,
1044 request->security_origin, device->id); 1042 request->security_origin, device->id);
1045 if (!device->group_id.empty())
1046 device->group_id = GetHMACForMediaDeviceID(
1047 request->salt, request->security_origin, device->group_id);
1048 } 1043 }
1049 } 1044 }
1050 1045
1051 void MediaStreamManager::ClearEnumerationCache(EnumerationCache* cache) { 1046 void MediaStreamManager::ClearEnumerationCache(EnumerationCache* cache) {
1052 DCHECK(CalledOnIOThread()); 1047 DCHECK(CalledOnIOThread());
1053 cache->valid = false; 1048 cache->valid = false;
1054 } 1049 }
1055 1050
1056 bool MediaStreamManager::EnumerationRequired(EnumerationCache* cache, 1051 bool MediaStreamManager::EnumerationRequired(EnumerationCache* cache,
1057 MediaStreamType stream_type) { 1052 MediaStreamType stream_type) {
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 if (device_info.session_id == session_id && 2181 if (device_info.session_id == session_id &&
2187 device_info.device.type == type) { 2182 device_info.device.type == type) {
2188 request->SetCapturingLinkSecured(is_secure); 2183 request->SetCapturingLinkSecured(is_secure);
2189 return; 2184 return;
2190 } 2185 }
2191 } 2186 }
2192 } 2187 }
2193 } 2188 }
2194 2189
2195 } // namespace content 2190 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_input_device_manager.cc ('k') | content/common/media/media_stream_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698