[][src]Crate opus_sys2

Structs

OpusDecoder
OpusEncoder
OpusRepacketizer
__lc_time_data
lconv
localeinfo_struct
tagLC_ID
threadlocaleinfostruct
threadlocaleinfostruct__bindgen_ty_1
threadmbcinfostruct

Constants

INT8_MIN
INT8_MAX
INT16_MIN
INT16_MAX
INT32_MIN
INT32_MAX
INT64_MIN
INT64_MAX
INTMAX_MAX
INTMAX_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST8_MIN
INT_FAST8_MAX
INT_FAST16_MIN
INT_FAST16_MAX
INT_FAST32_MIN
INT_FAST32_MAX
INT_FAST64_MIN
INT_FAST64_MAX
INT_LEAST8_MIN
INT_LEAST8_MAX
INT_LEAST16_MIN
INT_LEAST16_MAX
INT_LEAST32_MIN
INT_LEAST32_MAX
INT_LEAST64_MIN
INT_LEAST64_MAX
MINGW_HAS_DDK_H
MINGW_HAS_SECURE_API
OPUS_ALLOC_FAIL
OPUS_APPLICATION_AUDIO
OPUS_APPLICATION_RESTRICTED_LOWDELAY
OPUS_APPLICATION_VOIP
OPUS_AUTO
OPUS_BAD_ARG
OPUS_BANDWIDTH_FULLBAND
OPUS_BANDWIDTH_MEDIUMBAND
OPUS_BANDWIDTH_NARROWBAND
OPUS_BANDWIDTH_SUPERWIDEBAND
OPUS_BANDWIDTH_WIDEBAND
OPUS_BITRATE_MAX
OPUS_BUFFER_TOO_SMALL
OPUS_FRAMESIZE_5_MS
OPUS_FRAMESIZE_10_MS
OPUS_FRAMESIZE_20_MS
OPUS_FRAMESIZE_40_MS
OPUS_FRAMESIZE_60_MS
OPUS_FRAMESIZE_80_MS
OPUS_FRAMESIZE_100_MS
OPUS_FRAMESIZE_120_MS
OPUS_FRAMESIZE_2_5_MS
OPUS_FRAMESIZE_ARG
OPUS_GET_APPLICATION_REQUEST
OPUS_GET_BANDWIDTH_REQUEST
OPUS_GET_BITRATE_REQUEST
OPUS_GET_COMPLEXITY_REQUEST
OPUS_GET_DTX_REQUEST
OPUS_GET_EXPERT_FRAME_DURATION_REQUEST
OPUS_GET_FINAL_RANGE_REQUEST
OPUS_GET_FORCE_CHANNELS_REQUEST
OPUS_GET_GAIN_REQUEST
OPUS_GET_INBAND_FEC_REQUEST
OPUS_GET_IN_DTX_REQUEST
OPUS_GET_LAST_PACKET_DURATION_REQUEST
OPUS_GET_LOOKAHEAD_REQUEST
OPUS_GET_LSB_DEPTH_REQUEST
OPUS_GET_MAX_BANDWIDTH_REQUEST
OPUS_GET_PACKET_LOSS_PERC_REQUEST
OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST
OPUS_GET_PITCH_REQUEST
OPUS_GET_PREDICTION_DISABLED_REQUEST
OPUS_GET_SAMPLE_RATE_REQUEST
OPUS_GET_SIGNAL_REQUEST
OPUS_GET_VBR_CONSTRAINT_REQUEST
OPUS_GET_VBR_REQUEST
OPUS_INTERNAL_ERROR
OPUS_INVALID_PACKET
OPUS_INVALID_STATE
OPUS_OK
OPUS_RESET_STATE
OPUS_SET_APPLICATION_REQUEST
OPUS_SET_BANDWIDTH_REQUEST
OPUS_SET_BITRATE_REQUEST
OPUS_SET_COMPLEXITY_REQUEST
OPUS_SET_DTX_REQUEST
OPUS_SET_EXPERT_FRAME_DURATION_REQUEST
OPUS_SET_FORCE_CHANNELS_REQUEST
OPUS_SET_GAIN_REQUEST
OPUS_SET_INBAND_FEC_REQUEST
OPUS_SET_LSB_DEPTH_REQUEST
OPUS_SET_MAX_BANDWIDTH_REQUEST
OPUS_SET_PACKET_LOSS_PERC_REQUEST
OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
OPUS_SET_PREDICTION_DISABLED_REQUEST
OPUS_SET_SIGNAL_REQUEST
OPUS_SET_VBR_CONSTRAINT_REQUEST
OPUS_SET_VBR_REQUEST
OPUS_SIGNAL_MUSIC
OPUS_SIGNAL_VOICE
OPUS_UNIMPLEMENTED
PTRDIFF_MAX
PTRDIFF_MIN
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINT64_MAX
UINTMAX_MAX
UINTPTR_MAX
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_FAST64_MAX
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
UINT_LEAST64_MAX
USE___UUIDOF
WCHAR_MAX
WCHAR_MIN
WINT_MAX
WINT_MIN
_ARGMAX
_CRT_PACKING
_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES
_CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT
_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY
_M_AMD64
_M_X64
_SECURECRT_FILL_BUFFER_PATTERN
_WIN32_WINNT
__
__CRT__NO_INLINE
__GOT_SECURE_LIB__
__MINGW32_MAJOR_VERSION
__MINGW32_MINOR_VERSION
__MINGW64_VERSION_MAJOR
__MINGW64_VERSION_MINOR
__MINGW64_VERSION_BUGFIX
__MINGW64_VERSION_RC
__MINGW64_VERSION_STATE
__MINGW_FORTIFY_LEVEL
__MINGW_FORTIFY_VA_ARG
__MINGW_HAVE_ANSI_C99_PRINTF
__MINGW_HAVE_ANSI_C99_SCANF
__MINGW_HAVE_WIDE_C99_PRINTF
__MINGW_HAVE_WIDE_C99_SCANF
__MINGW_MSVC2005_DEPREC_STR
__MINGW_SEC_WARN_STR
__MINGW_USE_UNDERSCORE_PREFIX
__MSVCRT_VERSION__
__STDC_SECURE_LIB__
__USE_CRTIMP
__USE_MINGW_ANSI_STDIO

