diff options
author | Timothy B. Terriberry <tterribe@xiph.org> | 2012-09-07 17:01:53 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-09-08 10:17:53 +0400 |
commit | a40689e6efccb13065a0e2db22c06208482dea6f (patch) | |
tree | d363df43e866bcf1059f05a6d4e05a34e12ab63a /include | |
parent | 84dd1cf9b701d45124770b795656a98aa53222dd (diff) |
Remove large multistream stack buffers.
This avoids allocating any buffers on the stack that depend on the
total channel count.
Such buffers could easily exceed the size of the
NONTHREADSAFE_PSEUDOSTACK.
It also checks the frame_size argument in both the encoder and
decoder to avoid allocating large stack buffers for opus_encode()
calls that would fail anyway or opus_decode() calls that would
never use all that space anyway.
Diffstat (limited to 'include')
-rw-r--r-- | include/opus_defines.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/opus_defines.h b/include/opus_defines.h index d86fbccf..830d225f 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -111,7 +111,8 @@ extern "C" { #endif /** These are the actual Encoder CTL ID numbers. - * They should not be used directly by applications. */ + * They should not be used directly by applications. + * In general, SETs should be even and GETs should be odd.*/ #define OPUS_SET_APPLICATION_REQUEST 4000 #define OPUS_GET_APPLICATION_REQUEST 4001 #define OPUS_SET_BITRATE_REQUEST 4002 @@ -138,6 +139,7 @@ extern "C" { #define OPUS_GET_SIGNAL_REQUEST 4025 #define OPUS_GET_LOOKAHEAD_REQUEST 4027 /* #define OPUS_RESET_STATE 4028 */ +#define OPUS_GET_SAMPLE_RATE_REQUEST 4029 #define OPUS_GET_FINAL_RANGE_REQUEST 4031 #define OPUS_GET_PITCH_REQUEST 4033 #define OPUS_SET_GAIN_REQUEST 4034 @@ -422,6 +424,14 @@ extern "C" { * @hideinitializer */ #define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x) +/** Gets the sampling rate the encoder or decoder was initialized with. + * This simply returns the <code>Fs</code> value passed to opus_encoder_init() + * or opus_decoder_init(). + * @param[out] x <tt>opus_int32 *</tt>: Sampling rate of encoder or decoder. + * @hideinitializer + */ +#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) + /** Gets the total samples of delay added by the entire codec. * This can be queried by the encoder and then the provided number of samples can be * skipped on from the start of the decoder's output to provide time aligned input |