Go to the documentation of this file.
121 "changes, but PARAM_CHANGE side data was sent to it.\n");
135 val = bytestream_get_le32(&
data);
136 if (val <= 0 || val > INT_MAX) {
147 avctx->
width = bytestream_get_le32(&
data);
219 #define ff_thread_get_packet(avctx, pkt) (AVERROR_BUG)
220 #define ff_thread_receive_frame(avctx, frame) (AVERROR_BUG)
296 dc->pts_correction_num_faulty_dts += dts <=
dc->pts_correction_last_dts;
297 dc->pts_correction_last_dts = dts;
299 dc->pts_correction_last_dts = reordered_pts;
302 dc->pts_correction_num_faulty_pts += reordered_pts <=
dc->pts_correction_last_pts;
303 dc->pts_correction_last_pts = reordered_pts;
305 dc->pts_correction_last_pts = dts;
307 if ((
dc->pts_correction_num_faulty_pts<=
dc->pts_correction_num_faulty_dts || dts ==
AV_NOPTS_VALUE)
320 uint32_t discard_padding = 0;
321 uint8_t skip_reason = 0;
322 uint8_t discard_reason = 0;
325 if (side && side->
size >= 10) {
351 *discarded_samples +=
frame->nb_samples;
357 *discarded_samples +=
frame->nb_samples;
370 frame->pts += diff_ts;
372 frame->pkt_dts += diff_ts;
373 if (
frame->duration >= diff_ts)
374 frame->duration -= diff_ts;
386 if (discard_padding > 0 && discard_padding <= frame->nb_samples) {
387 if (discard_padding ==
frame->nb_samples) {
388 *discarded_samples +=
frame->nb_samples;
395 frame->duration = diff_ts;
400 (
int)discard_padding,
frame->nb_samples);
401 frame->nb_samples -= discard_padding;
420 int got_frame, consumed;
441 frame->pict_type =
dc->initial_pict_type;
442 frame->flags |=
dc->intra_only_flag;
493 "Stop draining and force EOF.\n");
536 if (!sd || !sd->
size)
539 if (!avci->icc.avctx) {
560 frame->color_primaries = prim;
562 frame->color_trc = trc;
593 if (!
frame->ch_layout.nb_channels) {
598 if (!
frame->sample_rate)
610 while (!
frame->buf[0]) {
632 frame->pict_type =
dc->initial_pict_type;
633 frame->flags |=
dc->intra_only_flag;
694 #if FF_API_INTERLACED_FRAME
709 if (
frame->private_ref) {
737 if (
dc->draining_started)
740 if (avpkt && !avpkt->
size && avpkt->
data)
750 dc->draining_started = 1;
764 if (
frame->crop_left >= INT_MAX -
frame->crop_right ||
765 frame->crop_top >= INT_MAX -
frame->crop_bottom ||
769 "Invalid cropping information set by a decoder: "
771 "(frame size %dx%d). This is a bug, please report it\n",
774 frame->crop_left = 0;
775 frame->crop_right = 0;
777 frame->crop_bottom = 0;
801 frame->sample_rate <= 0)
811 "This is a bug, please report it.\n");
843 #if FF_API_DROPCHANGED
881 " drop count: %d \n",
898 memset(sub, 0,
sizeof(*sub));
902 #define UTF8_MAX_BYTES 4
907 iconv_t cd = (iconv_t)-1;
936 outb = buf_pkt->
data;
937 outl = buf_pkt->
size;
939 if (iconv(cd, &inb, &inl, &outb, &outl) == (
size_t)-1 ||
940 iconv(cd,
NULL,
NULL, &outb, &outl) == (
size_t)-1 ||
941 outl >= buf_pkt->
size || inl != 0) {
947 buf_pkt->
size -= outl;
948 memset(buf_pkt->
data + buf_pkt->
size, 0, outl);
955 if (cd != (iconv_t)-1)
967 uint32_t codepoint,
min;
971 GET_UTF8(codepoint, *(
byte++),
return 0;);
972 min =
byte - str == 1 ? 0 :
byte - str == 2 ? 0x80 :
973 1 << (5 * (
byte - str) - 4);
974 if (codepoint < min || codepoint >= 0x110000 ||
975 codepoint == 0xFFFE ||
976 codepoint >= 0xD800 && codepoint <= 0xDFFF )
984 int *got_sub_ptr,
const AVPacket *avpkt)
1039 "Invalid UTF-8 in decoded subtitles text; "
1040 "maybe missing -sub_charenc option\n");
1076 if (
config->pix_fmt == fmt[n])
1099 if (
config->pix_fmt == fmt[n])
1131 "required for hardware accelerated decoding.\n");
1136 if (device_ctx->
type != dev_type) {
1177 bool clean_priv_data =
false;
1202 clean_priv_data =
true;
1221 *out_frames_ref = frames_ref;
1223 if (clean_priv_data)
1254 "hwaccel initialisation returned error.\n",
1298 choices =
av_memdup(fmt, (n + 1) *
sizeof(*choices));
1306 user_choice = avctx->
get_format(avctx, choices);
1316 "get_format() callback.\n");
1323 for (
i = 0;
i < n;
i++) {
1324 if (choices[
i] == user_choice)
1329 "%s not in possible list.\n",
desc->name);
1358 if (frames_ctx->
format != user_choice) {
1360 "does not match the format of the provided frames "
1361 "context.\n",
desc->name);
1364 }
else if (
config->methods &
1371 "does not match the type of the provided device "
1372 "context.\n",
desc->name);
1375 }
else if (
config->methods &
1378 }
else if (
config->methods &
1383 "missing configuration.\n",
desc->name);
1398 "get_format() without it.\n",
desc->name);
1399 for (
i = 0;
i < n;
i++) {
1400 if (choices[
i] == user_choice)
1403 for (;
i + 1 < n;
i++)
1404 choices[
i] = choices[
i + 1];
1419 for (
int i = 0;
i < nb_sd;
i++)
1454 dst->primary_eye =
src->primary_eye;
1457 dst->baseline =
src->baseline;
1459 if (!
dst->horizontal_disparity_adjustment.num)
1460 dst->horizontal_disparity_adjustment =
src->horizontal_disparity_adjustment;
1462 if (!
dst->horizontal_field_of_view.num)
1463 dst->horizontal_field_of_view =
src->horizontal_field_of_view;
1507 const uint8_t *side_metadata;
1533 #if FF_API_FRAME_PKT
1579 #if FF_API_FRAME_PKT
1594 frame->sample_aspect_ratio) < 0) {
1596 frame->sample_aspect_ratio.num,
1597 frame->sample_aspect_ratio.den);
1614 for (
i = 0;
i < num_planes;
i++) {
1620 av_log(avctx,
AV_LOG_ERROR,
"Buffer returned by get_buffer2() did not zero unused plane pointers\n");
1658 frame->private_ref = fdd_buf;
1671 if (
dc->lcevc_frame) {
1684 if (
dc->lcevc_frame) {
1694 dc->lcevc_frame = 0;
1700 int override_dimensions = 1;
1713 if (
frame->width <= 0 ||
frame->height <= 0) {
1716 override_dimensions = 0;
1784 av_log(avctx,
AV_LOG_WARNING,
"Picture changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s in reget buffer()\n",
1789 if (!
frame->data[0])
1844 f->f =
f->progress->f;
1968 "supported with subtitles codecs\n");
1972 "subtitles character encoding will be ignored\n",
1983 iconv_t cd = iconv_open(
"UTF-8", avctx->
sub_charenc);
1984 if (cd == (iconv_t)-1) {
1987 "with input character encoding \"%s\"\n", avctx->
sub_charenc);
1993 "conversion needs a libavcodec built with iconv support "
1994 "for this codec\n");
2001 dc->pts_correction_num_faulty_pts =
2002 dc->pts_correction_num_faulty_dts = 0;
2003 dc->pts_correction_last_pts =
2004 dc->pts_correction_last_dts = INT64_MIN;
2009 "gray decoding requested but not enabled at configuration time\n");
2016 dc->side_data_pref_mask = ~0ULL;
2037 dc->side_data_pref_mask |= 1ULL <<
val;
2068 #if FF_API_DROPCHANGED
2090 if (
dc->side_data_pref_mask & (1ULL <<
type))
2115 return sd ? 0 :
AVERROR(ENOMEM);
2188 return *mdm ? 0 :
AVERROR(ENOMEM);
2233 return *clm ? 0 :
AVERROR(ENOMEM);
2260 if (
hwaccel->free_frame_priv) {
2274 if (!*hwaccel_picture_private)
2288 dc->pts_correction_last_pts =
2289 dc->pts_correction_last_dts = INT64_MIN;
2294 dc->nb_draining_errors = 0;
2295 dc->draining_started = 0;
const AVPacketSideData * ff_get_coded_side_data(const AVCodecContext *avctx, enum AVPacketSideDataType type)
Get side data of the given type from a decoding context.
int intra_only_flag
This is set to AV_FRAME_FLAG_KEY for decoders of intra-only formats (those whose codec descriptor has...
void ff_progress_frame_report(ProgressFrame *f, int n)
Notify later decoding threads when part of their reference frame is ready.
int av_samples_copy(uint8_t *const *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.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
#define FF_ENABLE_DEPRECATION_WARNINGS
int(* receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame)
Decode API with decoupled packet/frame dataflow.
AVCodecParameters * par_in
Parameters of the input stream.
static int hwaccel_init(AVCodecContext *avctx, const FFHWAccel *hwaccel)
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt)
Called by decoders to get the next packet for decoding.
static enum AVPixelFormat hw_pix_fmt
static void progress_frame_pool_reset_cb(FFRefStructOpaque unused, void *obj)
AVPixelFormat
Pixel format.
#define AV_EF_EXPLODE
abort decoding on minor error detection
void ff_thread_progress_report(ThreadProgress *pro, int n)
This function is a no-op in no-op mode; otherwise it notifies other threads that a certain level of p...
void * ff_refstruct_ref(void *obj)
Create a new reference to an object managed via this API, i.e.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVPixelFormat(* get_format)(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
Callback to negotiate the pixel format.
int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, AVColorPrimariesDesc *out_primaries)
Read the color primaries and white point coefficients encoded by an ICC profile, and return the raw v...
enum AVColorSpace colorspace
YUV colorspace type.
AVColorTransferCharacteristic
Color Transfer Characteristic.
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Select the (possibly hardware accelerated) pixel format.
static int apply_cropping(AVCodecContext *avctx, AVFrame *frame)
ThreadProgress is an API to easily notify other threads about progress of any kind as long as it can ...
int sample_rate
samples per second
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
Struct that contains both white point location and primaries location, providing the complete descrip...
enum AVPictureType initial_pict_type
This is set to AV_PICTURE_TYPE_I for intra only video decoders and to AV_PICTURE_TYPE_NONE for other ...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AVERROR_EOF
End of file.
uint8_t * data
The data buffer.
int ff_lcevc_alloc(FFLCEVCContext **plcevc)
#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL
HWAccel is experimental and is thus avoided in favor of non experimental codecs.
@ AV_FRAME_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
#define AV_PKT_FLAG_DISCARD
Flag is used to discard packets which are required to maintain valid decoder state but are not requir...
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
int skip_samples
Number of audio samples to skip at the start of the next decoded frame.
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
#define AV_CODEC_FLAG_UNALIGNED
Allow decoders to produce frames with data planes that are not aligned to CPU requirements (e....
const struct AVCodecDescriptor * codec_descriptor
AVCodecDescriptor.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
const char * name
Name of the codec described by this descriptor.
AVPacketSideData * coded_side_data
Additional data associated with the entire coded stream.
static void * ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, void(*free_cb)(FFRefStructOpaque opaque, void *obj))
A wrapper around ff_refstruct_alloc_ext_c() for the common case of a non-const qualified opaque.
static int decode_simple_receive_frame(AVCodecContext *avctx, AVFrame *frame)
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
AVHWAccel p
The public AVHWAccel.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
void * opaque
Frame owner's private data.
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
int64_t pts_correction_last_pts
Number of incorrect DTS values so far.
This structure describes decoded (raw) audio or video data.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
int capabilities
Codec capabilities.
int(* frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Fill the given hw_frames context with current codec parameters.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
int ff_progress_frame_get_buffer(AVCodecContext *avctx, ProgressFrame *f, int flags)
This function sets up the ProgressFrame, i.e.
@ AV_PKT_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1:2014.
uint8_t * subtitle_header
@ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE
void(* hwaccel_priv_free)(void *priv)
#define FF_HW_SIMPLE_CALL(avctx, function)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define FF_COMPLIANCE_EXPERIMENTAL
Allow nonstandardized experimental things.
#define FF_SUB_CHARENC_MODE_PRE_DECODER
the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
RefStruct is an API for creating reference-counted objects with minimal overhead.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *avctx, const enum AVPixelFormat *fmt)
int avcodec_is_open(AVCodecContext *s)
int nb_channels
Number of channels in this layout.
#define ff_thread_receive_frame(avctx, frame)
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
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.
static DecodeContext * decode_ctx(AVCodecInternal *avci)
void av_bsf_free(AVBSFContext **pctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
#define FF_SUB_CHARENC_MODE_AUTOMATIC
libavcodec will select the mode itself
@ AV_STEREO3D_VIEW_UNSPEC
Content is unspecified.
@ AV_STEREO3D_UNSPEC
Video is stereoscopic but the packing is unspecified.
int av_frame_apply_cropping(AVFrame *frame, int flags)
Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ crop_bottom fields.
@ AV_CODEC_HW_CONFIG_METHOD_INTERNAL
The codec supports this format by some internal method.
int64_t pts_correction_num_faulty_dts
Number of incorrect PTS values so far.
void ff_hwaccel_uninit(AVCodecContext *avctx)
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
static int decode_get_packet(AVCodecContext *avctx, AVPacket *pkt)
uint8_t max_lowres
maximum value for lowres supported by the decoder
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
struct FFRefStructPool * progress_frame_pool
#define AV_CODEC_FLAG_COPY_OPAQUE
static int64_t guess_correct_pts(DecodeContext *dc, int64_t reordered_pts, int64_t dts)
Attempt to guess proper monotonic timestamps for decoded video frames which might have incorrect time...
const struct AVCodec * codec
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
AVChannelLayout ch_layout
Audio channel layout.
int ff_icc_context_init(FFIccContext *s, void *avctx)
Initializes an FFIccContext.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
@ AV_FRAME_CROP_UNALIGNED
Apply the maximum possible cropping, even if it requires setting the AVFrame.data[] entries to unalig...
int ff_lcevc_process(void *logctx, AVFrame *frame)
#define FF_SUB_CHARENC_MODE_DO_NOTHING
do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for inst...
int flags
AV_CODEC_FLAG_*.
static double val(void *priv, double ch)
void(* post_process_opaque_free)(void *opaque)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx, AVFrame *frame, const AVPacket *pkt)
Set various frame properties from the provided packet.
@ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
The codec supports this format via the hw_frames_ctx interface.
static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame)
int64_t max_samples
The number of samples per frame to maximally accept.
char * ass
0 terminated ASS/SSA compatible event line.
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef **buf)
Similar to ff_frame_new_side_data, but using an existing buffer ref.
@ AV_CODEC_HW_CONFIG_METHOD_AD_HOC
The codec supports this format by some ad-hoc method.
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
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.
#define FF_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR
If this flag is set and both init_cb and free_entry_cb callbacks are provided, then free_cb will be c...
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
Decode a subtitle message.
int ff_decode_content_light_new_ext(const AVCodecContext *avctx, AVFrameSideData ***sd, int *nb_sd, AVContentLightMetadata **clm)
Same as ff_decode_content_light_new, but taking a AVFrameSideData array directly instead of an AVFram...
#define AV_CODEC_FLAG_DROPCHANGED
Don't output frames whose parameters differ from first decoded frame in stream.
#define FF_CODEC_CAP_USES_PROGRESSFRAMES
The decoder might make use of the ProgressFrame API.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
@ AV_PKT_DATA_PARAM_CHANGE
An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame)
avcodec_receive_frame() implementation for decoders.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
int has_b_frames
Size of the frame reordering buffer in the decoder.
void ff_progress_frame_ref(ProgressFrame *dst, const ProgressFrame *src)
Set dst->f to src->f and make dst a co-owner of src->f.
@ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS
int * side_data_prefer_packet
Decoding only.
int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private)
Allocate a hwaccel frame private data if the provided avctx uses a hwaccel method that needs it.
static void get_subtitle_defaults(AVSubtitle *sub)
void * post_process_opaque
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static void validate_avframe_allocation(AVCodecContext *avctx, AVFrame *frame)
AVPacket * buffer_pkt
Temporary buffers for newly received or not yet output packets/frames.
void av_bsf_flush(AVBSFContext *ctx)
Reset the internal bitstream filter state.
#define AV_CEIL_RSHIFT(a, b)
int priv_data_size
Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.
#define AV_BUFFER_FLAG_READONLY
Always treat the buffer as read-only, even when it has only one reference.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
#define AVERROR_INPUT_CHANGED
Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void ff_progress_frame_unref(ProgressFrame *f)
Give up a reference to the underlying frame contained in a ProgressFrame and reset the ProgressFrame,...
AVRational time_base_in
The timebase used for the timestamps of the input packets.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
enum AVPixelFormat pix_fmt
For decoders, a hardware pixel format which that decoder may be able to decode to if suitable hardwar...
int64_t pts
Same as packet pts, in AV_TIME_BASE.
enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm)
Detects which enum AVColorPrimaries constant corresponds to the given complete gamut description.
int64_t max_pixels
The number of pixels per image to maximally accept.
@ AV_PKT_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
FFRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
void * opaque
for some private data of the user
const struct FFHWAccel * hwaccel
If this configuration uses a hwaccel, a pointer to it.
static void check_progress_consistency(const ProgressFrame *f)
int(* decode)(struct AVCodecContext *avctx, struct AVFrame *frame, int *got_frame_ptr, struct AVPacket *avpkt)
Decode to an AVFrame.
static int discard_samples(AVCodecContext *avctx, AVFrame *frame, int64_t *discarded_samples)
static void decode_data_free(void *opaque, uint8_t *data)
int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx, enum AVHWDeviceType dev_type)
Make sure avctx.hw_frames_ctx is set.
int ff_decode_mastering_display_new(const AVCodecContext *avctx, AVFrame *frame, AVMasteringDisplayMetadata **mdm)
Wrapper around av_mastering_display_metadata_create_side_data(), which rejects side data overridden b...
int draining_started
The caller has submitted a NULL packet on input.
#define ff_thread_get_packet(avctx, pkt)
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
int changed_frames_dropped
char * sub_charenc
Character encoding of the input subtitles file.
AVCodecInternal * ff_decode_internal_alloc(void)
#define AV_CODEC_FLAG2_SKIP_MANUAL
Do not skip samples and export skip information as frame side data.
#define AV_CODEC_PROP_INTRA_ONLY
Codec uses only intra compression.
void ff_thread_progress_await(const ThreadProgress *pro_c, int n)
This function is a no-op in no-op mode; otherwise it waits until other threads have reached a certain...
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
static int utf8_check(const uint8_t *str)
static void update_frame_props(AVCodecContext *avctx, AVFrame *frame)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
void ff_decode_flush_buffers(AVCodecContext *avctx)
int apply_cropping
Video decoding only.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
Rational number (pair of numerator and denominator).
struct AVCodecInternal * internal
Private context used for internal data.
void av_frame_side_data_remove(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type from an array.
@ FF_CODEC_CB_TYPE_DECODE_SUB
@ AV_PICTURE_TYPE_I
Intra.
void ff_lcevc_unref(void *opaque)
#define AV_CODEC_PROP_BITMAP_SUB
Subtitle codec is bitmap based Decoded AVSubtitle data can be read from the AVSubtitleRect->pict fiel...
@ AV_FRAME_DATA_ICC_PROFILE
The data contains an ICC profile as an opaque octet buffer following the format described by ISO 1507...
static void * ff_refstruct_allocz(size_t size)
Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL)
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
int64_t pts_correction_last_dts
PTS of the last frame.
#define AV_CODEC_FLAG2_ICC_PROFILES
Generate/parse ICC profiles on encode/decode, as appropriate for the type of file.
int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, enum AVColorTransferCharacteristic *out_trc)
Attempt detecting the transfer characteristic that best approximates the transfer function encoded by...
@ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
The codec supports this format via the hw_device_ctx interface.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
#define FF_HW_HAS_CB(avctx, function)
#define AVPACKET_IS_EMPTY(pkt)
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
const SideDataMap ff_sd_global_map[]
A map between packet and frame side data types.
@ AVCOL_RANGE_UNSPECIFIED
#define AV_CODEC_EXPORT_DATA_ENHANCEMENTS
Decoding only.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
AVPacket * last_pkt_props
Properties (timestamps+side data) extracted from the last packet passed for decoding.
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
@ AV_PKT_DATA_NB
The number of side data types.
#define attribute_align_arg
int av_codec_is_decoder(const AVCodec *codec)
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
int flags2
AV_CODEC_FLAG2_*.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
enum AVPacketSideDataType packet
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
int ff_progress_frame_alloc(AVCodecContext *avctx, ProgressFrame *f)
This function allocates ProgressFrame.f May be called before ff_progress_frame_get_buffer() in the ca...
Tag MUST be and< 10hcoeff half pel interpolation filter coefficients, hcoeff[0] are the 2 middle coefficients[1] are the next outer ones and so on, resulting in a filter like:...eff[2], hcoeff[1], hcoeff[0], hcoeff[0], hcoeff[1], hcoeff[2] ... the sign of the coefficients is not explicitly stored but alternates after each coeff and coeff[0] is positive, so ...,+,-,+,-,+,+,-,+,-,+,... hcoeff[0] is not explicitly stored but found by subtracting the sum of all stored coefficients with signs from 32 hcoeff[0]=32 - hcoeff[1] - hcoeff[2] - ... a good choice for hcoeff and htaps is htaps=6 hcoeff={40,-10, 2} an alternative which requires more computations at both encoder and decoder side and may or may not be better is htaps=8 hcoeff={42,-14, 6,-2}ref_frames minimum of the number of available reference frames and max_ref_frames for example the first frame after a key frame always has ref_frames=1spatial_decomposition_type wavelet type 0 is a 9/7 symmetric compact integer wavelet 1 is a 5/3 symmetric compact integer wavelet others are reserved stored as delta from last, last is reset to 0 if always_reset||keyframeqlog quality(logarithmic quantizer scale) stored as delta from last, last is reset to 0 if always_reset||keyframemv_scale stored as delta from last, last is reset to 0 if always_reset||keyframe FIXME check that everything works fine if this changes between framesqbias dequantization bias stored as delta from last, last is reset to 0 if always_reset||keyframeblock_max_depth maximum depth of the block tree stored as delta from last, last is reset to 0 if always_reset||keyframequant_table quantization tableHighlevel bitstream structure:==============================--------------------------------------------|Header|--------------------------------------------|------------------------------------|||Block0||||split?||||yes no||||......... intra?||||:Block01 :yes no||||:Block02 :....... ..........||||:Block03 ::y DC ::ref index:||||:Block04 ::cb DC ::motion x :||||......... :cr DC ::motion y :||||....... ..........|||------------------------------------||------------------------------------|||Block1|||...|--------------------------------------------|------------ ------------ ------------|||Y subbands||Cb subbands||Cr subbands||||--- ---||--- ---||--- ---|||||LL0||HL0||||LL0||HL0||||LL0||HL0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||LH0||HH0||||LH0||HH0||||LH0||HH0|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HL1||LH1||||HL1||LH1||||HL1||LH1|||||--- ---||--- ---||--- ---||||--- ---||--- ---||--- ---|||||HH1||HL2||||HH1||HL2||||HH1||HL2|||||...||...||...|||------------ ------------ ------------|--------------------------------------------Decoding process:=================------------|||Subbands|------------||||------------|Intra DC||||LL0 subband prediction ------------|\ Dequantization ------------------- \||Reference frames|\ IDWT|------- -------|Motion \|||Frame 0||Frame 1||Compensation . OBMC v -------|------- -------|--------------. \------> Frame n output Frame Frame<----------------------------------/|...|------------------- Range Coder:============Binary Range Coder:------------------- The implemented range coder is an adapted version based upon "Range encoding: an algorithm for removing redundancy from a digitised message." by G. N. N. Martin. The symbols encoded by the Snow range coder are bits(0|1). The associated probabilities are not fix but change depending on the symbol mix seen so far. bit seen|new state ---------+----------------------------------------------- 0|256 - state_transition_table[256 - old_state];1|state_transition_table[old_state];state_transition_table={ 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 190, 191, 192, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 202, 204, 205, 206, 207, 208, 209, 209, 210, 211, 212, 213, 215, 215, 216, 217, 218, 219, 220, 220, 222, 223, 224, 225, 226, 227, 227, 229, 229, 230, 231, 232, 234, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 248, 0, 0, 0, 0, 0, 0, 0};FIXME Range Coding of integers:------------------------- FIXME Neighboring Blocks:===================left and top are set to the respective blocks unless they are outside of the image in which case they are set to the Null block top-left is set to the top left block unless it is outside of the image in which case it is set to the left block if this block has no larger parent block or it is at the left side of its parent block and the top right block is not outside of the image then the top right block is used for top-right else the top-left block is used Null block y, cb, cr are 128 level, ref, mx and my are 0 Motion Vector Prediction:=========================1. the motion vectors of all the neighboring blocks are scaled to compensate for the difference of reference frames scaled_mv=(mv *(256 *(current_reference+1)/(mv.reference+1))+128)> the median of the scaled top and top right vectors is used as motion vector prediction the used motion vector is the sum of the predictor and(mvx_diff, mvy_diff) *mv_scale Intra DC Prediction block[y][x] dc[1]
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_WB16 unsigned int_TMPL byte
int extra_hw_frames
Video decoding only.
int(* post_process)(void *logctx, AVFrame *frame)
The callback to perform some delayed processing on the frame right before it is returned to the calle...
void * hwaccel_priv_data
hwaccel-specific private data
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
@ AV_PKT_DATA_DYNAMIC_HDR10_PLUS
HDR10+ dynamic metadata associated with a video frame.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define FF_CODEC_CAP_SETS_FRAME_PROPS
Codec handles output frame properties internally instead of letting the internal logic derive them fr...
struct AVBSFContext * bsf
enum AVSampleFormat sample_fmt
audio sample format
@ AV_FRAME_DATA_LCEVC
Raw LCEVC payload data, as a uint8_t array, with NAL emulation bytes intact.
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
#define FF_CODEC_CAP_EXPORTS_CROPPING
The decoder sets the cropping fields in the output frames manually.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int frame_validate(AVCodecContext *avctx, AVFrame *frame)
int ff_frame_new_side_data(const AVCodecContext *avctx, AVFrame *frame, enum AVFrameSideDataType type, size_t size, AVFrameSideData **psd)
Wrapper around av_frame_new_side_data, which rejects side data overridden by the demuxer.
int ff_frame_new_side_data_from_buf_ext(const AVCodecContext *avctx, AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef **buf)
Same as ff_frame_new_side_data_from_buf, but taking a AVFrameSideData array directly instead of an AV...
static int side_data_pref(const AVCodecContext *avctx, AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type)
Check side data preference and clear existing side data from frame if needed.
static const av_always_inline FFCodec * ffcodec(const AVCodec *codec)
int av_frame_is_writable(AVFrame *frame)
Check if the frame data is writable.
static int fill_frame_props(const AVCodecContext *avctx, AVFrame *frame)
@ AVCHROMA_LOC_UNSPECIFIED
@ AV_PICTURE_TYPE_NONE
Undefined.
int av_buffer_make_writable(AVBufferRef **pbuf)
Create a writable reference from a given buffer reference, avoiding data copy if possible.
uint32_t end_display_time
int av_packet_unpack_dictionary(const uint8_t *data, size_t size, AVDictionary **dict)
Unpack a dictionary from side_data.
void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
Remove and free all side data instances of the given type.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
@ AV_PRIMARY_EYE_NONE
Neither eye.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
enum AVFrameSideDataType frame
int flags
A combination of AV_PKT_FLAG values.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void ff_progress_frame_await(const ProgressFrame *f, int n)
Wait for earlier decoding threads to finish reference frames.
const struct AVCodecHWConfigInternal *const * hw_configs
Array of pointers to hardware configurations supported by the codec, or NULL if no hardware supported...
uint64_t side_data_pref_mask
DTS of the last frame.
@ FF_THREAD_NO_FRAME_THREADING
static const AVPacketSideData * packet_side_data_get(const AVPacketSideData *sd, int nb_sd, enum AVPacketSideDataType type)
unsigned nb_side_data_prefer_packet
Number of entries in side_data_prefer_packet.
static int detect_colorspace(av_unused AVCodecContext *c, av_unused AVFrame *f)
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
#define AV_LOG_INFO
Standard information.
#define FF_THREAD_FRAME
Decode more than one frame at once.
@ AV_FRAME_DATA_SKIP_SAMPLES
Recommmends skipping the specified number of samples.
const char * name
Name of the hardware accelerated codec.
@ AV_PKT_DATA_STRINGS_METADATA
A list of zero terminated key/value strings.
int is_frame_mt
This field is set to 1 when frame threading is being used and the parent AVCodecContext of this AVCod...
int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
unsigned caps_internal
Internal codec capabilities FF_CODEC_CAP_*.
static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt)
static void uninit(AVBSFContext *ctx)
int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
Copy only "properties" fields from src to dst.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd)
Free all side data entries and their contents, then zeroes out the values which the pointers are poin...
static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
static void attach_post_process_data(AVCodecContext *avctx, AVFrame *frame)
static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
int ff_decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
Do the actual decoding and obtain a decoded frame from the decoder, if available.
AVPacket * in_pkt
This packet is used to hold the packet given to decoders implementing the .decode API; it is unused b...
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int ff_decode_preinit(AVCodecContext *avctx)
Perform decoder initialization and validation.
av_cold int ff_thread_progress_init(ThreadProgress *pro, int init_mode)
Initialize a ThreadProgress.
@ AV_FRAME_DATA_STEREO3D
Stereoscopic 3d metadata.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
Ensure dst refers to the same data as src.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
static int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, int64_t *discarded_samples)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
int(* decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, int *got_frame_ptr, const struct AVPacket *avpkt)
Decode subtitle data to an AVSubtitle.
int sub_charenc_mode
Subtitles character encoding mode.
This struct describes a set or pool of "hardware" frames (i.e.
int64_t frame_num
Frame counter, set by libavcodec.
int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, AVBufferRef *device_ref, enum AVPixelFormat hw_pix_fmt, AVBufferRef **out_frames_ref)
Create and return a AVHWFramesContext with values adequate for hardware decoding.
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
#define AV_CODEC_PROP_TEXT_SUB
Subtitle codec is text based.
int av_channel_layout_check(const AVChannelLayout *channel_layout)
Check whether a channel layout is valid, i.e.
enum ThreadingStatus ff_thread_sync_ref(AVCodecContext *avctx, size_t offset)
Allows to synchronize objects whose lifetime is the whole decoding process among all frame threads.
static const char * hwaccel
void ff_refstruct_replace(void *dstp, const void *src)
Ensure *dstp refers to the same object as src.
int ff_decode_content_light_new(const AVCodecContext *avctx, AVFrame *frame, AVContentLightMetadata **clm)
Wrapper around av_content_light_metadata_create_side_data(), which rejects side data overridden by th...
av_cold void ff_thread_progress_destroy(ThreadProgress *pro)
Destroy a ThreadProgress.
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
#define AV_INPUT_BUFFER_PADDING_SIZE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
void ff_progress_frame_replace(ProgressFrame *dst, const ProgressFrame *src)
Do nothing if dst and src already refer to the same AVFrame; otherwise unreference dst and if src is ...
static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt)
static av_cold int progress_frame_pool_init_cb(FFRefStructOpaque opaque, void *obj)
static av_cold void progress_frame_pool_free_entry_cb(FFRefStructOpaque opaque, void *obj)
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
Set various frame properties from the codec context / packet data.
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
main external API structure.
int active_thread_type
Which multithreading methods are in use by the codec.
static int recode_subtitle(AVCodecContext *avctx, const AVPacket **outpkt, const AVPacket *inpkt, AVPacket *buf_pkt)
static FFRefStructPool * ff_refstruct_pool_alloc_ext(size_t size, unsigned flags, void *opaque, int(*init_cb)(FFRefStructOpaque opaque, void *obj), void(*reset_cb)(FFRefStructOpaque opaque, void *obj), void(*free_entry_cb)(FFRefStructOpaque opaque, void *obj), void(*free_cb)(FFRefStructOpaque opaque))
A wrapper around ff_refstruct_pool_alloc_ext_c() for the common case of a non-const qualified opaque.
static const FFHWAccel * ffhwaccel(const AVHWAccel *codec)
static int side_data_stereo3d_merge(AVFrameSideData *sd_frame, const AVPacketSideData *sd_pkt)
@ AV_PKT_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
@ AV_PKT_DATA_SKIP_SAMPLES
Recommmends skipping the specified number of samples.
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
@ FF_CODEC_CB_TYPE_RECEIVE_FRAME
static void ff_thread_progress_reset(ThreadProgress *pro)
Reset the ThreadProgress.progress counter; must only be called if the ThreadProgress is not in use in...
unsigned cb_type
This field determines the type of the codec (decoder/encoder) and also the exact callback cb implemen...
const AVCodecHWConfig * avcodec_get_hw_config(const AVCodec *codec, int index)
Retrieve supported hardware configurations for a codec.
#define AV_CODEC_CAP_PARAM_CHANGE
Codec supports changed parameters at any point.
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
int draining
decoding: AVERROR_EOF has been returned from ff_decode_get_packet(); must not be used by decoders tha...
const char * bsfs
Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding.
#define FF_DISABLE_DEPRECATION_WARNINGS
int coded_width
Bitstream width / height, may be different from width/height e.g.
int initial_pool_size
Initial size of the frame pool.
enum AVMediaType codec_type
#define AV_FRAME_FLAG_DISCARD
A flag to mark the frames which need to be decoded, but shouldn't be output.
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst)
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole...
int ff_decode_mastering_display_new_ext(const AVCodecContext *avctx, AVFrameSideData ***sd, int *nb_sd, struct AVMasteringDisplayMetadata **mdm)
Same as ff_decode_mastering_display_new, but taking a AVFrameSideData array directly instead of an AV...
static int side_data_map(AVFrame *dst, const AVPacketSideData *sd_src, int nb_sd_src, const SideDataMap *map)
@ AV_PKT_DATA_A53_CC
ATSC A53 Part 4 Closed Captions.
void ff_decode_internal_uninit(AVCodecContext *avctx)
A reference to a data buffer.
#define AV_CODEC_EXPORT_DATA_MVS
Export motion vectors through frame side data.
int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile)
Sanitize an ICC profile to try and fix badly broken values.
int ff_attach_decode_data(AVFrame *frame)
AVChannelLayout initial_ch_layout
int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
Structure to hold side data for an AVFrame.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
const VDPAUPixFmtMap * map
#define AV_CODEC_FLAG2_EXPORT_MVS
Export motion vectors through frame side data.
The ProgressFrame structure.
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
int64_t pts_correction_num_faulty_pts
static const AVFrameSideData * av_frame_side_data_get(AVFrameSideData *const *sd, const int nb_sd, enum AVFrameSideDataType type)
Wrapper around av_frame_side_data_get_c() to workaround the limitation that for any type T the conver...
int width
picture width / height.
void * hwaccel_priv
Per-frame private data for hwaccels.
#define flags(name, subs,...)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
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.
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx)
Check whether the side-data of src contains a palette of size AVPALETTE_SIZE; if so,...
AVCodecHWConfig public
This is the structure which will be returned to the user by avcodec_get_hw_config().
static int decode_bsfs_init(AVCodecContext *avctx)
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
enum AVPixelFormat pix_fmt
Supported pixel format.
void ff_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
AVFrameSideData * av_frame_side_data_add(AVFrameSideData ***sd, int *nb_sd, enum AVFrameSideDataType type, AVBufferRef **pbuf, unsigned int flags)
Add a new side data entry to an array from an existing AVBufferRef.
#define FF_REGET_BUFFER_FLAG_READONLY
the returned buffer does not need to be writable
void * ff_refstruct_pool_get(FFRefStructPool *pool)
Get an object from the pool, reusing an old one from the pool when available.
void ff_decode_internal_sync(AVCodecContext *dst, const AVCodecContext *src)
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.
#define FF_SUB_CHARENC_MODE_IGNORE
neither convert the subtitles, nor check them for valid UTF-8