Functions

__debugbreak
__mingw_get_crt_info
opus_decode

Decode an Opus packet. @param [in] st OpusDecoder*: Decoder state @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss @param [in] len opus_int32: Number of bytes in payload* @param [out] pcm opus_int16*: Output signal (interleaved if 2 channels). length is frame_sizechannelssizeof(opus_int16) @param [in] frame_size Number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size must be a multiple of 2.5 ms. @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available, the frame is decoded as if it were lost. @returns Number of decoded samples or @ref opus_errorcodes

opus_decode_float

Decode an Opus packet with floating point output. @param [in] st OpusDecoder*: Decoder state @param [in] data char*: Input payload. Use a NULL pointer to indicate packet loss @param [in] len opus_int32: Number of bytes in payload @param [out] pcm float*: Output signal (interleaved if 2 channels). length is frame_sizechannelssizeof(float) @param [in] frame_size Number of samples per channel of available space in \a pcm. If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will not be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1), then frame_size needs to be exactly the duration of audio that is missing, otherwise the decoder will not be in the optimal state to decode the next incoming packet. For the PLC and FEC cases, frame_size must be a multiple of 2.5 ms. @param [in] decode_fec int: Flag (0 or 1) to request that any in-band forward error correction data be decoded. If no such data is available the frame is decoded as if it were lost. @returns Number of decoded samples or @ref opus_errorcodes

opus_decoder_create

