Bug 1388229 - Update libcubeb to revision d59010139. r=kamidphish

This commit is contained in:
Matthew Gregan 2017-08-10 13:00:07 +12:00
Родитель 62b297a9cc
Коммит b359c3ce6d
7 изменённых файлов: 7 добавлений и 121 удалений

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

@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system.
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
The git commit ID used was 0e10388459fe1e252c075e4a1fab7a9363dc13a1 (2017-08-03 17:58:06 +1200)
The git commit ID used was d59010398cee559349ba8f8363a7250b5279aa69 (2017-08-07 22:45:24 +1200)

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

@ -35,9 +35,6 @@ TEST(cubeb, latency)
preferred_rate,
max_channels,
CUBEB_LAYOUT_UNDEFINED
#if defined(__ANDROID__)
, CUBEB_STREAM_TYPE_MUSIC
#endif
};
r = cubeb_get_min_latency(ctx, &params, &latency_frames);
ASSERT_TRUE(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);

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

@ -115,9 +115,6 @@ downmix_test(float const * data, cubeb_channel_layout in_layout, cubeb_channel_l
STREAM_FREQUENCY,
layout_infos[in_layout].channels,
in_layout
#if defined(__ANDROID__)
, CUBEB_STREAM_TYPE_MUSIC
#endif
};
cubeb_stream_params out_params = {
@ -128,9 +125,6 @@ downmix_test(float const * data, cubeb_channel_layout in_layout, cubeb_channel_l
(out_layout == CUBEB_LAYOUT_UNDEFINED) ?
layout_infos[in_layout].channels : layout_infos[out_layout].channels,
out_layout
#if defined(__ANDROID__)
, CUBEB_STREAM_TYPE_MUSIC
#endif
};
if (!cubeb_should_downmix(&in_params, &out_params)) {

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

@ -125,9 +125,6 @@ TEST(cubeb, context_variables)
params.format = STREAM_FORMAT;
params.rate = STREAM_RATE;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_get_min_latency(ctx, &params, &value);
ASSERT_TRUE(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);
if (r == CUBEB_OK) {
@ -163,9 +160,6 @@ TEST(cubeb, init_destroy_stream)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
@ -192,9 +186,6 @@ TEST(cubeb, init_destroy_multiple_streams)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
for (i = 0; i < ARRAY_LENGTH(stream); ++i) {
r = cubeb_stream_init(ctx, &stream[i], "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
@ -225,9 +216,6 @@ TEST(cubeb, configure_stream)
params.rate = STREAM_RATE;
params.channels = 2; // panning
params.layout = CUBEB_LAYOUT_STEREO;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
@ -259,9 +247,6 @@ TEST(cubeb, configure_stream_undefined_layout)
params.rate = STREAM_RATE;
params.channels = 2; // panning
params.layout = CUBEB_LAYOUT_UNDEFINED;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
@ -297,9 +282,6 @@ test_init_start_stop_destroy_multiple_streams(int early, int delay_ms)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
for (i = 0; i < ARRAY_LENGTH(stream); ++i) {
r = cubeb_stream_init(ctx, &stream[i], "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
@ -384,9 +366,6 @@ TEST(cubeb, init_destroy_multiple_contexts_and_streams)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
for (i = 0; i < ARRAY_LENGTH(ctx); ++i) {
r = common_init(&ctx[i], "test_sanity");
@ -425,9 +404,6 @@ TEST(cubeb, basic_stream_operations)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
@ -476,9 +452,6 @@ TEST(cubeb, stream_position)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
@ -612,9 +585,6 @@ TEST(cubeb, drain)
params.rate = STREAM_RATE;
params.channels = STREAM_CHANNELS;
params.layout = STREAM_LAYOUT;
#if defined(__ANDROID__)
params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
#endif
r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
test_drain_data_callback, test_drain_state_callback, &dummy);

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

@ -144,28 +144,6 @@ typedef enum {
#endif
} cubeb_sample_format;
#if defined(__ANDROID__)
/**
* This maps to the underlying stream types on supported platforms, e.g.
* Android.
*/
typedef enum {
CUBEB_STREAM_TYPE_VOICE_CALL = 0,
CUBEB_STREAM_TYPE_SYSTEM = 1,
CUBEB_STREAM_TYPE_RING = 2,
CUBEB_STREAM_TYPE_MUSIC = 3,
CUBEB_STREAM_TYPE_ALARM = 4,
CUBEB_STREAM_TYPE_NOTIFICATION = 5,
CUBEB_STREAM_TYPE_BLUETOOTH_SCO = 6,
CUBEB_STREAM_TYPE_SYSTEM_ENFORCED = 7,
CUBEB_STREAM_TYPE_DTMF = 8,
CUBEB_STREAM_TYPE_TTS = 9,
CUBEB_STREAM_TYPE_FM = 10,
CUBEB_STREAM_TYPE_MAX
} cubeb_stream_type;
#endif
/** An opaque handle used to refer a particular input or output device
* across calls. */
typedef void const * cubeb_devid;
@ -242,9 +220,6 @@ typedef struct {
uint32_t rate; /**< Requested sample rate. Valid range is [1000, 192000]. */
uint32_t channels; /**< Requested channel count. Valid range is [1, 8]. */
cubeb_channel_layout layout; /**< Requested channel layout. This must be consistent with the provided channels. */
#if defined(__ANDROID__)
cubeb_stream_type stream_type; /**< Used to map Android audio stream types */
#endif
} cubeb_stream_params;
/** Audio device description */

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

@ -145,9 +145,9 @@ audiotrack_get_min_frame_count(cubeb * ctx, cubeb_stream_params * params, int *
status_t status;
/* Recent Android have a getMinFrameCount method. */
if (!audiotrack_version_is_gingerbread(ctx)) {
status = ctx->klass.get_min_frame_count(min_frame_count, params->stream_type, params->rate);
status = ctx->klass.get_min_frame_count(min_frame_count, AUDIO_STREAM_TYPE_MUSIC, params->rate);
} else {
status = ctx->klass.get_min_frame_count_gingerbread(min_frame_count, params->stream_type, params->rate);
status = ctx->klass.get_min_frame_count_gingerbread(min_frame_count, AUDIO_STREAM_TYPE_MUSIC, params->rate);
}
if (status != 0) {
ALOG("error getting the min frame count");
@ -325,7 +325,7 @@ audiotrack_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_
channels = stm->params.channels == 2 ? AUDIO_CHANNEL_OUT_STEREO_ICS : AUDIO_CHANNEL_OUT_MONO_ICS;
}
ctx->klass.ctor(stm->instance, stm->params.stream_type, stm->params.rate,
ctx->klass.ctor(stm->instance, AUDIO_STREAM_TYPE_MUSIC, stm->params.rate,
AUDIO_FORMAT_PCM_16_BIT, channels, min_frame_count, 0,
audiotrack_refill, stm, 0, 0);

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

@ -105,7 +105,6 @@ struct cubeb_stream {
/* Flag indicating draining. Synchronized
* by stream::mutex lock. */
int draining;
cubeb_stream_type stream_type;
/* Flags to determine in/out.*/
uint32_t input_enabled;
uint32_t output_enabled;
@ -599,31 +598,6 @@ player_fullduplex_callback(SLBufferQueueItf caller, void * user_ptr)
TIMESTAMP("EXIT");
}
#if defined(__ANDROID__)
static SLuint32
convert_stream_type_to_sl_stream(cubeb_stream_type stream_type)
{
switch(stream_type) {
case CUBEB_STREAM_TYPE_SYSTEM:
return SL_ANDROID_STREAM_SYSTEM;
case CUBEB_STREAM_TYPE_MUSIC:
return SL_ANDROID_STREAM_MEDIA;
case CUBEB_STREAM_TYPE_NOTIFICATION:
return SL_ANDROID_STREAM_NOTIFICATION;
case CUBEB_STREAM_TYPE_ALARM:
return SL_ANDROID_STREAM_ALARM;
case CUBEB_STREAM_TYPE_VOICE_CALL:
return SL_ANDROID_STREAM_VOICE;
case CUBEB_STREAM_TYPE_RING:
return SL_ANDROID_STREAM_RING;
case CUBEB_STREAM_TYPE_SYSTEM_ENFORCED:
return SL_ANDROID_STREAM_SYSTEM_ENFORCED;
default:
return 0xFFFFFFFF;
}
}
#endif
static void opensl_destroy(cubeb * ctx);
#if defined(__ANDROID__)
@ -912,7 +886,7 @@ opensl_get_min_latency(cubeb * ctx, cubeb_stream_params params, uint32_t * laten
if (get_primary_output_frame_count) {
primary_buffer_size = get_primary_output_frame_count();
} else {
if (get_output_frame_count(&primary_buffer_size, params.stream_type) != 0) {
if (get_output_frame_count(&primary_buffer_size, AUDIO_STREAM_TYPE_MUSIC) != 0) {
return CUBEB_ERROR;
}
}
@ -1140,7 +1114,6 @@ opensl_configure_playback(cubeb_stream * stm, cubeb_stream_params * params) {
assert(params);
stm->inputrate = params->rate;
stm->stream_type = params->stream_type;
stm->framesize = params->channels * sizeof(int16_t);
stm->lastPosition = -1;
stm->lastPositionTimeStamp = 0;
@ -1241,29 +1214,6 @@ opensl_configure_playback(cubeb_stream * stm, cubeb_stream_params * params) {
assert(stm->queuebuf[i]);
}
#if defined(__ANDROID__)
SLuint32 stream_type = convert_stream_type_to_sl_stream(params->stream_type);
if (stream_type != 0xFFFFFFFF) {
SLAndroidConfigurationItf playerConfig;
res = (*stm->playerObj)->GetInterface(stm->playerObj,
stm->context->SL_IID_ANDROIDCONFIGURATION,
&playerConfig);
if (res != SL_RESULT_SUCCESS) {
LOG("Failed to get android configuration interface. Error code: %lu", res);
return CUBEB_ERROR;
}
res = (*playerConfig)->SetConfiguration(playerConfig,
SL_ANDROID_KEY_STREAM_TYPE,
&stream_type,
sizeof(SLint32));
if (res != SL_RESULT_SUCCESS) {
LOG("Failed to set android configuration interface. Error code: %lu", res);
return CUBEB_ERROR;
}
}
#endif
res = (*stm->playerObj)->Realize(stm->playerObj, SL_BOOLEAN_FALSE);
if (res != SL_RESULT_SUCCESS) {
LOG("Failed to realize player object. Error code: %lu", res);
@ -1667,7 +1617,7 @@ opensl_stream_get_position(cubeb_stream * stm, uint64_t * position)
samplerate = stm->inputrate;
r = stm->context->get_output_latency(&mixer_latency, stm->stream_type);
r = stm->context->get_output_latency(&mixer_latency, AUDIO_STREAM_TYPE_MUSIC);
if (r) {
return CUBEB_ERROR;
}
@ -1703,7 +1653,7 @@ opensl_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
uint32_t mixer_latency; // The latency returned by AudioFlinger is in ms.
/* audio_stream_type_t is an int, so this is okay. */
r = stm->context->get_output_latency(&mixer_latency, stm->stream_type);
r = stm->context->get_output_latency(&mixer_latency, AUDIO_STREAM_TYPE_MUSIC);
if (r) {
return CUBEB_ERROR;
}