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
00042 typedef struct OpusMSEncoder OpusMSEncoder;
00043 typedef struct OpusMSDecoder OpusMSDecoder;
00044
00045 #define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr)))
00046 #define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr)))
00047
00048 #define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120
00049 #define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122
00050
00051 #define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y)
00052 #define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y)
00053
00057 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create(
00058 opus_int32 Fs,
00059 int channels,
00060 int streams,
00061 int coupled_streams,
00062 const unsigned char *mapping,
00063 int application,
00064 int *error
00065 ) OPUS_ARG_NONNULL(5);
00066
00068 OPUS_EXPORT int opus_multistream_encoder_init(
00069 OpusMSEncoder *st,
00070 opus_int32 Fs,
00071 int channels,
00072 int streams,
00073 int coupled_streams,
00074 const unsigned char *mapping,
00075 int application
00076 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
00077
00079 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
00080 OpusMSEncoder *st,
00081 const opus_int16 *pcm,
00082 int frame_size,
00083 unsigned char *data,
00084 opus_int32 max_data_bytes
00085 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00086
00088 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float(
00089 OpusMSEncoder *st,
00090 const float *pcm,
00091 int frame_size,
00092 unsigned char *data,
00093 opus_int32 max_data_bytes
00094 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
00095
00099 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size(
00100 int streams,
00101 int coupled_streams
00102 );
00103
00105 OPUS_EXPORT void opus_multistream_encoder_destroy(OpusMSEncoder *st);
00106
00108 OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) OPUS_ARG_NONNULL(1);
00109
00113 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create(
00114 opus_int32 Fs,
00115 int channels,
00116 int streams,
00117 int coupled_streams,
00118 const unsigned char *mapping,
00119 int *error
00120 ) OPUS_ARG_NONNULL(5);
00121
00123 OPUS_EXPORT int opus_multistream_decoder_init(
00124 OpusMSDecoder *st,
00125 opus_int32 Fs,
00126 int channels,
00127 int streams,
00128 int coupled_streams,
00129 const unsigned char *mapping
00130 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
00131
00133 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode(
00134 OpusMSDecoder *st,
00135 const unsigned char *data,
00136 opus_int32 len,
00137 opus_int16 *pcm,
00138 int frame_size,
00139 int decode_fec
00141 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00142
00144 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode_float(
00145 OpusMSDecoder *st,
00146 const unsigned char *data,
00147 opus_int32 len,
00148 float *pcm,
00149 int frame_size,
00150 int decode_fec
00152 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
00153
00157 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size(
00158 int streams,
00159 int coupled_streams
00160 );
00161
00163 OPUS_EXPORT int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request, ...) OPUS_ARG_NONNULL(1);
00164
00166 OPUS_EXPORT void opus_multistream_decoder_destroy(OpusMSDecoder *st);
00167
00168 #ifdef __cplusplus
00169 }
00170 #endif
00171
00172 #endif