OLD | NEW |
1 /* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited | 1 /* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited |
2 Written by Jean-Marc Valin and Koen Vos */ | 2 Written by Jean-Marc Valin and Koen Vos */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 * last call to opus_repacketizer_init() or | 904 * last call to opus_repacketizer_init() or |
905 * opus_repacketizer_create() is also | 905 * opus_repacketizer_create() is also |
906 * sufficient, and possibly much smaller. | 906 * sufficient, and possibly much smaller. |
907 * @returns The total size of the output packet on success, or an error code | 907 * @returns The total size of the output packet on success, or an error code |
908 * on failure. | 908 * on failure. |
909 * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the | 909 * @retval #OPUS_BUFFER_TOO_SMALL \a maxlen was insufficient to contain the |
910 * complete output packet. | 910 * complete output packet. |
911 */ | 911 */ |
912 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacke
tizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); | 912 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacke
tizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); |
913 | 913 |
| 914 /** Pads a given Opus packet to a larger size (possibly changing the TOC sequenc
e). |
| 915 * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the |
| 916 * packet to pad. |
| 917 * @param len <tt>opus_int32</tt>: The size of the packet. |
| 918 * This must be at least 1. |
| 919 * @param new_len <tt>opus_int32</tt>: The desired size of the packet after pad
ding. |
| 920 * This must be at least as large as len. |
| 921 * @returns an error code |
| 922 * @retval #OPUS_OK \a on success. |
| 923 * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. |
| 924 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. |
| 925 */ |
| 926 OPUS_EXPORT int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32
new_len); |
| 927 |
| 928 /** Remove all padding from a given Opus packet and rewrite the TOC sequence to |
| 929 * minimize space usage. |
| 930 * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the |
| 931 * packet to strip. |
| 932 * @param len <tt>opus_int32</tt>: The size of the packet. |
| 933 * This must be at least 1. |
| 934 * @returns The new size of the output packet on success, or an error code |
| 935 * on failure. |
| 936 * @retval #OPUS_BAD_ARG \a len was less than 1. |
| 937 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. |
| 938 */ |
| 939 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_packet_unpad(unsigned char *
data, opus_int32 len); |
| 940 |
| 941 /** Pads a given Opus multi-stream packet to a larger size (possibly changing th
e TOC sequence). |
| 942 * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the |
| 943 * packet to pad. |
| 944 * @param len <tt>opus_int32</tt>: The size of the packet. |
| 945 * This must be at least 1. |
| 946 * @param new_len <tt>opus_int32</tt>: The desired size of the packet after pad
ding. |
| 947 * This must be at least 1. |
| 948 * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels)
in the packet. |
| 949 * This must be at least as large as len. |
| 950 * @returns an error code |
| 951 * @retval #OPUS_OK \a on success. |
| 952 * @retval #OPUS_BAD_ARG \a len was less than 1. |
| 953 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. |
| 954 */ |
| 955 OPUS_EXPORT int opus_multistream_packet_pad(unsigned char *data, opus_int32 len,
opus_int32 new_len, int nb_streams); |
| 956 |
| 957 /** Remove all padding from a given Opus multi-stream packet and rewrite the TOC
sequence to |
| 958 * minimize space usage. |
| 959 * @param[in,out] data <tt>const unsigned char*</tt>: The buffer containing the |
| 960 * packet to strip. |
| 961 * @param len <tt>opus_int32</tt>: The size of the packet. |
| 962 * This must be at least 1. |
| 963 * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels)
in the packet. |
| 964 * This must be at least 1. |
| 965 * @returns The new size of the output packet on success, or an error code |
| 966 * on failure. |
| 967 * @retval #OPUS_BAD_ARG \a len was less than 1 or new_len was less than len. |
| 968 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet. |
| 969 */ |
| 970 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(uns
igned char *data, opus_int32 len, int nb_streams); |
| 971 |
914 /**@}*/ | 972 /**@}*/ |
915 | 973 |
916 #ifdef __cplusplus | 974 #ifdef __cplusplus |
917 } | 975 } |
918 #endif | 976 #endif |
919 | 977 |
920 #endif /* OPUS_H */ | 978 #endif /* OPUS_H */ |
OLD | NEW |