36 #if FF_API_AVFILTERBUFFER
37 void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
39 if (ptr->extended_data != ptr->data)
45 static int copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *
src) {
48 int qsize = src->qp_table_size;
52 dst->qp_table_size = 0;
55 memcpy(dst->qp_table, src->qp_table, qsize);
60 AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref,
int pmask)
62 AVFilterBufferRef *
ret =
av_malloc(
sizeof(AVFilterBufferRef));
71 ret->video =
av_malloc(
sizeof(AVFilterBufferRefVideoProps));
76 copy_video_props(ret->video, ref->video);
77 ret->extended_data = ret->data;
79 ret->audio =
av_malloc(
sizeof(AVFilterBufferRefAudioProps));
84 *ret->audio = *ref->audio;
86 if (ref->extended_data && ref->extended_data != ref->data) {
94 memcpy(ret->extended_data, ref->extended_data,
95 sizeof(*ret->extended_data) * nb_channels);
97 ret->extended_data = ret->data;
100 ret->buf->refcount ++;
104 void avfilter_unref_buffer(AVFilterBufferRef *ref)
109 if (!(--ref->buf->refcount))
110 ref->buf->free(ref->buf);
111 if (ref->extended_data != ref->data)
121 void avfilter_unref_bufferp(AVFilterBufferRef **ref)
124 avfilter_unref_buffer(*ref);
129 int avfilter_copy_frame_props(AVFilterBufferRef *dst,
const AVFrame *src)
133 dst->format = src->
format;
140 dst->video->w = src->
width;
141 dst->video->h = src->
height;
159 void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst,
const AVFilterBufferRef *src)
167 if (dst->video->qp_table)
169 copy_video_props(dst->video, src->video);
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
Libavfilter version macros.
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int interlaced_frame
The content of the picture is interlaced.
void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
simple assert() macros that are a bit more flexible than ISO C assert().
Libavcodec external API header.
uint64_t channel_layout
Channel layout of the audio data.
common internal API header
audio channel layout utility functions
enum AVPictureType pict_type
Picture type of the frame.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
AVDictionary * av_frame_get_metadata(const AVFrame *frame)
int sample_rate
Sample rate of the audio data.
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal and external API header
#define FF_ENABLE_DEPRECATION_WARNINGS
int top_field_first
If the content is interlaced, is top field displayed first.
int64_t av_frame_get_pkt_pos(const AVFrame *frame)
int key_frame
1 -> keyframe, 0-> not
#define av_malloc_array(a, b)