2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVFILTER_AVCODEC_H
20 #define AVFILTER_AVCODEC_H
24 * libavcodec/libavfilter gluing utilities
26 * This should be included in an application ONLY if the installed
27 * libavfilter has been compiled with libavcodec support, otherwise
28 * symbols defined below will not be available.
31 #include "libavcodec/avcodec.h" // AVFrame
33 #include "vsrc_buffer.h"
36 * Copy the frame properties of src to dst, without copying the actual
39 * @return 0 on success, a negative number on error.
41 int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
44 * Copy the frame properties and data pointers of src to dst, without copying
47 * @return 0 on success, a negative number on error.
49 int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
52 * Create and return a picref reference from the data and properties
55 * @param perms permissions to assign to the new buffer reference
57 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
61 * Create and return a picref reference from the data and properties
64 * @param perms permissions to assign to the new buffer reference
66 AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
70 * Fill an AVFrame with the information stored in samplesref.
72 * @param frame an already allocated AVFrame
73 * @param samplesref an audio buffer reference
74 * @return 0 in case of success, a negative AVERROR code in case of
77 int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
78 const AVFilterBufferRef *samplesref);
81 * Fill an AVFrame with the information stored in picref.
83 * @param frame an already allocated AVFrame
84 * @param picref a video buffer reference
85 * @return 0 in case of success, a negative AVERROR code in case of
88 int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
89 const AVFilterBufferRef *picref);
92 * Fill an AVFrame with information stored in ref.
94 * @param frame an already allocated AVFrame
95 * @param ref a video or audio buffer reference
96 * @return 0 in case of success, a negative AVERROR code in case of
99 int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
100 const AVFilterBufferRef *ref);
103 * Add frame data to buffer_src.
105 * @param buffer_src pointer to a buffer source context
106 * @param frame a frame, or NULL to mark EOF
107 * @param flags a combination of AV_BUFFERSRC_FLAG_*
108 * @return >= 0 in case of success, a negative AVERROR code
111 int av_buffersrc_add_frame(AVFilterContext *buffer_src,
112 const AVFrame *frame, int flags);
115 * Add frame data to buffer_src.
117 * @param buffer_src pointer to a buffer source context
118 * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
119 * @return >= 0 in case of success, a negative AVERROR code in case of
122 int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
123 const AVFrame *frame, int flags);
125 #endif /* AVFILTER_AVCODEC_H */