00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #ifndef OPUS_MULTISTREAM_H
00034 #define OPUS_MULTISTREAM_H
00035
00036 #include "opus.h"
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00047 #define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr)))
00048 #define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr)))
00049
00055 #define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120
00056 #define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122
00057
00086 #define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y)
00087
00099 #define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y)
00100
00175 typedef struct OpusMSEncoder OpusMSEncoder;
00176
00183 typedef struct OpusMSDecoder OpusMSDecoder;
00184
00203 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size(
00204 int streams,
00205 int coupled_streams
00206 );
00207
00251 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create(
00252 opus_int32 Fs,
00253 int channels,
00254 int streams,
00255 int coupled_streams,
00256 const unsigned char *mapping,
00257 int application,
00258 int *error
00259 ) OPUS_ARG_NONNULL(5);
00260
00309 OPUS_EXPORT int opus_multistream_encoder_init(
00310 OpusMSEncoder *st,
00311 opus_int32 Fs,
00312 int channels,
00313 int streams,
00314 int coupled_streams,
00315 const unsigned char *mapping,
00316 int application
00317 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
00318
00349 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
00350 OpusMSEncoder *st,
00351 const opus_int16 *pcm,
00352 int frame_size,
00353 unsigned char *data,
00354 opus_int32 max_data_bytes
00355 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00356
00394 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float(
00395 OpusMSEncoder *st,
00396 const float *pcm,
00397 int frame_size,
00398 unsigned char *data,
00399 opus_int32 max_data_bytes
00400 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00401
00406 OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st);
00407
00420 OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1);
00421
00442 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size(
00443 int streams,
00444 int coupled_streams
00445 );
00446
00476 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create(
00477 opus_int32 Fs,
00478 int channels,
00479 int streams,
00480 int coupled_streams,
00481 const unsigned char *mapping,
00482 int *error
00483 ) OPUS_ARG_NONNULL(5);
00484
00519 OPUS_EXPORT int opus_multistream_decoder_init(
00520 OpusMSDecoder *st,
00521 opus_int32 Fs,
00522 int channels,
00523 int streams,
00524 int coupled_streams,
00525 const unsigned char *mapping
00526 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
00527
00557 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode(
00558 OpusMSDecoder *st,
00559 const unsigned char *data,
00560 opus_int32 len,
00561 opus_int16 *pcm,
00562 int frame_size,
00563 int decode_fec
00564 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00565
00595 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float(
00596 OpusMSDecoder *st,
00597 const unsigned char *data,
00598 opus_int32 len,
00599 float *pcm,
00600 int frame_size,
00601 int decode_fec
00602 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00603
00616 OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1);
00617
00622 OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st);
00623
00628 #ifdef __cplusplus
00629 }
00630 #endif
00631
00632 #endif