Lines Matching refs:packet
63 * @li Good loss robustness and packet loss concealment (PLC)
131 * len = opus_encode(enc, audio_frame, frame_size, packet, max_packet);
138 * <li>packet is the byte array to which the compressed data is written</li>
139 * <li>max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended).
143 * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet.
145 * is 1 byte, then the packet does not need to be transmitted (DTX).
182 * forward error correction to protect against packet loss. Use this
260 * @returns The length of the encoded packet (in bytes) on success or a
301 * @returns The length of the encoded packet (in bytes) on success or a
365 * To decode a frame, opus_decode() or opus_decode_float() must be called with a packet of compressed audio data:
367 * frame_size = opus_decode(dec, packet, len, decoded, max_size, 0);
371 * @li packet is the byte array containing the compressed data
372 * @li len is the exact number of bytes contained in the packet
376 * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet.
377 * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio
384 * the decoder with a null pointer and zero length for the missing packet.
446 /** Decode an Opus packet.
448 * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
453 * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will
456 * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and
471 /** Decode an Opus packet with floating point output.
473 * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
478 * If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will
481 * decoder will not be in the optimal state to decode the next incoming packet. For the PLC and
514 /** Parse an opus packet into one or more frames.
518 * the input packet.
519 * @param [in] data <tt>char*</tt>: Opus packet to be parsed
524 * @param [out] payload_offset <tt>int*</tt>: returns the position of the payload within the packet (in bytes)
536 /** Gets the bandwidth of an Opus packet.
537 * @param [in] data <tt>char*</tt>: Opus packet
547 /** Gets the number of samples per frame from an Opus packet.
548 * @param [in] data <tt>char*</tt>: Opus packet.
558 /** Gets the number of channels from an Opus packet.
559 * @param [in] data <tt>char*</tt>: Opus packet
565 /** Gets the number of frames in an Opus packet.
566 * @param [in] packet <tt>char*</tt>: Opus packet
567 * @param [in] len <tt>opus_int32</tt>: Length of packet
572 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned char packet[], opus_int32 len) OPUS_ARG_NONNULL(1);
574 /** Gets the number of samples of an Opus packet.
575 * @param [in] packet <tt>char*</tt>: Opus packet
576 * @param [in] len <tt>opus_int32</tt>: Length of packet
584 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1);
586 /** Gets the number of samples of an Opus packet.
588 * @param [in] packet <tt>char*</tt>: Opus packet
589 * @param [in] len <tt>opus_int32</tt>: Length of packet
594 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);
615 * packet or alternatively to split Opus packets that have previously been
619 * packet is no more than 120 ms.
696 * // If adding the next packet would exceed our target, or it has an
700 * // packet since the last call to opus_repacketizer_init(). Otherwise a
701 * // single packet longer than TARGET_DURATION_MS would cause us to try to
702 * // output an (invalid) empty packet. It also ensures that prev_toc has
733 * // Output the final, partial packet.
745 * unconditionally until it fails. At that point, the merged packet can be
746 * obtained with opus_repacketizer_out() and the input packet for which
763 * repacketized, which is necessary if the maximum packet duration of 120 ms
766 * Failure to do so will prevent a new packet from being added with
788 /** Add a packet to the current repacketizer state.
789 * This packet must match the configuration of any packets already submitted
794 * byte of the packet, and ensuring they match the top 6 bits of the first
795 * byte of any previously submitted packet.
797 * 120 ms, the maximum duration of a single packet, after adding this packet.
802 * In order to add a packet with a different configuration or to add more
805 * If a packet is too large to add to the current repacketizer state, no part
809 * another repacketizer to split the packet into pieces and add them
815 * add the packet.
816 * @param[in] data <tt>const unsigned char*</tt>: The packet data.
822 * @param len <tt>opus_int32</tt>: The number of bytes in the packet data.
824 * @retval #OPUS_OK The packet's contents have been added to the repacketizer
826 * @retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence,
827 * the packet's TOC sequence was not compatible
831 * this packet would increase the total amount of
838 /** Construct a new packet from data previously submitted to the repacketizer
841 * construct the new packet.
848 * store the output packet.
856 * the size of all packet data submitted to
861 * @returns The total size of the output packet on success, or an error code
867 * complete output packet.
871 /** Return the total number of frames contained in packet data submitted to
878 * @returns The total number of frames contained in the packet data submitted
883 /** Construct a new packet from data previously submitted to the repacketizer
886 * in a single packet.
893 * construct the new packet.
895 * store the output packet.
902 * plus the size of all packet data
907 * @returns The total size of the output packet on success, or an error code
910 * complete output packet.
914 /** Pads a given Opus packet to a larger size (possibly changing the TOC sequence).
916 * packet to pad.
917 * @param len <tt>opus_int32</tt>: The size of the packet.
919 * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding.
924 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
928 /** Remove all padding from a given Opus packet and rewrite the TOC sequence to
931 * packet to strip.
932 * @param len <tt>opus_int32</tt>: The size of the packet.
934 * @returns The new size of the output packet on success, or an error code
937 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
941 /** Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence).
943 * packet to pad.
944 * @param len <tt>opus_int32</tt>: The size of the packet.
946 * @param new_len <tt>opus_int32</tt>: The desired size of the packet after padding.
948 * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet.
953 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.
957 /** Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to
960 * packet to strip.
961 * @param len <tt>opus_int32</tt>: The size of the packet.
963 * @param nb_streams <tt>opus_int32</tt>: The number of streams (not channels) in the packet.
965 * @returns The new size of the output packet on success, or an error code
968 * @retval #OPUS_INVALID_PACKET \a data did not contain a valid Opus packet.