diff --git a/media/libcubeb/moz.yaml b/media/libcubeb/moz.yaml index 1b60661831db..b2b0265b247f 100644 --- a/media/libcubeb/moz.yaml +++ b/media/libcubeb/moz.yaml @@ -19,5 +19,5 @@ origin: license: "ISC" # update.sh will update this value - release: "3d598eff576ea5939b63119d54a8a54183eec144 (2022-01-07 14:34:59 +1300)" + release: "9e29d728b0025c674904f83f5a13a88d1a6a5edc (2022-01-08 10:44:20 +1300)" diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp index 0957d5ebd6b2..9685de315b54 100644 --- a/media/libcubeb/src/cubeb_wasapi.cpp +++ b/media/libcubeb/src/cubeb_wasapi.cpp @@ -183,6 +183,28 @@ private: extern cubeb_ops const wasapi_ops; +static com_heap_ptr +wasapi_get_default_device_id(EDataFlow flow, ERole role, + IMMDeviceEnumerator * enumerator); + +struct wasapi_default_devices { + wasapi_default_devices(IMMDeviceEnumerator * enumerator) + : render_console_id( + wasapi_get_default_device_id(eRender, eConsole, enumerator)), + render_comms_id( + wasapi_get_default_device_id(eRender, eCommunications, enumerator)), + capture_console_id( + wasapi_get_default_device_id(eCapture, eConsole, enumerator)), + capture_comms_id( + wasapi_get_default_device_id(eCapture, eCommunications, enumerator)) + { + } + com_heap_ptr render_console_id; + com_heap_ptr render_comms_id; + com_heap_ptr capture_console_id; + com_heap_ptr capture_comms_id; +}; + int wasapi_stream_stop(cubeb_stream * stm); int @@ -193,6 +215,10 @@ int setup_wasapi_stream(cubeb_stream * stm); ERole pref_to_role(cubeb_stream_prefs param); +int +wasapi_create_device(cubeb * ctx, cubeb_device_info & ret, + IMMDeviceEnumerator * enumerator, IMMDevice * dev, + wasapi_default_devices * defaults); void wasapi_destroy_device(cubeb_device_info * device_info); static int @@ -1884,7 +1910,7 @@ handle_channel_layout(cubeb_stream * stm, EDataFlow direction, } } -static bool +static int initialize_iaudioclient2(com_ptr & audio_client) { com_ptr audio_client2; @@ -3029,24 +3055,6 @@ wasapi_get_default_device_id(EDataFlow flow, ERole role, return nullptr; } -struct wasapi_default_devices { - wasapi_default_devices(IMMDeviceEnumerator * enumerator) - : render_console_id( - wasapi_get_default_device_id(eRender, eConsole, enumerator)), - render_comms_id( - wasapi_get_default_device_id(eRender, eCommunications, enumerator)), - capture_console_id( - wasapi_get_default_device_id(eCapture, eConsole, enumerator)), - capture_comms_id( - wasapi_get_default_device_id(eCapture, eCommunications, enumerator)) - { - } - com_heap_ptr render_console_id; - com_heap_ptr render_comms_id; - com_heap_ptr capture_console_id; - com_heap_ptr capture_comms_id; -}; - /* `ret` must be deallocated with `wasapi_destroy_device`, iff the return value * of this function is `CUBEB_OK`. */ int