comparison avcodec.h @ 9822:2887f410011f libavcodec

Remove '\p', '\c' and '\e' doxygen markup from doxy, as it should improve plain text doxy readability. See the thread: "[RFC] Should we use doxygen markup?".
author stefano
date Sat, 06 Jun 2009 09:35:15 +0000
parents 798d6520c7f4
children 37558edc9df2
comparison
equal deleted inserted replaced
9821:0813b30e7db9 9822:2887f410011f
2542 */ 2542 */
2543 void (*flush)(AVCodecContext *); 2543 void (*flush)(AVCodecContext *);
2544 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} 2544 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
2545 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 2545 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
2546 /** 2546 /**
2547 * Descriptive name for the codec, meant to be more human readable than \p name. 2547 * Descriptive name for the codec, meant to be more human readable than name.
2548 * You \e should use the NULL_IF_CONFIG_SMALL() macro to define it. 2548 * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
2549 */ 2549 */
2550 const char *long_name; 2550 const char *long_name;
2551 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 2551 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
2552 const enum SampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 2552 const enum SampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
2553 const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 2553 const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
2597 * Called at the beginning of each frame or field picture. 2597 * Called at the beginning of each frame or field picture.
2598 * 2598 *
2599 * Meaningful frame information (codec specific) is guaranteed to 2599 * Meaningful frame information (codec specific) is guaranteed to
2600 * be parsed at this point. This function is mandatory. 2600 * be parsed at this point. This function is mandatory.
2601 * 2601 *
2602 * Note that \p buf can be NULL along with \p buf_size set to 0. 2602 * Note that buf can be NULL along with buf_size set to 0.
2603 * Otherwise, this means the whole frame is available at this point. 2603 * Otherwise, this means the whole frame is available at this point.
2604 * 2604 *
2605 * @param avctx the codec context 2605 * @param avctx the codec context
2606 * @param buf the frame data buffer base 2606 * @param buf the frame data buffer base
2607 * @param buf_size the size of the frame in bytes 2607 * @param buf_size the size of the frame in bytes
2913 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); 2913 void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
2914 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); 2914 const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
2915 void avcodec_set_dimensions(AVCodecContext *s, int width, int height); 2915 void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
2916 2916
2917 /** 2917 /**
2918 * Returns the pixel format corresponding to the name \p name. 2918 * Returns the pixel format corresponding to the name name.
2919 * 2919 *
2920 * If there is no pixel format with name \p name, then looks for a 2920 * If there is no pixel format with name name, then looks for a
2921 * pixel format with the name corresponding to the native endian 2921 * pixel format with the name corresponding to the native endian
2922 * format of \p name. 2922 * format of name.
2923 * For example in a little-endian system, first looks for "gray16", 2923 * For example in a little-endian system, first looks for "gray16",
2924 * then for "gray16le". 2924 * then for "gray16le".
2925 * 2925 *
2926 * Finally if no pixel format has been found, returns \c PIX_FMT_NONE. 2926 * Finally if no pixel format has been found, returns PIX_FMT_NONE.
2927 */ 2927 */
2928 enum PixelFormat avcodec_get_pix_fmt(const char* name); 2928 enum PixelFormat avcodec_get_pix_fmt(const char* name);
2929 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p); 2929 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
2930 2930
2931 #define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ 2931 #define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
2961 * may occur. For example, when converting from RGB24 to GRAY, the color 2961 * may occur. For example, when converting from RGB24 to GRAY, the color
2962 * information will be lost. Similarly, other losses occur when converting from 2962 * information will be lost. Similarly, other losses occur when converting from
2963 * some formats to other formats. avcodec_find_best_pix_fmt() searches which of 2963 * some formats to other formats. avcodec_find_best_pix_fmt() searches which of
2964 * the given pixel formats should be used to suffer the least amount of loss. 2964 * the given pixel formats should be used to suffer the least amount of loss.
2965 * The pixel formats from which it chooses one, are determined by the 2965 * The pixel formats from which it chooses one, are determined by the
2966 * \p pix_fmt_mask parameter. 2966 * pix_fmt_mask parameter.
2967 * 2967 *
2968 * @code 2968 * @code
2969 * src_pix_fmt = PIX_FMT_YUV420P; 2969 * src_pix_fmt = PIX_FMT_YUV420P;
2970 * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); 2970 * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
2971 * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); 2971 * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
3023 unsigned avcodec_version(void); 3023 unsigned avcodec_version(void);
3024 3024
3025 /** 3025 /**
3026 * Initializes libavcodec. 3026 * Initializes libavcodec.
3027 * 3027 *
3028 * @warning This function \e must be called before any other libavcodec 3028 * @warning This function must be called before any other libavcodec
3029 * function. 3029 * function.
3030 */ 3030 */
3031 void avcodec_init(void); 3031 void avcodec_init(void);
3032 3032
3033 #if LIBAVCODEC_VERSION_MAJOR < 53 3033 #if LIBAVCODEC_VERSION_MAJOR < 53
3036 */ 3036 */
3037 attribute_deprecated void register_avcodec(AVCodec *codec); 3037 attribute_deprecated void register_avcodec(AVCodec *codec);
3038 #endif 3038 #endif
3039 3039
3040 /** 3040 /**
3041 * Register the codec \p codec and initialize libavcodec. 3041 * Register the codec codec and initialize libavcodec.
3042 * 3042 *
3043 * @see avcodec_init() 3043 * @see avcodec_init()
3044 */ 3044 */
3045 void avcodec_register(AVCodec *codec); 3045 void avcodec_register(AVCodec *codec);
3046 3046
3168 */ 3168 */
3169 int avcodec_open(AVCodecContext *avctx, AVCodec *codec); 3169 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
3170 3170
3171 #if LIBAVCODEC_VERSION_MAJOR < 53 3171 #if LIBAVCODEC_VERSION_MAJOR < 53
3172 /** 3172 /**
3173 * Decodes an audio frame from \p buf into \p samples. 3173 * Decodes an audio frame from buf into samples.
3174 * Wrapper function which calls avcodec_decode_audio3. 3174 * Wrapper function which calls avcodec_decode_audio3.
3175 * 3175 *
3176 * @deprecated Use avcodec_decode_audio3 instead. 3176 * @deprecated Use avcodec_decode_audio3 instead.
3177 * @param avctx the codec context 3177 * @param avctx the codec context
3178 * @param[out] samples the output buffer 3178 * @param[out] samples the output buffer
3190 /** 3190 /**
3191 * Decodes the audio frame of size avpkt->size from avpkt->data into samples. 3191 * Decodes the audio frame of size avpkt->size from avpkt->data into samples.
3192 * Some decoders may support multiple frames in a single AVPacket, such 3192 * Some decoders may support multiple frames in a single AVPacket, such
3193 * decoders would then just decode the first frame. 3193 * decoders would then just decode the first frame.
3194 * If no frame 3194 * If no frame
3195 * could be decompressed, \p frame_size_ptr is zero. Otherwise, it is the 3195 * could be decompressed, frame_size_ptr is zero. Otherwise, it is the
3196 * decompressed frame size in \e bytes. 3196 * decompressed frame size in bytes.
3197 * 3197 *
3198 * @warning You \e must set \p frame_size_ptr to the allocated size of the 3198 * @warning You must set frame_size_ptr to the allocated size of the
3199 * output buffer before calling avcodec_decode_audio3(). 3199 * output buffer before calling avcodec_decode_audio3().
3200 * 3200 *
3201 * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than 3201 * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
3202 * the actual read bytes because some optimized bitstream readers read 32 or 64 3202 * the actual read bytes because some optimized bitstream readers read 32 or 64
3203 * bits at once and could read over the end. 3203 * bits at once and could read over the end.
3204 * 3204 *
3205 * @warning The end of the input buffer \p avpkt->data should be set to 0 to ensure that 3205 * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that
3206 * no overreading happens for damaged MPEG streams. 3206 * no overreading happens for damaged MPEG streams.
3207 * 3207 *
3208 * @note You might have to align the input buffer \p avpkt->data and output buffer \p 3208 * @note You might have to align the input buffer avpkt->data and output buffer
3209 * samples. The alignment requirements depend on the CPU: On some CPUs it isn't 3209 * samples. The alignment requirements depend on the CPU: On some CPUs it isn't
3210 * necessary at all, on others it won't work at all if not aligned and on others 3210 * necessary at all, on others it won't work at all if not aligned and on others
3211 * it will work but it will have an impact on performance. In practice, the 3211 * it will work but it will have an impact on performance. In practice, the
3212 * bitstream should have 4 byte alignment at minimum and all sample data should 3212 * bitstream should have 4 byte alignment at minimum and all sample data should
3213 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If 3213 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
3228 int *frame_size_ptr, 3228 int *frame_size_ptr,
3229 AVPacket *avpkt); 3229 AVPacket *avpkt);
3230 3230
3231 #if LIBAVCODEC_VERSION_MAJOR < 53 3231 #if LIBAVCODEC_VERSION_MAJOR < 53
3232 /** 3232 /**
3233 * Decodes a video frame from \p buf into \p picture. 3233 * Decodes a video frame from buf into picture.
3234 * Wrapper function which calls avcodec_decode_video2. 3234 * Wrapper function which calls avcodec_decode_video2.
3235 * 3235 *
3236 * @deprecated Use avcodec_decode_video2 instead. 3236 * @deprecated Use avcodec_decode_video2 instead.
3237 * @param avctx the codec context 3237 * @param avctx the codec context
3238 * @param[out] picture The AVFrame in which the decoded video frame will be stored. 3238 * @param[out] picture The AVFrame in which the decoded video frame will be stored.
3250 /** 3250 /**
3251 * Decodes the video frame of size avpkt->size from avpkt->data into picture. 3251 * Decodes the video frame of size avpkt->size from avpkt->data into picture.
3252 * Some decoders may support multiple frames in a single AVPacket, such 3252 * Some decoders may support multiple frames in a single AVPacket, such
3253 * decoders would then just decode the first frame. 3253 * decoders would then just decode the first frame.
3254 * 3254 *
3255 * @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than 3255 * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
3256 * the actual read bytes because some optimized bitstream readers read 32 or 64 3256 * the actual read bytes because some optimized bitstream readers read 32 or 64
3257 * bits at once and could read over the end. 3257 * bits at once and could read over the end.
3258 * 3258 *
3259 * @warning The end of the input buffer \p buf should be set to 0 to ensure that 3259 * @warning The end of the input buffer buf should be set to 0 to ensure that
3260 * no overreading happens for damaged MPEG streams. 3260 * no overreading happens for damaged MPEG streams.
3261 * 3261 *
3262 * @note You might have to align the input buffer \p avpkt->data and output buffer \p 3262 * @note You might have to align the input buffer avpkt->data and output buffer
3263 * samples. The alignment requirements depend on the CPU: on some CPUs it isn't 3263 * samples. The alignment requirements depend on the CPU: on some CPUs it isn't
3264 * necessary at all, on others it won't work at all if not aligned and on others 3264 * necessary at all, on others it won't work at all if not aligned and on others
3265 * it will work but it will have an impact on performance. In practice, the 3265 * it will work but it will have an impact on performance. In practice, the
3266 * bitstream should have 4 byte alignment at minimum and all sample data should 3266 * bitstream should have 4 byte alignment at minimum and all sample data should
3267 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If 3267 * be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do). If
3296 #endif 3296 #endif
3297 3297
3298 /** 3298 /**
3299 * Decodes a subtitle message. 3299 * Decodes a subtitle message.
3300 * Returns a negative value on error, otherwise returns the number of bytes used. 3300 * Returns a negative value on error, otherwise returns the number of bytes used.
3301 * If no subtitle could be decompressed, \p got_sub_ptr is zero. 3301 * If no subtitle could be decompressed, got_sub_ptr is zero.
3302 * Otherwise, the subtitle is stored in \p *sub. 3302 * Otherwise, the subtitle is stored in *sub.
3303 * 3303 *
3304 * @param avctx the codec context 3304 * @param avctx the codec context
3305 * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored. 3305 * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored.
3306 * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. 3306 * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
3307 * @param[in] avpkt The input AVPacket containing the input buffer. 3307 * @param[in] avpkt The input AVPacket containing the input buffer.
3312 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, 3312 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
3313 int *data_size_ptr, 3313 int *data_size_ptr,
3314 uint8_t *buf, int buf_size); 3314 uint8_t *buf, int buf_size);
3315 3315
3316 /** 3316 /**
3317 * Encodes an audio frame from \p samples into \p buf. 3317 * Encodes an audio frame from samples into buf.
3318 * 3318 *
3319 * @note The output buffer should be at least \c FF_MIN_BUFFER_SIZE bytes large. 3319 * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large.
3320 * However, for PCM audio the user will know how much space is needed 3320 * However, for PCM audio the user will know how much space is needed
3321 * because it depends on the value passed in \p buf_size as described 3321 * because it depends on the value passed in buf_size as described
3322 * below. In that case a lower value can be used. 3322 * below. In that case a lower value can be used.
3323 * 3323 *
3324 * @param avctx the codec context 3324 * @param avctx the codec context
3325 * @param[out] buf the output buffer 3325 * @param[out] buf the output buffer
3326 * @param[in] buf_size the output buffer size 3326 * @param[in] buf_size the output buffer size
3327 * @param[in] samples the input buffer containing the samples 3327 * @param[in] samples the input buffer containing the samples
3328 * The number of samples read from this buffer is frame_size*channels, 3328 * The number of samples read from this buffer is frame_size*channels,
3329 * both of which are defined in \p avctx. 3329 * both of which are defined in avctx.
3330 * For PCM audio the number of samples read from \p samples is equal to 3330 * For PCM audio the number of samples read from samples is equal to
3331 * \p buf_size * input_sample_size / output_sample_size. 3331 * buf_size * input_sample_size / output_sample_size.
3332 * @return On error a negative value is returned, on success zero or the number 3332 * @return On error a negative value is returned, on success zero or the number
3333 * of bytes used to encode the data read from the input buffer. 3333 * of bytes used to encode the data read from the input buffer.
3334 */ 3334 */
3335 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, 3335 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
3336 const short *samples); 3336 const short *samples);
3337 3337
3338 /** 3338 /**
3339 * Encodes a video frame from \p pict into \p buf. 3339 * Encodes a video frame from pict into buf.
3340 * The input picture should be 3340 * The input picture should be
3341 * stored using a specific format, namely \c avctx.pix_fmt. 3341 * stored using a specific format, namely avctx.pix_fmt.
3342 * 3342 *
3343 * @param avctx the codec context 3343 * @param avctx the codec context
3344 * @param[out] buf the output buffer for the bitstream of encoded frame 3344 * @param[out] buf the output buffer for the bitstream of encoded frame
3345 * @param[in] buf_size the size of the output buffer in bytes 3345 * @param[in] buf_size the size of the output buffer in bytes
3346 * @param[in] pict the input picture to encode 3346 * @param[in] pict the input picture to encode
3374 void avcodec_default_free_buffers(AVCodecContext *s); 3374 void avcodec_default_free_buffers(AVCodecContext *s);
3375 3375
3376 /* misc useful functions */ 3376 /* misc useful functions */
3377 3377
3378 /** 3378 /**
3379 * Returns a single letter to describe the given picture type \p pict_type. 3379 * Returns a single letter to describe the given picture type pict_type.
3380 * 3380 *
3381 * @param[in] pict_type the picture type 3381 * @param[in] pict_type the picture type
3382 * @return A single character representing the picture type. 3382 * @return A single character representing the picture type.
3383 */ 3383 */
3384 char av_get_pict_type_char(int pict_type); 3384 char av_get_pict_type_char(int pict_type);
3664 int padtop, int padbottom, int padleft, int padright, int *color); 3664 int padtop, int padbottom, int padleft, int padright, int *color);
3665 3665
3666 unsigned int av_xiphlacing(unsigned char *s, unsigned int v); 3666 unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
3667 3667
3668 /** 3668 /**
3669 * Parses \p str and put in \p width_ptr and \p height_ptr the detected values. 3669 * Parses str and put in width_ptr and height_ptr the detected values.
3670 * 3670 *
3671 * @return 0 in case of a successful parsing, a negative value otherwise 3671 * @return 0 in case of a successful parsing, a negative value otherwise
3672 * @param[in] str the string to parse: it has to be a string in the format 3672 * @param[in] str the string to parse: it has to be a string in the format
3673 * <width>x<height> or a valid video frame size abbreviation. 3673 * <width>x<height> or a valid video frame size abbreviation.
3674 * @param[in,out] width_ptr pointer to the variable which will contain the detected 3674 * @param[in,out] width_ptr pointer to the variable which will contain the detected
3677 * frame height value 3677 * frame height value
3678 */ 3678 */
3679 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str); 3679 int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
3680 3680
3681 /** 3681 /**
3682 * Parses \p str and put in \p frame_rate the detected values. 3682 * Parses str and put in frame_rate the detected values.
3683 * 3683 *
3684 * @return 0 in case of a successful parsing, a negative value otherwise 3684 * @return 0 in case of a successful parsing, a negative value otherwise
3685 * @param[in] str the string to parse: it has to be a string in the format 3685 * @param[in] str the string to parse: it has to be a string in the format
3686 * <frame_rate_num>/<frame_rate_den>, a float number or a valid video rate abbreviation 3686 * <frame_rate_num>/<frame_rate_den>, a float number or a valid video rate abbreviation
3687 * @param[in,out] frame_rate pointer to the AVRational which will contain the detected 3687 * @param[in,out] frame_rate pointer to the AVRational which will contain the detected
3708 #define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */ 3708 #define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
3709 #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */ 3709 #define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
3710 #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */ 3710 #define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
3711 3711
3712 /** 3712 /**
3713 * Registers the hardware accelerator \p hwaccel. 3713 * Registers the hardware accelerator hwaccel.
3714 */ 3714 */
3715 void av_register_hwaccel(AVHWAccel *hwaccel); 3715 void av_register_hwaccel(AVHWAccel *hwaccel);
3716 3716
3717 /** 3717 /**
3718 * If hwaccel is NULL, returns the first registered hardware accelerator, 3718 * If hwaccel is NULL, returns the first registered hardware accelerator,
3732 AV_LOCK_DESTROY, ///< Free mutex resources 3732 AV_LOCK_DESTROY, ///< Free mutex resources
3733 }; 3733 };
3734 3734
3735 /** 3735 /**
3736 * Register a user provided lock manager supporting the operations 3736 * Register a user provided lock manager supporting the operations
3737 * specified by AVLockOp. \p mutex points to a (void *) where the 3737 * specified by AVLockOp. mutex points to a (void *) where the
3738 * lockmgr should store/get a pointer to a user allocated mutex. It's 3738 * lockmgr should store/get a pointer to a user allocated mutex. It's
3739 * NULL upon AV_LOCK_CREATE and != NULL for all other ops. 3739 * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
3740 * 3740 *
3741 * @param cb User defined callback. Note: FFmpeg may invoke calls to this 3741 * @param cb User defined callback. Note: FFmpeg may invoke calls to this
3742 * callback during the call to av_lockmgr_register(). 3742 * callback during the call to av_lockmgr_register().