31 #if FF_API_AVFILTERBUFFER
33 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(
const AVFrame *
frame,
36 AVFilterBufferRef *picref =
42 if (avfilter_copy_frame_props(picref, frame) < 0) {
43 picref->buf->data[0] =
NULL;
44 avfilter_unref_bufferp(&picref);
49 AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(
const AVFrame *frame,
52 AVFilterBufferRef *samplesref;
61 samplesref = avfilter_get_audio_buffer_ref_from_arrays_channels(
66 if (avfilter_copy_frame_props(samplesref, frame) < 0) {
67 samplesref->buf->data[0] =
NULL;
68 avfilter_unref_bufferp(&samplesref);
73 AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(
enum AVMediaType type,
79 return avfilter_get_video_buffer_ref_from_frame(frame, perms);
81 return avfilter_get_audio_buffer_ref_from_frame(frame, perms);
87 int avfilter_copy_buf_props(
AVFrame *dst,
const AVFilterBufferRef *
src)
96 memcpy(dst->
data, src->data,
sizeof(dst->
data));
100 dst->
format = src->format;
106 dst->
width = src->video->w;
107 dst->
height = src->video->h;
void av_frame_set_channels(AVFrame *frame, int val)
This structure describes decoded (raw) audio or video data.
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.
libavcodec/libavfilter gluing utilities
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.
void av_frame_set_channel_layout(AVFrame *frame, int64_t val)
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
simple assert() macros that are a bit more flexible than ISO C assert().
uint64_t channel_layout
Channel layout of the audio data.
int channels
number of audio channels, only used for audio.
audio channel layout utility functions
enum AVPictureType pict_type
Picture type of the frame.
void av_frame_set_pkt_pos(AVFrame *frame, int64_t val)
#define FF_ARRAY_ELEMS(a)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
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.
int av_frame_get_channels(const AVFrame *frame)
AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *const data[4], const int linesize[4], int perms, int w, int h, enum AVPixelFormat format)
int64_t av_frame_get_channel_layout(const AVFrame *frame)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define FF_DISABLE_DEPRECATION_WARNINGS
#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
void av_frame_set_sample_rate(AVFrame *frame, int val)
static void * av_mallocz_array(size_t nmemb, size_t size)
uint8_t ** extended_data
pointers to the data planes/channels.
int nb_samples
number of audio samples (per channel) described by this frame