Backed out 7 changesets (bug 1670917) for multiple GTest perma failures. CLOSED TREE

Backed out changeset 635942af8244 (bug 1670917)
Backed out changeset b0825300e78d (bug 1670917)
Backed out changeset 881fac72e13c (bug 1670917)
Backed out changeset 0285b2ab6d50 (bug 1670917)
Backed out changeset b58d65b96f2d (bug 1670917)
Backed out changeset 6ad13b34f08d (bug 1670917)
Backed out changeset 426aa6482835 (bug 1670917)
This commit is contained in:
Razvan Maries 2020-10-20 22:55:47 +03:00
Родитель 785c75dc53
Коммит 6ad7ee6c29
75 изменённых файлов: 192 добавлений и 2146 удалений

Просмотреть файл

@ -55,7 +55,7 @@ rev = "bce6358eb1026c13d2f1c6d365af37afe8869a86"
[source."https://github.com/djg/cubeb-pulse-rs"]
git = "https://github.com/djg/cubeb-pulse-rs"
replace-with = "vendored-sources"
rev = "bf31534d08b2c16fb5e4c5834944ae3271efbd63"
rev = "3224e2dee65c0726c448484d4c3c43956b9330ec"
[source."https://github.com/bytecodealliance/wasmtime"]
git = "https://github.com/bytecodealliance/wasmtime"
@ -80,7 +80,7 @@ rev = "477d8fc53a64705a9d3fbcce9de92f4988558525"
[source."https://github.com/ChunMinChang/cubeb-coreaudio-rs"]
git = "https://github.com/ChunMinChang/cubeb-coreaudio-rs"
replace-with = "vendored-sources"
rev = "b4f45e18a413abe0dc583406714407ce5ab8da97"
rev = "08a2b75285732a2e1a389bc4ab02518c74a8a9c5"
[source.crates-io]
replace-with = "vendored-sources"

26
Cargo.lock сгенерированный
Просмотреть файл

