summaryrefslogtreecommitdiff
path: root/omx/gstomxvideoenc.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-03-08 12:22:26 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-04-25 09:15:38 +0200
commitdc0ed29a62248c42b7488da8f3bb1d04b2430d8c (patch)
tree987f2a58b8c9445864bd2a7d005d33d3c440d036 /omx/gstomxvideoenc.c
parentd40c6c0449f447a85c9b049aa96306e32f9b8ce9 (diff)
downloadgst-omx-dc0ed29a62248c42b7488da8f3bb1d04b2430d8c.tar.gz
omxvideoenc: add NV16 support
NV16 format wasn't supported on encoder input while it was on decoder output. https://bugzilla.gnome.org/show_bug.cgi?id=794175
Diffstat (limited to 'omx/gstomxvideoenc.c')
-rw-r--r--omx/gstomxvideoenc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index b78ea5d..20e5108 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1841,6 +1841,7 @@ gst_omx_video_enc_configure_input_buffer (GstOMXVideoEnc * self,
((port_def.format.video.nFrameHeight + 1) / 2));
break;
+ case OMX_COLOR_FormatYUV422SemiPlanar:
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
/* Formats defined in extensions have their own enum so disable to -Wswitch warning */
#pragma GCC diagnostic push
@@ -2135,6 +2136,9 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
case GST_VIDEO_FORMAT_NV12:
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
break;
+ case GST_VIDEO_FORMAT_NV16:
+ port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV422SemiPlanar;
+ break;
case GST_VIDEO_FORMAT_ABGR:
port_def.format.video.eColorFormat = OMX_COLOR_Format32bitARGB8888;
break;
@@ -2278,8 +2282,8 @@ gst_omx_video_enc_flush (GstVideoEncoder * encoder)
}
static gboolean
-gst_omx_video_enc_nv12_manual_copy (GstOMXVideoEnc * self, GstBuffer * inbuf,
- GstOMXBuffer * outbuf, gboolean variant_10)
+gst_omx_video_enc_semi_planar_manual_copy (GstOMXVideoEnc * self,
+ GstBuffer * inbuf, GstOMXBuffer * outbuf, gboolean variant_10)
{
GstVideoInfo *info = &self->input_state->info;
OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def;
@@ -2470,11 +2474,15 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
break;
}
case GST_VIDEO_FORMAT_NV12:
- ret = gst_omx_video_enc_nv12_manual_copy (self, inbuf, outbuf, FALSE);
+ case GST_VIDEO_FORMAT_NV16:
+ ret =
+ gst_omx_video_enc_semi_planar_manual_copy (self, inbuf, outbuf,
+ FALSE);
break;
case GST_VIDEO_FORMAT_NV12_10LE32:
case GST_VIDEO_FORMAT_NV16_10LE32:
- ret = gst_omx_video_enc_nv12_manual_copy (self, inbuf, outbuf, TRUE);
+ ret =
+ gst_omx_video_enc_semi_planar_manual_copy (self, inbuf, outbuf, TRUE);
break;
default:
GST_ERROR_OBJECT (self, "Unsupported format");
@@ -2942,6 +2950,7 @@ filter_supported_formats (GList * negotiation_map)
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV12_10LE32:
+ case GST_VIDEO_FORMAT_NV16:
case GST_VIDEO_FORMAT_NV16_10LE32:
//case GST_VIDEO_FORMAT_ABGR:
//case GST_VIDEO_FORMAT_ARGB: