mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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
This commit is contained in:
parent
d40c6c0449
commit
dc0ed29a62
1 changed files with 13 additions and 4 deletions
|
@ -1841,6 +1841,7 @@ gst_omx_video_enc_configure_input_buffer (GstOMXVideoEnc * self,
|
||||||
((port_def.format.video.nFrameHeight + 1) / 2));
|
((port_def.format.video.nFrameHeight + 1) / 2));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OMX_COLOR_FormatYUV422SemiPlanar:
|
||||||
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
|
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
|
||||||
/* Formats defined in extensions have their own enum so disable to -Wswitch warning */
|
/* Formats defined in extensions have their own enum so disable to -Wswitch warning */
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
@ -2135,6 +2136,9 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
|
||||||
case GST_VIDEO_FORMAT_NV12:
|
case GST_VIDEO_FORMAT_NV12:
|
||||||
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
|
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
|
||||||
break;
|
break;
|
||||||
|
case GST_VIDEO_FORMAT_NV16:
|
||||||
|
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV422SemiPlanar;
|
||||||
|
break;
|
||||||
case GST_VIDEO_FORMAT_ABGR:
|
case GST_VIDEO_FORMAT_ABGR:
|
||||||
port_def.format.video.eColorFormat = OMX_COLOR_Format32bitARGB8888;
|
port_def.format.video.eColorFormat = OMX_COLOR_Format32bitARGB8888;
|
||||||
break;
|
break;
|
||||||
|
@ -2278,8 +2282,8 @@ gst_omx_video_enc_flush (GstVideoEncoder * encoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_omx_video_enc_nv12_manual_copy (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
gst_omx_video_enc_semi_planar_manual_copy (GstOMXVideoEnc * self,
|
||||||
GstOMXBuffer * outbuf, gboolean variant_10)
|
GstBuffer * inbuf, GstOMXBuffer * outbuf, gboolean variant_10)
|
||||||
{
|
{
|
||||||
GstVideoInfo *info = &self->input_state->info;
|
GstVideoInfo *info = &self->input_state->info;
|
||||||
OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case GST_VIDEO_FORMAT_NV12:
|
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;
|
break;
|
||||||
case GST_VIDEO_FORMAT_NV12_10LE32:
|
case GST_VIDEO_FORMAT_NV12_10LE32:
|
||||||
case GST_VIDEO_FORMAT_NV16_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;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_ERROR_OBJECT (self, "Unsupported format");
|
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_I420:
|
||||||
case GST_VIDEO_FORMAT_NV12:
|
case GST_VIDEO_FORMAT_NV12:
|
||||||
case GST_VIDEO_FORMAT_NV12_10LE32:
|
case GST_VIDEO_FORMAT_NV12_10LE32:
|
||||||
|
case GST_VIDEO_FORMAT_NV16:
|
||||||
case GST_VIDEO_FORMAT_NV16_10LE32:
|
case GST_VIDEO_FORMAT_NV16_10LE32:
|
||||||
//case GST_VIDEO_FORMAT_ABGR:
|
//case GST_VIDEO_FORMAT_ABGR:
|
||||||
//case GST_VIDEO_FORMAT_ARGB:
|
//case GST_VIDEO_FORMAT_ARGB:
|
||||||
|
|
Loading…
Reference in a new issue