From 442722beba234f69f69e7e886dadf4f172735af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 14 Mar 2006 13:16:49 +0000 Subject: [PATCH] gst-libs/gst/riff/riff-media.c: Add support for 24bpp DIB (#305279). Original commit message from CVS: * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): Add support for 24bpp DIB (#305279). --- ChangeLog | 5 +++++ gst-libs/gst/riff/riff-media.c | 31 +++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1e08fe762..692f1a804b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-14 Tim-Philipp Müller + + * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): + Add support for 24bpp DIB (#305279). + 2006-03-14 Wim Taymans * gst-libs/gst/video/gstvideofilter.c: (gst_video_filter_init): diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index ebdebf1d65..d8ad8355da 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -56,16 +56,35 @@ gst_riff_create_video_caps (guint32 codec_fcc, GstBuffer *palette = NULL; switch (codec_fcc) { - case GST_MAKE_FOURCC ('D', 'I', 'B', ' '): - caps = gst_caps_new_simple ("video/x-raw-rgb", - "bpp", G_TYPE_INT, 8, - "depth", G_TYPE_INT, 8, "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL); + case GST_MAKE_FOURCC ('D', 'I', 'B', ' '):{ + gint bpp = (strf && strf->bit_cnt != 0) ? strf->bit_cnt : 8; + + if (strf) { + if (bpp == 8) { + caps = gst_caps_new_simple ("video/x-raw-rgb", + "bpp", G_TYPE_INT, 8, "depth", G_TYPE_INT, 8, + "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL); + } else if (bpp == 24) { + caps = gst_caps_new_simple ("video/x-raw-rgb", + "bpp", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24, + "endianness", G_TYPE_INT, G_BIG_ENDIAN, + "red_mask", G_TYPE_INT, 0xff, "green_mask", G_TYPE_INT, 0xff00, + "blue_mask", G_TYPE_INT, 0xff0000, NULL); + } else { + GST_WARNING ("Unhandled DIB RGB depth: %d", bpp); + } + } else { + /* for template */ + caps = gst_caps_from_string ("video/x-raw-rgb, bpp = (int) { 8, 24 }, " + "depth = (int) { 8, 24}"); + } + palette = strf_data; strf_data = NULL; if (codec_name) - *codec_name = g_strdup ("Palettized 8-bit RGB"); + *codec_name = g_strdup_printf ("Palettized %d-bit RGB", bpp); break; - + } case GST_MAKE_FOURCC ('I', '4', '2', '0'): caps = gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC, codec_fcc, NULL);