int (*config_props)(AVFilterLink *link);
};
+#if FF_API_FILTERS_PUBLIC
/** default handler for start_frame() for video inputs */
+attribute_deprecated
void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
/** default handler for draw_slice() for video inputs */
+attribute_deprecated
void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir);
/** default handler for end_frame() for video inputs */
+attribute_deprecated
void avfilter_default_end_frame(AVFilterLink *link);
#if FF_API_DEFAULT_CONFIG_OUTPUT_LINK
#endif
/** default handler for get_video_buffer() for video inputs */
+attribute_deprecated
AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link,
int perms, int w, int h);
+/** Default handler for query_formats() */
+attribute_deprecated
+int avfilter_default_query_formats(AVFilterContext *ctx);
+#endif
+
/**
* A helper for query_formats() which sets all links to the same list of
* formats. If there are no links hooked to this filter, the list of formats is
*/
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats);
-/** Default handler for query_formats() */
-int avfilter_default_query_formats(AVFilterContext *ctx);
-
/** start_frame() handler for filters which simply pass video along */
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref);
if (graph->filters[i]->filter->query_formats)
graph->filters[i]->filter->query_formats(graph->filters[i]);
else
- avfilter_default_query_formats(graph->filters[i]);
+ ff_default_query_formats(graph->filters[i]);
}
/* go through and merge as many format lists as possible */
avfilter_formats_ref, formats);
}
-int avfilter_default_query_formats(AVFilterContext *ctx)
+int ff_default_query_formats(AVFilterContext *ctx)
{
enum AVMediaType type = ctx->inputs && ctx->inputs [0] ? ctx->inputs [0]->type :
ctx->outputs && ctx->outputs[0] ? ctx->outputs[0]->type :
return 0;
}
+
+#if FF_API_FILTERS_PUBLIC
+int avfilter_default_query_formats(AVFilterContext *ctx)
+{
+ return ff_default_query_formats(ctx);
+}
+#endif
void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
AVFilterChannelLayouts **newref);
+int ff_default_query_formats(AVFilterContext *ctx);
+
#endif // AVFILTER_FORMATS_H
#ifndef FF_API_DEFAULT_CONFIG_OUTPUT_LINK
#define FF_API_DEFAULT_CONFIG_OUTPUT_LINK (LIBAVFILTER_VERSION_MAJOR < 3)
#endif
+#ifndef FF_API_FILTERS_PUBLIC
+#define FF_API_FILTERS_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 3)
+#endif
#endif // AVFILTER_VERSION_H
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "video.h"
typedef struct {
int vsub; ///< vertical chroma subsampling
int i;
if (!(perms & AV_PERM_NEG_LINESIZES))
- return avfilter_default_get_video_buffer(link, perms, w, h);
+ return ff_default_get_video_buffer(link, perms, w, h);
picref = avfilter_get_video_buffer(link->dst->outputs[0], perms, w, h);
for (i = 0; i < 4; i ++) {
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "video.h"
#include "yadif.h"
#undef NDEBUG
int height= FFALIGN(h+2, 32);
int i;
- picref = avfilter_default_get_video_buffer(link, perms, width, height);
+ picref = ff_default_get_video_buffer(link, perms, width, height);
picref->video->w = w;
picref->video->h = h;
#include "avfilter.h"
#include "internal.h"
+#include "video.h"
#ifdef DEBUG
static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
/* TODO: set the buffer's priv member to a context structure for the whole
* filter chain. This will allow for a buffer pool instead of the constant
* alloc & free cycle currently implemented. */
-AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
+AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
int linesize[4];
uint8_t *data[4];
ret = link->dstpad->get_video_buffer(link, perms, w, h);
if (!ret)
- ret = avfilter_default_get_video_buffer(link, perms, w, h);
+ ret = ff_default_get_video_buffer(link, perms, w, h);
if (ret)
ret->type = AVMEDIA_TYPE_VIDEO;
avfilter_start_frame(link->dst->outputs[0], picref);
}
-void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
+static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
{
AVFilterLink *outlink = NULL;
FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
if (!(start_frame = dst->start_frame))
- start_frame = avfilter_default_start_frame;
+ start_frame = default_start_frame;
if (picref->linesize[0] < 0)
perms |= AV_PERM_NEG_LINESIZES;
avfilter_end_frame(link->dst->outputs[0]);
}
-void avfilter_default_end_frame(AVFilterLink *inlink)
+static void default_end_frame(AVFilterLink *inlink)
{
AVFilterLink *outlink = NULL;
void (*end_frame)(AVFilterLink *);
if (!(end_frame = link->dstpad->end_frame))
- end_frame = avfilter_default_end_frame;
+ end_frame = default_end_frame;
end_frame(link);
avfilter_draw_slice(link->dst->outputs[0], y, h, slice_dir);
}
-void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
+static void default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
{
AVFilterLink *outlink = NULL;
}
if (!(draw_slice = link->dstpad->draw_slice))
- draw_slice = avfilter_default_draw_slice;
+ draw_slice = default_draw_slice;
draw_slice(link, y, h, slice_dir);
}
+#if FF_API_FILTERS_PUBLIC
+AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
+{
+ return ff_default_get_video_buffer(link, perms, w, h);
+}
+void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
+{
+ default_start_frame(inlink, picref);
+}
+void avfilter_default_end_frame(AVFilterLink *inlink)
+{
+ default_end_frame(inlink);
+}
+void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
+{
+ default_draw_slice(inlink, y, h, slice_dir);
+}
+#endif
--- /dev/null
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFILTER_VIDEO_H
+#define AVFILTER_VIDEO_H
+
+AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link,
+ int perms, int w, int h);
+#endif /* AVFILTER_VIDEO_H */
#include "libavformat/avformat.h"
#include "libavutil/pixdesc.h"
#include "libavfilter/avfilter.h"
+#include "libavfilter/formats.h"
int main(int argc, char **argv)
{
if (filter->query_formats)
filter->query_formats(filter_ctx);
else
- avfilter_default_query_formats(filter_ctx);
+ ff_default_query_formats(filter_ctx);
/* print the supported formats in input */
for (i = 0; i < filter_ctx->input_count; i++) {