Allocates and initializes a decoder state. @param [in] Fs opus_int32: Sample rate to decode at (Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param [in] channels int: Number of channels (1 or 2) to decode @param [out] error int*: #OPUS_OK Success or @ref opus_errorcodes

opus_decoder_ctl

Perform a CTL function on an Opus decoder.

opus_decoder_destroy

Frees an OpusDecoder allocated by opus_decoder_create(). @param[in] st OpusDecoder*: State to be freed.

opus_decoder_get_nb_samples

Gets the number of samples of an Opus packet. @param [in] dec OpusDecoder*: Decoder state @param [in] packet char*: Opus packet @param [in] len opus_int32: Length of packet @returns Number of samples @retval OPUS_BAD_ARG Insufficient data was passed to the function @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

opus_decoder_get_size

Gets the size of an OpusDecoder structure. @param [in] channels int: Number of channels. This must be 1 or 2. @returns The size in bytes.

opus_decoder_init

Initializes a previously allocated decoder state. The state must be at least the size returned by opus_decoder_get_size(). This is intended for applications which use their own allocator instead of malloc. @see opus_decoder_create,opus_decoder_get_size To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @param [in] st OpusDecoder*: Decoder state. @param [in] Fs opus_int32: Sampling rate to decode to (Hz). This must be one of 8000, 12000, 16000, 24000, or 48000. @param [in] channels int: Number of channels (1 or 2) to decode @retval #OPUS_OK Success or @ref opus_errorcodes

opus_encode

Encodes an Opus frame. @param [in] st OpusEncoder*: Encoder state @param [in] pcm opus_int16*: Input signal (interleaved if 2 channels). length is frame_sizechannelssizeof(opus_int16) @param [in] frame_size int: Number of samples per channel in the input signal. This must be an Opus frame size for the encoder's sampling rate. For example, at 48 kHz the permitted values are 120, 240, 480, 960, 1920, and 2880. Passing in a duration of less than 10 ms (480 samples at 48 kHz) will prevent the encoder from using the LPC or hybrid modes. @param [out] data unsigned char*: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes opus_int32: Size of the allocated memory for the output payload. This may be used to impose an upper limit on the instant bitrate, but should not be used as the only bitrate control. Use #OPUS_SET_BITRATE to control the bitrate. @returns The length of the encoded packet (in bytes) on success or a negative error code (see @ref opus_errorcodes) on failure.

opus_encode_float

Encodes an Opus frame from floating point input. @param [in] st OpusEncoder*: Encoder state @param [in] pcm float*: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0. Samples with a range beyond +/-1.0 are supported but will be clipped by decoders using the integer API and should only be used if it is known that the far end supports extended dynamic range. length is frame_sizechannelssizeof(float) @param [in] frame_size int: Number of samples per channel in the input signal. This must be an Opus frame size for the encoder's sampling rate. For example, at 48 kHz the permitted values are 120, 240, 480, 960, 1920, and 2880. Passing in a duration of less than 10 ms (480 samples at 48 kHz) will prevent the encoder from using the LPC or hybrid modes. @param [out] data unsigned char*: Output payload. This must contain storage for at least \a max_data_bytes. @param [in] max_data_bytes opus_int32: Size of the allocated memory for the output payload. This may be used to impose an upper limit on the instant bitrate, but should not be used as the only bitrate control. Use #OPUS_SET_BITRATE to control the bitrate. @returns The length of the encoded packet (in bytes) on success or a negative error code (see @ref opus_errorcodes) on failure.

opus_encoder_create

Allocates and initializes an encoder state. There are three coding modes:

opus_encoder_ctl

Perform a CTL function on an Opus encoder.

opus_encoder_destroy

Frees an OpusEncoder allocated by opus_encoder_create(). @param[in] st OpusEncoder*: State to be freed.

opus_encoder_get_size

Gets the size of an OpusEncoder structure. @param[in] channels int: Number of channels. This must be 1 or 2. @returns The size in bytes.

opus_encoder_init

Initializes a previously allocated encoder state The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). This is intended for applications which use their own allocator instead of malloc. @see opus_encoder_create(),opus_encoder_get_size() To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. @param [in] st OpusEncoder*: Encoder state @param [in] Fs opus_int32: Sampling rate of input signal (Hz) This must be one of 8000, 12000, 16000, 24000, or 48000. @param [in] channels int: Number of channels (1 or 2) in input signal @param [in] application int: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY) @retval #OPUS_OK Success or @ref opus_errorcodes

opus_get_version_string

Gets the libopus version string.

