From d3c2a7c8d1bb94a4bf6fa745ef93d2ca9f59f7d0 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 10 Apr 2020 11:47:03 +0200 Subject: omxvideoenc: remove unsupported formats from caps template Our encoder implementation actually supports a small subset of the formats supported by the decoder. Those are the formats for which we have a copy path in gst_omx_video_enc_fill_buffer() and which are not filtered out in filter_supported_formats(). --- omx/gstomxh265enc.c | 4 ++-- omx/gstomxvideo.c | 2 +- omx/gstomxvideo.h | 5 ++++- omx/gstomxvideodec.c | 4 ++-- omx/gstomxvideoenc.c | 4 +--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/omx/gstomxh265enc.c b/omx/gstomxh265enc.c index 3fd8c0d..8b31c42 100644 --- a/omx/gstomxh265enc.c +++ b/omx/gstomxh265enc.c @@ -198,10 +198,10 @@ gst_omx_h265_enc_class_init (GstOMXH265EncClass * klass) videoenc_class->cdata.default_sink_template_caps = #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_FORMAT_INTERLACED, - GST_OMX_VIDEO_SUPPORTED_FORMATS) + GST_OMX_VIDEO_ENC_SUPPORTED_FORMATS) ", interlace-mode = (string) alternate ; " #endif - GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_SUPPORTED_FORMATS); + GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_ENC_SUPPORTED_FORMATS); videoenc_class->cdata.default_src_template_caps = "video/x-h265, " "width=(int) [ 1, MAX ], " "height=(int) [ 1, MAX ], " diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c index a761e70..e08ff4c 100644 --- a/omx/gstomxvideo.c +++ b/omx/gstomxvideo.c @@ -33,7 +33,7 @@ GST_DEBUG_CATEGORY (gst_omx_video_debug_category); #define GST_CAT_DEFAULT gst_omx_video_debug_category -/* Keep synced with GST_OMX_VIDEO_SUPPORTED_FORMATS */ +/* Keep synced with GST_OMX_VIDEO_DEC_SUPPORTED_FORMATS */ GstVideoFormat gst_omx_video_get_format_from_omx (OMX_COLOR_FORMATTYPE omx_colorformat) { diff --git a/omx/gstomxvideo.h b/omx/gstomxvideo.h index 4e5ac43..8664345 100644 --- a/omx/gstomxvideo.h +++ b/omx/gstomxvideo.h @@ -35,9 +35,12 @@ G_BEGIN_DECLS /* Keep synced with gst_omx_video_get_format_from_omx(). Sort by decreasing quality */ -#define GST_OMX_VIDEO_SUPPORTED_FORMATS "{ NV16_10LE32, NV12_10LE32, " \ +#define GST_OMX_VIDEO_DEC_SUPPORTED_FORMATS "{ NV16_10LE32, NV12_10LE32, " \ "NV16, YUY2, YVYU, UYVY, NV12, I420, RGB16, BGR16, ABGR, ARGB, GRAY8 }" +#define GST_OMX_VIDEO_ENC_SUPPORTED_FORMATS "{ NV16_10LE32, NV12_10LE32, " \ + "NV16, NV12, I420, GRAY8 }" + typedef struct { GstVideoFormat format; diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index ac2c7a8..9e172a4 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -191,10 +191,10 @@ gst_omx_video_dec_class_init (GstOMXVideoDecClass * klass) #endif #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_FORMAT_INTERLACED, - GST_OMX_VIDEO_SUPPORTED_FORMATS) + GST_OMX_VIDEO_DEC_SUPPORTED_FORMATS) ", interlace-mode = (string) alternate ; " #endif - GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_SUPPORTED_FORMATS); + GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_DEC_SUPPORTED_FORMATS); } static void diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 5549115..6d809ee 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -545,7 +545,7 @@ gst_omx_video_enc_class_init (GstOMXVideoEncClass * klass) klass->cdata.type = GST_OMX_COMPONENT_TYPE_FILTER; klass->cdata.default_sink_template_caps = - GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_SUPPORTED_FORMATS); + GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_ENC_SUPPORTED_FORMATS); klass->handle_output_frame = GST_DEBUG_FUNCPTR (gst_omx_video_enc_handle_output_frame); @@ -3540,8 +3540,6 @@ filter_supported_formats (GList * negotiation_map) case GST_VIDEO_FORMAT_NV16: case GST_VIDEO_FORMAT_NV16_10LE32: case GST_VIDEO_FORMAT_GRAY8: - //case GST_VIDEO_FORMAT_ABGR: - //case GST_VIDEO_FORMAT_ARGB: cur = g_list_next (cur); continue; default: -- cgit v1.2.1