summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_hflip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_hflip.c')
-rw-r--r--libavfilter/vf_hflip.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c
index 3ae0fc6..70bf5c9 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
*/
@@ -50,8 +50,10 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE,
AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE,
+ AV_PIX_FMT_RGB444BE, AV_PIX_FMT_RGB444LE,
AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE,
AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE,
+ AV_PIX_FMT_BGR444BE, AV_PIX_FMT_BGR444LE,
AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE,
AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE,
AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE,
@@ -84,6 +86,21 @@ static int config_props(AVFilterLink *inlink)
return 0;
}
+static int 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);
+
+ return ff_start_frame(outlink, avfilter_ref_buffer(outlink->out_buf, ~0));
+}
+
static int draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
{
FlipContext *flip = inlink->dst->priv;
@@ -152,6 +169,7 @@ static const AVFilterPad avfilter_vf_hflip_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
+ .start_frame = start_frame,
.draw_slice = draw_slice,
.config_props = config_props,
.min_perms = AV_PERM_READ,
OpenPOWER on IntegriCloud