opus_multistream_packet_pad

Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). @param[in,out] data const unsigned char*: The buffer containing the packet to pad. @param len opus_int32: The size of the packet. This must be at least 1. @param new_len opus_int32: The desired size of the packet after padding. This must be at least 1. @param nb_streams opus_int32: The number of streams (not channels) in the packet. This must be at least as large as len. @returns an error code @retval #OPUS_OK \a on success. @retval #OPUS_BAD_ARG \a len was less than 1. @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

opus_multistream_packet_unpad

Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to minimize space usage. @param[in,out] data const unsigned char*: The buffer containing the packet to strip. @param len opus_int32: The size of the packet. This must be at least 1. @param nb_streams opus_int32: The number of streams (not channels) in the packet. This must be at least 1. @returns The new size of the output packet on success, or an error code on failure. @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

opus_packet_get_bandwidth

Gets the bandwidth of an Opus packet. @param [in] data char*: Opus packet @retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass) @retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass) @retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass) @retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass) @retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass) @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

opus_packet_get_nb_channels

Gets the number of channels from an Opus packet. @param [in] data char*: Opus packet @returns Number of channels @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

opus_packet_get_nb_frames

Gets the number of frames in an Opus packet. @param [in] packet char*: Opus packet @param [in] len opus_int32: Length of packet @returns Number of frames @retval OPUS_BAD_ARG Insufficient data was passed to the function @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

opus_packet_get_nb_samples

Gets the number of samples of an Opus packet. @param [in] packet char*: Opus packet @param [in] len opus_int32: Length of packet @param [in] Fs opus_int32: Sampling rate in Hz. This must be a multiple of 400, or inaccurate results will be returned. @returns Number of samples @retval OPUS_BAD_ARG Insufficient data was passed to the function @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type

opus_packet_get_samples_per_frame

Gets the number of samples per frame from an Opus packet. @param [in] data char*: Opus packet. This must contain at least one byte of data. @param [in] Fs opus_int32: Sampling rate in Hz. This must be a multiple of 400, or inaccurate results will be returned. @returns Number of samples per frame.

opus_packet_pad

Pads a given Opus packet to a larger size (possibly changing the TOC sequence). @param[in,out] data const unsigned char*: The buffer containing the packet to pad. @param len opus_int32: The size of the packet. This must be at least 1. @param new_len opus_int32: The desired size of the packet after padding. This must be at least as large as len. @returns an error code @retval #OPUS_OK \a on success. @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

opus_packet_parse

Parse an opus packet into one or more frames. Opus_decode will perform this operation internally so most applications do not need to use this function. This function does not copy the frames, the returned pointers are pointers into the input packet. @param [in] data char*: Opus packet to be parsed @param [in] len opus_int32: size of data @param [out] out_toc char*: TOC pointer @param [out] frames char*[48] encapsulated frames @param [out] size opus_int16[48] sizes of the encapsulated frames @param [out] payload_offset int*: returns the position of the payload within the packet (in bytes) @returns number of frames

opus_packet_unpad

Remove all padding from a given Opus packet and rewrite the TOC sequence to minimize space usage. @param[in,out] data const unsigned char*: The buffer containing the packet to strip. @param len opus_int32: The size of the packet. This must be at least 1. @returns The new size of the output packet on success, or an error code on failure. @retval #OPUS_BAD_ARG \a len was less than 1. @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.

opus_pcm_soft_clip

Applies soft-clipping to bring a float signal within the [-1,1] range. If the signal is already in that range, nothing is done. If there are values outside of [-1,1], then the signal is clipped as smoothly as possible to both fit in the range and avoid creating excessive distortion in the process. @param [in,out] pcm float*: Input PCM and modified PCM @param [in] frame_size int Number of samples per channel to process @param [in] channels int: Number of channels @param [in,out] softclip_mem float*: State memory for the soft clipping process (one float per channel, initialized to zero)

opus_repacketizer_cat

Add a packet to the current repacketizer state. This packet must match the configuration of any packets already submitted for repacketization since the last call to opus_repacketizer_init(). This means that it must have the same coding mode, audio bandwidth, frame size, and channel count. This can be checked in advance by examining the top 6 bits of the first byte of the packet, and ensuring they match the top 6 bits of the first byte of any previously submitted packet. The total duration of audio in the repacketizer state also must not exceed 120 ms, the maximum duration of a single packet, after adding this packet.

