|
|
|
@ -151,6 +151,18 @@ int opus_codec_encoder_application_set(opus_codec_encoder_t* enc, int applicatio |
|
|
|
return opus_encoder_ctl(enc->opus_enc, OPUS_SET_APPLICATION(application)); |
|
|
|
return opus_encoder_ctl(enc->opus_enc, OPUS_SET_APPLICATION(application)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int opus_codec_encoder_delay(opus_codec_encoder_t* enc, int* samples) { |
|
|
|
|
|
|
|
if (!enc || !samples) { DEBUG_ERROR(DEBUG_CATEGORY_CALL, "Opus delay invalid arguments"); return -1; } |
|
|
|
|
|
|
|
opus_int32 delay = 0; |
|
|
|
|
|
|
|
int result = opus_encoder_ctl(enc->opus_enc, OPUS_GET_LOOKAHEAD(&delay)); |
|
|
|
|
|
|
|
if (result != OPUS_OK || delay < 0 || delay > enc->sample_rate) { |
|
|
|
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "Opus delay query failed result=%d samples=%d", result, (int)delay); return -1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
*samples = delay; |
|
|
|
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_CALL, "Opus capture delay samples=%d rate=%d", (int)delay, enc->sample_rate); |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const char* opus_codec_strerror(int err) { |
|
|
|
const char* opus_codec_strerror(int err) { |
|
|
|
switch (err) { |
|
|
|
switch (err) { |
|
|
|
case OPUS_OK: return "OK"; |
|
|
|
case OPUS_OK: return "OK"; |
|
|
|
|