diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-01-06 16:20:25 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-01-06 16:20:25 +0100 |
commit | 96b9b6c0d94606b346bc67b5ce78bb20f2e28769 (patch) | |
tree | f4b56a89140cd593a913e1d39f2dc3822f63570c /include | |
parent | 4d6e0dfbad11b6d8f65d15ac5a1743cc8d2afc4d (diff) |
audio: sample format for audio encoder/decoder
config:
auenc_format s16 # s16, float
audec_format s16 # s16, float
modules: only opus module supports this for now.
default is s16
Diffstat (limited to 'include')
-rw-r--r-- | include/baresip.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/baresip.h b/include/baresip.h index 6887c5c..526354d 100644 --- a/include/baresip.h +++ b/include/baresip.h @@ -205,6 +205,8 @@ struct config_audio { bool level; /**< Enable audio level indication */ int src_fmt; /**< Audio source sample format */ int play_fmt; /**< Audio playback sample format */ + int enc_fmt; /**< Audio encoder sample format */ + int dec_fmt; /**< Audio decoder sample format */ }; #ifdef USE_VIDEO @@ -838,11 +840,17 @@ typedef int (auenc_update_h)(struct auenc_state **aesp, struct auenc_param *prm, const char *fmtp); typedef int (auenc_encode_h)(struct auenc_state *aes, uint8_t *buf, size_t *len, const int16_t *sampv, size_t sampc); +typedef int (auenc_encode_fmt_h)(struct auenc_state *aes, + uint8_t *buf, size_t *len, + int fmt, const void *sampv, size_t sampc); typedef int (audec_update_h)(struct audec_state **adsp, const struct aucodec *ac, const char *fmtp); typedef int (audec_decode_h)(struct audec_state *ads, int16_t *sampv, size_t *sampc, const uint8_t *buf, size_t len); +typedef int (audec_decode_fmt_h)(struct audec_state *ads, + int fmt, void *sampv, size_t *sampc, + const uint8_t *buf, size_t len); typedef int (audec_plc_h)(struct audec_state *ads, int16_t *sampv, size_t *sampc); @@ -861,6 +869,8 @@ struct aucodec { audec_plc_h *plch; sdp_fmtp_enc_h *fmtp_ench; sdp_fmtp_cmp_h *fmtp_cmph; + auenc_encode_fmt_h *encfmth; + audec_decode_fmt_h *decfmth; }; void aucodec_register(struct list *aucodecl, struct aucodec *ac); |