opus_repacketizer_create

Allocates memory and initializes the new repacketizer with opus_repacketizer_init().

opus_repacketizer_destroy

Frees an OpusRepacketizer allocated by opus_repacketizer_create(). @param[in] rp OpusRepacketizer*: State to be freed.

opus_repacketizer_get_nb_frames

Return the total number of frames contained in packet data submitted to the repacketizer state so far via opus_repacketizer_cat() since the last call to opus_repacketizer_init() or opus_repacketizer_create(). This defines the valid range of packets that can be extracted with opus_repacketizer_out_range() or opus_repacketizer_out(). @param rp OpusRepacketizer*: The repacketizer state containing the frames. @returns The total number of frames contained in the packet data submitted to the repacketizer state.

opus_repacketizer_get_size

Gets the size of an OpusRepacketizer structure. @returns The size in bytes.

opus_repacketizer_init

(Re)initializes a previously allocated repacketizer state. The state must be at least the size returned by opus_repacketizer_get_size(). This can be used for applications which use their own allocator instead of malloc(). It must also be called to reset the queue of packets waiting to be repacketized, which is necessary if the maximum packet duration of 120 ms is reached or if you wish to submit packets with a different Opus configuration (coding mode, audio bandwidth, frame size, or channel count). Failure to do so will prevent a new packet from being added with opus_repacketizer_cat(). @see opus_repacketizer_create @see opus_repacketizer_get_size @see opus_repacketizer_cat @param rp OpusRepacketizer*: The repacketizer state to (re)initialize. @returns A pointer to the same repacketizer state that was passed in.

opus_repacketizer_out

Construct a new packet from data previously submitted to the repacketizer state via opus_repacketizer_cat(). This is a convenience routine that returns all the data submitted so far in a single packet. It is equivalent to calling @code opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp), data, maxlen) @endcode @param rp OpusRepacketizer*: The repacketizer state from which to construct the new packet. @param[out] data const unsigned char*: The buffer in which to store the output packet. @param maxlen opus_int32: The maximum number of bytes to store in the output buffer. In order to guarantee success, this should be at least 1277opus_repacketizer_get_nb_frames(rp). However, 1opus_repacketizer_get_nb_frames(rp) plus the size of all packet data submitted to the repacketizer since the last call to opus_repacketizer_init() or opus_repacketizer_create() is also sufficient, and possibly much smaller. @returns The total size of the output packet on success, or an error code on failure. @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the complete output packet.

opus_repacketizer_out_range

Construct a new packet from data previously submitted to the repacketizer state via opus_repacketizer_cat(). @param rp OpusRepacketizer*: The repacketizer state from which to construct the new packet. @param begin int: The index of the first frame in the current repacketizer state to include in the output. @param end int: One past the index of the last frame in the current repacketizer state to include in the output. @param[out] data const unsigned char*: The buffer in which to store the output packet. @param maxlen opus_int32: The maximum number of bytes to store in the output buffer. In order to guarantee success, this should be at least 1276 for a single frame, or for multiple frames, 1277*(end-begin). However, 1*(end-begin) plus the size of all packet data submitted to the repacketizer since the last call to opus_repacketizer_init() or opus_repacketizer_create() is also sufficient, and possibly much smaller. @returns The total size of the output packet on success, or an error code on failure. @retval #OPUS_BAD_ARG [begin,end) was an invalid range of frames (begin < 0, begin >= end, or end > opus_repacketizer_get_nb_frames()). @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the complete output packet.

opus_strerror

Converts an opus error code into a human readable string.

Type Definitions

LC_ID
LPLC_ID
__builtin_va_list
__gnuc_va_list
__time32_t
__time64_t
_locale_t
_locale_tstruct
errno_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
opus_int8
opus_int16
opus_int32
opus_int64
opus_uint8
opus_uint16
opus_uint32
opus_uint64
pthreadlocinfo
pthreadmbcinfo
rsize_t
size_t
ssize_t
threadlocinfo
time_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
va_list
wchar_t
wctype_t
wint_t