annotate ffmpeg/libavfilter/buffersrc.h @ 13:844d341cf643 tip

Back up before ISMIR
author Yading Song <yading.song@eecs.qmul.ac.uk>
date Thu, 31 Oct 2013 13:17:06 +0000
parents 6840f77b83aa
children
rev   line source
yading@10 1 /*
yading@10 2 *
yading@10 3 * This file is part of Libav.
yading@10 4 *
yading@10 5 * Libav is free software; you can redistribute it and/or
yading@10 6 * modify it under the terms of the GNU Lesser General Public
yading@10 7 * License as published by the Free Software Foundation; either
yading@10 8 * version 2.1 of the License, or (at your option) any later version.
yading@10 9 *
yading@10 10 * Libav is distributed in the hope that it will be useful,
yading@10 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
yading@10 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
yading@10 13 * Lesser General Public License for more details.
yading@10 14 *
yading@10 15 * You should have received a copy of the GNU Lesser General Public
yading@10 16 * License along with Libav; if not, write to the Free Software
yading@10 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yading@10 18 */
yading@10 19
yading@10 20 #ifndef AVFILTER_BUFFERSRC_H
yading@10 21 #define AVFILTER_BUFFERSRC_H
yading@10 22
yading@10 23 /**
yading@10 24 * @file
yading@10 25 * Memory buffer source API.
yading@10 26 */
yading@10 27
yading@10 28 #include "libavcodec/avcodec.h"
yading@10 29 #include "avfilter.h"
yading@10 30
yading@10 31 enum {
yading@10 32
yading@10 33 /**
yading@10 34 * Do not check for format changes.
yading@10 35 */
yading@10 36 AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1,
yading@10 37
yading@10 38 #if FF_API_AVFILTERBUFFER
yading@10 39 /**
yading@10 40 * Ignored
yading@10 41 */
yading@10 42 AV_BUFFERSRC_FLAG_NO_COPY = 2,
yading@10 43 #endif
yading@10 44
yading@10 45 /**
yading@10 46 * Immediately push the frame to the output.
yading@10 47 */
yading@10 48 AV_BUFFERSRC_FLAG_PUSH = 4,
yading@10 49
yading@10 50 /**
yading@10 51 * Keep a reference to the frame.
yading@10 52 * If the frame if reference-counted, create a new reference; otherwise
yading@10 53 * copy the frame data.
yading@10 54 */
yading@10 55 AV_BUFFERSRC_FLAG_KEEP_REF = 8,
yading@10 56
yading@10 57 };
yading@10 58
yading@10 59 /**
yading@10 60 * Add buffer data in picref to buffer_src.
yading@10 61 *
yading@10 62 * @param buffer_src pointer to a buffer source context
yading@10 63 * @param picref a buffer reference, or NULL to mark EOF
yading@10 64 * @param flags a combination of AV_BUFFERSRC_FLAG_*
yading@10 65 * @return >= 0 in case of success, a negative AVERROR code
yading@10 66 * in case of failure
yading@10 67 */
yading@10 68 int av_buffersrc_add_ref(AVFilterContext *buffer_src,
yading@10 69 AVFilterBufferRef *picref, int flags);
yading@10 70
yading@10 71 /**
yading@10 72 * Get the number of failed requests.
yading@10 73 *
yading@10 74 * A failed request is when the request_frame method is called while no
yading@10 75 * frame is present in the buffer.
yading@10 76 * The number is reset when a frame is added.
yading@10 77 */
yading@10 78 unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
yading@10 79
yading@10 80 #if FF_API_AVFILTERBUFFER
yading@10 81 /**
yading@10 82 * Add a buffer to the filtergraph s.
yading@10 83 *
yading@10 84 * @param buf buffer containing frame data to be passed down the filtergraph.
yading@10 85 * This function will take ownership of buf, the user must not free it.
yading@10 86 * A NULL buf signals EOF -- i.e. no more frames will be sent to this filter.
yading@10 87 *
yading@10 88 * @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame()
yading@10 89 */
yading@10 90 attribute_deprecated
yading@10 91 int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf);
yading@10 92 #endif
yading@10 93
yading@10 94 /**
yading@10 95 * Add a frame to the buffer source.
yading@10 96 *
yading@10 97 * @param s an instance of the buffersrc filter.
yading@10 98 * @param frame frame to be added. If the frame is reference counted, this
yading@10 99 * function will make a new reference to it. Otherwise the frame data will be
yading@10 100 * copied.
yading@10 101 *
yading@10 102 * @return 0 on success, a negative AVERROR on error
yading@10 103 *
yading@10 104 * This function is equivalent to av_buffersrc_add_frame_flags() with the
yading@10 105 * AV_BUFFERSRC_FLAG_KEEP_REF flag.
yading@10 106 */
yading@10 107 int av_buffersrc_write_frame(AVFilterContext *s, const AVFrame *frame);
yading@10 108
yading@10 109 /**
yading@10 110 * Add a frame to the buffer source.
yading@10 111 *
yading@10 112 * @param s an instance of the buffersrc filter.
yading@10 113 * @param frame frame to be added. If the frame is reference counted, this
yading@10 114 * function will take ownership of the reference(s) and reset the frame.
yading@10 115 * Otherwise the frame data will be copied. If this function returns an error,
yading@10 116 * the input frame is not touched.
yading@10 117 *
yading@10 118 * @return 0 on success, a negative AVERROR on error.
yading@10 119 *
yading@10 120 * @note the difference between this function and av_buffersrc_write_frame() is
yading@10 121 * that av_buffersrc_write_frame() creates a new reference to the input frame,
yading@10 122 * while this function takes ownership of the reference passed to it.
yading@10 123 *
yading@10 124 * This function is equivalent to av_buffersrc_add_frame_flags() without the
yading@10 125 * AV_BUFFERSRC_FLAG_KEEP_REF flag.
yading@10 126 */
yading@10 127 int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame);
yading@10 128
yading@10 129 /**
yading@10 130 * Add a frame to the buffer source.
yading@10 131 *
yading@10 132 * By default, if the frame is reference-counted, this function will take
yading@10 133 * ownership of the reference(s) and reset the frame. This can be controled
yading@10 134 * using the flags.
yading@10 135 *
yading@10 136 * If this function returns an error, the input frame is not touched.
yading@10 137 *
yading@10 138 * @param buffer_src pointer to a buffer source context
yading@10 139 * @param frame a frame, or NULL to mark EOF
yading@10 140 * @param flags a combination of AV_BUFFERSRC_FLAG_*
yading@10 141 * @return >= 0 in case of success, a negative AVERROR code
yading@10 142 * in case of failure
yading@10 143 */
yading@10 144 int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
yading@10 145 AVFrame *frame, int flags);
yading@10 146
yading@10 147
yading@10 148 #endif /* AVFILTER_BUFFERSRC_H */