86 static int initialized = 0;
127 #if FF_API_SET_DIMENSIONS 176 *data = matrix_encoding;
181 #if HAVE_SIMD_ALIGN_32 182 # define STRIDE_ALIGN 32 183 #elif HAVE_SIMD_ALIGN_16 184 # define STRIDE_ALIGN 16 186 # define STRIDE_ALIGN 8 275 *width =
FFALIGN(*width, w_align);
276 *height =
FFALIGN(*height, h_align);
281 for (i = 0; i < 4; i++)
293 align =
FFMAX(linesize_align[0], linesize_align[3]);
294 linesize_align[1] <<= chroma_shift;
295 linesize_align[2] <<= chroma_shift;
296 align =
FFMAX3(align, linesize_align[1], linesize_align[2]);
297 *width =
FFALIGN(*width, align);
302 int buf_size,
int align)
304 int ch, planar, needed_size, ret = 0;
309 if (buf_size < needed_size)
323 sample_fmt, align)) < 0) {
346 int w = frame->
width;
348 int tmpsize, unaligned;
364 for (i = 0; i < 4; i++)
373 for (i = 0; i < 3 && data[i + 1]; i++)
374 size[i] = data[i + 1] - data[i];
375 size[i] = tmpsize - (data[i] - data[0]);
377 for (i = 0; i < 4; i++) {
382 if (!pool->
pools[i]) {
397 int planes = planar ? ch : 1;
410 if (!pool->
pools[0]) {
425 for (i = 0; i < 4; i++)
436 int planes = pool->
planes;
486 memset(pic->
data, 0,
sizeof(pic->
data));
489 for (i = 0; i < 4 && pool->
pools[i]; i++) {
582 memcpy(frame_sd->
data, packet_sd, size);
592 int override_dimensions = 1;
600 override_dimensions = 0;
646 default:
return AVERROR(EINVAL);
707 for (i = 0; i < count; i++) {
708 int r =
func(c, (
char *)arg + i * size);
719 for (i = 0; i < count; i++) {
720 int r =
func(c, arg, i, 0);
746 if (hwaccel->
id == codec_id
747 && hwaccel->
pix_fmt == pix_fmt)
761 "Could not find an AVHWAccel for the pixel format: %s",
773 ret = hwa->
init(avctx);
803 memcpy(choices, fmt, (n + 1) *
sizeof(*choices));
828 "does not match the format of provided AVHWFramesContext\n");
838 for (n = 0; choices[n] != ret; n++)
842 choices[n] = choices[n + 1];
858 if ((!codec && !avctx->
codec)) {
862 if ((codec && avctx->
codec && codec != avctx->
codec)) {
864 "but %s passed to avcodec_open2().\n", avctx->
codec->
name, codec->
name);
868 codec = avctx->
codec;
886 "Insufficient thread locking. At least %d threads are " 887 "calling avcodec_open2() at the same time right now.\n",
978 avctx->
codec = codec;
1015 #if FF_API_CODED_FRAME 1103 "ticks_per_frame %d too large for the timebase %d/%d.",
1114 "Mismatching AVCodecContext.pix_fmt and AVHWFramesContext.format\n");
1121 "Mismatching AVCodecContext.sw_pix_fmt (%s) " 1122 "and AVHWFramesContext.sw_format (%s)\n",
1139 #if FF_API_AUDIOENC_DELAY 1150 else if (channels != avctx->
channels) {
1152 "channel layout does not match number of channels\n");
1162 #if FF_API_AVCTX_TIMEBASE 1192 #if FF_API_CODED_FRAME 1219 if (avpkt->
size < size)
1273 int *got_packet_ptr)
1278 int user_packet = !!avpkt->
data;
1280 *got_packet_ptr = 0;
1283 av_log(avctx,
AV_LOG_ERROR,
"This encoder requires using the avcodec_send_frame() API.\n");
1298 "with more than %d channels, but extended_data is not set.\n",
1328 frame = padded_frame;
1339 ret = avctx->
codec->
encode2(avctx, avpkt, frame, got_packet_ptr);
1341 if (*got_packet_ptr) {
1354 if (!user_packet && avpkt->
size) {
1363 if (ret < 0 || !*got_packet_ptr) {
1377 #if FF_API_AUDIOENC_DELAY 1387 int *got_packet_ptr)
1390 int user_packet = !!avpkt->
data;
1392 *got_packet_ptr = 0;
1395 av_log(avctx,
AV_LOG_ERROR,
"This encoder requires using the avcodec_send_frame() API.\n");
1411 ret = avctx->
codec->
encode2(avctx, avpkt, frame, got_packet_ptr);
1413 if (!*got_packet_ptr)
1418 if (!user_packet && avpkt->
size) {
1427 if (ret < 0 || !*got_packet_ptr)
1461 "changes, but PARAM_CHANGE side data was sent to it.\n");
1469 flags = bytestream_get_le32(&data);
1475 avctx->
channels = bytestream_get_le32(&data);
1493 avctx->
width = bytestream_get_le32(&data);
1494 avctx->
height = bytestream_get_le32(&data);
1560 int *got_picture_ptr,
1566 *got_picture_ptr = 0;
1571 av_log(avctx,
AV_LOG_ERROR,
"This decoder requires using the avcodec_send_packet() API.\n");
1588 ret = avctx->
codec->
decode(avctx, picture, got_picture_ptr,
1603 if (*got_picture_ptr) {
1616 #if FF_API_AVCTX_TIMEBASE 1635 av_log(avctx,
AV_LOG_ERROR,
"This decoder requires using the avcodec_send_packet() API.\n");
1653 ret = avctx->
codec->
decode(avctx, frame, got_frame_ptr, avpkt);
1654 if (ret >= 0 && *got_frame_ptr) {
1681 ret = avctx->
codec->
decode(avctx, sub, got_sub_ptr, avpkt);
1744 if (ret >= pkt->
size) {
1777 if (!avpkt || !avpkt->
size) {
1868 if (ret >= 0 && *got_packet) {
1908 return do_encode(avctx, frame, &(
int){0});
1934 if (ret >= 0 && !got_packet)
1981 #if FF_API_CODED_FRAME 2007 return experimental;
2051 int bits_per_sample;
2073 int i,
len, ret = 0;
2075 #define TAG_PRINT(x) \ 2076 (((x) >= '0' && (x) <= '9') || \ 2077 ((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || \ 2078 ((x) == '.' || (x) == ' ')) 2080 for (i = 0; i < 4; i++) {
2081 len = snprintf(buf, buf_size,
2082 TAG_PRINT(codec_tag & 0xFF) ?
"%c" :
"[%d]", codec_tag & 0xFF);
2084 buf_size = buf_size > len ? buf_size -
len : 0;
2093 const char *codec_name;
2102 codec_name = desc->
name;
2107 codec_name =
"mpeg2ts";
2112 snprintf(buf1,
sizeof(buf1),
"%s / 0x%04X", tag_buf, enc->
codec_tag);
2118 snprintf(buf, buf_size,
2122 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2127 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2128 " [%s / 0x%04X]", tag_buf, enc->
codec_tag);
2132 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2137 snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s",
2143 snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s/%s/%s",
2150 snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s",
2154 av_strlcat(buf, new_line ?
"\n " :
", ", buf_size);
2156 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2163 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2171 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2172 " [PAR %d:%d DAR %d:%d]",
2174 display_aspect_ratio.
num, display_aspect_ratio.
den);
2178 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2184 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2185 ", q=%d-%d", enc->
qmin, enc->
qmax);
2189 snprintf(buf, buf_size,
2193 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2198 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2199 " [%s / 0x%04X]", tag_buf, enc->
codec_tag);
2204 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2209 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2214 snprintf(buf, buf_size,
"Data: %s", codec_name);
2217 snprintf(buf, buf_size,
"Subtitle: %s", codec_name);
2220 snprintf(buf, buf_size,
"Attachment: %s", codec_name);
2223 snprintf(buf, buf_size,
"Invalid Codec type %d", enc->
codec_type);
2228 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2231 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2236 snprintf(buf + strlen(buf), buf_size - strlen(buf),
2237 ", %d kb/s", bitrate / 1000);
2281 #define LICENSE_PREFIX "libavcodec license: " 2367 uint32_t
tag,
int bits_per_coded_sample,
int frame_bytes)
2372 if (bps > 0 && ch > 0 && frame_bytes > 0)
2373 return (frame_bytes * 8) / (bps * ch);
2374 bps = bits_per_coded_sample;
2400 return 256 * sr / 245;
2405 return (480 << (sr / 22050)) / ch;
2413 case 20:
return 160;
2414 case 19:
return 144;
2415 case 29:
return 288;
2416 case 37:
return 480;
2420 case 38:
return 160;
2421 case 50:
return 240;
2426 if (frame_bytes > 0) {
2429 return 240 * (frame_bytes / 32);
2431 return 256 * (frame_bytes / 64);
2436 return frame_bytes * 8 /
bps;
2444 return (frame_bytes - 4 * ch) * 2 / ch;
2446 return (frame_bytes - 4) * 2 / ch;
2448 return (frame_bytes - 8) * 2 / ch;
2450 return (frame_bytes / 128) * 224 / ch;
2452 return (frame_bytes - 6 - ch) / ch;
2454 return (frame_bytes - 8) / ch;
2456 return (frame_bytes - 2 * ch) / ch;
2458 return 3 * frame_bytes / ch;
2460 return 6 * frame_bytes / ch;
2462 return 2 * (frame_bytes / (5 * ch));
2469 return frame_bytes / ch;
2471 return frame_bytes * 2 / ch;
2477 int blocks = frame_bytes / ba;
2480 return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8);
2482 return blocks * (((ba - 16) * 2 / 3 * 4) / ch);
2484 return blocks * (1 + (ba - 4 * ch) * 2 / ch);
2486 return blocks * (2 + (ba - 7 * ch) * 2 / ch);
2494 return 2 * (frame_bytes / ((bps * 2 / 8) * ch));
2496 return frame_bytes / ((
FFALIGN(ch, 2) *
bps) / 8);
2498 return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
2548 for (i = 0; i < size && !(
tab[i][0] == a &&
tab[i][1] ==
b); i++) ;
2552 #if FF_API_MISSING_SAMPLE 2557 "version to the newest one from Git. If the problem still " 2558 "occurs, it means that your file has a feature which has not " 2559 "been implemented.\n", feature);
2566 va_list argument_list;
2568 va_start(argument_list, msg);
2573 "of this file to ftp://upload.libav.org/incoming/ " 2574 "and contact the libav-devel mailing list.\n");
2576 va_end(argument_list);
2610 void *new_codec_mutex =
NULL;
2611 void *new_avformat_mutex =
NULL;
2717 for (i = 0; i < 3; i++) {
2718 uint32_t
tmp = *state << 8;
2719 *state = tmp + *(p++);
2720 if (tmp == 0x100 || p == end)
2725 if (p[-1] > 1 ) p += 3;
2726 else if (p[-2] ) p += 2;
2727 else if (p[-3]|(p[-1]-1)) p++;
2734 p =
FFMIN(p, end) - 4;
2747 *size =
sizeof(*props);
2784 memset(par, 0,
sizeof(*par));
2822 memcpy(dst, src,
sizeof(*dst));
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_SANE_NB_CHANNELS
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
callback to negotiate the pixelFormat
static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
uint64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
enum AVChromaLocation chroma_location
const struct AVCodec * codec
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
enum AVFieldOrder field_order
Video only.
static AVCodec * find_encdec(enum AVCodecID id, int encoder)
enum AVColorTransferCharacteristic color_trc
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_NUM_DATA_POINTERS
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
Set various frame properties from the codec context / packet data.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
int stride_align[AV_NUM_DATA_POINTERS]
#define LIBAV_CONFIGURATION
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
This side data must be associated with an audio frame and corresponds to enum AVAudioServiceType defi...
int coded_width
Bitstream width / height, may be different from width/height e.g.
int av_lockmgr_register(int(*cb)(void **mutex, enum AVLockOp op))
Register a user provided lock manager supporting the operations specified by AVLockOp.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Decode the audio frame of size avpkt->size from avpkt->data into frame.
AVRational sample_aspect_ratio
Video only.
int rc_initial_buffer_occupancy
Number of bits which should be loaded into the rc buffer before decoding starts.
static int do_decode(AVCodecContext *avctx, AVPacket *pkt)
int attribute_align_arg avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
Read encoded data from the encoder.
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
const char * avcodec_configuration(void)
Return the libavcodec build-time configuration.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
int nb_extended_buf
Number of elements in extended_buf.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
const char * avcodec_license(void)
Return the libavcodec license.
enum AVPixelFormat pix_fmt
Supported pixel format.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static int pad_last_frame(AVCodecContext *s, AVFrame **dst, const AVFrame *src)
Pad last frame with silence.
AVPacket * pkt
Current packet as passed into the decoder, to avoid having to pass the packet into every function...
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of audio.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer with padding, reusing the given one if large enough.
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
#define AV_CODEC_CAP_EXPERIMENTAL
Codec is experimental and is thus avoided in favor of non experimental encoders.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
Put a string representing the codec tag codec_tag in buf.
#define FF_ARRAY_ELEMS(a)
AVBufferPool * pools[4]
Pools for each data plane.
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)
Decode a subtitle message.
int(* alloc_frame)(AVCodecContext *avctx, AVFrame *frame)
Allocate a custom buffer.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
This struct describes the properties of an encoded stream.
AVLockOp
Lock operation used by lockmgr.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
char * text
0 terminated plain UTF-8 text
enum AVColorSpace color_space
unsigned avcodec_get_edge_width(void)
Return the amount of padding in pixels which the get_buffer callback must provide around the edge of ...
const char * av_color_space_name(enum AVColorSpace space)
Macro definitions for various function/variable attributes.
FF_DISABLE_DEPRECATION_WARNINGS void av_log_missing_feature(void *avc, const char *feature, int want_sample)
Log a generic warning message about a missing feature.
static void * codec_mutex
int(* receive_packet)(AVCodecContext *avctx, AVPacket *avpkt)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
int av_codec_is_decoder(const AVCodec *codec)
int(* uninit)(AVCodecContext *avctx)
Uninitialize the hwaccel private data.
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align)
Fill audio frame data and linesize.
int av_codec_is_encoder(const AVCodec *codec)
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height)
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
struct AVHWAccel * hwaccel
Hardware accelerator in use.
static int volatile entangled_thread_counter
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
enum AVSampleFormat sample_fmt
audio sample format
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Opaque data information usually continuous.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
8 bits with AV_PIX_FMT_RGB32 palette
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt)
const char * av_color_range_name(enum AVColorRange range)
static int setup_hwaccel(AVCodecContext *avctx, const enum AVPixelFormat fmt, const char *name)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static AVCodec * first_avcodec
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int ff_side_data_update_matrix_encoding(AVFrame *frame, enum AVMatrixEncoding matrix_encoding)
Add or update AV_FRAME_DATA_MATRIXENCODING side data.
Multithreading support functions.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define LIBAVCODEC_VERSION_INT
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
AVCPBProperties * ff_add_cpb_side_data(AVCodecContext *avctx)
Add a CPB properties side data to an encoding context.
int initial_padding
Audio only.
int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar)
Check if the given sample aspect ratio of an image is valid.
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AVERROR_EOF
End of file.
#define AV_LOG_VERBOSE
Detailed information.
enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
Get the planar alternative form of the given sample format.
int(* init)(AVCodecContext *avctx)
Initialize the hwaccel private data.
int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b)
Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
AVCPBProperties * av_cpb_properties_alloc(size_t *size)
Allocate a CPB properties structure and initialize its fields to default values.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
static void codec_parameters_reset(AVCodecParameters *par)
uint64_t channel_layout
Audio only.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
const OptionDef options[]
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])
Modify width and height values so that they will result in a memory buffer that is acceptable for the...
static av_cold void avcodec_init(void)
int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)
Submit a new frame to a decoding thread.
planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
void avcodec_set_dimensions(AVCodecContext *s, int width, int height)
Libavcodec version macros.
av_cold int avcodec_close(AVCodecContext *avctx)
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext its...
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, uint32_t tag, int bits_per_coded_sample, int frame_bytes)
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0
planar GBR 4:4:4 27bpp, big-endian
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
const char * av_chroma_location_name(enum AVChromaLocation location)
static int do_encode(AVCodecContext *avctx, const AVFrame *frame, int *got_packet)
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
AVCodecID
Identify the syntax and semantics of the bitstream.
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
unsigned int avpriv_toupper4(unsigned int x)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int(* send_frame)(AVCodecContext *avctx, const AVFrame *frame)
Decode/encode API with decoupled packet/frame dataflow.
int qmax
maximum quantizer
AVCodec * av_codec_next(const AVCodec *c)
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec...
int active_thread_type
Which multithreading methods are in use by the codec.
enum AVColorPrimaries color_primaries
int avcodec_is_open(AVCodecContext *s)
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder.
int capabilities
Codec capabilities.
enum AVColorRange color_range
int initial_padding
Audio only.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int ff_thread_init(AVCodecContext *s)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
enum AVMediaType codec_type
General type of the encoded data.
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
int flags
AV_CODEC_FLAG_*.
enum AVColorSpace colorspace
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
simple assert() macros that are a bit more flexible than ISO C assert().
int64_t av_gcd(int64_t a, int64_t b)
Return the greatest common divisor of a and b.
enum AVPacketSideDataType type
int av_log_get_level(void)
Get the current log level.
const char * name
Name of the codec implementation.
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
const struct AVProfile * profiles
If non-NULL, an array of profiles recognized for this codec.
int av_buffer_realloc(AVBufferRef **pbuf, int size)
Reallocate a given buffer.
void ff_thread_free(AVCodecContext *avctx)
void avcodec_parameters_free(AVCodecParameters **ppar)
Free an AVCodecParameters instance and everything associated with it and write NULL to the supplied p...
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
av_cold void ff_me_cmp_init_static(void)
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE
Audio encoder supports receiving a different number of samples in each call.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
int priv_data_size
Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.
int flags
A combination of AV_PKT_FLAG values.
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
reference-counted frame API
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
uint64_t channel_layout
Audio channel layout.
int extradata_size
Size of the extradata content in bytes.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int rc_buffer_size
decoder bitstream buffer size
int(* send_packet)(AVCodecContext *avctx, const AVPacket *avpkt)
uint64_t channel_layout
Channel layout of the audio data.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
int bit_rate
The average bitrate of the encoded data (in bits per second).
common internal API header
#define FF_MAX_EXTRADATA_SIZE
Maximum size in bytes of extradata.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
static AVHWAccel * find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt)
int block_align
Audio only.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
int bit_rate
the average bitrate
audio channel layout utility functions
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
#define FF_THREAD_FRAME
Decode more than one frame at once.
#define AV_CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
const uint8_t * avpriv_find_start_code(const uint8_t *restrict p, const uint8_t *end, uint32_t *restrict state)
AVBufferRef ** extended_buf
For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
static int is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
int width
picture width / height.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames...
#define FF_PROFILE_UNKNOWN
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb
void ff_thread_finish_setup(AVCodecContext *avctx)
If the codec defines update_thread_context(), call this when they are ready for the next thread to st...
const AVProfile * profiles
array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} ...
int64_t reordered_opaque
opaque 64-bit number (generally a PTS) that will be reordered and output in AVFrame.reordered_opaque
static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
int refcounted_frames
If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
packed RGB 8:8:8, 24bpp, BGRBGR...
planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
enum AVColorRange color_range
Video only.
int mb_decision
macroblock decision mode
Usually treated as AVMEDIA_TYPE_DATA.
void av_log_ask_for_sample(void *avc, const char *msg,...)
Opaque data information usually sparse.
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
enum AVPixelFormat pix_fmt
static pthread_mutex_t * mutex
static int audio_get_buffer(AVCodecContext *avctx, AVFrame *frame)
planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
uint8_t * data[4]
data+linesize for the bitmap of this subtitle.
int draining
checks API usage: after codec draining, flush is required to resume operation
#define AVERROR_EXPERIMENTAL
Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it...
int thread_count
thread count is used to decide how many independent tasks should be passed to execute() ...
the normal 2^n-1 "JPEG" YUV ranges
if(ac->has_optimized_func)
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal decoder state / flush internal buffers.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
const char * av_get_profile_name(const AVCodec *codec, int profile)
Return a name for the specified profile, if available.
int frame_size
Number of samples per channel in an audio frame.
#define attribute_align_arg
This structure describes the bitrate properties of an encoded bitstream.
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags)
The default callback for AVCodecContext.get_buffer2().
int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height, uint8_t *ptr, const int linesizes[4])
Fill plane data pointers for an image with pixel format pix_fmt and height height.
Libavcodec external API header.
enum AVMediaType codec_type
AVSampleFormat
Audio Sample Formats.
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
int av_opt_set_dict(void *obj, AVDictionary **options)
int sample_rate
samples per second
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
planar GBR 4:4:4 30bpp, big-endian
main external API structure.
int(* receive_frame)(AVCodecContext *avctx, AVFrame *frame)
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * data
The data buffer.
int qmin
minimum quantizer
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame)
Supply a raw video or audio frame to the encoder.
int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Copy samples from src to dst.
int(* close)(AVCodecContext *)
#define AVERROR_BUG
Bug detected, please report the issue.
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
int64_t reordered_opaque
reordered opaque 64 bits (generally an integer or a double precision float PTS but can be anything)...
Describe the class of an AVClass context structure.
int sample_rate
Sample rate of the audio data.
int(* get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags)
This callback is called at the beginning of each frame to get data buffer(s) for it.
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
Fill plane linesizes for an image with pixel format pix_fmt and width width.
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, int size)
Add a new side data to a frame.
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
void av_buffer_pool_uninit(AVBufferPool **ppool)
Mark the pool as being available for freeing.
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Get the required buffer size for the given audio parameters.
enum AVColorSpace colorspace
YUV colorspace type.
rational number numerator/denominator
int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode a frame of video.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
Wrapper around release_buffer() frame-for multithreaded codecs.
const char * name
short name for the profile
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
This struct describes a set or pool of "hardware" frames (i.e.
void av_vlog(void *avcl, int level, const char *fmt, va_list vl)
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static FF_ENABLE_DEPRECATION_WARNINGS AVHWAccel * first_hwaccel
const char * name
Name of the codec described by this descriptor.
enum AVChromaLocation chroma_location
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
Return audio frame duration.
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
AVHWAccel * av_hwaccel_next(const AVHWAccel *hwaccel)
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL...
This struct describes the properties of a single codec described by an AVCodecID. ...
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
This side data should be associated with an audio stream and contains ReplayGain information in form ...
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void * av_malloc_array(size_t nmemb, size_t size)
const AVClass * priv_class
AVClass for the private context.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
attribute_deprecated int64_t pkt_pts
PTS copied from the AVPacket that was decoded to produce this frame.
int sample_rate
Audio only.
AVPacket * buffer_pkt
buffers for using new encode/decode API through legacy API
int64_t pkt_dts
DTS copied from the AVPacket that triggered returning this frame.
A reference to a data buffer.
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
void av_opt_free(void *obj)
Free all allocated objects in obj.
#define FF_DISABLE_DEPRECATION_WARNINGS
int(* decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)
common internal api header.
AVBufferPool * av_buffer_pool_init(int size, AVBufferRef *(*alloc)(int size))
Allocate and initialize a buffer pool.
int avpriv_lock_avformat(void)
void av_register_hwaccel(AVHWAccel *hwaccel)
Register the hardware accelerator hwaccel.
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
planar GBRA 4:4:4:4 32bpp
void(* flush)(AVCodecContext *)
Flush buffers.
planar GBR 4:4:4 27bpp, little-endian
int(* init)(AVCodecContext *)
int profile
Codec-specific bitstream restrictions that the stream conforms to.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
void * hwaccel_priv_data
hwaccel-specific private data
uint32_t start_display_time
int(* encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
enum AVCodecID id
Codec implemented by the hardware accelerator.
void ff_thread_report_progress(ThreadFrame *f, int progress, int field)
Notify later decoding threads when part of their reference picture is ready.
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
#define AV_PIX_FMT_RGB555
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
int caps_internal
Internal codec capabilities.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
int avcodec_default_execute2(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count)
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
int av_packet_ref(AVPacket *dst, AVPacket *src)
Setup a new reference to the data described by a given packet.
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Fill channel data pointers and linesize for samples with sample format sample_fmt.
void ff_thread_flush(AVCodecContext *avctx)
Wait for decoding threads to finish and reset internal state.
#define FF_ENABLE_DEPRECATION_WARNINGS
int(* encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
as in Berlin toast format
int channels
number of audio channels
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0 ...
struct AVCodecInternal * internal
Private context used for internal data.
unsigned avcodec_version(void)
Return the LIBAVCODEC_VERSION_INT constant.
Y , 16bpp, little-endian.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
char * ass
0 terminated ASS/SSA compatible event line.
This side data corresponds to the AVCPBProperties struct.
static void * avformat_mutex
static int get_bit_rate(AVCodecContext *ctx)
int bits_per_coded_sample
enum AVColorPrimaries color_primaries
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
static const struct twinvq_data tab
void ff_thread_await_progress(ThreadFrame *f, int progress, int field)
Wait for earlier decoding threads to finish reference pictures.
planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
av_cold void avcodec_register(AVCodec *codec)
Register the codec codec and initialize libavcodec.
int frame_number
Frame counter, set by libavcodec.
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
enum AVFieldOrder field_order
Field order.
static int unrefcount_frame(AVCodecInternal *avci, AVFrame *frame)
void(* init_static_data)(struct AVCodec *codec)
Initialize codec static data, called from avcodec_register().
enum AVColorTransferCharacteristic color_trc
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Select the (possibly hardware accelerated) pixel format.
int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)
static int(* lockmgr_cb)(void **mutex, enum AVLockOp op)
static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx, int64_t samples)
Rescale from sample rate to AVCodecContext.time_base.
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
int avpriv_unlock_avformat(void)
ReplayGain information in the form of the AVReplayGain struct.
int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)
Decode the video frame of size avpkt->size from avpkt->data into picture.
uint8_t ** extended_data
pointers to the data planes/channels.
packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
Stereoscopic 3d metadata.
AVPixelFormat
Pixel format.
This structure stores compressed data.
const char * avcodec_profile_name(enum AVCodecID codec_id, int profile)
Return a name for the specified profile, if available.
int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
int nb_samples
number of audio samples (per channel) described by this frame
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define AV_NOPTS_VALUE
Undefined timestamp value.
planar GBR 4:4:4 30bpp, little-endian
int avcodec_default_execute(AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void *arg, int *ret, int count, int size)
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
Return a description of a channel layout.
int last_audio_frame
An audio frame with less than required samples has been submitted and padded with silence...
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
uint8_t * subtitle_header
Header containing style information for text subtitles.
planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian