]> git.sesse.net Git - ffmpeg/blob - libavfilter/avcodec.h
mpeg4videoenc: use av_assert
[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
34 /**
35  * Copy the frame properties of src to dst, without copying the actual
36  * image data.
37  *
38  * @return 0 on success, a negative number on error.
39  */
40 int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
41
42 /**
43  * Copy the frame properties and data pointers of src to dst, without copying
44  * the actual data.
45  *
46  * @return 0 on success, a negative number on error.
47  */
48 int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
49
50 /**
51  * Create and return a picref reference from the data and properties
52  * contained in frame.
53  *
54  * @param perms permissions to assign to the new buffer reference
55  */
56 AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
57
58
59 /**
60  * Create and return a picref reference from the data and properties
61  * contained in frame.
62  *
63  * @param perms permissions to assign to the new buffer reference
64  */
65 AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
66                                                             int perms);
67
68 #ifdef FF_API_FILL_FRAME
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  * @deprecated Use avfilter_copy_buf_props() instead.
77  */
78 attribute_deprecated
79 int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
80                                               const AVFilterBufferRef *samplesref);
81
82 /**
83  * Fill an AVFrame with the information stored in picref.
84  *
85  * @param frame an already allocated AVFrame
86  * @param picref a video buffer reference
87  * @return 0 in case of success, a negative AVERROR code in case of
88  * failure
89  * @deprecated Use avfilter_copy_buf_props() instead.
90  */
91 attribute_deprecated
92 int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
93                                               const AVFilterBufferRef *picref);
94
95 /**
96  * Fill an AVFrame with information stored in ref.
97  *
98  * @param frame an already allocated AVFrame
99  * @param ref a video or audio buffer reference
100  * @return 0 in case of success, a negative AVERROR code in case of
101  * failure
102  * @deprecated Use avfilter_copy_buf_props() instead.
103  */
104 attribute_deprecated
105 int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
106                                         const AVFilterBufferRef *ref);
107 #endif
108
109 /**
110  * Add frame data to buffer_src.
111  *
112  * @param buffer_src  pointer to a buffer source context
113  * @param frame       a frame, or NULL to mark EOF
114  * @param flags       a combination of AV_BUFFERSRC_FLAG_*
115  * @return            >= 0 in case of success, a negative AVERROR code
116  *                    in case of failure
117  */
118 int av_buffersrc_add_frame(AVFilterContext *buffer_src,
119                            const AVFrame *frame, int flags);
120
121 #endif /* AVFILTER_AVCODEC_H */