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

Unified Diff: content/renderer/pepper/pepper_media_device_manager.cc

Issue 2755613002: Support audio output device enumeration and selection in PPAPI (Closed)
Patch Set: Should not include local change to ppapi/generators/idl_outfile.py Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_media_device_manager.cc
diff --git a/content/renderer/pepper/pepper_media_device_manager.cc b/content/renderer/pepper/pepper_media_device_manager.cc
index 8888bb715bf25256d15b8ffbc3c931b833ba364c..55a2fd0f57fdb013867203828713b507687175b5 100644
--- a/content/renderer/pepper/pepper_media_device_manager.cc
+++ b/content/renderer/pepper/pepper_media_device_manager.cc
@@ -25,6 +25,8 @@ PP_DeviceType_Dev FromMediaDeviceType(MediaDeviceType type) {
return PP_DEVICETYPE_DEV_AUDIOCAPTURE;
case MEDIA_DEVICE_TYPE_VIDEO_INPUT:
return PP_DEVICETYPE_DEV_VIDEOCAPTURE;
+ case MEDIA_DEVICE_TYPE_AUDIO_OUTPUT:
+ return PP_DEVICETYPE_DEV_AUDIOOUTPUT;
default:
NOTREACHED();
return PP_DEVICETYPE_DEV_INVALID;
@@ -37,6 +39,8 @@ MediaDeviceType ToMediaDeviceType(PP_DeviceType_Dev type) {
return MEDIA_DEVICE_TYPE_AUDIO_INPUT;
case PP_DEVICETYPE_DEV_VIDEOCAPTURE:
return MEDIA_DEVICE_TYPE_VIDEO_INPUT;
+ case PP_DEVICETYPE_DEV_AUDIOOUTPUT:
+ return MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
default:
NOTREACHED();
return MEDIA_DEVICE_TYPE_AUDIO_OUTPUT;
@@ -82,9 +86,10 @@ void PepperMediaDeviceManager::EnumerateDevices(
#if BUILDFLAG(ENABLE_WEBRTC)
bool request_audio_input = type == PP_DEVICETYPE_DEV_AUDIOCAPTURE;
bool request_video_input = type == PP_DEVICETYPE_DEV_VIDEOCAPTURE;
- CHECK(request_audio_input || request_video_input);
+ bool request_audio_output = type == PP_DEVICETYPE_DEV_AUDIOOUTPUT;
+ CHECK(request_audio_input || request_video_input || request_audio_output);
GetMediaDevicesDispatcher()->EnumerateDevices(
- request_audio_input, request_video_input, false /* audio_output */,
+ request_audio_input, request_video_input, request_audio_output,
url::Origin(document_url.GetOrigin()),
base::Bind(&PepperMediaDeviceManager::DevicesEnumerated, AsWeakPtr(),
callback, ToMediaDeviceType(type)));

Powered by Google App Engine
This is Rietveld 408576698