]> git.sesse.net Git - ffmpeg/blob - libavfilter/avcodec.h
vsrc_cellauto: use AV_OPT_TYPE_IMAGE_SIZE.
[ffmpeg] / libavfilter / avcodec.h
1 /*
2  * This file is part of FFmpeg.
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef AVFILTER_AVCODEC_H
20 #define AVFILTER_AVCODEC_H
21
22 /**
23  * @file
24  * libavcodec/libavfilter gluing utilities
25  *
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.
29  */
30
31 #include "libavcodec/avcodec.h" // AVFrame
32 #include "avfilter.h"
33 #include "vsrc_buffer.h"
34
35 /**
36  * Copy the frame properties of src to dst, without copying the actual
37  * image data.
38  *
39  * @return 0 on success, a negative number on error.
40  */
41 int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
42
43 /**
44  * Copy the frame properties and data pointers of src to dst, without copying
45  * the actual data.
46  *
47  * @return 0 on success, a negative number on error.
48  */
49 int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
50
51 /**
52  * Create and return a picref reference from the data and properties
53  * contained in frame.
54  *
55  * @param perms permissions to assign to the new buffer reference
56  */
57 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
58
59
60 /**
61  * Create and return a picref reference from the data and properties
62  * contained in frame.
63  *
64  * @param perms permissions to assign to the new buffer reference
65  */
66 AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
67                                                             int perms);
68
69 /**
70  * Fill an AVFrame with the information stored in samplesref.
71  *
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
75  * failure
76  */
77 int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
78                                               const AVFilterBufferRef *samplesref);
79
80 /**
81  * Fill an AVFrame with the information stored in picref.
82  *
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
86  * failure
87  */
88 int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
89                                               const AVFilterBufferRef *picref);
90
91 /**
92  * Fill an AVFrame with information stored in ref.
93  *
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
97  * failure
98  */
99 int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
100                                         const AVFilterBufferRef *ref);
101
102 /**
103  * Add frame data to buffer_src.
104  *
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
109  *                    in case of failure
110  */
111 int av_buffersrc_add_frame(AVFilterContext *buffer_src,
112                            const AVFrame *frame, int flags);
113
114 /**
115  * Add frame data to buffer_src.
116  *
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
120  * failure
121  */
122 int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
123                              const AVFrame *frame, int flags);
124
125 #endif /* AVFILTER_AVCODEC_H */