AV_CODEC_ID_IAC,
AV_CODEC_ID_ILBC,
AV_CODEC_ID_OPUS,
+ AV_CODEC_ID_COMFORT_NOISE,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
AV_PKT_DATA_H263_MB_INFO,
};
+/**
+ * This structure stores compressed data. It is typically exported by demuxers
+ * and then passed as input to decoders, or received as output from encoders and
+ * then passed to muxers.
+ *
+ * For video, it should typically contain one compressed frame. For audio it may
+ * contain several compressed frames.
+ *
+ * AVPacket is one of the few structs in Libav, whose size is a part of public
+ * ABI. Thus it may be allocated on stack and no new fields can be added to it
+ * without libavcodec and libavformat major bump.
+ *
+ * The semantics of data ownership depends on the destruct field.
+ * If it is set, the packet data is dynamically allocated and is valid
+ * indefinitely until av_free_packet() is called (which in turn calls the
+ * destruct callback to free the data). If destruct is not set, the packet data
+ * is typically backed by some static buffer somewhere and is only valid for a
+ * limited time (e.g. until the next read call when demuxing).
+ *
+ * The side data is always allocated with av_malloc() and is freed in
+ * av_free_packet().
+ */
typedef struct AVPacket {
/**
* Presentation timestamp in AVStream->time_base units; the time at which
* extended_data must be used by the decoder in order to access all
* channels.
*
- * encoding: unused
+ * encoding: set by user
* decoding: set by AVCodecContext.get_buffer()
*/
uint8_t **extended_data;
/**
* format of the frame, -1 if unknown or unset
- * Values correspond to enum PixelFormat for video frames,
+ * Values correspond to enum AVPixelFormat for video frames,
* enum AVSampleFormat for audio)
* - encoding: unused
* - decoding: Read by user.
int ticks_per_frame;
/**
- * Encoder delay.
+ * Codec delay.
*
* Video:
* Number of frames the decoded output will be delayed relative to the
int gop_size;
/**
- * Pixel format, see PIX_FMT_xxx.
+ * Pixel format, see AV_PIX_FMT_xxx.
* May be set by the demuxer if known from headers.
* May be overriden by the decoder if it knows better.
* - encoding: Set by user.
* - decoding: Set by user if known, overridden by libavcodec if known
*/
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
/**
* Motion estimation algorithm used for video coding.
* - encoding: unused
* - decoding: Set by user, if not set the native format will be chosen.
*/
- enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
+ enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
/**
* maximum number of B-frames between non-B-frames
/* The following data should not be initialized. */
/**
- * Samples per packet, initialized when calling 'init'.
+ * Number of samples per channel in an audio frame.
+ *
+ * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
+ * except the last must contain exactly frame_size samples per channel.
+ * May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
+ * frame size is not restricted.
+ * - decoding: may be set by some decoders to indicate constant frame size
*/
int frame_size;
#define FF_IDCT_INT 1
#define FF_IDCT_SIMPLE 2
#define FF_IDCT_SIMPLEMMX 3
+#if FF_API_LIBMPEG2
#define FF_IDCT_LIBMPEG2MMX 4
+#endif
+#if FF_API_MMI
#define FF_IDCT_MMI 5
+#endif
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9
*/
int capabilities;
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
- const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
+ const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
*
* Only hardware accelerated formats are supported here.
*/
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
/**
* Hardware accelerated codec capabilities.
SUBTITLE_ASS,
};
+#define AV_SUBTITLE_FLAG_FORCED 0x00000001
+
typedef struct AVSubtitleRect {
int x; ///< top left corner of pict, undefined when pict is not set
int y; ///< top left corner of pict, undefined when pict is not set
* struct.
*/
char *ass;
+ int flags;
} AVSubtitleRect;
typedef struct AVSubtitle {
int64_t pts, int64_t dts,
int64_t pos);
+/**
+ * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
+ * @deprecated use AVBitstreamFilter
+ */
int av_parser_change(AVCodecParserContext *s,
AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
* @param height the height of the picture
* @return zero if successful, a negative value if not
*/
-int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
+int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
/**
* Free a picture previously allocated by avpicture_alloc().
* @return size of the image data in bytes
*/
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
- enum PixelFormat pix_fmt, int width, int height);
+ enum AVPixelFormat pix_fmt, int width, int height);
/**
* Copy pixel data from an AVPicture into a buffer.
* @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,
+int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
+ int width, int height,
unsigned char *dest, int dest_size);
/**
* @param height the height of the image
* @return Image data size in bytes or -1 on error (e.g. too large dimensions).
*/
-int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
+int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
/**
* deinterlace - if not supported return -1
*/
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
- enum PixelFormat pix_fmt, int width, int height);
+ enum AVPixelFormat pix_fmt, int width, int height);
/**
* Copy image src to dst. Wraps av_picture_data_copy() above.
*/
void av_picture_copy(AVPicture *dst, const AVPicture *src,
- enum PixelFormat pix_fmt, int width, int height);
+ enum AVPixelFormat pix_fmt, int width, int height);
/**
* Crop image top and left side.
*/
int av_picture_crop(AVPicture *dst, const AVPicture *src,
- enum PixelFormat pix_fmt, int top_band, int left_band);
+ enum AVPixelFormat pix_fmt, int top_band, int left_band);
/**
* Pad image.
*/
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
int padtop, int padbottom, int padleft, int padright, int *color);
/**
* @{
*/
-void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
+void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
/**
* Return a value representing the fourCC code associated to the
* pixel format pix_fmt, or 0 if no associated fourCC code can be
* found.
*/
-unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
+unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @return Combination of flags informing you what kind of losses will occur.
*/
-int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
+int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha);
#if FF_API_FIND_BEST_PIX_FMT
* pix_fmt_mask parameter.
*
* @code
- * src_pix_fmt = PIX_FMT_YUV420P;
- * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);
+ * src_pix_fmt = AV_PIX_FMT_YUV420P;
+ * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) || (1 << AV_PIX_FMT_RGB24);
* dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
* @endcode
*
* @return The best pixel format to convert to or -1 if none was found.
*/
attribute_deprecated
-enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
+enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */
* pix_fmt_list parameter.
*
*
- * @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from
+ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
* @param[in] src_pix_fmt source pixel format
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
* @return The best pixel format to convert to or -1 if none was found.
*/
-enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
- enum PixelFormat src_pix_fmt,
- int has_alpha, int *loss_ptr);
+enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
+ enum AVPixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
-enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
+enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
/**
* @}