summaryrefslogtreecommitdiff
path: root/libavfilter/vf_hflip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_hflip.c')
-rw-r--r--libavfilter/vf_hflip.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index af167e142d..459cfab886 100644
--- a/libavfilter/vf_hflip.c
+++ b/libavfilter/vf_hflip.c
@@ -2,20 +2,20 @@
* Copyright (c) 2007 Benoit Fouet
* Copyright (c) 2010 Stefano Sabatini
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg 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,
+ * FFmpeg 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
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -47,8 +47,10 @@ static int query_formats(AVFilterContext *ctx)
PIX_FMT_RGB24, PIX_FMT_BGR24,
PIX_FMT_RGB565BE, PIX_FMT_RGB565LE,
PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,
+ PIX_FMT_RGB444BE, PIX_FMT_RGB444LE,
PIX_FMT_BGR565BE, PIX_FMT_BGR565LE,
PIX_FMT_BGR555BE, PIX_FMT_BGR555LE,
+ PIX_FMT_BGR444BE, PIX_FMT_BGR444LE,
PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE,
PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE,
PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE,
@@ -81,6 +83,21 @@ static int config_props(AVFilterLink *inlink)
return 0;
}
+static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
+{
+ AVFilterLink *outlink = inlink->dst->outputs[0];
+
+ outlink->out_buf =
+ ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+ avfilter_copy_buffer_ref_props(outlink->out_buf, picref);
+
+ /* copy palette if required */
+ if (av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL)
+ memcpy(inlink->dst->outputs[0]->out_buf->data[1], picref->data[1], AVPALETTE_SIZE);
+
+ ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
+}
+
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
{
FlipContext *flip = inlink->dst->priv;
@@ -151,13 +168,14 @@ AVFilter avfilter_vf_hflip = {
.priv_size = sizeof(FlipContext),
.query_formats = query_formats,
- .inputs = (AVFilterPad[]) {{ .name = "default",
+ .inputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .start_frame = start_frame,
.draw_slice = draw_slice,
.config_props = config_props,
.min_perms = AV_PERM_READ, },
{ .name = NULL}},
- .outputs = (AVFilterPad[]) {{ .name = "default",
+ .outputs = (const AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, },
{ .name = NULL}},
};