diff options
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 81 |
1 files changed, 69 insertions, 12 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 7eb8b52..f3d255c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1,20 +1,20 @@ /* * copyright (c) 2001 Fabrice Bellard * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -353,6 +353,7 @@ enum CodecID { CODEC_ID_HDMV_PGS_SUBTITLE, CODEC_ID_DVB_TELETEXT, CODEC_ID_SRT, + CODEC_ID_MICRODVD, /* other specific kind of codecs (generally used for attachments) */ CODEC_ID_TTF= 0x18000, @@ -689,10 +690,12 @@ typedef struct RcOverride{ * Codec should fill in channel configuration and samplerate instead of container */ #define CODEC_CAP_CHANNEL_CONF 0x0400 + /** * Codec is able to deal with negative linesizes */ #define CODEC_CAP_NEG_LINESIZES 0x0800 + /** * Codec supports frame-level multithreading. */ @@ -1010,6 +1013,14 @@ typedef struct AVPanScan{ * - decoding: Set by libavcodec.\ */\ void *thread_opaque;\ +\ + /**\ + * frame timestamp estimated using various heuristics, in stream time base\ + * - encoding: unused\ + * - decoding: set by libavcodec, read by user.\ + */\ + int64_t best_effort_timestamp;\ + #define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG2 1 @@ -2894,6 +2905,17 @@ typedef struct AVCodecContext { * - decoding: Set by libavcodec. */ enum AVAudioServiceType audio_service_type; + + /** + * Current statistics for PTS correction. + * - decoding: maintained and used by libavcodec, not intended to be used by user apps + * - encoding: unused + */ + int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far + int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far + int64_t pts_correction_last_pts; /// PTS of the last frame + int64_t pts_correction_last_dts; /// DTS of the last frame + } AVCodecContext; /** @@ -2944,7 +2966,9 @@ typedef struct AVCodec { const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder + AVClass *priv_class; ///< AVClass for the private context + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} /** @@ -3290,7 +3314,9 @@ void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int c void av_resample_close(struct AVResampleContext *c); /** - * Allocate memory for a picture. Call avpicture_free to free it. + * Allocate memory for a picture. Call avpicture_free() to free it. + * + * \see avpicture_fill() * * @param picture the picture to be filled in * @param pix_fmt the format of the picture @@ -3302,6 +3328,8 @@ int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int /** * Free a picture previously allocated by avpicture_alloc(). + * The data buffer used by the AVPicture is freed, but the AVPicture structure + * itself is not. * * @param picture the AVPicture to be freed */ @@ -3317,6 +3345,9 @@ void avpicture_free(AVPicture *picture); * will be stored in the lines_sizes array. * Call with ptr == NULL to get the required size for the ptr buffer. * + * To allocate the buffer and fill in the AVPicture fields in one call, + * use avpicture_alloc(). + * * @param picture AVPicture whose fields are to be filled in * @param ptr Buffer which will contain or contains the actual image data * @param pix_fmt The format in which the picture data is stored. @@ -3326,6 +3357,22 @@ void avpicture_free(AVPicture *picture); */ int avpicture_fill(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, int width, int height); + +/** + * Copy pixel data from an AVPicture into a buffer. + * The data is stored compactly, without any gaps for alignment or padding + * which may be applied by avpicture_fill(). + * + * \see avpicture_get_size() + * + * @param[in] src AVPicture containing image data + * @param[in] pix_fmt The format in which the picture data is stored. + * @param[in] width the width of the image in pixels. + * @param[in] height the height of the image in pixels. + * @param[out] dest A buffer into which picture data will be copied. + * @param[in] dest_size The size of 'dest'. + * @return The number of bytes written to dest, or a negative value (error code) on error. + */ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size); @@ -3333,8 +3380,8 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, * Calculate the size in bytes that a picture of the given width and height * would occupy if stored in the given picture format. * Note that this returns the size of a compact representation as generated - * by avpicture_layout, which can be smaller than the size required for e.g. - * avpicture_fill. + * by avpicture_layout(), which can be smaller than the size required for e.g. + * avpicture_fill(). * * @param pix_fmt the given picture format * @param width the width of the image @@ -3343,7 +3390,14 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, */ int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); + +/** + * Return the short name for a pixel format. + * + * \see av_get_pix_fmt(), av_get_pix_fmt_string(). + */ const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); + void avcodec_set_dimensions(AVCodecContext *s, int width, int height); #if LIBAVCODEC_VERSION_MAJOR < 53 @@ -3480,9 +3534,12 @@ const char *avcodec_license(void); /** * Initialize libavcodec. + * If called more than once, does nothing. * * @warning This function must be called before any other libavcodec * function. + * + * @warning This function is not thread-safe. */ void avcodec_init(void); @@ -3496,7 +3553,7 @@ attribute_deprecated void register_avcodec(AVCodec *codec); /** * Register the codec codec and initialize libavcodec. * - * @see avcodec_init() + * @see avcodec_init(), avcodec_register_all() */ void avcodec_register(AVCodec *codec); @@ -3684,7 +3741,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, * @param avctx The context which will be set up to use the given codec. * @param codec The codec to use within the context. * @return zero on success, a negative value on error - * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder + * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder, avcodec_close */ int avcodec_open(AVCodecContext *avctx, AVCodec *codec); @@ -4244,7 +4301,7 @@ attribute_deprecated int av_parse_video_frame_rate(AVRational *frame_rate, const /** * Logs a generic warning message about a missing feature. This function is - * intended to be used internally by Libav (libavcodec, libavformat, etc.) + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct @@ -4258,7 +4315,7 @@ void av_log_missing_feature(void *avc, const char *feature, int want_sample); /** * Log a generic warning message asking for a sample. This function is - * intended to be used internally by Libav (libavcodec, libavformat, etc.) + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) * only, and would normally not be used by applications. * @param[in] avc a pointer to an arbitrary struct of which the first field is * a pointer to an AVClass struct @@ -4295,7 +4352,7 @@ enum AVLockOp { * lockmgr should store/get a pointer to a user allocated mutex. It's * NULL upon AV_LOCK_CREATE and != NULL for all other ops. * - * @param cb User defined callback. Note: Libav may invoke calls to this + * @param cb User defined callback. Note: FFmpeg may invoke calls to this * callback during the call to av_lockmgr_register(). * Thus, the application must be prepared to handle that. * If cb is set to NULL the lockmgr will be unregistered. |