summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/opus.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/opus.h')
-rw-r--r--lib/rbcodec/codecs/libopus/opus.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libopus/opus.h b/lib/rbcodec/codecs/libopus/opus.h
index 38817b405a..93a53a2ffc 100644
--- a/lib/rbcodec/codecs/libopus/opus.h
+++ b/lib/rbcodec/codecs/libopus/opus.h
@@ -911,6 +911,64 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_repacketizer_get_nb_frames(OpusRepa
911 */ 911 */
912OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus_int32 maxlen) OPUS_ARG_NONNULL(1); 912OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_repacketizer_out(OpusRepacketizer *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 sequence).
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 padding.
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 */
926OPUS_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 */
939OPUS_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 the 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 padding.
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 */
955OPUS_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 */
970OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, int nb_streams);
971
914/**@}*/ 972/**@}*/
915 973
916#ifdef __cplusplus 974#ifdef __cplusplus