diff options
author | Aurélien Zanelli <aurelien.zanelli@parrot.com> | 2014-04-09 18:52:16 +0200 |
---|---|---|
committer | Julien Isorce <julien.isorce@collabora.co.uk> | 2014-04-15 15:09:24 +0100 |
commit | 1b6879921cdddf261c47391a47150c13158ac0cb (patch) | |
tree | 5978ddc859388f1d2142777dbd252b1185fa9208 | |
parent | f5f876f6817b4dc98cc88fc5e6ee1e62a78c119b (diff) |
omxvideodec: add support of more color format
Add support for ABGR, ARGB, RGB16, BGR16, YUY2, UYVY, YVYU, GRAY8 and
NV16 color format.
-rw-r--r-- | omx/gstomxbufferpool.c | 10 | ||||
-rw-r--r-- | omx/gstomxvideodec.c | 21 |
2 files changed, 31 insertions, 0 deletions
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; |