diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c index 44d919a6dd..9feda19b05 100644 --- a/omx/gstomxvideo.c +++ b/omx/gstomxvideo.c @@ -33,6 +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 */ GstVideoFormat gst_omx_video_get_format_from_omx (OMX_COLOR_FORMATTYPE omx_colorformat) { diff --git a/omx/gstomxvideo.h b/omx/gstomxvideo.h index 993f3d69bc..9251547489 100644 --- a/omx/gstomxvideo.h +++ b/omx/gstomxvideo.h @@ -34,6 +34,10 @@ 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, " \ + "NV16, YUY2, YVYU, UYVY, NV12, I420, RGB16, BGR16, ABGR, ARGB, BGR, GRAY8 }" + typedef struct { GstVideoFormat format; diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 9ef857614e..1072b82e68 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -189,9 +189,7 @@ gst_omx_video_dec_class_init (GstOMXVideoDecClass * klass) GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, "RGBA") "; " #endif - "video/x-raw, " - "width = " GST_VIDEO_SIZE_RANGE ", " - "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE; + GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_SUPPORTED_FORMATS); } static void diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 86da12c202..f27c40811a 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -490,9 +490,8 @@ gst_omx_video_enc_class_init (GstOMXVideoEncClass * klass) GST_DEBUG_FUNCPTR (gst_omx_video_enc_decide_allocation); klass->cdata.type = GST_OMX_COMPONENT_TYPE_FILTER; - klass->cdata.default_sink_template_caps = "video/x-raw, " - "width = " GST_VIDEO_SIZE_RANGE ", " - "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE; + klass->cdata.default_sink_template_caps = + GST_VIDEO_CAPS_MAKE (GST_OMX_VIDEO_SUPPORTED_FORMATS); klass->handle_output_frame = GST_DEBUG_FUNCPTR (gst_omx_video_enc_handle_output_frame);