From 1b6879921cdddf261c47391a47150c13158ac0cb Mon Sep 17 00:00:00 2001 From: Aurélien Zanelli Date: Wed, 9 Apr 2014 18:52:16 +0200 Subject: omxvideodec: add support of more color format Add support for ABGR, ARGB, RGB16, BGR16, YUY2, UYVY, YVYU, GRAY8 and NV16 color format. --- omx/gstomxbufferpool.c | 10 ++++++++++ omx/gstomxvideodec.c | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c index 5ebb191..43fc656 100644 --- a/omx/gstomxbufferpool.c +++ b/omx/gstomxbufferpool.c @@ -378,6 +378,15 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool, gint stride[GST_VIDEO_MAX_PLANES] = { nstride, 0, }; switch (GST_VIDEO_INFO_FORMAT (&pool->video_info)) { + case GST_VIDEO_FORMAT_ABGR: + case GST_VIDEO_FORMAT_ARGB: + case GST_VIDEO_FORMAT_RGB16: + case GST_VIDEO_FORMAT_BGR16: + case GST_VIDEO_FORMAT_YUY2: + case GST_VIDEO_FORMAT_UYVY: + case GST_VIDEO_FORMAT_YVYU: + case GST_VIDEO_FORMAT_GRAY8: + break; case GST_VIDEO_FORMAT_I420: stride[1] = nstride / 2; offset[1] = offset[0] + stride[0] * nslice; @@ -385,6 +394,7 @@ gst_omx_buffer_pool_alloc_buffer (GstBufferPool * bpool, offset[2] = offset[1] + (stride[1] * nslice / 2); break; case GST_VIDEO_FORMAT_NV12: + case GST_VIDEO_FORMAT_NV16: stride[1] = nstride; offset[1] = offset[0] + stride[0] * nslice; break; diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 20109c1..d9ed7ff 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -448,6 +448,20 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self, guint p; switch (GST_VIDEO_INFO_FORMAT (vinfo)) { + case GST_VIDEO_FORMAT_ABGR: + case GST_VIDEO_FORMAT_ARGB: + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 4; + break; + case GST_VIDEO_FORMAT_RGB16: + case GST_VIDEO_FORMAT_BGR16: + case GST_VIDEO_FORMAT_YUY2: + case GST_VIDEO_FORMAT_UYVY: + case GST_VIDEO_FORMAT_YVYU: + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo) * 2; + break; + case GST_VIDEO_FORMAT_GRAY8: + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo); + break; case GST_VIDEO_FORMAT_I420: dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo); src_stride[1] = nstride / 2; @@ -466,6 +480,13 @@ gst_omx_video_dec_fill_buffer (GstOMXVideoDec * self, dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo); dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo) / 2; break; + case GST_VIDEO_FORMAT_NV16: + dst_width[0] = GST_VIDEO_INFO_WIDTH (vinfo); + src_stride[1] = nstride; + src_size[1] = src_stride[1] * nslice; + dst_width[1] = GST_VIDEO_INFO_WIDTH (vinfo); + dst_height[1] = GST_VIDEO_INFO_HEIGHT (vinfo); + break; default: g_assert_not_reached (); break; -- cgit v1.2.3