diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-02-04 20:31:52 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-02-04 20:31:52 +0100 |
commit | 43f4f5e8c8f0b14c2aa99c92cb6da2e8bcb72642 (patch) | |
tree | 2be280f5888cd792cc7ec4563c94b83b0fc4d9e9 /modules | |
parent | 69452253ee62ffbc58b4e17e84a66333641a67dc (diff) |
silk: updated aucodec API
Diffstat (limited to 'modules')
-rw-r--r-- | modules/silk/silk.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/silk/silk.c b/modules/silk/silk.c index dee296c..5bd9be5 100644 --- a/modules/silk/silk.c +++ b/modules/silk/silk.c @@ -4,6 +4,7 @@ * Copyright (C) 2010 - 2015 Creytiv.com */ #include <re.h> +#include <rem.h> #include <baresip.h> #include <silk/SKP_Silk_SDK_API.h> @@ -155,13 +156,15 @@ static int decode_update(struct audec_state **adsp, static int encode(struct auenc_state *st, uint8_t *buf, size_t *len, - const int16_t *sampv, size_t sampc) + int fmt, const void *sampv, size_t sampc) { int ret; int16_t nBytesOut; if (*len < MAX_BYTES_PER_FRAME) return ENOMEM; + if (fmt != AUFMT_S16LE) + return ENOTSUP; nBytesOut = *len; ret = SKP_Silk_SDK_Encode(st->enc, @@ -180,12 +183,15 @@ static int encode(struct auenc_state *st, uint8_t *buf, size_t *len, } -static int decode(struct audec_state *st, int16_t *sampv, +static int decode(struct audec_state *st, int fmt, void *sampv, size_t *sampc, const uint8_t *buf, size_t len) { int16_t nsamp = *sampc; int ret; + if (fmt != AUFMT_S16LE) + return ENOTSUP; + ret = SKP_Silk_SDK_Decode(st->dec, &st->decControl, 0, @@ -203,11 +209,14 @@ static int decode(struct audec_state *st, int16_t *sampv, } -static int plc(struct audec_state *st, int16_t *sampv, size_t *sampc) +static int plc(struct audec_state *st, int fmt, void *sampv, size_t *sampc) { int16_t nsamp = *sampc; int ret; + if (fmt != AUFMT_S16LE) + return ENOTSUP; + ret = SKP_Silk_SDK_Decode(st->dec, &st->decControl, 1, |