summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h80
1 files changed, 68 insertions, 12 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 40d3b2245b..dd1dd6bf3b 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
*/
@@ -333,6 +333,7 @@ enum CodecID {
CODEC_ID_BINKAUDIO_DCT,
CODEC_ID_AAC_LATM,
CODEC_ID_QDMC,
+ CODEC_ID_CELT,
/* subtitle codecs */
CODEC_ID_DVD_SUBTITLE= 0x17000,
@@ -344,6 +345,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,
@@ -668,10 +670,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.
*/
@@ -989,6 +993,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
@@ -2850,6 +2862,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;
/**
@@ -3260,7 +3283,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
@@ -3272,6 +3297,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
*/
@@ -3287,6 +3314,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.
@@ -3296,6 +3326,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);
@@ -3303,8 +3349,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
@@ -3313,7 +3359,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);
/**
@@ -3425,16 +3478,19 @@ 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);
/**
* Register the codec codec and initialize libavcodec.
*
- * @see avcodec_init()
+ * @see avcodec_init(), avcodec_register_all()
*/
void avcodec_register(AVCodec *codec);
@@ -3606,7 +3662,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);
@@ -4084,7 +4140,7 @@ unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
/**
* 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
@@ -4098,7 +4154,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
@@ -4135,7 +4191,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.