28 #if FF_API_AVFILTERBUFFER 32 if (ptr->extended_data != ptr->data)
40 AVFilterBufferRef *ret =
av_malloc(
sizeof(AVFilterBufferRef));
45 ret->video =
av_malloc(
sizeof(AVFilterBufferRefVideoProps));
50 *ret->video = *ref->video;
51 ret->extended_data = ret->data;
53 ret->audio =
av_malloc(
sizeof(AVFilterBufferRefAudioProps));
58 *ret->audio = *ref->audio;
60 if (ref->extended_data != ref->data) {
62 if (!(ret->extended_data =
av_malloc(
sizeof(*ret->extended_data) *
68 memcpy(ret->extended_data, ref->extended_data,
69 sizeof(*ret->extended_data) * nb_channels);
71 ret->extended_data = ret->data;
74 ret->buf->refcount ++;
82 if (!(--ref->buf->refcount))
83 ref->buf->free(ref->buf);
84 if (ref->extended_data != ref->data)
102 dst->format = src->
format;
106 dst->video->w = src->
width;
107 dst->video->h = src->
height;
129 memcpy(dst->
data, src->data,
sizeof(dst->
data));
133 dst->
format = src->format;
137 dst->
width = src->video->w;
138 dst->
height = src->video->h;
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
This structure describes decoded (raw) audio or video data.
Main libavfilter public API header.
Libavfilter version macros.
#define FF_ARRAY_ELEMS(a)
void avfilter_unref_buffer(AVFilterBufferRef *ref)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
default handler for freeing audio/video buffer when there are no references left
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.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
int width
width and height of the video frame
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
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.
void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
int sample_rate
Sample rate of the audio data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal and external API header
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
#define FF_ENABLE_DEPRECATION_WARNINGS
int top_field_first
If the content is interlaced, is top field displayed first.
int key_frame
1 -> keyframe, 0-> not
int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src)
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
uint8_t ** extended_data
pointers to the data planes/channels.
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 ...
void avfilter_unref_bufferp(AVFilterBufferRef **ref)