Bug 1621428 - Update cubeb to 6e7e7659. r=chunmin

Differential Revision: https://phabricator.services.mozilla.com/D66303

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Gregan 2020-03-11 15:49:23 +00:00
parent 279ef74842
commit 210f8ccbc5
7 changed files with 49 additions and 87 deletions

View File

@ -3,4 +3,6 @@
See INSTALL.md for build instructions.
See [Backend Support](https://github.com/kinetiknz/cubeb/wiki/Backend-Support) in the wiki for the support level of each backend.
Licensed under an ISC-style license. See LICENSE for details.

View File

@ -1,64 +0,0 @@
diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -1916,24 +1916,24 @@ int setup_wasapi_stream_one_side(cubeb_s
LOG("Could not get default %s endpoint, error: %lx\n", DIRECTION_NAME, hr);
}
return CUBEB_ERROR;
}
}
/* Get a client. We will get all other interfaces we need from
* this pointer. */
- hr = device->Activate(__uuidof(IAudioClient3),
- CLSCTX_INPROC_SERVER,
- NULL, audio_client.receive_vpp());
- if (hr == E_NOINTERFACE) {
+ // hr = device->Activate(__uuidof(IAudioClient3),
+ // CLSCTX_INPROC_SERVER,
+ // NULL, audio_client.receive_vpp());
+ // if (hr == E_NOINTERFACE) {
hr = device->Activate(__uuidof(IAudioClient),
CLSCTX_INPROC_SERVER,
NULL, audio_client.receive_vpp());
- }
+ //}
if (FAILED(hr)) {
LOG("Could not activate the device to get an audio"
" client for %s: error: %lx\n", DIRECTION_NAME, hr);
// A particular device can't be activated because it has been
// unplugged, try fall back to the default audio device.
if (devid && hr == AUDCLNT_E_DEVICE_INVALIDATED) {
LOG("Trying again with the default %s audio device.", DIRECTION_NAME);
@@ -1989,26 +1989,26 @@ int setup_wasapi_stream_one_side(cubeb_s
// Check if a loopback device should be requested. Note that event callbacks
// do not work with loopback devices, so only request these if not looping.
if (is_loopback) {
flags |= AUDCLNT_STREAMFLAGS_LOOPBACK;
} else {
flags |= AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
}
- if (initialize_iaudioclient3(audio_client, stm, mix_format, flags, direction)) {
- LOG("Initialized with IAudioClient3");
- } else {
+ // if (initialize_iaudioclient3(audio_client, stm, mix_format, flags, direction)) {
+ // LOG("Initialized with IAudioClient3");
+ // } else {
hr = audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED,
flags,
frames_to_hns(stm, stm->latency),
0,
mix_format.get(),
NULL);
- }
+ // }
if (FAILED(hr)) {
LOG("Unable to initialize audio client for %s: %lx.", DIRECTION_NAME, hr);
return CUBEB_ERROR;
}
hr = audio_client->GetBufferSize(buffer_frame_count);
if (FAILED(hr)) {
LOG("Could not get the buffer size from the client"

View File

@ -19,5 +19,5 @@ origin:
license: "ISC"
# update.sh will update this value
release: "d4b23d1e9b2857b5c6020c58b183fdd8dbe36921 (2020-01-22 12:00:49 +0100)"
release: "6e7e7659d39bfb4e3b62c073b686f910178f1754 (2020-02-28 13:45:04 +1300)"

View File

@ -80,7 +80,7 @@ validate_stream_params(cubeb_stream_params * input_stream_params,
}
if (input_stream_params) {
if (input_stream_params->rate < 1000 || input_stream_params->rate > 192000 ||
input_stream_params->channels < 1 || input_stream_params->channels > 8) {
input_stream_params->channels < 1 || input_stream_params->channels > UINT8_MAX) {
return CUBEB_ERROR_INVALID_FORMAT;
}
}

View File

@ -2871,6 +2871,15 @@ audiounit_stream_destroy_internal(cubeb_stream *stm)
static void
audiounit_stream_destroy(cubeb_stream * stm)
{
int r = audiounit_uninstall_system_changed_callback(stm);
if (r != CUBEB_OK) {
LOG("(%p) Could not uninstall the device changed callback", stm);
}
r = audiounit_uninstall_device_changed_callback(stm);
if (r != CUBEB_OK) {
LOG("(%p) Could not uninstall all device change listeners", stm);
}
if (!stm->shutdown.load()){
auto_lock context_lock(stm->context->mutex);
audiounit_stream_stop_internal(stm);

View File

@ -346,13 +346,14 @@ public:
~monitor_device_notifications()
{
SetEvent(shutdown);
WaitForSingleObject(thread, INFINITE);
SetEvent(begin_shutdown);
WaitForSingleObject(shutdown_complete, INFINITE);
CloseHandle(thread);
CloseHandle(input_changed);
CloseHandle(output_changed);
CloseHandle(shutdown);
CloseHandle(begin_shutdown);
CloseHandle(shutdown_complete);
}
void notify(EDataFlow flow)
@ -377,8 +378,9 @@ private:
thread_proc(LPVOID args)
{
XASSERT(args);
static_cast<monitor_device_notifications*>(args)
->notification_thread_loop();
auto mdn = static_cast<monitor_device_notifications*>(args);
mdn->notification_thread_loop();
SetEvent(mdn->shutdown_complete);
return 0;
}
@ -397,7 +399,7 @@ private:
HANDLE wait_array[3] = {
input_changed,
output_changed,
shutdown,
begin_shutdown,
};
while (true) {
@ -435,9 +437,15 @@ private:
return;
}
shutdown = CreateEvent(nullptr, 0, 0, nullptr);
if (!shutdown) {
LOG("Failed to create shutdown event.");
begin_shutdown = CreateEvent(nullptr, 0, 0, nullptr);
if (!begin_shutdown) {
LOG("Failed to create begin_shutdown event.");
return;
}
shutdown_complete = CreateEvent(nullptr, 0, 0, nullptr);
if (!shutdown_complete) {
LOG("Failed to create shutdown_complete event.");
return;
}
@ -456,7 +464,8 @@ private:
HANDLE thread = INVALID_HANDLE_VALUE;
HANDLE output_changed = INVALID_HANDLE_VALUE;
HANDLE input_changed = INVALID_HANDLE_VALUE;
HANDLE shutdown = INVALID_HANDLE_VALUE;
HANDLE begin_shutdown = INVALID_HANDLE_VALUE;
HANDLE shutdown_complete = INVALID_HANDLE_VALUE;
cubeb * cubeb_context = nullptr;
};
@ -1921,14 +1930,18 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
/* Get a client. We will get all other interfaces we need from
* this pointer. */
// hr = device->Activate(__uuidof(IAudioClient3),
// CLSCTX_INPROC_SERVER,
// NULL, audio_client.receive_vpp());
// if (hr == E_NOINTERFACE) {
#if 0 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1590902
hr = device->Activate(__uuidof(IAudioClient3),
CLSCTX_INPROC_SERVER,
NULL, audio_client.receive_vpp());
if (hr == E_NOINTERFACE) {
#endif
hr = device->Activate(__uuidof(IAudioClient),
CLSCTX_INPROC_SERVER,
NULL, audio_client.receive_vpp());
//}
#if 0
}
#endif
if (FAILED(hr)) {
LOG("Could not activate the device to get an audio"
@ -1994,16 +2007,20 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
flags |= AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
}
// if (initialize_iaudioclient3(audio_client, stm, mix_format, flags, direction)) {
// LOG("Initialized with IAudioClient3");
// } else {
#if 0 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1590902
if (initialize_iaudioclient3(audio_client, stm, mix_format, flags, direction)) {
LOG("Initialized with IAudioClient3");
} else {
#endif
hr = audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED,
flags,
frames_to_hns(stm, stm->latency),
0,
mix_format.get(),
NULL);
// }
#if 0
}
#endif
if (FAILED(hr)) {
LOG("Unable to initialize audio client for %s: %lx.", DIRECTION_NAME, hr);
return CUBEB_ERROR;

View File

@ -84,5 +84,3 @@ else
echo "Remember to update moz.yaml with the version details."
fi
echo "Applying disable-iaudioclient3.patch on top of $rev"
patch -p3 < disable-iaudioclient3.patch