summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-12-02 11:39:42 +0100
committerWim Taymans <wtaymans@redhat.com>2014-12-02 15:10:49 +0100
commitdfb202a1172f0c965dcfa6ce0877fc55fe38e76d (patch)
treeb676ffa1d6459699949d2e7a4539fdee477b95b4
parent0f2be22e76df1bcf93b2adbc9296e376c48407c6 (diff)
video-converter: add palette when needed
-rw-r--r--gst-libs/gst/video/video-converter.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c
index bee22d12c..36086a3dd 100644
--- a/gst-libs/gst/video/video-converter.c
+++ b/gst-libs/gst/video/video-converter.c
@@ -222,6 +222,8 @@ struct _GstVideoConverter
gboolean pack_rgb;
gboolean identity_pack;
gint pack_pstride;
+ gconstpointer pack_pal;
+ gsize pack_palsize;
const GstVideoFrame *src;
GstVideoFrame *dest;
@@ -1579,6 +1581,9 @@ gst_video_converter_new (GstVideoInfo * in_info, GstVideoInfo * out_info,
finfo = gst_video_format_get_info (convert->pack_format);
convert->pack_bits = GST_VIDEO_FORMAT_INFO_DEPTH (finfo, 0);
convert->pack_rgb = GST_VIDEO_FORMAT_INFO_IS_RGB (finfo);
+ convert->pack_pal =
+ gst_video_format_get_palette (GST_VIDEO_INFO_FORMAT (out_info),
+ &convert->pack_palsize);
if (video_converter_lookup_fastpath (convert))
goto done;
@@ -2293,6 +2298,10 @@ video_converter_generic (GstVideoConverter * convert, const GstVideoFrame * src,
for (i = out_y + out_height; i < out_maxheight; i++)
PACK_FRAME (dest, convert->borderline, i, out_maxwidth);
}
+ if (convert->pack_pal) {
+ memcpy (GST_VIDEO_FRAME_PLANE_DATA (dest, 1), convert->pack_pal,
+ convert->pack_palsize);
+ }
}
/* Fast paths */