ffmpeg:avcodec_decode_audio
Differences
This shows you the differences between two versions of the page.
ffmpeg:avcodec_decode_audio [2007/12/30 14:50] – created deva | ffmpeg:avcodec_decode_audio [2007/12/30 14:51] (current) – deva | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code c> | ||
/** | /** | ||
* @deprecated Use avcodec_decode_audio2() instead. | * @deprecated Use avcodec_decode_audio2() instead. | ||
Line 5: | Line 6: | ||
int *frame_size_ptr, | int *frame_size_ptr, | ||
| | ||
- | + | </code> | |
- | /** | + | |
- | * Decodes an audio frame from \p buf into \p samples. | + | |
- | * The avcodec_decode_audio2() function decodes an audio frame from the input | + | |
- | * buffer \p buf of size \p buf_size. To decode it, it makes use of the | + | |
- | * audio codec which was coupled with \p avctx using avcodec_open(). The | + | |
- | * resulting decoded frame is stored in output buffer \p samples. | + | |
- | * could be decompressed, | + | |
- | * decompressed frame size in \e bytes. | + | |
- | * | + | |
- | * @warning You \e must set \p frame_size_ptr to the allocated size of the | + | |
- | * output buffer before calling avcodec_decode_audio2(). | + | |
- | * | + | |
- | * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than | + | |
- | * the actual read bytes because some optimized bitstream readers read 32 or 64 | + | |
- | * bits at once and could read over the end. | + | |
- | * | + | |
- | * @warning The end of the input buffer \p buf should be set to 0 to ensure that | + | |
- | * no overreading happens for damaged MPEG streams. | + | |
- | * | + | |
- | * @note You might have to align the input buffer \p buf and output buffer \p | + | |
- | * samples. The alignment requirements depend on the CPU: On some CPUs it isn' | + | |
- | * necessary at all, on others it won't work at all if not aligned and on others | + | |
- | * it will work but it will have an impact on performance. In practice, the | + | |
- | * bitstream should have 4 byte alignment at minimum and all sample data should | + | |
- | * be 16 byte aligned unless the CPU doesn' | + | |
- | * the linesize is not a multiple of 16 then there' | + | |
- | * start of the buffer to 16. | + | |
- | * | + | |
- | * @param avctx the codec context | + | |
- | * @param[out] samples the output buffer | + | |
- | * @param[in, | + | |
- | * @param[in] buf the input buffer | + | |
- | * @param[in] buf_size the input buffer size in bytes | + | |
- | * @return On error a negative value is returned, otherwise the number of bytes | + | |
- | * used or zero if no frame could be decompressed. | + | |
- | */ | + | |
- | int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples, | + | |
- | int *frame_size_ptr, | + | |
- | | + | |
ffmpeg/avcodec_decode_audio.1199022624.txt.gz · Last modified: 2007/12/30 14:50 by deva