$treeview $search $mathjax
|
|
$projectbrief
|
$searchbox |
00001 /* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited 00002 Written by Jean-Marc Valin and Koen Vos */ 00003 /* 00004 Redistribution and use in source and binary forms, with or without 00005 modification, are permitted provided that the following conditions 00006 are met: 00007 00008 - Redistributions of source code must retain the above copyright 00009 notice, this list of conditions and the following disclaimer. 00010 00011 - Redistributions in binary form must reproduce the above copyright 00012 notice, this list of conditions and the following disclaimer in the 00013 documentation and/or other materials provided with the distribution. 00014 00015 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00016 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00017 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00018 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 00019 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00020 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00021 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00022 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00023 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00024 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00033 #ifndef OPUS_H 00034 #define OPUS_H 00035 00036 #include "opus_types.h" 00037 #include "opus_defines.h" 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00162 typedef struct OpusEncoder OpusEncoder; 00163 00164 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels); 00165 00199 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create( 00200 opus_int32 Fs, 00201 int channels, 00202 int application, 00203 int *error 00204 ); 00205 00217 OPUS_EXPORT int opus_encoder_init( 00218 OpusEncoder *st, 00219 opus_int32 Fs, 00220 int channels, 00221 int application 00222 ) OPUS_ARG_NONNULL(1); 00223 00236 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode( 00237 OpusEncoder *st, 00238 const opus_int16 *pcm, 00239 int frame_size, 00240 unsigned char *data, 00241 opus_int32 max_data_bytes 00242 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); 00243 00261 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_encode_float( 00262 OpusEncoder *st, 00263 const float *pcm, 00264 int frame_size, 00265 unsigned char *data, 00266 opus_int32 max_data_bytes 00267 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); 00268 00272 OPUS_EXPORT void opus_encoder_destroy(OpusEncoder *st); 00273 00280 OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NONNULL(1); 00339 typedef struct OpusDecoder OpusDecoder; 00340 00345 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_size(int channels); 00346 00360 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusDecoder *opus_decoder_create( 00361 opus_int32 Fs, 00362 int channels, 00363 int *error 00364 ); 00365 00375 OPUS_EXPORT int opus_decoder_init( 00376 OpusDecoder *st, 00377 opus_int32 Fs, 00378 int channels 00379 ) OPUS_ARG_NONNULL(1); 00380 00393 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode( 00394 OpusDecoder *st, 00395 const unsigned char *data, 00396 opus_int32 len, 00397 opus_int16 *pcm, 00398 int frame_size, 00399 int decode_fec 00400 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); 00401 00414 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decode_float( 00415 OpusDecoder *st, 00416 const unsigned char *data, 00417 opus_int32 len, 00418 float *pcm, 00419 int frame_size, 00420 int decode_fec 00421 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); 00422 00429 OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NONNULL(1); 00430 00434 OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); 00435 00449 OPUS_EXPORT int opus_packet_parse( 00450 const unsigned char *data, 00451 opus_int32 len, 00452 unsigned char *out_toc, 00453 const unsigned char *frames[48], 00454 short size[48], 00455 int *payload_offset 00456 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); 00457 00467 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_bandwidth(const unsigned char *data) OPUS_ARG_NONNULL(1); 00468 00475 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_samples_per_frame(const unsigned char *data, opus_int32 Fs) OPUS_ARG_NONNULL(1); 00476 00482 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_channels(const unsigned char *data) OPUS_ARG_NONNULL(1); 00483 00490 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1); 00491 00499 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); 00510 typedef struct OpusRepacketizer OpusRepacketizer; 00511 00512 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_size(void); 00513 00514 OPUS_EXPORT OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); 00515 00516 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusRepacketizer *opus_repacketizer_create(void); 00517 00518 OPUS_EXPORT void opus_repacketizer_destroy(OpusRepacketizer *rp); 00519 00520 OPUS_EXPORT int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, opus_int32 len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); 00521 00522 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); 00523 00524 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepacketizer *rp) OPUS_ARG_NONNULL(1); 00525 00526 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); 00527 00530 #ifdef __cplusplus 00531 } 00532 #endif 00533 00534 #endif /* OPUS_H */
For more information visit the Opus Website. |
©2012 $generatedby doxygen 1.7.1 |