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

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

Issue 2313663002: Reland of Add groupid for media devices. Group audio devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. 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/audio_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_renderer_host.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 return true; 74 return true;
75 } 75 }
76 76
77 AudioOutputDeviceInfo GetDefaultDeviceInfoOnDeviceThread( 77 AudioOutputDeviceInfo GetDefaultDeviceInfoOnDeviceThread(
78 media::AudioManager* audio_manager) { 78 media::AudioManager* audio_manager) {
79 DCHECK(audio_manager->GetTaskRunner()->BelongsToCurrentThread()); 79 DCHECK(audio_manager->GetTaskRunner()->BelongsToCurrentThread());
80 AudioOutputDeviceInfo default_device_info = { 80 AudioOutputDeviceInfo default_device_info = {
81 media::AudioDeviceDescription::kDefaultDeviceId, 81 media::AudioDeviceDescription::kDefaultDeviceId,
82 media::AudioDeviceDescription::GetDefaultDeviceName(), 82 media::AudioDeviceDescription::GetDefaultDeviceName(),
83 audio_manager->GetGroupIDOutput(
84 media::AudioDeviceDescription::kDefaultDeviceId),
83 audio_manager->GetDefaultOutputStreamParameters()}; 85 audio_manager->GetDefaultOutputStreamParameters()};
84 86
85 return default_device_info; 87 return default_device_info;
86 } 88 }
87 89
88 void NotifyRenderProcessHostThatAudioStateChanged(int render_process_id) { 90 void NotifyRenderProcessHostThatAudioStateChanged(int render_process_id) {
89 DCHECK_CURRENTLY_ON(BrowserThread::UI); 91 DCHECK_CURRENTLY_ON(BrowserThread::UI);
90 92
91 RenderProcessHost* render_process_host = 93 RenderProcessHost* render_process_host =
92 RenderProcessHost::FromID(render_process_id); 94 RenderProcessHost::FromID(render_process_id);
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 return; 851 return;
850 } 852 }
851 } else if (content::DoesMediaDeviceIDMatchHMAC( 853 } else if (content::DoesMediaDeviceIDMatchHMAC(
852 salt_, security_origin, device_id, device_info.unique_id)) { 854 salt_, security_origin, device_id, device_info.unique_id)) {
853 callback.Run(true, device_info); 855 callback.Run(true, device_info);
854 return; 856 return;
855 } 857 }
856 } 858 }
857 DCHECK(!device_id.empty()); // Default device must always be found 859 DCHECK(!device_id.empty()); // Default device must always be found
858 AudioOutputDeviceInfo device_info = { 860 AudioOutputDeviceInfo device_info = {
859 std::string(), std::string(), 861 std::string(), std::string(), std::string(),
860 media::AudioParameters::UnavailableDeviceParams()}; 862 media::AudioParameters::UnavailableDeviceParams()};
861 callback.Run(false, device_info); 863 callback.Run(false, device_info);
862 } 864 }
863 865
864 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) { 866 bool AudioRendererHost::IsAuthorizationStarted(int stream_id) {
865 DCHECK_CURRENTLY_ON(BrowserThread::IO); 867 DCHECK_CURRENTLY_ON(BrowserThread::IO);
866 const auto& i = authorizations_.find(stream_id); 868 const auto& i = authorizations_.find(stream_id);
867 return i != authorizations_.end(); 869 return i != authorizations_.end();
868 } 870 }
869 871
870 } // namespace content 872 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698