diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-01-04 10:11:38 +0100 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2019-01-25 23:48:11 +0000 |
commit | 9ff4dc533fb9c4023f35cf7baa2d26446b747391 (patch) | |
tree | 87419fc479e878f692287ad60048f703a547a1b5 | |
parent | 09bc1d630f3e0e1b7c7bf7aa1fb8384f2f6aef61 (diff) | |
download | gst-omx-9ff4dc533fb9c4023f35cf7baa2d26446b747391.tar.gz |
omxvideo: use GST_VIDEO_CAPS_MAKE() for template caps
Simplify the code and so we advertise the formats actually supported by
gst-omx.
-rw-r--r-- | omx/gstomxvideo.c | 1 | ||||
-rw-r--r-- | omx/gstomxvideo.h | 4 | ||||
-rw-r--r-- | omx/gstomxvideodec.c | 4 | ||||
-rw-r--r-- | omx/gstomxvideoenc.c | 5 |
4 files changed, 8 insertions, 6 deletions
diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c index 44d919a..9feda19 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 993f3d6..9251547 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 9ef8576..1072b82 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 86da12c..f27c408 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); |