@ -729,7 +729,7 @@ dependencies = [
[[package]]
name = "coreaudio-sys-utils"
version = "0.1.0"
source = "git+https://github.com/ChunMinChang/cubeb-coreaudio-rs?rev=b4f45e18a413abe0dc583406714407ce5ab8da97#b4f45e18a413abe0dc583406714407ce5ab8da97"
source = "git+https://github.com/ChunMinChang/cubeb-coreaudio-rs?rev=08a2b75285732a2e1a389bc4ab02518c74a8a9c5#08a2b75285732a2e1a389bc4ab02518c74a8a9c5"
dependencies = [
"core-foundation-sys",
"coreaudio-sys",
@ -949,27 +949,27 @@ dependencies = [
[[package]]
name = "cubeb"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "289952682b57343f3d852161d60f2a34a07c5fc39c113f155ab8aa3f471c917b"
checksum = "1116606d6045c9199f6a1e082f3cf63383ba6f9961339701faa6370dcf73135f"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-backend"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2052099fa6e07b444a43aa167874fb0350ed9be840f399e639f9e50cf37ec05c"
checksum = "cc644425cb33d45994a5df4351958369c00e3f7bbf785b8cab270c7840b75774"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-core"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6197f805b94171473c3fa3059f688f00a2df1ee76259f9ea641401b58917df3"
checksum = "f7c55529b8f47926e4242e1fc01d31b08a5a4847967c5c250644e33fe237cfe5"
dependencies = [
"bitflags",
"cubeb-sys",
@ -978,7 +978,7 @@ dependencies = [
[[package]]
name = "cubeb-coreaudio"
version = "0.1.0"
source = "git+https://github.com/ChunMinChang/cubeb-coreaudio-rs?rev=b4f45e18a413abe0dc583406714407ce5ab8da97#b4f45e18a413abe0dc583406714407ce5ab8da97"
source = "git+https://github.com/ChunMinChang/cubeb-coreaudio-rs?rev=08a2b75285732a2e1a389bc4ab02518c74a8a9c5#08a2b75285732a2e1a389bc4ab02518c74a8a9c5"
dependencies = [
"atomic",
"audio-mixer",
@ -996,7 +996,7 @@ dependencies = [
[[package]]
name = "cubeb-pulse"
version = "0.3.0"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=bf31534d08b2c16fb5e4c5834944ae3271efbd63#bf31534d08b2c16fb5e4c5834944ae3271efbd63"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=3224e2dee65c0726c448484d4c3c43956b9330ec#3224e2dee65c0726c448484d4c3c43956b9330ec"
dependencies = [
"cubeb-backend",
"pulse",
@ -1007,9 +1007,9 @@ dependencies = [
[[package]]
name = "cubeb-sys"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0f751f2aee031f589bcfd812b99cfbf923aa1612d34c9757608cf540f74ad9"
checksum = "dcbc562eb6ccf62abacf9e3eebce992e5c36b230ca313ebd7c2d7d0e99deae90"
dependencies = [
"cmake",
"pkg-config",
@ -3898,7 +3898,7 @@ dependencies = [
[[package]]
name = "pulse"
version = "0.3.0"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=bf31534d08b2c16fb5e4c5834944ae3271efbd63#bf31534d08b2c16fb5e4c5834944ae3271efbd63"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=3224e2dee65c0726c448484d4c3c43956b9330ec#3224e2dee65c0726c448484d4c3c43956b9330ec"
dependencies = [
"bitflags",
"pulse-ffi",
@ -3907,7 +3907,7 @@ dependencies = [
[[package]]
name = "pulse-ffi"
version = "0.1.0"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=bf31534d08b2c16fb5e4c5834944ae3271efbd63#bf31534d08b2c16fb5e4c5834944ae3271efbd63"
source = "git+https://github.com/djg/cubeb-pulse-rs?rev=3224e2dee65c0726c448484d4c3c43956b9330ec#3224e2dee65c0726c448484d4c3c43956b9330ec"
dependencies = [
"libc",
]

Просмотреть файл

@ -286,7 +286,7 @@ nsresult AudioStream::Init(uint32_t aNumChannels,
params.channels = mOutChannels;
params.layout = static_cast<uint32_t>(aChannelMap);
params.format = ToCubebFormat<AUDIO_OUTPUT_FORMAT>::value;
params.prefs = CubebUtils::GetDefaultStreamPrefs(CUBEB_DEVICE_TYPE_OUTPUT);
params.prefs = CubebUtils::GetDefaultStreamPrefs();
// This is noop if MOZ_DUMP_AUDIO is not set.
mDumpFile.Open("AudioStream", mOutChannels, aRate);

Просмотреть файл

@ -39,7 +39,6 @@
#include <cmath>
#include <thread>
#include "AudioThreadRegistry.h"
#include "mozilla/StaticPrefs_media.h"
#define AUDIOIPC_POOL_SIZE_DEFAULT 1
#define AUDIOIPC_STACK_SIZE_DEFAULT (64 * 4096)
@ -126,9 +125,8 @@ int sInCommunicationCount = 0;
const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties";
const char* AUDIOSTREAM_BACKEND_ID_STR[] = {
"jack", "pulse", "alsa", "audiounit", "audioqueue",
"wasapi", "winmm", "directsound", "sndio", "opensl",
"oss", "audiotrack", "kai"};
"jack", "pulse", "alsa", "audiounit", "audioqueue", "wasapi",
"winmm", "directsound", "sndio", "opensl", "audiotrack", "kai"};
/* Index for failures to create an audio stream the first time. */
const int CUBEB_BACKEND_INIT_FAILURE_FIRST =
ArrayLength(AUDIOSTREAM_BACKEND_ID_STR);
@ -696,20 +694,16 @@ char* GetForcedOutputDevice() {
return sCubebOutputDeviceName;
}
cubeb_stream_prefs GetDefaultStreamPrefs(cubeb_device_type aType) {
cubeb_stream_prefs prefs = CUBEB_STREAM_PREF_NONE;
cubeb_stream_prefs GetDefaultStreamPrefs() {
#ifdef XP_WIN
// Investigation for bug 1427011 - if we're in E10S mode, rely on the
// AudioNotification IPC to detect device changes.
if (sCubebDisableDeviceSwitching &&
(XRE_IsE10sParentProcess() || XRE_IsContentProcess())) {
prefs |= CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING;
}
if (StaticPrefs::media_cubeb_wasapi_raw() & static_cast<uint32_t>(aType)) {
prefs |= CUBEB_STREAM_PREF_RAW;
return CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING;
}
#endif
return prefs;
return CUBEB_STREAM_PREF_NONE;
}
bool RouteOutputAsVoice() { return sRouteOutputAsVoice; }
@ -740,7 +734,7 @@ bool EstimatedRoundTripLatencyDefaultDevices(double* aMean, double* aStdDev) {
output_params.rate = rate;
output_params.channels = 2;
output_params.layout = CUBEB_LAYOUT_UNDEFINED;
output_params.prefs = GetDefaultStreamPrefs(CUBEB_DEVICE_TYPE_OUTPUT);
output_params.prefs = GetDefaultStreamPrefs();
latencyFrames = GetCubebMTGLatencyInFrames(&output_params);
@ -749,7 +743,7 @@ bool EstimatedRoundTripLatencyDefaultDevices(double* aMean, double* aStdDev) {
input_params.rate = rate;
input_params.channels = 1;
input_params.layout = CUBEB_LAYOUT_UNDEFINED;
input_params.prefs = GetDefaultStreamPrefs(CUBEB_DEVICE_TYPE_INPUT);
input_params.prefs = GetDefaultStreamPrefs();
cubeb_stream* stm;
rv = cubeb_stream_init(GetCubebContext(), &stm,

Просмотреть файл

@ -54,7 +54,7 @@ uint32_t GetCubebPlaybackLatencyInMilliseconds();
uint32_t GetCubebMTGLatencyInFrames(cubeb_stream_params* params);
bool CubebLatencyPrefSet();
void GetCurrentBackend(nsAString& aBackend);
cubeb_stream_prefs GetDefaultStreamPrefs(cubeb_device_type aType);
cubeb_stream_prefs GetDefaultStreamPrefs();
char* GetForcedOutputDevice();
// No-op on all platforms but Android, where it tells the device's AudioManager
// to switch to "communication mode", which might change audio routing,

Просмотреть файл

@ -636,7 +636,7 @@ void AudioCallbackDriver::Init() {
AudioConfig::ChannelLayout(mOutputChannelCount).Map();
output.layout = static_cast<uint32_t>(channelMap);
output.prefs = CubebUtils::GetDefaultStreamPrefs(CUBEB_DEVICE_TYPE_OUTPUT);
output.prefs = CubebUtils::GetDefaultStreamPrefs();
if (mInputDevicePreference == CUBEB_DEVICE_PREF_VOICE &&
CubebUtils::RouteOutputAsVoice()) {
output.prefs |= static_cast<cubeb_stream_prefs>(CUBEB_STREAM_PREF_VOICE);
@ -666,7 +666,7 @@ void AudioCallbackDriver::Init() {
input = output;
input.channels = mInputChannelCount;
input.layout = CUBEB_LAYOUT_UNDEFINED;
input.prefs = CubebUtils::GetDefaultStreamPrefs(CUBEB_DEVICE_TYPE_INPUT);
input.prefs = CubebUtils::GetDefaultStreamPrefs();
if (mInputDevicePreference == CUBEB_DEVICE_PREF_VOICE) {
input.prefs |= static_cast<cubeb_stream_prefs>(CUBEB_STREAM_PREF_VOICE);
}

Просмотреть файл

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The audioipc-2 git repository is: https://github.com/djg/audioipc-2.git
The git commit ID used was c474b0b78f49b86531bf09f4c0e4af2e16cf15a9 (2020-10-08 15:13:49 +1300)
The git commit ID used was 56be0bfc252096818ea8e1bd8cff1de315a623df (2020-07-16 21:58:48 +1200)

Просмотреть файл

@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
bincode = "1"
bytes = "0.4"
cubeb = "0.8"
cubeb = "0.7"
futures = "0.1.29"
log = "0.4"
memmap = "0.7"

Просмотреть файл

@ -208,7 +208,6 @@ pub enum ServerMessage {
StreamGetLatency(usize),
StreamGetInputLatency(usize),
StreamSetVolume(usize, f32),
StreamSetName(usize, CString),
StreamGetCurrentDevice(usize),
StreamRegisterDeviceChangeCallback(usize, bool),
@ -241,7 +240,6 @@ pub enum ClientMessage {
StreamLatency(u32),
StreamInputLatency(u32),
StreamVolumeSet,
StreamNameSet,
StreamCurrentDevice(Device),
StreamRegisterDeviceChangeCallback,

Просмотреть файл

@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
audio_thread_priority = "0.23.4"
audioipc = { path="../audioipc" }
cubeb-backend = "0.8"
cubeb-backend = "0.7"
futures = { version="0.1.18", default-features=false, features=["use_std"] }
futures-cpupool = { version="0.1.8", default-features=false }
log = "0.4"

Просмотреть файл

@ -13,7 +13,7 @@ use audioipc::shm::{SharedMemMutSlice, SharedMemSlice};
use cubeb_backend::{ffi, DeviceRef, Error, Result, Stream, StreamOps};
use futures::Future;
use futures_cpupool::{CpuFuture, CpuPool};
use std::ffi::{CStr, CString};
use std::ffi::CString;
use std::os::raw::c_void;
use std::ptr;
use std::sync::mpsc;
@ -298,12 +298,6 @@ impl<'ctx> StreamOps for ClientStream<'ctx> {
send_recv!(rpc, StreamSetVolume(self.token, volume) => StreamVolumeSet)
}
fn set_name(&mut self, name: &CStr) -> Result<()> {
assert_not_in_callback();
let rpc = self.context.rpc();
send_recv!(rpc, StreamSetName(self.token, name.to_owned()) => StreamNameSet)
}
fn current_device(&mut self) -> Result<&DeviceRef> {
assert_not_in_callback();
let rpc = self.context.rpc();

Просмотреть файл

@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
audio_thread_priority = "0.23.4"
audioipc = { path = "../audioipc" }
cubeb-core = "0.8.0"
cubeb-core = "0.7.0"
futures = "0.1.29"
once_cell = "1.2.0"
log = "0.4"

Просмотреть файл

@ -556,12 +556,6 @@ impl CubebServer {
.map(|_| ClientMessage::StreamVolumeSet)
.unwrap_or_else(error),
ServerMessage::StreamSetName(stm_tok, ref name) => try_stream!(self, stm_tok)
.stream
.set_name(name)
.map(|_| ClientMessage::StreamNameSet)
.unwrap_or_else(error),
ServerMessage::StreamGetCurrentDevice(stm_tok) => try_stream!(self, stm_tok)
.stream
.current_device()

Просмотреть файл

@ -227,9 +227,6 @@ TEST(cubeb, configure_stream)
r = cubeb_stream_set_volume(stream, 1.0f);
ASSERT_TRUE(r == 0 || r == CUBEB_ERROR_NOT_SUPPORTED);
r = cubeb_stream_set_name(stream, "test 2");
ASSERT_TRUE(r == 0 || r == CUBEB_ERROR_NOT_SUPPORTED);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
}

Просмотреть файл

@ -230,18 +230,12 @@ typedef enum {
CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING = 0x02, /**< Disable switching
default device on OS
changes. */
CUBEB_STREAM_PREF_VOICE = 0x04, /**< This stream is going to transport voice data.
CUBEB_STREAM_PREF_VOICE = 0x04 /**< This stream is going to transport voice data.
Depending on the backend and platform, this can
change the audio input or output devices
selected, as well as the quality of the stream,
for example to accomodate bluetooth SCO modes on
bluetooth devices. */
CUBEB_STREAM_PREF_RAW = 0x08, /**< Windows only. Bypass all signal processing
except for always on APO, driver and hardware. */
CUBEB_STREAM_PREF_PERSIST = 0x10, /**< Request that the volume and mute settings
should persist across restarts of the stream
and/or application. May not be honored for
all backends and platforms. */
} cubeb_stream_prefs;
/** Stream format initialization parameters. */
@ -590,14 +584,6 @@ CUBEB_EXPORT int cubeb_stream_get_input_latency(cubeb_stream * stream, uint32_t
@retval CUBEB_ERROR_NOT_SUPPORTED */
CUBEB_EXPORT int cubeb_stream_set_volume(cubeb_stream * stream, float volume);
/** Change a stream's name.
@param stream the stream for which to set the name.
@param stream_name the new name for the stream
@retval CUBEB_OK
@retval CUBEB_ERROR_INVALID_PARAMETER if any pointer is invalid
@retval CUBEB_ERROR_NOT_SUPPORTED */
CUBEB_EXPORT int cubeb_stream_set_name(cubeb_stream * stream, char const * stream_name);
/** Get the current output device for this stream.
@param stm the stream for which to query the current output device
@param device a pointer in which the current output device will be stored.

Просмотреть файл

@ -19,5 +19,5 @@ origin:
license: "ISC"
# update.sh will update this value
release: "a7e83aa2b1571b842a555158e8f25aeb1419ebd1 (2020-10-13 12:05:17 +0100)"
release: "1358724f731b9813410f1ef4015ea8c26a201ab2 (2020-09-22 11:09:51 +0200)"

Просмотреть файл

@ -65,7 +65,6 @@ struct cubeb_ops {
int (* stream_get_latency)(cubeb_stream * stream, uint32_t * latency);
int (* stream_get_input_latency)(cubeb_stream * stream, uint32_t * latency);
int (* stream_set_volume)(cubeb_stream * stream, float volumes);
int (* stream_set_name)(cubeb_stream * stream, char const * stream_name);
int (* stream_get_current_device)(cubeb_stream * stream,
cubeb_device ** const device);
int (* stream_device_destroy)(cubeb_stream * stream,

Просмотреть файл

@ -60,9 +60,6 @@ int sun_init(cubeb ** context, char const * context_name);
#if defined(USE_OPENSL)
int opensl_init(cubeb ** context, char const * context_name);
#endif
#if defined(USE_OSS)
int oss_init(cubeb ** context, char const * context_name);
#endif
#if defined(USE_AUDIOTRACK)
int audiotrack_init(cubeb ** context, char const * context_name);
#endif
@ -168,10 +165,6 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
} else if (!strcmp(backend_name, "opensl")) {
#if defined(USE_OPENSL)
init_oneshot = opensl_init;
#endif
} else if (!strcmp(backend_name, "oss")) {
#if defined(USE_OSS)
init_oneshot = oss_init;
#endif
} else if (!strcmp(backend_name, "audiotrack")) {
#if defined(USE_AUDIOTRACK)
@ -207,9 +200,6 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
#if defined(USE_ALSA)
alsa_init,
#endif
#if defined (USE_OSS)
oss_init,
#endif
#if defined(USE_AUDIOUNIT_RUST)
audiounit_rust_init,
#endif
@ -458,20 +448,6 @@ cubeb_stream_set_volume(cubeb_stream * stream, float volume)
return stream->context->ops->stream_set_volume(stream, volume);
}
int
cubeb_stream_set_name(cubeb_stream * stream, char const * stream_name)
{
if (!stream || !stream_name) {
return CUBEB_ERROR_INVALID_PARAMETER;
}
if (!stream->context->ops->stream_set_name) {
return CUBEB_ERROR_NOT_SUPPORTED;
}
return stream->context->ops->stream_set_name(stream, stream_name);
}
int cubeb_stream_get_current_device(cubeb_stream * stream,
cubeb_device ** const device)
{
@ -700,3 +676,4 @@ int cubeb_set_log_callback(cubeb_log_level log_level,
return CUBEB_OK;
}

Просмотреть файл

@ -1446,7 +1446,6 @@ static struct cubeb_ops const alsa_ops = {
.stream_get_latency = alsa_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = alsa_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -1513,6 +1513,7 @@ audiounit_set_channel_layout(AudioUnit unit,
return CUBEB_OK;
}
OSStatus r;
uint32_t nb_channels = cubeb_channel_layout_nb_channels(layout);
@ -2069,6 +2070,7 @@ audiounit_create_unit(AudioUnit * unit, device_info * device)
return CUBEB_OK;
}
if (device->flags & DEV_INPUT) {
r = audiounit_enable_unit_scope(unit, io_side::INPUT, ENABLE);
if (r != CUBEB_OK) {
@ -2215,6 +2217,7 @@ buffer_size_changed_callback(void * inClientData,
}
switch (inPropertyID) {
case kAudioDevicePropertyBufferFrameSize: {
if (inScope != au_scope) {
break;
@ -2728,6 +2731,7 @@ audiounit_setup_stream(cubeb_stream * stm)
LOG("(%p) Could not install all device change callback.", stm);
}
return CUBEB_OK;
}
@ -3208,6 +3212,7 @@ audiounit_get_available_samplerate(AudioObjectID devid, AudioObjectPropertyScope
} else {
*min = *max = 0;
}
}
static UInt32
@ -3618,7 +3623,6 @@ cubeb_ops const audiounit_ops = {
/*.stream_get_latency =*/ audiounit_stream_get_latency,
/*.stream_get_input_latency =*/ NULL,
/*.stream_set_volume =*/ audiounit_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ audiounit_stream_get_current_device,
/*.stream_device_destroy =*/ audiounit_stream_device_destroy,
/*.stream_register_device_changed_callback =*/ audiounit_stream_register_device_changed_callback,

Просмотреть файл

@ -134,7 +134,6 @@ static struct cubeb_ops const cbjack_ops = {
.stream_get_latency = cbjack_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = cbjack_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = cbjack_stream_get_current_device,
.stream_device_destroy = cbjack_stream_device_destroy,
.stream_register_device_changed_callback = NULL,
@ -239,22 +238,6 @@ load_jack_lib(cubeb * context)
return CUBEB_OK;
}
static void
cbjack_connect_port_out (cubeb_stream * stream, const size_t out_port, const char * const phys_in_port)
{
const char *src_port = api_jack_port_name (stream->output_ports[out_port]);
api_jack_connect (stream->context->jack_client, src_port, phys_in_port);
}
static void
cbjack_connect_port_in (cubeb_stream * stream, const char * const phys_out_port, size_t in_port)
{
const char *src_port = api_jack_port_name (stream->input_ports[in_port]);
api_jack_connect (stream->context->jack_client, phys_out_port, src_port);
}
static int
cbjack_connect_ports (cubeb_stream * stream)
{
@ -274,14 +257,10 @@ cbjack_connect_ports (cubeb_stream * stream)
// Connect outputs to playback
for (unsigned int c = 0; c < stream->out_params.channels && phys_in_ports[c] != NULL; c++) {
cbjack_connect_port_out(stream, c, phys_in_ports[c]);
}
const char *src_port = api_jack_port_name (stream->output_ports[c]);
// Special case playing mono source in stereo
if (stream->out_params.channels == 1 && phys_in_ports[1] != NULL) {
cbjack_connect_port_out(stream, 0, phys_in_ports[1]);
api_jack_connect (stream->context->jack_client, src_port, phys_in_ports[c]);
}
r = CUBEB_OK;
skipplayback:
@ -290,7 +269,9 @@ skipplayback:
}
// Connect inputs to capture
for (unsigned int c = 0; c < stream->in_params.channels && phys_out_ports[c] != NULL; c++) {
cbjack_connect_port_in(stream, phys_out_ports[c], c);
const char *src_port = api_jack_port_name (stream->input_ports[c]);
api_jack_connect (stream->context->jack_client, phys_out_ports[c], src_port);
}
r = CUBEB_OK;
end:
@ -400,6 +381,7 @@ cbjack_process(jack_nframes_t nframes, void * arg)
}
}
} else {
// try to lock stream mutex
if (pthread_mutex_trylock(&stm->mutex) == 0) {

Просмотреть файл

@ -943,6 +943,7 @@ opensl_configure_capture(cubeb_stream * stm, cubeb_stream_params * params)
}
}
if (get_android_version() > ANDROID_VERSION_JELLY_BEAN) {
SLAndroidConfigurationItf recorderConfig;
res = (*stm->recorderObj)
@ -1755,7 +1756,6 @@ static struct cubeb_ops const opensl_ops = {
.stream_get_latency = opensl_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = opensl_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -220,6 +220,7 @@ sndio_mainloop(void *arg)
/* was this last call-back invocation (aka end-of-stream) ? */
if (nfr < s->nfr) {
if (!(s->mode & SIO_PLAY) || nfr == 0) {
state = CUBEB_STATE_DRAINED;
break;
@ -661,7 +662,6 @@ static struct cubeb_ops const sndio_ops = {
.stream_get_position = sndio_stream_get_position,
.stream_get_latency = sndio_stream_get_latency,
.stream_set_volume = sndio_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -723,7 +723,6 @@ static struct cubeb_ops const sun_ops = {
.stream_get_latency = sun_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = sun_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = sun_get_current_device,
.stream_device_destroy = sun_stream_device_destroy,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -4,7 +4,7 @@
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
#define _WIN32_WINNT 0x0603
#define _WIN32_WINNT 0x0600
#define NOMINMAX
#include <initguid.h>
@ -1812,28 +1812,6 @@ handle_channel_layout(cubeb_stream * stm, EDataFlow direction, com_heap_ptr<WAV
}
}
static bool
initialize_iaudioclient2(com_ptr<IAudioClient> & audio_client)
{
com_ptr<IAudioClient2> audio_client2;
audio_client->QueryInterface<IAudioClient2>(audio_client2.receive());
if (!audio_client2) {
LOG("Could not get IAudioClient2 interface, not setting AUDCLNT_STREAMOPTIONS_RAW.");
return CUBEB_OK;
}
AudioClientProperties properties = { 0 };
properties.cbSize = sizeof(AudioClientProperties);
#ifndef __MINGW32__
properties.Options |= AUDCLNT_STREAMOPTIONS_RAW;
#endif
HRESULT hr = audio_client2->SetClientProperties(&properties);
if (FAILED(hr)) {
LOG("IAudioClient2::SetClientProperties error: %lx", GetLastError());
return CUBEB_ERROR;
}
return CUBEB_OK;
}
static bool
initialize_iaudioclient3(com_ptr<IAudioClient> & audio_client,
cubeb_stream * stm,
@ -1857,7 +1835,7 @@ initialize_iaudioclient3(com_ptr<IAudioClient> & audio_client,
// IAudioClient3 doesn't support AUDCLNT_STREAMFLAGS_NOPERSIST, and will return
// AUDCLNT_E_INVALID_STREAM_FLAG. This is undocumented.
flags = flags & ~AUDCLNT_STREAMFLAGS_NOPERSIST;
flags = flags ^ AUDCLNT_STREAMFLAGS_NOPERSIST;
// Some people have reported glitches with capture streams:
// http://blog.nirbheek.in/2018/03/low-latency-audio-on-windows-with.html
@ -2054,13 +2032,7 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
mix_params->format, mix_params->rate, mix_params->channels,
mix_params->layout);
DWORD flags = 0;
bool is_persist = stream_params->prefs & CUBEB_STREAM_PREF_PERSIST;
if (!is_persist) {
flags |= AUDCLNT_STREAMFLAGS_NOPERSIST;
}
DWORD flags = AUDCLNT_STREAMFLAGS_NOPERSIST;
// 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.
@ -2110,13 +2082,6 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
LOG("Could not get cubeb_device_info.");
}
if (stream_params->prefs & CUBEB_STREAM_PREF_RAW) {
if (initialize_iaudioclient2(audio_client) != CUBEB_OK) {
LOG("Can't initialize an IAudioClient2, error: %lx", GetLastError());
// This is not fatal.
}
}
#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");
@ -3246,7 +3211,6 @@ cubeb_ops const wasapi_ops = {
/*.stream_get_latency =*/ wasapi_stream_get_latency,
/*.stream_get_input_latency =*/ wasapi_stream_get_input_latency,
/*.stream_set_volume =*/ wasapi_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ NULL,
/*.stream_device_destroy =*/ NULL,
/*.stream_register_device_changed_callback =*/ NULL,

Просмотреть файл

@ -1061,7 +1061,6 @@ static struct cubeb_ops const winmm_ops = {
/*.stream_get_latency = */ winmm_stream_get_latency,
/*.stream_get_input_latency = */ NULL,
/*.stream_set_volume =*/ winmm_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ NULL,
/*.stream_device_destroy =*/ NULL,
/*.stream_register_device_changed_callback=*/ NULL,

Просмотреть файл

@ -40,12 +40,6 @@ if CONFIG['MOZ_JACK']:
]
DEFINES['USE_JACK'] = True
if CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD', 'SunOS'):
SOURCES += [
'cubeb_oss.c',
]
DEFINES['USE_OSS'] = True
if CONFIG['OS_ARCH'] == 'OpenBSD':
SOURCES += [
'cubeb_sndio.c',

Просмотреть файл

@ -27,7 +27,6 @@ cp $1/src/cubeb-jni.cpp src
cp $1/src/cubeb-jni.h src
cp $1/src/android/cubeb-output-latency.h src/android
cp $1/src/android/cubeb_media_library.h src/android
cp $1/src/cubeb_oss.c src
cp $1/src/cubeb_osx_run_loop.h src
cp $1/src/cubeb_resampler.cpp src
cp $1/src/cubeb_resampler.h src

Просмотреть файл

@ -6829,19 +6829,6 @@
value: false
#endif
# Whether or not to pass AUDCLNT_STREAMOPTIONS_RAW when initializing audio
# streams when using WASAPI.
# 0 - don't use RAW streams
# 1 - use RAW streams for input streams only
# 2 - use RAW streams for output streams only
# 3 - use RAW streams for input and output streams
#if defined (XP_WIN)
- name: media.cubeb.wasapi-raw
type: RelaxedAtomicUint32
mirror: always
value: 1
#endif // XP_WIN
# ClockDrift desired buffering in milliseconds
- name: media.clockdrift.buffering
type: int32_t

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"47ed9c84aeefa661dfc3f37490159ffad25c46a0f5e9368abb79669ea199d455","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"a24fb59538c2adc258f4fa7a843d2bb72dcb21fcb0e2e4c6f2c5094fbf2c6dd6","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"cf8e3a778f6b72d4cd80c1c56963355aa2224f19fd4fdf07d03f6fb366000899","src/ops.rs":"5ab7ed9c11e9713ea0954fc235983b98b806a9e756ddeb693bb65a67a15118ed","src/traits.rs":"0de6e31e4765d2a8db2451b1dfe7ff7c0ec60b4ccc9b042bf0aede449ea63e74","tests/test_capi.rs":"da296f48eee39564ace7c48a4ee3145b9d130eb206b91c793276451813abd759"},"package":"2052099fa6e07b444a43aa167874fb0350ed9be840f399e639f9e50cf37ec05c"}
{"files":{"Cargo.toml":"1e79db9b3f52dc7d3b4d8354cd92022d6d9540aa2b8eee1be6f653cf0f9b6f79","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/capi.rs":"a772331992b8e058a11e0a96515092ca19182c8eb4c0766e459ccceeb434b2ad","src/lib.rs":"94b80747ae1037423a2281f2572fc6d15cd7702417974ae3730adccd71c7a300","src/log.rs":"cf8e3a778f6b72d4cd80c1c56963355aa2224f19fd4fdf07d03f6fb366000899","src/ops.rs":"12c808c465a8e40bfd19ef8449035924d795fe19bab25b2f13779dca68040010","src/traits.rs":"e8c268343f21799b806e85b0ab1c0f4350b109d83af3e565ac6ff1eb17413672","tests/test_capi.rs":"eea51e60d631d0dab2c8e7f5172467b4fbafa652487f8840e9c5c89da42bf598"},"package":"cc644425cb33d45994a5df4351958369c00e3f7bbf785b8cab270c7840b75774"}

4
third_party/rust/cubeb-backend/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package]
name = "cubeb-backend"
version = "0.8.0"
version = "0.7.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = "Bindings to libcubeb internals to facilitate implementing cubeb backends in rust.\n"
homepage = "https://github.com/djg/cubeb-rs"
@ -21,7 +21,7 @@ categories = ["api-bindings"]
license = "ISC"
repository = "https://github.com/djg/cubeb-rs"
[dependencies.cubeb-core]
version = "0.8.0"
version = "0.7.0"
[features]
gecko-in-tree = ["cubeb-core/gecko-in-tree"]

15
third_party/rust/cubeb-backend/src/capi.rs поставляемый
Просмотреть файл

@ -51,7 +51,6 @@ macro_rules! capi_new(
stream_get_latency: Some($crate::capi::capi_stream_get_latency::<$stm>),
stream_get_input_latency: Some($crate::capi::capi_stream_get_input_latency::<$stm>),
stream_set_volume: Some($crate::capi::capi_stream_set_volume::<$stm>),
stream_set_name: Some($crate::capi::capi_stream_set_name::<$stm>),
stream_get_current_device: Some($crate::capi::capi_stream_get_current_device::<$stm>),
stream_device_destroy: Some($crate::capi::capi_stream_device_destroy::<$stm>),
stream_register_device_changed_callback:
@ -238,20 +237,6 @@ pub unsafe extern "C" fn capi_stream_set_volume<STM: StreamOps>(
ffi::CUBEB_OK
}
pub unsafe extern "C" fn capi_stream_set_name<STM: StreamOps>(
s: *mut ffi::cubeb_stream,
name: *const c_char,
) -> c_int {
let stm = &mut *(s as *mut STM);
let anchor = &();
if let Some(name) = opt_cstr(anchor, name) {
_try!(stm.set_name(name));
ffi::CUBEB_OK
} else {
ffi::CUBEB_ERROR_INVALID_PARAMETER
}
}
pub unsafe extern "C" fn capi_stream_get_current_device<STM: StreamOps>(
s: *mut ffi::cubeb_stream,
device: *mut *mut ffi::cubeb_device,

2
third_party/rust/cubeb-backend/src/ops.rs поставляемый
Просмотреть файл

@ -67,8 +67,6 @@ pub struct Ops {
Option<unsafe extern "C" fn(stream: *mut ffi::cubeb_stream, latency: *mut u32) -> c_int>,
pub stream_set_volume:
Option<unsafe extern "C" fn(stream: *mut ffi::cubeb_stream, volumes: c_float) -> c_int>,
pub stream_set_name:
Option<unsafe extern "C" fn(stream: *mut ffi::cubeb_stream, name: *const c_char) -> c_int>,
pub stream_get_current_device: Option<
unsafe extern "C" fn(stream: *mut ffi::cubeb_stream, device: *mut *mut ffi::cubeb_device)
-> c_int,

Просмотреть файл

@ -50,7 +50,6 @@ pub trait StreamOps {
fn latency(&mut self) -> Result<u32>;
fn input_latency(&mut self) -> Result<u32>;
fn set_volume(&mut self, volume: f32) -> Result<()>;
fn set_name(&mut self, name: &CStr) -> Result<()>;
fn current_device(&mut self) -> Result<&DeviceRef>;
fn device_destroy(&mut self, device: &DeviceRef) -> Result<()>;
fn register_device_changed_callback(

Просмотреть файл

@ -107,10 +107,6 @@ impl StreamOps for TestStream {
assert_eq!(volume, 0.5);
Ok(())
}
fn set_name(&mut self, name: &CStr) -> Result<()> {
assert_eq!(name, CStr::from_bytes_with_nul(b"test\0").unwrap());
Ok(())
}
fn current_device(&mut self) -> Result<&DeviceRef> {
Ok(unsafe { DeviceRef::from_ptr(0xDEAD_BEEF as *mut _) })
}
@ -225,14 +221,6 @@ fn test_ops_stream_set_volume() {
}
}
#[test]
fn test_ops_stream_set_name() {
let s: *mut ffi::cubeb_stream = ptr::null_mut();
unsafe {
OPS.stream_set_name.unwrap()(s, CStr::from_bytes_with_nul(b"test\0").unwrap().as_ptr());
}
}
#[test]
fn test_ops_stream_current_device() {
let s: *mut ffi::cubeb_stream = ptr::null_mut();

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"f847e823e011300f8d020e13dd07c1ea6eecb33258495f55e74564362b876f1f","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"ca97e3a3d1f3fc451c17851c8538964ec67f3964dfe29e902d904ee7445becca","src/channel.rs":"971488fca24a11d49046f8fe9c396765560c070013e5d022afcbe27cfd51d941","src/context.rs":"09625b75070ec88d566a907ab2e574e2d85df4c6df295f798b3372df2cdc8f7a","src/device.rs":"c526d8f992c8ad6d137b0bda803c5182247c9c32797a6f86e0d86d4f6361eb4c","src/device_collection.rs":"f6d0c1628cc34b524f86b84a1e1c79971c3f64ebc4ac64eeb10a1330bbe8c238","src/error.rs":"60454b30bd496dffa94ed9c1bee5a39f29219f2411b76cff6a4f3074f3154701","src/ffi_types.rs":"d815d7a80895b5e86907e708dc0219fca4ac4668cde114afee434e7d702a145d","src/format.rs":"5513c537a72af1c222ee7c30b26d4de9d368a69772688b95d88b1a99f6892d5c","src/lib.rs":"6010a5e20b836b8e5c9fba382fde819e6f3c18c0ec2016e6e7e118eabedbcd51","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"06aae5ff1228f86c28c2ba1a306d9f72f886875a036ae917caf0381cdbb7d771","src/try_call.rs":"99c59a13db90326613d8cf91909e8a7eaef80646984d10927cbc7cde2cb4b066","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"c6197f805b94171473c3fa3059f688f00a2df1ee76259f9ea641401b58917df3"}
{"files":{"Cargo.toml":"acc28d182a00d78ed6e11c8773d40939016d3df2cd9f3593fae8983eb05db540","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","src/builders.rs":"ca97e3a3d1f3fc451c17851c8538964ec67f3964dfe29e902d904ee7445becca","src/channel.rs":"971488fca24a11d49046f8fe9c396765560c070013e5d022afcbe27cfd51d941","src/context.rs":"09625b75070ec88d566a907ab2e574e2d85df4c6df295f798b3372df2cdc8f7a","src/device.rs":"c526d8f992c8ad6d137b0bda803c5182247c9c32797a6f86e0d86d4f6361eb4c","src/device_collection.rs":"f6d0c1628cc34b524f86b84a1e1c79971c3f64ebc4ac64eeb10a1330bbe8c238","src/error.rs":"60454b30bd496dffa94ed9c1bee5a39f29219f2411b76cff6a4f3074f3154701","src/ffi_types.rs":"d815d7a80895b5e86907e708dc0219fca4ac4668cde114afee434e7d702a145d","src/format.rs":"5513c537a72af1c222ee7c30b26d4de9d368a69772688b95d88b1a99f6892d5c","src/lib.rs":"6010a5e20b836b8e5c9fba382fde819e6f3c18c0ec2016e6e7e118eabedbcd51","src/log.rs":"c46bae3472043fd076df3229c3421d948a87fae8495c1524b41ab2d8608f612a","src/stream.rs":"c237f288e6c78597d5a8f53c30927b1aaa40d482f2edb4343991b4d9d0bb1230","src/try_call.rs":"99c59a13db90326613d8cf91909e8a7eaef80646984d10927cbc7cde2cb4b066","src/util.rs":"308cfbaacd615ff600e74415c52daeef007fff34a4a0648a73c0042f6067f84f"},"package":"f7c55529b8f47926e4242e1fc01d31b08a5a4847967c5c250644e33fe237cfe5"}

4
third_party/rust/cubeb-core/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package]
name = "cubeb-core"
version = "0.8.0"
version = "0.7.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = "Common types and definitions for cubeb rust and C bindings. Not intended for direct use.\n"
homepage = "https://github.com/djg/cubeb-rs"
@ -24,7 +24,7 @@ repository = "https://github.com/djg/cubeb-rs"
version = "1.2.0"
[dependencies.cubeb-sys]
version = "0.8.0"
version = "0.7.0"
[features]
gecko-in-tree = ["cubeb-sys/gecko-in-tree"]

6
third_party/rust/cubeb-core/src/stream.rs поставляемый
Просмотреть файл

@ -7,7 +7,6 @@ use {ChannelLayout, DeviceRef, Result, SampleFormat};
use ffi;
use std::os::raw::c_void;
use std::ptr;
use std::ffi::CStr;
/// Stream states signaled via `state_callback`.
#[derive(PartialEq, Eq, Clone, Debug, Copy)]
@ -160,11 +159,6 @@ impl StreamRef {
unsafe { call!(ffi::cubeb_stream_set_volume(self.as_ptr(), volume)) }
}
/// Change a stream's name
pub fn set_name(&self, name: &CStr) -> Result<()> {
unsafe { call!(ffi::cubeb_stream_set_name(self.as_ptr(), name.as_ptr())) }
}
/// Get the current output device for this stream.
pub fn current_device(&self) -> Result<&DeviceRef> {
let mut device: *mut ffi::cubeb_device = ptr::null_mut();

Просмотреть файл

@ -1 +1 @@
{"files":{".editorconfig":"4e53b182bcc78b83d7e1b5c03efa14d22d4955c4ed2514d1ba4e99c1eb1a50ba",".githooks/pre-push":"8b8b26544cd56f54c0c33812551f786bb25cb08c86dbfeb6bf3daad881c826a1",".travis.yml":"dc07bac53f70f16c9bdf52264bdc58500ae6018c1b4c567bc7642f6b4ca3cc35","Cargo.toml":"9f97e1566873abf7f452f954665cf238078db5ab2f4a4254e10a6964574f3378","LICENSE":"6e6f56aff5bbf3cbc60747e152fb1a719bd0716aaf6d711c554f57d92e96297c","README.md":"d420509677fc444eb2ad8542e1e0e54cec800eb0fbbe50ba0ae2f89ac687c2a5","install_git_hook.sh":"d38c8e51e636f6b90b489621ac34ccd1d1b1f40dccce3d178ed1da1c5068f16d","install_rustfmt_clippy.sh":"4ae90d8dcb9757cb3ae4ae142ef80e5377c0dde61c63f4a3c32418646e80ca7b","run_device_tests.sh":"4b7d65eb638c1a278ffc8ecb6d30d47b3b8405392e976cae38c6f744e2bed532","run_sanitizers.sh":"2f0934ba01cbcd74485f19d50147f6b604cf9730bbd3a3d3f3d958e40d0f799f","run_tests.sh":"3dd76659f6dceeb0490dd92b355e113301ba0d0a8f034993a56f40e09edd25b2","src/backend/aggregate_device.rs":"ab8d0ac7339532495f189abb8162031099b2218d081f2e6d7c53e6393ca6e364","src/backend/auto_release.rs":"050fdcee74cf46b9a8a85a877e166d72a853d33220f59cf734cbb6ea09daa441","src/backend/buffer_manager.rs":"9c10a261792e32e75833b5f976b18547c338ca6beb2330eeab1ad203cc8c32bf","src/backend/device_property.rs":"d43642ea6e5f40e29c2a59ec7d81b42c154134685e417585045785359aa31686","src/backend/mixer.rs":"14e2156a8c1aeabcd4adb3336c3c9401b9c8526ec82a8c78942af7a79648f0f8","src/backend/mod.rs":"10163265ca84d7bab31a55bbdc6704e7314d9f6545ba7c32012b6cee74115086","src/backend/resampler.rs":"fd1281d28a4db1659d2f75e43b8457651745e1b6eb5a53a77f04d752135f6dc7","src/backend/tests/aggregate_device.rs":"107f5c637844cd5ae43d2b42cec4ef3369bb702751586078c0a9d50f039161cd","src/backend/tests/api.rs":"9ce44a867519d7b7a2b43c7f833327c35be38af7ba6fcc3d277ed1d7d8e7c8c2","src/backend/tests/backlog.rs":"3b189a7e036543c467cc242af0ed3332721179ee2b1c8847a6db563546f1ac52","src/backend/tests/device_change.rs":"8261f561f69dabd374ac47d69aa484812b65070a9e9581dfb2605e8404eaad6d","src/backend/tests/device_property.rs":"373f76d3bee83b263db3f02be3b94b408bdf852d84e4b5153273fda34b11a374","src/backend/tests/interfaces.rs":"14943e84a79976a7ef52882edeb9330350705d5190db6647f98b4ffa851a8396","src/backend/tests/manual.rs":"87210af9527feece99ad2b7b85651fbc8f02ec306ba8082da0c0705070e882af","src/backend/tests/mod.rs":"8dba770023d7f9c4228f0e11915347f0e07da5fd818e3ee4478c4b197af9aa2a","src/backend/tests/parallel.rs":"f9e1883660d6146b6e5075806561f5f689810e25c5e7764dfd28c9b939821a49","src/backend/tests/tone.rs":"fadf78543950249cccd64d6d42ca41cd58c68d4a4c2dc656d474da6a44eb550e","src/backend/tests/utils.rs":"1bb99ef71d3c18545bca49767e7b6bfffbe11896246994f41be7ed372772fd48","src/backend/utils.rs":"6c3ffbcd602e6cc9f56deb9ecb07b2eef2e6f074ef924178e466f380aae5c595","src/capi.rs":"21b66b70545bf04ec719928004d1d9adb45b24ced51288f5b2993d79aaf78f5f","src/lib.rs":"5e586d45cd6b3722f0a6736d9252593299269817a153eef1930a5fb9bfbb56f5","todo.md":"b1700be0fd28f8f226ddcbff59f844ca57e1d225f21ca1d6aa613d6269da6f2c"},"package":null}
{"files":{".editorconfig":"4e53b182bcc78b83d7e1b5c03efa14d22d4955c4ed2514d1ba4e99c1eb1a50ba",".githooks/pre-push":"8b8b26544cd56f54c0c33812551f786bb25cb08c86dbfeb6bf3daad881c826a1",".travis.yml":"dc07bac53f70f16c9bdf52264bdc58500ae6018c1b4c567bc7642f6b4ca3cc35","Cargo.toml":"4a25bbb1d243aedb93ec65197aa1312c1995fc466b2c707663d3f4dc8340e851","LICENSE":"6e6f56aff5bbf3cbc60747e152fb1a719bd0716aaf6d711c554f57d92e96297c","README.md":"d420509677fc444eb2ad8542e1e0e54cec800eb0fbbe50ba0ae2f89ac687c2a5","install_git_hook.sh":"d38c8e51e636f6b90b489621ac34ccd1d1b1f40dccce3d178ed1da1c5068f16d","install_rustfmt_clippy.sh":"4ae90d8dcb9757cb3ae4ae142ef80e5377c0dde61c63f4a3c32418646e80ca7b","run_device_tests.sh":"4b7d65eb638c1a278ffc8ecb6d30d47b3b8405392e976cae38c6f744e2bed532","run_sanitizers.sh":"2f0934ba01cbcd74485f19d50147f6b604cf9730bbd3a3d3f3d958e40d0f799f","run_tests.sh":"3dd76659f6dceeb0490dd92b355e113301ba0d0a8f034993a56f40e09edd25b2","src/backend/aggregate_device.rs":"ab8d0ac7339532495f189abb8162031099b2218d081f2e6d7c53e6393ca6e364","src/backend/auto_release.rs":"050fdcee74cf46b9a8a85a877e166d72a853d33220f59cf734cbb6ea09daa441","src/backend/buffer_manager.rs":"9c10a261792e32e75833b5f976b18547c338ca6beb2330eeab1ad203cc8c32bf","src/backend/device_property.rs":"d43642ea6e5f40e29c2a59ec7d81b42c154134685e417585045785359aa31686","src/backend/mixer.rs":"14e2156a8c1aeabcd4adb3336c3c9401b9c8526ec82a8c78942af7a79648f0f8","src/backend/mod.rs":"615697185c92513dcf8dcef38a949e024de9fcd97e54857473365be10a7361a1","src/backend/resampler.rs":"fd1281d28a4db1659d2f75e43b8457651745e1b6eb5a53a77f04d752135f6dc7","src/backend/tests/aggregate_device.rs":"107f5c637844cd5ae43d2b42cec4ef3369bb702751586078c0a9d50f039161cd","src/backend/tests/api.rs":"9ce44a867519d7b7a2b43c7f833327c35be38af7ba6fcc3d277ed1d7d8e7c8c2","src/backend/tests/backlog.rs":"3b189a7e036543c467cc242af0ed3332721179ee2b1c8847a6db563546f1ac52","src/backend/tests/device_change.rs":"8261f561f69dabd374ac47d69aa484812b65070a9e9581dfb2605e8404eaad6d","src/backend/tests/device_property.rs":"373f76d3bee83b263db3f02be3b94b408bdf852d84e4b5153273fda34b11a374","src/backend/tests/interfaces.rs":"14943e84a79976a7ef52882edeb9330350705d5190db6647f98b4ffa851a8396","src/backend/tests/manual.rs":"87210af9527feece99ad2b7b85651fbc8f02ec306ba8082da0c0705070e882af","src/backend/tests/mod.rs":"8dba770023d7f9c4228f0e11915347f0e07da5fd818e3ee4478c4b197af9aa2a","src/backend/tests/parallel.rs":"f9e1883660d6146b6e5075806561f5f689810e25c5e7764dfd28c9b939821a49","src/backend/tests/tone.rs":"fadf78543950249cccd64d6d42ca41cd58c68d4a4c2dc656d474da6a44eb550e","src/backend/tests/utils.rs":"1bb99ef71d3c18545bca49767e7b6bfffbe11896246994f41be7ed372772fd48","src/backend/utils.rs":"6c3ffbcd602e6cc9f56deb9ecb07b2eef2e6f074ef924178e466f380aae5c595","src/capi.rs":"21b66b70545bf04ec719928004d1d9adb45b24ced51288f5b2993d79aaf78f5f","src/lib.rs":"5e586d45cd6b3722f0a6736d9252593299269817a153eef1930a5fb9bfbb56f5","todo.md":"b1700be0fd28f8f226ddcbff59f844ca57e1d225f21ca1d6aa613d6269da6f2c"},"package":null}

2
third_party/rust/cubeb-coreaudio/Cargo.toml поставляемый
Просмотреть файл

@ -11,7 +11,7 @@ crate-type = ["staticlib", "rlib"]
atomic = "0.4"
bitflags = "1.0"
coreaudio-sys-utils = { path = "coreaudio-sys-utils" }
cubeb-backend = "0.8"
cubeb-backend = "0.7"
float-cmp = "0.6"
libc = "0.2"
lazy_static = "1.2"

Просмотреть файл

@ -3539,9 +3539,6 @@ impl<'ctx> StreamOps for AudioUnitStream<'ctx> {
fn set_volume(&mut self, volume: f32) -> Result<()> {
set_volume(self.core_stream_data.output_unit, volume)
}
fn set_name(&mut self, _: &CStr) -> Result<()> {
Err(Error::not_supported())
}
#[cfg(target_os = "ios")]
fn current_device(&mut self) -> Result<&DeviceRef> {
Err(not_supported())

Просмотреть файл

@ -1 +1 @@
{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".travis.yml":"0394e2adb041175457685cde5ee05ff04bdab8885fd8a62551f2ff43d9e48872","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"f4c3a703af8daa96b8b581ca2dd2619a076cbd0249d8add88f69b25a517cc67a","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"e6a98ee5630b9ce1a096a2907d095454f2770e298a5b0976ab552cc53ca96cfc","src/backend/context.rs":"33d9fdf1504fe1ae43d301e288daf6eaeabeb47aa0ef86efa135c6d984425fc4","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"374a9a3bd79fddc47739dda1dbfc5929aea5a91946794fe65fba3c8d130fbda9","src/backend/mod.rs":"06ce9250865abf0ea461f215b128470636d072a6776821efef3caf5a7b992fb9","src/backend/stream.rs":"2d4f200506ac62be2db7fd1446c937b98fe1a429d614f16af855f19f26fcd997","src/capi.rs":"b2c1be8128cadd36caa65c80950440f9d6f2aa0c24cc7bae6a9eaf6347ac454d","src/lib.rs":"7282560d84b134b09acfd8d6282600982e42fb3557f72454c535637cc26c7bf6"},"package":null}
{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".travis.yml":"0394e2adb041175457685cde5ee05ff04bdab8885fd8a62551f2ff43d9e48872","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"603fb672fb83699707559d13a651963321991b9bec6ea208723d3ee37c40694e","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"e6a98ee5630b9ce1a096a2907d095454f2770e298a5b0976ab552cc53ca96cfc","src/backend/context.rs":"33d9fdf1504fe1ae43d301e288daf6eaeabeb47aa0ef86efa135c6d984425fc4","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"374a9a3bd79fddc47739dda1dbfc5929aea5a91946794fe65fba3c8d130fbda9","src/backend/mod.rs":"06ce9250865abf0ea461f215b128470636d072a6776821efef3caf5a7b992fb9","src/backend/stream.rs":"e8c605b4217a61b795b4baf41a8dc20e852ac1541eb99751638103790a008f0b","src/capi.rs":"b2c1be8128cadd36caa65c80950440f9d6f2aa0c24cc7bae6a9eaf6347ac454d","src/lib.rs":"7282560d84b134b09acfd8d6282600982e42fb3557f72454c535637cc26c7bf6"},"package":null}

2
third_party/rust/cubeb-pulse/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@ pulse-dlopen = ["pulse-ffi/dlopen"]
crate-type = ["staticlib", "rlib"]
[dependencies]
cubeb-backend = "0.8"
cubeb-backend = "0.7"
pulse-ffi = { path = "pulse-ffi" }
pulse = { path = "pulse-rs" }
semver = "^0.9"

Просмотреть файл

@ -13,7 +13,6 @@ use std::{mem, ptr};
use std::ffi::{CStr, CString};
use std::os::raw::{c_long, c_void};
use std::slice;
use std::sync::atomic::{AtomicUsize, Ordering};
use ringbuf::RingBuffer;
use self::RingBufferConsumer::*;
@ -223,33 +222,6 @@ impl BufferManager {
return p;
}
pub fn trim(&mut self, final_size: usize) {
match &self.linear_input_buffer {
LinearInputBuffer::IntegerLinearInputBuffer(b) => {
let length = b.len();
assert!(final_size <= length);
let nframes_to_pop = length - final_size;
self.get_linear_input_data(nframes_to_pop);
}
LinearInputBuffer::FloatLinearInputBuffer(b) => {
let length = b.len();
assert!(final_size <= length);
let nframes_to_pop = length - final_size;
self.get_linear_input_data(nframes_to_pop);
}
}
}
pub fn available_samples(&mut self) -> usize {
match &self.linear_input_buffer {
LinearInputBuffer::IntegerLinearInputBuffer(b) => {
b.len()
}
LinearInputBuffer::FloatLinearInputBuffer(b) => {
b.len()
}
}
}
}
impl std::fmt::Debug for BufferManager {
@ -270,7 +242,6 @@ pub struct PulseStream<'ctx> {
drain_timer: *mut pa_time_event,
output_sample_spec: pulse::SampleSpec,
input_sample_spec: pulse::SampleSpec,
output_frame_count: AtomicUsize,
shutdown: bool,
volume: f32,
state: ffi::cubeb_state,
@ -370,19 +341,7 @@ impl<'ctx> PulseStream<'ctx> {
if stm.input_stream.is_some() {
let nframes = nbytes / stm.output_sample_spec.frame_size();
let nsamples_input = nframes * stm.input_sample_spec.channels as usize;
let input_buffer_manager = stm.input_buffer_manager.as_mut().unwrap();
if stm.output_frame_count.fetch_add(nframes, Ordering::SeqCst) == 0 {
let buffered_input_frames = input_buffer_manager.available_samples() / stm.input_sample_spec.channels as usize;
if buffered_input_frames > nframes {
// Trim the buffer to ensure minimal roundtrip latency
let popped_frames = buffered_input_frames - nframes;
input_buffer_manager.trim(nframes * stm.input_sample_spec.channels as usize);
cubeb_log!("Dropping {} frames in input buffer.", popped_frames);
}
}
let p = input_buffer_manager.get_linear_input_data(nsamples_input);
let p = stm.input_buffer_manager.as_mut().unwrap().get_linear_input_data(nsamples_input);
stm.trigger_user_callback(p, nbytes);
} else {
// Output/playback only operation.
@ -402,7 +361,6 @@ impl<'ctx> PulseStream<'ctx> {
drain_timer: ptr::null_mut(),
output_sample_spec: pulse::SampleSpec::default(),
input_sample_spec: pulse::SampleSpec::default(),
output_frame_count: AtomicUsize::new(0),
shutdown: false,
volume: PULSE_NO_GAIN,
state: ffi::CUBEB_STATE_ERROR,
@ -751,24 +709,6 @@ impl<'ctx> StreamOps for PulseStream<'ctx> {
}
}
fn set_name(&mut self, name: &CStr) -> Result<()> {
match self.output_stream {
None => Err(Error::error()),
Some(ref stm) => {
self.context.mainloop.lock();
if let Ok(o) = stm.set_name(
name,
stream_success,
self as *const _ as *mut _
) {
self.context.operation_wait(stm, &o);
}
self.context.mainloop.unlock();
Ok(())
}
}
}
fn current_device(&mut self) -> Result<&DeviceRef> {
if self.context.version_0_9_8 {
let mut dev: Box<ffi::cubeb_device> = Box::new(unsafe { mem::zeroed() });

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

2
third_party/rust/cubeb-sys/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package]
name = "cubeb-sys"
version = "0.8.0"
version = "0.7.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
build = "build.rs"
links = "cubeb"

Просмотреть файл

@ -231,7 +231,7 @@ if(USE_KAI)
target_link_libraries(cubeb PRIVATE kai)
endif()
if(USE_PULSE AND USE_PULSE_RUST)
if(USE_PULSE_RUST)
include(ExternalProject)
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
ExternalProject_Add(
@ -240,17 +240,17 @@ if(USE_PULSE AND USE_PULSE_RUST)
CONFIGURE_COMMAND ""
BUILD_COMMAND cargo build COMMAND cargo build --release
BUILD_ALWAYS ON
BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs"
BINARY_DIR "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs"
INSTALL_COMMAND ""
LOG_BUILD ON)
add_dependencies(cubeb cubeb_pulse_rs)
target_compile_definitions(cubeb PRIVATE USE_PULSE_RUST)
target_link_libraries(cubeb PRIVATE
debug "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a"
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse)
debug "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs/target/debug/libcubeb_pulse.a"
optimized "${CMAKE_SOURCE_DIR}/src/cubeb-pulse-rs/target/release/libcubeb_pulse.a" pulse)
endif()
if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
if(USE_AUDIOUNIT_RUST)
include(ExternalProject)
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/rust)
ExternalProject_Add(
@ -259,14 +259,14 @@ if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
CONFIGURE_COMMAND ""
BUILD_COMMAND cargo build COMMAND cargo build --release
BUILD_ALWAYS ON
BINARY_DIR "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs"
BINARY_DIR "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs"
INSTALL_COMMAND ""
LOG_BUILD ON)
add_dependencies(cubeb cubeb_coreaudio_rs)
target_compile_definitions(cubeb PRIVATE USE_AUDIOUNIT_RUST)
target_link_libraries(cubeb PRIVATE
debug "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a"
optimized "${PROJECT_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
debug "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a"
optimized "${CMAKE_SOURCE_DIR}/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
endif()
find_package(Doxygen)

Просмотреть файл

@ -487,17 +487,11 @@ CUBEB_EXPORT void cubeb_destroy(cubeb * context);
cubeb stream.
@param stream_name A name for this stream.
@param input_device Device for the input side of the stream. If NULL the
default input device is used. Passing a valid cubeb_devid
means the stream only ever uses that device. Passing a NULL
cubeb_devid allows the stream to follow that device type's
OS default.
default input device is used.
@param input_stream_params Parameters for the input side of the stream, or
NULL if this stream is output only.
@param output_device Device for the output side of the stream. If NULL the
default output device is used. Passing a valid cubeb_devid
means the stream only ever uses that device. Passing a NULL
cubeb_devid allows the stream to follow that device type's
OS default.
default output device is used.
@param output_stream_params Parameters for the output side of the stream, or
NULL if this stream is input only.
@param latency_frames Stream latency in frames. Valid range
@ -584,14 +578,6 @@ CUBEB_EXPORT int cubeb_stream_get_input_latency(cubeb_stream * stream, uint32_t
@retval CUBEB_ERROR_NOT_SUPPORTED */
CUBEB_EXPORT int cubeb_stream_set_volume(cubeb_stream * stream, float volume);
/** Change a stream's name.
@param stream the stream for which to set the name.
@param stream_name the new name for the stream
@retval CUBEB_OK
@retval CUBEB_ERROR_INVALID_PARAMETER if any pointer is invalid
@retval CUBEB_ERROR_NOT_SUPPORTED */
CUBEB_EXPORT int cubeb_stream_set_name(cubeb_stream * stream, char const * stream_name);
/** Get the current output device for this stream.
@param stm the stream for which to query the current output device
@param device a pointer in which the current output device will be stored.

Просмотреть файл

@ -65,7 +65,6 @@ struct cubeb_ops {
int (* stream_get_latency)(cubeb_stream * stream, uint32_t * latency);
int (* stream_get_input_latency)(cubeb_stream * stream, uint32_t * latency);
int (* stream_set_volume)(cubeb_stream * stream, float volumes);
int (* stream_set_name)(cubeb_stream * stream, char const * stream_name);
int (* stream_get_current_device)(cubeb_stream * stream,
cubeb_device ** const device);
int (* stream_device_destroy)(cubeb_stream * stream,

Просмотреть файл

@ -200,12 +200,12 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
#if defined(USE_ALSA)
alsa_init,
#endif
#if defined(USE_AUDIOUNIT_RUST)
audiounit_rust_init,
#endif
#if defined(USE_AUDIOUNIT)
audiounit_init,
#endif
#if defined(USE_AUDIOUNIT_RUST)
audiounit_rust_init,
#endif
#if defined(USE_WASAPI)
wasapi_init,
#endif
@ -448,20 +448,6 @@ cubeb_stream_set_volume(cubeb_stream * stream, float volume)
return stream->context->ops->stream_set_volume(stream, volume);
}
int
cubeb_stream_set_name(cubeb_stream * stream, char const * stream_name)
{
if (!stream || !stream_name) {
return CUBEB_ERROR_INVALID_PARAMETER;
}
if (!stream->context->ops->stream_set_name) {
return CUBEB_ERROR_NOT_SUPPORTED;
}
return stream->context->ops->stream_set_name(stream, stream_name);
}
int cubeb_stream_get_current_device(cubeb_stream * stream,
cubeb_device ** const device)
{

Просмотреть файл

@ -1446,7 +1446,6 @@ static struct cubeb_ops const alsa_ops = {
.stream_get_latency = alsa_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = alsa_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -435,7 +435,6 @@ static struct cubeb_ops const audiotrack_ops = {
.stream_get_latency = audiotrack_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = audiotrack_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -3623,7 +3623,6 @@ cubeb_ops const audiounit_ops = {
/*.stream_get_latency =*/ audiounit_stream_get_latency,
/*.stream_get_input_latency =*/ NULL,
/*.stream_set_volume =*/ audiounit_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ audiounit_stream_get_current_device,
/*.stream_device_destroy =*/ audiounit_stream_device_destroy,
/*.stream_register_device_changed_callback =*/ audiounit_stream_register_device_changed_callback,

Просмотреть файл

@ -134,7 +134,6 @@ static struct cubeb_ops const cbjack_ops = {
.stream_get_latency = cbjack_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = cbjack_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = cbjack_stream_get_current_device,
.stream_device_destroy = cbjack_stream_device_destroy,
.stream_register_device_changed_callback = NULL,
@ -239,22 +238,6 @@ load_jack_lib(cubeb * context)
return CUBEB_OK;
}
static void
cbjack_connect_port_out (cubeb_stream * stream, const size_t out_port, const char * const phys_in_port)
{
const char *src_port = api_jack_port_name (stream->output_ports[out_port]);
api_jack_connect (stream->context->jack_client, src_port, phys_in_port);
}
static void
cbjack_connect_port_in (cubeb_stream * stream, const char * const phys_out_port, size_t in_port)
{
const char *src_port = api_jack_port_name (stream->input_ports[in_port]);
api_jack_connect (stream->context->jack_client, phys_out_port, src_port);
}
static int
cbjack_connect_ports (cubeb_stream * stream)
{
@ -274,14 +257,10 @@ cbjack_connect_ports (cubeb_stream * stream)
// Connect outputs to playback
for (unsigned int c = 0; c < stream->out_params.channels && phys_in_ports[c] != NULL; c++) {
cbjack_connect_port_out(stream, c, phys_in_ports[c]);
}
const char *src_port = api_jack_port_name (stream->output_ports[c]);
// Special case playing mono source in stereo
if (stream->out_params.channels == 1 && phys_in_ports[1] != NULL) {
cbjack_connect_port_out(stream, 0, phys_in_ports[1]);
api_jack_connect (stream->context->jack_client, src_port, phys_in_ports[c]);
}
r = CUBEB_OK;
skipplayback:
@ -290,7 +269,9 @@ skipplayback:
}
// Connect inputs to capture
for (unsigned int c = 0; c < stream->in_params.channels && phys_out_ports[c] != NULL; c++) {
cbjack_connect_port_in(stream, phys_out_ports[c], c);
const char *src_port = api_jack_port_name (stream->input_ports[c]);
api_jack_connect (stream->context->jack_client, phys_out_ports[c], src_port);
}
r = CUBEB_OK;
end:
@ -309,9 +290,9 @@ cbjack_xrun_callback(void * arg)
cubeb * ctx = (cubeb *)arg;
float delay = api_jack_get_xrun_delayed_usecs(ctx->jack_client);
float fragments = ceilf(((delay / 1000000.0) * ctx->jack_sample_rate) / ctx->jack_buffer_size);
ctx->jack_xruns += (unsigned int)fragments;
int fragments = (int)ceilf( ((delay / 1000000.0) * ctx->jack_sample_rate )
/ (float)(ctx->jack_buffer_size) );
ctx->jack_xruns += fragments;
return 0;
}
@ -351,11 +332,9 @@ static int
cbjack_process(jack_nframes_t nframes, void * arg)
{
cubeb * ctx = (cubeb *)arg;
unsigned int t_jack_xruns = ctx->jack_xruns;
int t_jack_xruns = ctx->jack_xruns;
int i;
ctx->jack_xruns = 0;
for (int j = 0; j < MAX_STREAMS; j++) {
cubeb_stream *stm = &ctx->streams[j];
float *bufs_out[stm->out_params.channels];
@ -365,7 +344,10 @@ cbjack_process(jack_nframes_t nframes, void * arg)
continue;
// handle xruns by skipping audio that should have been played
stm->position += t_jack_xruns * ctx->fragment_size * stm->ratio;
for (i = 0; i < t_jack_xruns; i++) {
stm->position += ctx->fragment_size * stm->ratio;
}
ctx->jack_xruns -= t_jack_xruns;
if (!stm->ports_ready)
continue;

Просмотреть файл

@ -363,7 +363,6 @@ static struct cubeb_ops const kai_ops = {
/*.stream_get_latency = */ kai_stream_get_latency,
/*.stream_get_input_latency = */ NULL,
/*.stream_set_volume =*/ kai_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ NULL,
/*.stream_device_destroy =*/ NULL,
/*.stream_register_device_changed_callback=*/ NULL,

Просмотреть файл

@ -168,8 +168,7 @@ struct cubeb_stream {
int64_t lastPosition;
int64_t lastPositionTimeStamp;
int64_t lastCompensativePosition;
int voice_input;
int voice_output;
int voice;
};
/* Forward declaration. */
@ -960,8 +959,8 @@ opensl_configure_capture(cubeb_stream * stm, cubeb_stream_params * params)
// Voice recognition is the lowest latency, according to the docs. Camcorder
// uses a microphone that is in the same direction as the camera.
SLint32 streamType = stm->voice_input ? SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION
: SL_ANDROID_RECORDING_PRESET_CAMCORDER;
SLint32 streamType = stm->voice ? SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION
: SL_ANDROID_RECORDING_PRESET_CAMCORDER;
res = (*recorderConfig)
->SetConfiguration(recorderConfig, SL_ANDROID_KEY_RECORDING_PRESET,
@ -1186,7 +1185,7 @@ opensl_configure_playback(cubeb_stream * stm, cubeb_stream_params * params) {
}
SLint32 streamType = SL_ANDROID_STREAM_MEDIA;
if (stm->voice_output) {
if (stm->voice) {
streamType = SL_ANDROID_STREAM_VOICE;
}
res = (*playerConfig)->SetConfiguration(playerConfig,
@ -1386,11 +1385,10 @@ opensl_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name
stm->input_enabled = (input_stream_params) ? 1 : 0;
stm->output_enabled = (output_stream_params) ? 1 : 0;
stm->shutdown = 1;
stm->voice_input = has_pref_set(input_stream_params, NULL, CUBEB_STREAM_PREF_VOICE);
stm->voice_output = has_pref_set(NULL, output_stream_params, CUBEB_STREAM_PREF_VOICE);
stm->voice = has_pref_set(input_stream_params, output_stream_params, CUBEB_STREAM_PREF_VOICE);
LOG("cubeb stream prefs: voice: %s", stm->voice ? "true" : "false");
LOG("cubeb stream prefs: voice_input: %s voice_output: %s", stm->voice_input ? "true" : "false",
stm->voice_output ? "true" : "false");
#ifdef DEBUG
pthread_mutexattr_t attr;
@ -1756,7 +1754,6 @@ static struct cubeb_ops const opensl_ops = {
.stream_get_latency = opensl_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = opensl_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -86,7 +86,6 @@
X(pa_mainloop_api_once) \
X(pa_get_library_version) \
X(pa_channel_map_init_auto) \
X(pa_stream_set_name) \
#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x;
LIBPULSE_API_VISIT(MAKE_TYPEDEF);
@ -1140,14 +1139,6 @@ volume_success(pa_context *c, int success, void *userdata)
WRAP(pa_threaded_mainloop_signal)(stream->context->mainloop, 0);
}
static void
rename_success(pa_stream *s, int success, void *userdata)
{
cubeb_stream * stream = userdata;
assert(success);
WRAP(pa_threaded_mainloop_signal)(stream->context->mainloop, 0);
}
static int
pulse_stream_set_volume(cubeb_stream * stm, float volume)
{
@ -1192,28 +1183,6 @@ pulse_stream_set_volume(cubeb_stream * stm, float volume)
return CUBEB_OK;
}
static int
pulse_stream_set_name(cubeb_stream * stm, char const * stream_name)
{
if (!stm || !stm->output_stream) {
return CUBEB_ERROR;
}
WRAP(pa_threaded_mainloop_lock)(stm->context->mainloop);
pa_operation * op =
WRAP(pa_stream_set_name)(stm->output_stream, stream_name, rename_success, stm);
if (op) {
operation_wait(stm->context, stm->output_stream, op);
WRAP(pa_operation_unref)(op);
}
WRAP(pa_threaded_mainloop_unlock)(stm->context->mainloop);
return CUBEB_OK;
}
typedef struct {
char * default_sink_name;
char * default_source_name;
@ -1630,7 +1599,6 @@ static struct cubeb_ops const pulse_ops = {
.stream_get_latency = pulse_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = pulse_stream_set_volume,
.stream_set_name = pulse_stream_set_name,
.stream_get_current_device = pulse_stream_get_current_device,
.stream_device_destroy = pulse_stream_device_destroy,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -35,7 +35,6 @@ MOZ_END_STD_NAMESPACE
#include "cubeb_utils.h"
#include "cubeb-speex-resampler.h"
#include "cubeb_resampler.h"
#include "cubeb_log.h"
#include <stdio.h>
/* This header file contains the internal C++ API of the resamplers, for testing. */
@ -192,19 +191,6 @@ public:
speex_resampler = speex_resampler_init(channels, source_rate,
target_rate, quality, &r);
assert(r == RESAMPLER_ERR_SUCCESS && "resampler allocation failure");
uint32_t input_latency = speex_resampler_get_input_latency(speex_resampler);
const size_t LATENCY_SAMPLES = 8192;
T input_buffer[LATENCY_SAMPLES] = {};
T output_buffer[LATENCY_SAMPLES] = {};
uint32_t input_frame_count = input_latency;
uint32_t output_frame_count = LATENCY_SAMPLES;
assert(input_latency * channels <= LATENCY_SAMPLES);
speex_resample(
input_buffer,
&input_frame_count,
output_buffer,
&output_frame_count);
}
/** Destructor, deallocate the resampler */
@ -268,14 +254,7 @@ public:
speex_resample(resampling_in_buffer.data(), &in_len,
resampling_out_buffer.data(), &out_len);
if (out_len < output_frame_count) {
LOGV("underrun during resampling: got %u frames, expected %zu", (unsigned)out_len, output_frame_count);
// silence the rightmost part
T* data = resampling_out_buffer.data();
for (uint32_t i = frames_to_samples(out_len); i < frames_to_samples(output_frame_count); i++) {
data[i] = 0;
}
}
assert(out_len == output_frame_count);
/* This shifts back any unresampled samples to the beginning of the input
buffer. */
@ -304,12 +283,13 @@ public:
* exactly `output_frame_count` resampled frames. This can return a number
* slightly bigger than what is strictly necessary, but it guaranteed that the
* number of output frames will be exactly equal. */
uint32_t input_needed_for_output(int32_t output_frame_count) const
uint32_t input_needed_for_output(uint32_t output_frame_count) const
{
assert(output_frame_count >= 0); // Check overflow
int32_t unresampled_frames_left = samples_to_frames(resampling_in_buffer.length());
int32_t resampled_frames_left = samples_to_frames(resampling_out_buffer.length());
float input_frames_needed =
output_frame_count * resampling_ratio - resampled_frames_left;
float input_frames_needed =
(output_frame_count - unresampled_frames_left) * resampling_ratio
- resampled_frames_left;
if (input_frames_needed < 0) {
return 0;
}
@ -482,9 +462,8 @@ public:
* @parameter frames_needed the number of frames one want to write into the
* delay_line
* @returns the number of frames one will get. */
uint32_t input_needed_for_output(int32_t frames_needed) const
size_t input_needed_for_output(uint32_t frames_needed) const
{
assert(frames_needed >= 0); // Check overflow
return frames_needed;
}
/** Returns the number of frames produces for `input_frames` frames in input */
@ -547,7 +526,6 @@ cubeb_resampler_create_internal(cubeb_stream * stream,
(output_params && output_params->rate == target_rate)) ||
(input_params && !output_params && (input_params->rate == target_rate)) ||
(output_params && !input_params && (output_params->rate == target_rate))) {
LOG("Input and output sample-rate match, target rate of %dHz", target_rate);
return new passthrough_resampler<T>(stream, callback,
user_ptr,
input_params ? input_params->channels : 0,
@ -598,7 +576,6 @@ cubeb_resampler_create_internal(cubeb_stream * stream,
}
if (input_resampler && output_resampler) {
LOG("Resampling input (%d) and output (%d) to target rate of %dHz", input_params->rate, output_params->rate, target_rate);
return new cubeb_resampler_speex<T,
cubeb_resampler_speex_one_way<T>,
cubeb_resampler_speex_one_way<T>>
@ -606,7 +583,6 @@ cubeb_resampler_create_internal(cubeb_stream * stream,
output_resampler.release(),
stream, callback, user_ptr);
} else if (input_resampler) {
LOG("Resampling input (%d) to target and output rate of %dHz", input_params->rate, target_rate);
return new cubeb_resampler_speex<T,
cubeb_resampler_speex_one_way<T>,
delay_line<T>>
@ -614,7 +590,6 @@ cubeb_resampler_create_internal(cubeb_stream * stream,
output_delay.release(),
stream, callback, user_ptr);
} else {
LOG("Resampling output (%dHz) to target and input rate of %dHz", output_params->rate, target_rate);
return new cubeb_resampler_speex<T,
delay_line<T>,
cubeb_resampler_speex_one_way<T>>

Просмотреть файл

@ -662,7 +662,6 @@ static struct cubeb_ops const sndio_ops = {
.stream_get_position = sndio_stream_get_position,
.stream_get_latency = sndio_stream_get_latency,
.stream_set_volume = sndio_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = NULL,
.stream_device_destroy = NULL,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -362,8 +362,8 @@ sun_stream_stop(cubeb_stream * s)
static void
sun_stream_destroy(cubeb_stream * s)
{
sun_stream_stop(s);
pthread_mutex_destroy(&s->mutex);
sun_stream_stop(s);
if (s->play.fd != -1) {
close(s->play.fd);
}
@ -473,7 +473,7 @@ sun_io_routine(void * arg)
if (to_write > 0) {
bytes = to_write * s->play.frame_size;
if ((n = write(s->play.fd, (uint8_t *)s->play.buf + write_ofs, bytes)) < 0) {
if ((n = write(s->play.fd, s->play.buf + write_ofs, bytes)) < 0) {
state = CUBEB_STATE_ERROR;
break;
}
@ -482,17 +482,17 @@ sun_io_routine(void * arg)
s->frames_written += frames;
pthread_mutex_unlock(&s->mutex);
to_write -= frames;
write_ofs += n;
write_ofs += frames;
}
if (to_read > 0) {
bytes = to_read * s->record.frame_size;
if ((n = read(s->record.fd, (uint8_t *)s->record.buf + read_ofs, bytes)) < 0) {
if ((n = read(s->record.fd, s->record.buf + read_ofs, bytes)) < 0) {
state = CUBEB_STATE_ERROR;
break;
}
frames = n / s->record.frame_size;
to_read -= frames;
read_ofs += n;
read_ofs += frames;
}
}
if (drain && state != CUBEB_STATE_ERROR) {
@ -666,7 +666,7 @@ sun_stream_get_latency(cubeb_stream * s, uint32_t * latency)
#else
cubeb_stream_params params;
params.rate = s->play.info.play.sample_rate;
params.rate = stream->play.info.play.sample_rate;
return sun_get_min_latency(NULL, params, latency);
#endif
@ -723,7 +723,6 @@ static struct cubeb_ops const sun_ops = {
.stream_get_latency = sun_stream_get_latency,
.stream_get_input_latency = NULL,
.stream_set_volume = sun_stream_set_volume,
.stream_set_name = NULL,
.stream_get_current_device = sun_get_current_device,
.stream_device_destroy = sun_stream_device_destroy,
.stream_register_device_changed_callback = NULL,

Просмотреть файл

@ -193,10 +193,6 @@ int wasapi_stream_start(cubeb_stream * stm);
void close_wasapi_stream(cubeb_stream * stm);
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);
void wasapi_destroy_device(cubeb_device_info * device_info);
static int wasapi_enumerate_devices(cubeb * context, cubeb_device_type type, cubeb_device_collection * out);
static int wasapi_device_collection_destroy(cubeb * ctx, cubeb_device_collection * collection);
static char const * wstr_to_utf8(wchar_t const * str);
static std::unique_ptr<wchar_t const []> utf8_to_wstr(char const * str);
@ -249,15 +245,9 @@ struct cubeb_stream {
cubeb_stream_params output_stream_params = { CUBEB_SAMPLE_FLOAT32NE, 0, 0, CUBEB_LAYOUT_UNDEFINED, CUBEB_STREAM_PREF_NONE };
/* A MMDevice role for this stream: either communication or console here. */
ERole role;
/* True if this stream will transport voice-data. */
bool voice;
/* True if the input device of this stream is using bluetooth handsfree. */
bool input_bluetooth_handsfree;
/* The input and output device, or NULL for default. */
std::unique_ptr<const wchar_t[]> input_device_id;
std::unique_ptr<const wchar_t[]> output_device_id;
com_ptr<IMMDevice> input_device;
com_ptr<IMMDevice> output_device;
std::unique_ptr<const wchar_t[]> input_device;
std::unique_ptr<const wchar_t[]> output_device;
/* The latency initially requested for this stream, in frames. */
unsigned latency = 0;
cubeb_state_callback state_callback = nullptr;
@ -711,9 +701,8 @@ intern_device_id(cubeb * ctx, wchar_t const * id)
XASSERT(id);
char const * tmp = wstr_to_utf8(id);
if (!tmp) {
if (!tmp)
return nullptr;
}
char const * interned = cubeb_strings_intern(ctx->device_ids, tmp);
@ -784,12 +773,6 @@ frames_to_hns(cubeb_stream * stm, uint32_t frames)
return std::ceil(frames * 10000000.0 / get_rate(stm));
}
REFERENCE_TIME
frames_to_hns(uint32_t rate, uint32_t frames)
{
return std::ceil(frames * 10000000.0 / rate);
}
/* This returns the size of a frame in the stream, before the eventual upmix
occurs. */
static size_t
@ -1054,6 +1037,9 @@ refill_callback_duplex(cubeb_stream * stm)
}
input_frames = stm->linear_input_buffer->length() / stm->input_stream_params.channels;
if (!input_frames) {
return true;
}
rv = get_output_buffer(stm, output_buffer, output_frames);
if (!rv) {
@ -1346,11 +1332,17 @@ void wasapi_destroy(cubeb * context);
HRESULT register_notification_client(cubeb_stream * stm)
{
assert(stm->device_enumerator);
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator),
NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(stm->device_enumerator.receive()));
if (FAILED(hr)) {
LOG("Could not get device enumerator: %lx", hr);
return hr;
}
stm->notification_client.reset(new wasapi_endpoint_notification_client(stm->reconfigure_event, stm->role));
HRESULT hr = stm->device_enumerator->RegisterEndpointNotificationCallback(stm->notification_client.get());
hr = stm->device_enumerator->RegisterEndpointNotificationCallback(stm->notification_client.get());
if (FAILED(hr)) {
LOG("Could not register endpoint notification callback: %lx", hr);
stm->notification_client = nullptr;
@ -1378,6 +1370,7 @@ HRESULT unregister_notification_client(cubeb_stream * stm)
}
stm->notification_client = nullptr;
stm->device_enumerator = nullptr;
return S_OK;
}
@ -1486,7 +1479,8 @@ current_stream_delay(cubeb_stream * stm)
double cur_pos = static_cast<double>(pos) / freq;
double max_pos = static_cast<double>(stm->frames_written) / stm->output_mix_params.rate;
double delay = std::max(max_pos - cur_pos, 0.0);
double delay = max_pos - cur_pos;
XASSERT(delay >= 0);
return delay;
}
@ -1555,10 +1549,10 @@ int wasapi_init(cubeb ** context, char const * context_name)
LARGE_INTEGER frequency;
if (QueryPerformanceFrequency(&frequency)) {
ctx->performance_counter_frequency = frequency.QuadPart;
} else {
LOG("Failed getting performance counter frequency, latency reporting will be inacurate");
ctx->performance_counter_frequency = 0;
} else {
ctx->performance_counter_frequency = frequency.QuadPart;
}
*context = ctx;
@ -1784,18 +1778,17 @@ handle_channel_layout(cubeb_stream * stm, EDataFlow direction, com_heap_ptr<WAV
waveformatex_update_derived_properties(mix_format.get());
/* Check if wasapi will accept our channel layout request. */
WAVEFORMATEX * tmp = nullptr;
WAVEFORMATEX * closest;
HRESULT hr = audio_client->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED,
mix_format.get(),
&tmp);
com_heap_ptr<WAVEFORMATEX> closest(tmp);
&closest);
if (hr == S_FALSE) {
/* Channel layout not supported, but WASAPI gives us a suggestion. Use it,
and handle the eventual upmix/downmix ourselves. Ignore the subformat of
the suggestion, since it seems to always be IEEE_FLOAT. */
LOG("Using WASAPI suggested format: channels: %d", closest->nChannels);
XASSERT(closest->wFormatTag == WAVE_FORMAT_EXTENSIBLE);
WAVEFORMATEXTENSIBLE * closest_pcm = reinterpret_cast<WAVEFORMATEXTENSIBLE *>(closest.get());
WAVEFORMATEXTENSIBLE * closest_pcm = reinterpret_cast<WAVEFORMATEXTENSIBLE *>(closest);
format_pcm->dwChannelMask = closest_pcm->dwChannelMask;
mix_format->nChannels = closest->nChannels;
waveformatex_update_derived_properties(mix_format.get());
@ -1927,9 +1920,9 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
uint32_t * buffer_frame_count,
HANDLE & event,
T & render_or_capture_client,
cubeb_stream_params * mix_params,
com_ptr<IMMDevice>& device)
cubeb_stream_params * mix_params)
{
com_ptr<IMMDevice> device;
HRESULT hr;
bool is_loopback = stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK;
if (is_loopback && direction != eCapture) {
@ -2042,46 +2035,6 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
flags |= AUDCLNT_STREAMFLAGS_EVENTCALLBACK;
}
// Sanity check the latency, it may be that the device doesn't support it.
REFERENCE_TIME minimum_period;
REFERENCE_TIME default_period;
hr = audio_client->GetDevicePeriod(&default_period, &minimum_period);
if (FAILED(hr)) {
LOG("Could not get device period: %lx", hr);
return CUBEB_ERROR;
}
REFERENCE_TIME latency_hns;
uint32_t latency_frames = stm->latency;
cubeb_device_info device_info;
int rv = wasapi_create_device(stm->context, device_info, stm->device_enumerator.get(), device.get());
if (rv == CUBEB_OK) {
const char* HANDSFREE_TAG = "BTHHFEENUM";
size_t len = sizeof(HANDSFREE_TAG);
if (direction == eCapture && strncmp(device_info.group_id, HANDSFREE_TAG, len) == 0) {
// Rather high-latency to prevent constant under-runs in this particular
// case of an input device using bluetooth handsfree.
uint32_t default_period_frames = hns_to_frames(device_info.default_rate, default_period);
latency_frames = default_period_frames * 4;
stm->input_bluetooth_handsfree = true;
LOG("Input is a bluetooth device in handsfree, latency increased to %u frames from a default of %u", latency_frames, default_period_frames);
} else {
uint32_t minimum_period_frames = hns_to_frames(device_info.default_rate, minimum_period);
latency_frames = std::max(latency_frames, minimum_period_frames);
stm->input_bluetooth_handsfree = false;
LOG("Input is a not bluetooth handsfree, latency %s to %u frames (minimum %u)", latency_frames < minimum_period_frames ? "increased" : "set", latency_frames, minimum_period_frames);
}
latency_hns = frames_to_hns(device_info.default_rate, latency_frames);
wasapi_destroy_device(&device_info);
} else {
stm->input_bluetooth_handsfree = false;
latency_hns = frames_to_hns(mix_params->rate, latency_frames);
LOG("Could not get cubeb_device_info.");
}
#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");
@ -2089,7 +2042,7 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
#endif
hr = audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED,
flags,
latency_hns,
frames_to_hns(stm, stm->latency),
0,
mix_format.get(),
NULL);
@ -2129,54 +2082,6 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
#undef DIRECTION_NAME
void wasapi_find_matching_output_device(cubeb_stream * stm) {
HRESULT hr;
cubeb_device_info * input_device;
cubeb_device_collection collection;
// Only try to match to an output device if the input device is a bluetooth
// device that is using the handsfree protocol
if (!stm->input_bluetooth_handsfree) {
return;
}
wchar_t * tmp = nullptr;
hr = stm->input_device->GetId(&tmp);
if (FAILED(hr)) {
LOG("Couldn't get input device id in wasapi_find_matching_output_device");
return;
}
com_heap_ptr<wchar_t> device_id(tmp);
cubeb_devid input_device_id = intern_device_id(stm->context, device_id.get());
if (!input_device_id) {
return;
}
int rv = wasapi_enumerate_devices(stm->context, (cubeb_device_type)(CUBEB_DEVICE_TYPE_INPUT|CUBEB_DEVICE_TYPE_OUTPUT), &collection);
// Find the input device, and then find the output device with the same group
// id and the same rate.
for (uint32_t i = 0; i < collection.count; i++) {
cubeb_device_info dev = collection.device[i];
if (dev.devid == input_device_id) {
input_device = &dev;
break;
}
}
for (uint32_t i = 0; i < collection.count; i++) {
cubeb_device_info dev = collection.device[i];
if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT &&
dev.group_id && !strcmp(dev.group_id, input_device->group_id) &&
dev.default_rate == input_device->default_rate) {
LOG("Found matching device for %s: %s", input_device->friendly_name, dev.friendly_name);
stm->output_device_id = utf8_to_wstr(reinterpret_cast<char const *>(dev.devid));
}
}
wasapi_device_collection_destroy(stm->context, &collection);
}
int setup_wasapi_stream(cubeb_stream * stm)
{
int rv;
@ -2186,18 +2091,17 @@ int setup_wasapi_stream(cubeb_stream * stm)
XASSERT((!stm->output_client || !stm->input_client) && "WASAPI stream already setup, close it first.");
if (has_input(stm)) {
LOG("(%p) Setup capture: device=%p", stm, stm->input_device_id.get());
LOG("(%p) Setup capture: device=%p", stm, stm->input_device.get());
rv = setup_wasapi_stream_one_side(stm,
&stm->input_stream_params,
stm->input_device_id.get(),
stm->input_device.get(),
eCapture,
__uuidof(IAudioCaptureClient),
stm->input_client,
&stm->input_buffer_frame_count,
stm->input_available_event,
stm->capture_client,
&stm->input_mix_params,
stm->input_device);
&stm->input_mix_params);
if (rv != CUBEB_OK) {
LOG("Failure to open the input side.");
return rv;
@ -2216,14 +2120,6 @@ int setup_wasapi_stream(cubeb_stream * stm)
stm->linear_input_buffer->push_silence(stm->input_buffer_frame_count *
stm->input_stream_params.channels *
silent_buffer_count);
// If this is a bluetooth device, and the output device is the default
// device, and the default device is the same bluetooth device, pick the
// right output device, running at the same rate and with the same protocol
// as the input.
if (!stm->output_device_id) {
wasapi_find_matching_output_device(stm);
}
}
// If we don't have an output device but are requesting a loopback device,
@ -2234,32 +2130,31 @@ int setup_wasapi_stream(cubeb_stream * stm)
stm->output_stream_params.rate = stm->input_stream_params.rate;
stm->output_stream_params.channels = stm->input_stream_params.channels;
stm->output_stream_params.layout = stm->input_stream_params.layout;
if (stm->input_device_id) {
size_t len = wcslen(stm->input_device_id.get());
if (stm->input_device) {
size_t len = wcslen(stm->input_device.get());
std::unique_ptr<wchar_t[]> tmp(new wchar_t[len + 1]);
if (wcsncpy_s(tmp.get(), len + 1, stm->input_device_id.get(), len) != 0) {
if (wcsncpy_s(tmp.get(), len + 1, stm->input_device.get(), len) != 0) {
LOG("Failed to copy device identifier while copying input stream"
" configuration to output stream configuration to drive loopback.");
return CUBEB_ERROR;
}
stm->output_device_id = move(tmp);
stm->output_device = move(tmp);
}
stm->has_dummy_output = true;
}
if (has_output(stm)) {
LOG("(%p) Setup render: device=%p", stm, stm->output_device_id.get());
LOG("(%p) Setup render: device=%p", stm, stm->output_device.get());
rv = setup_wasapi_stream_one_side(stm,
&stm->output_stream_params,
stm->output_device_id.get(),
stm->output_device.get(),
eRender,
__uuidof(IAudioRenderClient),
stm->output_client,
&stm->output_buffer_frame_count,
stm->refill_event,
stm->render_client,
&stm->output_mix_params,
stm->output_device);
&stm->output_mix_params);
if (rv != CUBEB_OK) {
LOG("Failure to open the output side.");
return rv;
@ -2318,7 +2213,7 @@ int setup_wasapi_stream(cubeb_stream * stm)
target_sample_rate,
stm->data_callback,
stm->user_ptr,
stm->voice ? CUBEB_RESAMPLER_QUALITY_VOIP : CUBEB_RESAMPLER_QUALITY_DESKTOP));
CUBEB_RESAMPLER_QUALITY_DESKTOP));
if (!stm->resampler) {
LOG("Could not get a resampler");
return CUBEB_ERROR;
@ -2405,31 +2300,21 @@ wasapi_stream_init(cubeb * context, cubeb_stream ** stream,
stm->data_callback = data_callback;
stm->state_callback = state_callback;
stm->user_ptr = user_ptr;
stm->role = eConsole;
stm->input_bluetooth_handsfree = false;
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator),
NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(stm->device_enumerator.receive()));
if (FAILED(hr)) {
LOG("Could not get device enumerator: %lx", hr);
return hr;
if (stm->output_stream_params.prefs & CUBEB_STREAM_PREF_VOICE ||
stm->input_stream_params.prefs & CUBEB_STREAM_PREF_VOICE) {
stm->role = eCommunications;
} else {
stm->role = eConsole;
}
if (input_stream_params) {
stm->input_stream_params = *input_stream_params;
stm->input_device_id = utf8_to_wstr(reinterpret_cast<char const *>(input_device));
stm->input_device = utf8_to_wstr(reinterpret_cast<char const *>(input_device));
}
if (output_stream_params) {
stm->output_stream_params = *output_stream_params;
stm->output_device_id = utf8_to_wstr(reinterpret_cast<char const *>(output_device));
}
if (stm->output_stream_params.prefs & CUBEB_STREAM_PREF_VOICE ||
stm->input_stream_params.prefs & CUBEB_STREAM_PREF_VOICE) {
stm->voice = true;
} else {
stm->voice = false;
stm->output_device = utf8_to_wstr(reinterpret_cast<char const *>(output_device));
}
switch (output_stream_params ? output_stream_params->format : input_stream_params->format) {
@ -2509,9 +2394,6 @@ void close_wasapi_stream(cubeb_stream * stm)
stm->input_client = nullptr;
stm->capture_client = nullptr;
stm->output_device = nullptr;
stm->input_device = nullptr;
stm->audio_stream_volume = nullptr;
stm->audio_clock = nullptr;
@ -2549,8 +2431,6 @@ void wasapi_stream_destroy(cubeb_stream * stm)
// must be destroyed in wasapi_stream_destroy.
stm->linear_input_buffer.reset();
stm->device_enumerator = nullptr;
{
auto_lock lock(stm->stream_reset_lock);
close_wasapi_stream(stm);
@ -2749,27 +2629,15 @@ int wasapi_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
/* The GetStreamLatency method only works if the
AudioClient has been initialized. */
if (!stm->output_client) {
LOG("get_latency: No output_client.");
return CUBEB_ERROR;
}
REFERENCE_TIME latency_hns;
HRESULT hr = stm->output_client->GetStreamLatency(&latency_hns);
if (FAILED(hr)) {
LOG("GetStreamLatency failed %lx.", hr);
return CUBEB_ERROR;
}
// This happens on windows 10: no error, but always 0 for latency.
if (latency_hns == 0) {
LOG("GetStreamLatency returned 0, using workaround.");
double delay_s = current_stream_delay(stm);
// convert to sample-frames
*latency = delay_s * stm->output_stream_params.rate;
} else {
*latency = hns_to_frames(stm, latency_hns);
}
LOG("Output latency %u frames.", *latency);
*latency = hns_to_frames(stm, latency_hns);
return CUBEB_OK;
}
@ -2780,14 +2648,12 @@ int wasapi_stream_get_input_latency(cubeb_stream * stm, uint32_t * latency)
XASSERT(stm && latency);
if (!has_input(stm)) {
LOG("Input latency queried on an output-only stream.");
return CUBEB_ERROR;
}
auto_lock lock(stm->stream_reset_lock);
if (stm->input_latency_hns == LATENCY_NOT_AVAILABLE_YET) {
LOG("Input latency not available yet.");
return CUBEB_ERROR;
}
@ -2879,8 +2745,6 @@ wasapi_is_default_device(EDataFlow flow, ERole role, LPCWSTR device_id,
return ret;
}
/* `ret` must be deallocated with `wasapi_destroy_device`, iff the return value
* of this function is `CUBEB_OK`. */
int
wasapi_create_device(cubeb * ctx, cubeb_device_info& ret, IMMDeviceEnumerator * enumerator, IMMDevice * dev)
{
@ -2893,10 +2757,6 @@ wasapi_create_device(cubeb * ctx, cubeb_device_info& ret, IMMDeviceEnumerator *
REFERENCE_TIME def_period, min_period;
HRESULT hr;
// zero-out to be able to safely delete the pointers to friendly_name and
// group_id at all time in this function.
PodZero(&ret, 1);
struct prop_variant : public PROPVARIANT {
prop_variant() { PropVariantInit(this); }
~prop_variant() { PropVariantClear(this); }
@ -2905,97 +2765,57 @@ wasapi_create_device(cubeb * ctx, cubeb_device_info& ret, IMMDeviceEnumerator *
};
hr = dev->QueryInterface(IID_PPV_ARGS(endpoint.receive()));
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
hr = endpoint->GetDataFlow(&flow);
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
wchar_t * tmp = nullptr;
hr = dev->GetId(&tmp);
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
com_heap_ptr<wchar_t> device_id(tmp);
char const * device_id_intern = intern_device_id(ctx, device_id.get());
if (!device_id_intern) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
hr = dev->OpenPropertyStore(STGM_READ, propstore.receive());
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
hr = dev->GetState(&state);
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
ret.device_id = device_id_intern;
ret.devid = reinterpret_cast<cubeb_devid>(ret.device_id);
prop_variant namevar;
hr = propstore->GetValue(PKEY_Device_FriendlyName, &namevar);
if (SUCCEEDED(hr) && namevar.vt == VT_LPWSTR) {
if (SUCCEEDED(hr))
ret.friendly_name = wstr_to_utf8(namevar.pwszVal);
}
if (!ret.friendly_name) {
// This is not fatal, but a valid string is expected in all cases.
char* empty = new char[1];
empty[0] = '\0';
ret.friendly_name = empty;
}
devnode = wasapi_get_device_node(enumerator, dev);
if (devnode) {
com_ptr<IPropertyStore> ps;
hr = devnode->OpenPropertyStore(STGM_READ, ps.receive());
if (FAILED(hr)) {
wasapi_destroy_device(&ret);
return CUBEB_ERROR;
}
if (FAILED(hr)) return CUBEB_ERROR;
prop_variant instancevar;
hr = ps->GetValue(PKEY_Device_InstanceId, &instancevar);
if (SUCCEEDED(hr) && instancevar.vt == VT_LPWSTR) {
if (SUCCEEDED(hr)) {
ret.group_id = wstr_to_utf8(instancevar.pwszVal);
}
}
if (!ret.group_id) {
// This is not fatal, but a valid string is expected in all cases.
char* empty = new char[1];
empty[0] = '\0';
ret.group_id = empty;
}
ret.preferred = CUBEB_DEVICE_PREF_NONE;
if (wasapi_is_default_device(flow, eConsole, device_id.get(), enumerator)) {
if (wasapi_is_default_device(flow, eConsole, device_id.get(), enumerator))
ret.preferred = (cubeb_device_pref)(ret.preferred | CUBEB_DEVICE_PREF_MULTIMEDIA);
}
if (wasapi_is_default_device(flow, eCommunications, device_id.get(), enumerator)) {
if (wasapi_is_default_device(flow, eCommunications, device_id.get(), enumerator))
ret.preferred = (cubeb_device_pref)(ret.preferred | CUBEB_DEVICE_PREF_VOICE);
}
if (wasapi_is_default_device(flow, eConsole, device_id.get(), enumerator)) {
if (wasapi_is_default_device(flow, eConsole, device_id.get(), enumerator))
ret.preferred = (cubeb_device_pref)(ret.preferred | CUBEB_DEVICE_PREF_NOTIFICATION);
}
if (flow == eRender) {
ret.type = CUBEB_DEVICE_TYPE_OUTPUT;
} else if (flow == eCapture) {
ret.type = CUBEB_DEVICE_TYPE_INPUT;
}
if (flow == eRender) ret.type = CUBEB_DEVICE_TYPE_OUTPUT;
else if (flow == eCapture) ret.type = CUBEB_DEVICE_TYPE_INPUT;
switch (state) {
case DEVICE_STATE_ACTIVE:
ret.state = CUBEB_DEVICE_STATE_ENABLED;
@ -3038,18 +2858,9 @@ wasapi_create_device(cubeb * ctx, cubeb_device_info& ret, IMMDeviceEnumerator *
ret.latency_hi = 0;
}
XASSERT(ret.friendly_name && ret.group_id);
return CUBEB_OK;
}
void
wasapi_destroy_device(cubeb_device_info * device)
{
delete [] device->friendly_name;
delete [] device->group_id;
}
static int
wasapi_enumerate_devices(cubeb * context, cubeb_device_type type,
cubeb_device_collection * out)
@ -3113,7 +2924,8 @@ wasapi_device_collection_destroy(cubeb * /*ctx*/, cubeb_device_collection * coll
for (size_t n = 0; n < collection->count; n++) {
cubeb_device_info& dev = collection->device[n];
wasapi_destroy_device(&dev);
delete [] dev.friendly_name;
delete [] dev.group_id;
}
delete [] collection->device;
@ -3211,7 +3023,6 @@ cubeb_ops const wasapi_ops = {
/*.stream_get_latency =*/ wasapi_stream_get_latency,
/*.stream_get_input_latency =*/ wasapi_stream_get_input_latency,
/*.stream_set_volume =*/ wasapi_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ NULL,
/*.stream_device_destroy =*/ NULL,
/*.stream_register_device_changed_callback =*/ NULL,

Просмотреть файл

@ -1061,7 +1061,6 @@ static struct cubeb_ops const winmm_ops = {
/*.stream_get_latency = */ winmm_stream_get_latency,
/*.stream_get_input_latency = */ NULL,
/*.stream_set_volume =*/ winmm_stream_set_volume,
/*.stream_set_name =*/ NULL,
/*.stream_get_current_device =*/ NULL,
/*.stream_device_destroy =*/ NULL,
/*.stream_register_device_changed_callback=*/ NULL,

Просмотреть файл

@ -1061,21 +1061,3 @@ TEST(cubeb, passthrough_resampler_fill_input_left) {
ASSERT_EQ(input_frame_count, output_frame_count - 8);
}
TEST(cubeb, individual_methods) {
const uint32_t channels = 2;
const uint32_t sample_rate = 44100;
const uint32_t frames = 256;
delay_line<float> dl(10, channels, sample_rate);
uint32_t frames_needed1 = dl.input_needed_for_output(0);
ASSERT_EQ(frames_needed1, 0u);
cubeb_resampler_speex_one_way<float> one_way(channels, sample_rate, sample_rate, CUBEB_RESAMPLER_QUALITY_DEFAULT);
float buffer[channels * frames] = {0.0};
// Add all frames in the resampler's internal buffer.
one_way.input(buffer, frames);
// Ask for less than the existing frames, this would create a uint overlflow without the fix.
uint32_t frames_needed2 = one_way.input_needed_for_output(0);
ASSERT_EQ(frames_needed2, 0u);
}

Просмотреть файл

@ -227,9 +227,6 @@ TEST(cubeb, configure_stream)
r = cubeb_stream_set_volume(stream, 1.0f);
ASSERT_TRUE(r == 0 || r == CUBEB_ERROR_NOT_SUPPORTED);
r = cubeb_stream_set_name(stream, "test 2");
ASSERT_TRUE(r == 0 || r == CUBEB_ERROR_NOT_SUPPORTED);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
}
@ -642,65 +639,6 @@ TEST(cubeb, drain)
do_drain = 0;
}
TEST(cubeb, device_reset)
{
int r;
cubeb * ctx;
cubeb_stream * stream;
cubeb_stream_params params;
uint64_t position;
r = common_init(&ctx, "test_sanity");
ASSERT_EQ(r, CUBEB_OK);
ASSERT_NE(ctx, nullptr);
if (strcmp(cubeb_get_backend_id(ctx), "wasapi")) {
// cubeb_stream_reset_default_device is only useful and implemented in the
// WASAPI backend.
return;
}
params.format = STREAM_FORMAT;
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
params.prefs = CUBEB_STREAM_PREF_NONE;
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
ASSERT_EQ(r, CUBEB_OK);
ASSERT_NE(stream, nullptr);
r = cubeb_stream_start(stream);
ASSERT_EQ(r, CUBEB_OK);
uint32_t iterations = 5;
uint64_t previous_position = 0;
while (iterations--) {
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
ASSERT_GE(position, previous_position);
previous_position = position;
delay(100);
}
r = cubeb_stream_reset_default_device(stream);
ASSERT_EQ(r, CUBEB_OK);
iterations = 5;
while (iterations--) {
r = cubeb_stream_get_position(stream, &position);
ASSERT_EQ(r, CUBEB_OK);
ASSERT_GE(position, previous_position);
previous_position = position;
delay(100);
}
cubeb_stream_stop(stream);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
}
TEST(cubeb, DISABLED_eos_during_prefill)
{
// This test needs to be implemented.

Просмотреть файл

@ -57,8 +57,7 @@ public:
void set_latency_testing(bool on);
void set_latency_frames(uint32_t latency_frames);
uint64_t get_stream_position() const;
uint32_t get_stream_output_latency() const;
uint32_t get_stream_input_latency() const;
uint32_t get_stream_latency() const;
uint32_t get_max_channel_count() const;
long user_data_cb(cubeb_stream* stm, void* user, const void* input_buffer,
@ -195,7 +194,7 @@ uint64_t cubeb_client::get_stream_position() const {
return pos;
}
uint32_t cubeb_client::get_stream_output_latency() const {
uint32_t cubeb_client::get_stream_latency() const {
uint32_t latency = 0;
int rv = cubeb_stream_get_latency(stream, &latency);
if (rv != CUBEB_OK) {
@ -205,16 +204,6 @@ uint32_t cubeb_client::get_stream_output_latency() const {
return latency;
}
uint32_t cubeb_client::get_stream_input_latency() const {
uint32_t latency = 0;
int rv = cubeb_stream_get_input_latency(stream, &latency);
if (rv != CUBEB_OK) {
fprintf(stderr, "Could not get the latency of the input stream\n");
return 0;
}
return latency;
}
uint32_t cubeb_client::get_max_channel_count() const {
uint32_t channels = 0;
int rv = cubeb_get_max_channel_count(context, &channels);
@ -448,17 +437,8 @@ bool choose_action(cubeb_client& cl, operation_data * op, int c) {
fprintf(stderr, "max channel count (default output device): %u\n", channel_count);
} else if (c == 'f') {
uint64_t pos = cl.get_stream_position();
uint32_t latency;
fprintf(stderr, "stream position %" PRIu64 ".", pos);
if(op->pm == PLAYBACK || op->pm == DUPLEX) {
latency = cl.get_stream_output_latency();
fprintf(stderr, " (output latency %" PRIu32 ")", latency);
}
if(op->pm == RECORD || op->pm == DUPLEX) {
latency = cl.get_stream_input_latency();
fprintf(stderr, " (input latency %" PRIu32 ")", latency);
}
fprintf(stderr, "\n");
uint64_t latency = cl.get_stream_latency();
fprintf(stderr, "stream position %" PRIu64 " (latency %" PRIu64 ")\n", pos, latency);
} else if (c == 'i') {
op->collection_device_type = CUBEB_DEVICE_TYPE_INPUT;
fprintf(stderr, "collection device type changed to INPUT\n");

3
third_party/rust/cubeb-sys/src/stream.rs поставляемый
Просмотреть файл

@ -8,7 +8,7 @@ use channel::cubeb_channel_layout;
use device::cubeb_device;
use format::cubeb_sample_format;
use std::{fmt, mem};
use std::os::raw::{c_float, c_int, c_uint, c_void, c_char};
use std::os::raw::{c_float, c_int, c_uint, c_void};
cubeb_enum! {
pub enum cubeb_stream_prefs {
@ -68,7 +68,6 @@ extern "C" {
pub fn cubeb_stream_get_latency(stream: *mut cubeb_stream, latency: *mut c_uint) -> c_int;
pub fn cubeb_stream_get_input_latency(stream: *mut cubeb_stream, latency: *mut c_uint) -> c_int;
pub fn cubeb_stream_set_volume(stream: *mut cubeb_stream, volume: c_float) -> c_int;
pub fn cubeb_stream_set_name(stream: *mut cubeb_stream, name: *const c_char) -> c_int;
pub fn cubeb_stream_get_current_device(
stream: *mut cubeb_stream,
device: *mut *mut cubeb_device,

2
third_party/rust/cubeb/.cargo-checksum.json поставляемый
Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.lock":"5c6ff9f4925b4505337025ef175c6abeafd31a6d7f1035513bc1dad95bc980b4","Cargo.toml":"f98dcb39dea45c8a9b12a742dd8cd5e8385ee7da4c61cbd1411b8b840fba8dde","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"a5e1b79fc2b4addff1e442879ba3dbcb1cf5973e76b9a62d97dd0042597480db","examples/devices.rs":"ff5dcd588e7036165c4b4c20ec355d036e0ae90cf88b3b0f5cd86621fe2ce61d","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"72507f5338a2f520fef9e2eface0638afba4c0d9e87fde92a0aaade643ba1335","src/frame.rs":"ed1e8f4576022d0c23106bb115125e5a2967b0375a10d0c54bbe99f04a70cc3f","src/lib.rs":"98e9280890551ac9305f2f808e315b6aa6bcd5781b8e96a078787ded0ef91e2a","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"e23be3b691052001916f920ce9c1a0051bd097e39c9d34cbcb80ab8120265f45","src/stream.rs":"b3babf86252cd19cfbc98ffbc8f48bb033284f89db9cbdc46836611893356eff"},"package":"289952682b57343f3d852161d60f2a34a07c5fc39c113f155ab8aa3f471c917b"}
{"files":{"Cargo.lock":"8768f2709f7b520aa3bd0973a03333a1880eb65625af912514d1a26b712326fe","Cargo.toml":"28be23f743402b5e1b63a04246aeb186cdae205bf253617ef4bab42408ee1263","LICENSE":"8c044baa5d883274736eeece0b955249076c2697b826e576fce59496235b2cf5","README.md":"408c573ec240927cf5b9c036098e94e374ec41f71991415422586f450586b214","examples/common/mod.rs":"a5e1b79fc2b4addff1e442879ba3dbcb1cf5973e76b9a62d97dd0042597480db","examples/devices.rs":"ff5dcd588e7036165c4b4c20ec355d036e0ae90cf88b3b0f5cd86621fe2ce61d","examples/tone.rs":"8f5f9851b6d99f6f16c597fcb9312e3ef81769cbfb89341d2ea2522ca2e2214e","src/context.rs":"72507f5338a2f520fef9e2eface0638afba4c0d9e87fde92a0aaade643ba1335","src/frame.rs":"ed1e8f4576022d0c23106bb115125e5a2967b0375a10d0c54bbe99f04a70cc3f","src/lib.rs":"98e9280890551ac9305f2f808e315b6aa6bcd5781b8e96a078787ded0ef91e2a","src/log.rs":"704faeb31934dad6bc6d02e01caa85118754209bd559d30d03fcfa5cb8c1603c","src/sample.rs":"e23be3b691052001916f920ce9c1a0051bd097e39c9d34cbcb80ab8120265f45","src/stream.rs":"b3babf86252cd19cfbc98ffbc8f48bb033284f89db9cbdc46836611893356eff"},"package":"1116606d6045c9199f6a1e082f3cf63383ba6f9961339701faa6370dcf73135f"}

22
third_party/rust/cubeb/Cargo.lock сгенерированный поставляемый
Просмотреть файл

@ -8,31 +8,31 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "cc"
version = "1.0.60"
version = "1.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d"
[[package]]
name = "cmake"
version = "0.1.44"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb"
checksum = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62"
dependencies = [
"cc",
]
[[package]]
name = "cubeb"
version = "0.8.0"
version = "0.7.0"
dependencies = [
"cubeb-core",
]
[[package]]
name = "cubeb-core"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6197f805b94171473c3fa3059f688f00a2df1ee76259f9ea641401b58917df3"
checksum = "f7c55529b8f47926e4242e1fc01d31b08a5a4847967c5c250644e33fe237cfe5"
dependencies = [
"bitflags",
"cubeb-sys",
@ -40,9 +40,9 @@ dependencies = [
[[package]]
name = "cubeb-sys"
version = "0.8.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0f751f2aee031f589bcfd812b99cfbf923aa1612d34c9757608cf540f74ad9"
checksum = "dcbc562eb6ccf62abacf9e3eebce992e5c36b230ca313ebd7c2d7d0e99deae90"
dependencies = [
"cmake",
"pkg-config",
@ -50,6 +50,6 @@ dependencies = [
[[package]]
name = "pkg-config"
version = "0.3.18"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"

4
third_party/rust/cubeb/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package]
name = "cubeb"
version = "0.8.0"
version = "0.7.0"
authors = ["Dan Glastonbury <dglastonbury@mozilla.com>"]
description = "Bindings to libcubeb for interacting with system audio from rust.\n"
homepage = "https://github.com/djg/cubeb-rs"
@ -22,7 +22,7 @@ categories = ["api-bindings"]
license = "ISC"
repository = "https://github.com/djg/cubeb-rs"
[dependencies.cubeb-core]
version = "0.8.0"
version = "0.7.0"
[features]
gecko-in-tree = ["cubeb-core/gecko-in-tree"]

Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"86bb1c8ebc438416c3a1f71b41494f19a85f698860b8c12d4875c8247f9c3664","src/ffi_funcs.rs":"8e79fc30a6ae800efdd026a7f29808abf039491fedac3491e22e0b1399b5c06b","src/ffi_types.rs":"fd6ca280be7601ae1990d4d0626fa9c4c6c9c958040c29e651764d06386d15c1","src/lib.rs":"edb03c6d9bcddc69a688160ffda0b8bdb69f1f87ccbc3e3b005574c9d5484991"},"package":null}
{"files":{"Cargo.toml":"86bb1c8ebc438416c3a1f71b41494f19a85f698860b8c12d4875c8247f9c3664","src/ffi_funcs.rs":"0aae9bb21ead31098b38a2f64a0366b9e8b129dd250b5780deae9deb1a8a1499","src/ffi_types.rs":"fd6ca280be7601ae1990d4d0626fa9c4c6c9c958040c29e651764d06386d15c1","src/lib.rs":"edb03c6d9bcddc69a688160ffda0b8bdb69f1f87ccbc3e3b005574c9d5484991"},"package":null}

27
third_party/rust/pulse-ffi/src/ffi_funcs.rs поставляемый
Просмотреть файл

@ -154,11 +154,6 @@ mod static_fns {
offset: i64,
seek: pa_seek_mode_t)
-> c_int;
pub fn pa_stream_set_name(s: *mut pa_stream,
name: *const c_char,
cb: pa_stream_success_cb_t,
userdata: *mut c_void)
-> *mut pa_operation;
pub fn pa_sw_volume_from_linear(v: c_double) -> pa_volume_t;
pub fn pa_threaded_mainloop_free(m: *mut pa_threaded_mainloop);
pub fn pa_threaded_mainloop_get_api(m: *mut pa_threaded_mainloop) -> *mut pa_mainloop_api;
@ -644,13 +639,6 @@ mod dynamic_fns {
}
fp
};
PA_STREAM_SET_NAME = {
let fp = dlsym(h, cstr!("pa_stream_set_name"));
if fp.is_null() {
return None;
}
fp
};
PA_SW_VOLUME_FROM_LINEAR = {
let fp = dlsym(h, cstr!("pa_sw_volume_from_linear"));
if fp.is_null() {
@ -1356,21 +1344,6 @@ mod dynamic_fns {
-> c_int>(PA_STREAM_WRITE))(p, data, nbytes, free_cb, offset, seek)
}
static mut PA_STREAM_SET_NAME: *mut ::libc::c_void = 0 as *mut _;
#[inline]
pub unsafe fn pa_stream_set_name(s: *mut pa_stream,
name: *const c_char,
cb: pa_stream_success_cb_t,
userdata: *mut c_void)
-> *mut pa_operation {
(::std::mem::transmute::<_,
extern "C" fn(*mut pa_stream,
*const c_char,
pa_stream_success_cb_t,
*mut c_void)
-> *mut pa_operation>(PA_STREAM_SET_NAME))(s, name, cb, userdata)
}
static mut PA_SW_VOLUME_FROM_LINEAR: *mut ::libc::c_void = 0 as *mut _;
#[inline]
pub unsafe fn pa_sw_volume_from_linear(v: c_double) -> pa_volume_t {

2
third_party/rust/pulse/.cargo-checksum.json поставляемый
Просмотреть файл

@ -1 +1 @@
{"files":{"Cargo.toml":"961d0d5d82f0d128d23dd753ad89beccdefdc0bc830ff646c785ee87eed261db","src/context.rs":"5e43131c0a989336e149b5408e0b362c0ef8176854785f98191f86b75ef5d76a","src/error.rs":"7be0ad689b6519a5be3771c29a102ff394bdc5ee46502d418bced90268e912dd","src/lib.rs":"8636d18c55b7ccd8e79d45a8d12ea84ba94b7aeef8ac3975292c94a28ed4a2b1","src/mainloop_api.rs":"b4a6c7e1a507490157c5b4a25af367cf810e1ef64c7a96f71575a15674d9b649","src/operation.rs":"c0d3e28ef7db52d60b19f931fe7bb44271127009b2e82693da2b7e342e804022","src/proplist.rs":"65bfc2b90f31bc3969aef69eb3e26b34ac657a2149f1b6515791403d752f3fc5","src/stream.rs":"7205d53d3aa5de7473339e6baa02bd32998e6ae15f76e8aa94420449354ba570","src/threaded_mainloop.rs":"958181a46363ded3ac8e0d9c9d912587cb6f9f26ae6f190881014adbda2d3211","src/util.rs":"d971486fd828b8b9d81db61a21a77960ea34a99a59b96fceaf77c2b84ed2accc"},"package":null}
{"files":{"Cargo.toml":"961d0d5d82f0d128d23dd753ad89beccdefdc0bc830ff646c785ee87eed261db","src/context.rs":"5e43131c0a989336e149b5408e0b362c0ef8176854785f98191f86b75ef5d76a","src/error.rs":"7be0ad689b6519a5be3771c29a102ff394bdc5ee46502d418bced90268e912dd","src/lib.rs":"8636d18c55b7ccd8e79d45a8d12ea84ba94b7aeef8ac3975292c94a28ed4a2b1","src/mainloop_api.rs":"b4a6c7e1a507490157c5b4a25af367cf810e1ef64c7a96f71575a15674d9b649","src/operation.rs":"c0d3e28ef7db52d60b19f931fe7bb44271127009b2e82693da2b7e342e804022","src/proplist.rs":"65bfc2b90f31bc3969aef69eb3e26b34ac657a2149f1b6515791403d752f3fc5","src/stream.rs":"dd3d7b7ca4a4464b4da18d8640bc2bb640a8b06723775790477171b162e24095","src/threaded_mainloop.rs":"958181a46363ded3ac8e0d9c9d912587cb6f9f26ae6f190881014adbda2d3211","src/util.rs":"d971486fd828b8b9d81db61a21a77960ea34a99a59b96fceaf77c2b84ed2accc"},"package":null}

29
third_party/rust/pulse/src/stream.rs поставляемый
Просмотреть файл

@ -366,35 +366,6 @@ impl Stream {
&*ptr
}
}
pub fn set_name<CB>(&self, name: &CStr, _: CB, userdata: *mut c_void) -> Result<Operation>
where CB: Fn(&Stream, i32, *mut c_void)
{
assert_eq!(mem::size_of::<CB>(), 0);
// See: A note about `wrapped` functions
unsafe extern "C" fn wrapped<F>(s: *mut ffi::pa_stream, success: c_int, userdata: *mut c_void)
where F: Fn(&Stream, i32, *mut c_void)
{
let mut stm = stream::from_raw_ptr(s);
let cb = MaybeUninit::<F>::uninit();
let result = (*cb.as_ptr())(&mut stm, success, userdata);
forget(stm);
result
}
let r = unsafe { ffi::pa_stream_set_name(self.raw_mut(), name.as_ptr(), Some(wrapped::<CB>), userdata) };
if r.is_null() {
let err = if let Some(c) = self.get_context() {
c.errno()
} else {
ffi::PA_ERR_UNKNOWN
};
return Err(ErrorCode::from_error_code(err));
}
Ok(unsafe { operation::from_raw_ptr(r) })
}
}
#[doc(hidden)]

Просмотреть файл

@ -19,9 +19,9 @@ static_prefs = { path = "../../../../modules/libpref/init/static_prefs" }
profiler_helper = { path = "../../../../tools/profiler/rust-helper", optional = true }
mozurl = { path = "../../../../netwerk/base/mozurl" }
webrender_bindings = { path = "../../../../gfx/webrender_bindings", optional = true }
cubeb-coreaudio = { git = "https://github.com/ChunMinChang/cubeb-coreaudio-rs", rev = "b4f45e18a413abe0dc583406714407ce5ab8da97", optional = true }
cubeb-pulse = { git = "https://github.com/djg/cubeb-pulse-rs", rev="bf31534d08b2c16fb5e4c5834944ae3271efbd63", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.8", optional = true, features=["gecko-in-tree"] }
cubeb-coreaudio = { git = "https://github.com/ChunMinChang/cubeb-coreaudio-rs", rev = "08a2b75285732a2e1a389bc4ab02518c74a8a9c5", optional = true }
cubeb-pulse = { git = "https://github.com/djg/cubeb-pulse-rs", rev="3224e2dee65c0726c448484d4c3c43956b9330ec", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.7", optional = true, features=["gecko-in-tree"] }
encoding_glue = { path = "../../../../intl/encoding_glue" }
audioipc-client = { path = "../../../../media/audioipc/client", optional = true }
audioipc-server = { path = "../../../../media/audioipc/server", optional = true }