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
35 * Copy the frame properties of src to dst, without copying the actual
38 * @return 0 on success, a negative number on error.
40 int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
43 * Copy the frame properties and data pointers of src to dst, without copying
46 * @return 0 on success, a negative number on error.
48 int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
51 * Create and return a picref reference from the data and properties
54 * @param perms permissions to assign to the new buffer reference
56 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
60 * Create and return a picref reference from the data and properties
63 * @param perms permissions to assign to the new buffer reference
65 AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
69 * Create and return a buffer reference from the data and properties
72 * @param perms permissions to assign to the new buffer reference
74 AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
78 #ifdef FF_API_FILL_FRAME
80 * Fill an AVFrame with the information stored in samplesref.
82 * @param frame an already allocated AVFrame
83 * @param samplesref an audio buffer reference
84 * @return 0 in case of success, a negative AVERROR code in case of
86 * @deprecated Use avfilter_copy_buf_props() instead.
89 int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
90 const AVFilterBufferRef *samplesref);
93 * Fill an AVFrame with the information stored in picref.
95 * @param frame an already allocated AVFrame
96 * @param picref a video buffer reference
97 * @return 0 in case of success, a negative AVERROR code in case of
99 * @deprecated Use avfilter_copy_buf_props() instead.
102 int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
103 const AVFilterBufferRef *picref);
106 * Fill an AVFrame with information stored in ref.
108 * @param frame an already allocated AVFrame
109 * @param ref a video or audio buffer reference
110 * @return 0 in case of success, a negative AVERROR code in case of
112 * @deprecated Use avfilter_copy_buf_props() instead.
115 int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
116 const AVFilterBufferRef *ref);
120 * Add frame data to buffer_src.
122 * @param buffer_src pointer to a buffer source context
123 * @param frame a frame, or NULL to mark EOF
124 * @param flags a combination of AV_BUFFERSRC_FLAG_*
125 * @return >= 0 in case of success, a negative AVERROR code
128 int av_buffersrc_add_frame(AVFilterContext *buffer_src,
129 const AVFrame *frame, int flags);
131 #endif /* AVFILTER_AVCODEC_H */