From a9bea7476ce390a58bf03e00b7da29b1d5626b26 Mon Sep 17 00:00:00 2001 From: Jussi Saavalainen Date: Fri, 8 Feb 2013 15:22:21 +0200 Subject: [PATCH] Skip unneeded pixelformats during probe Change-Id: Ic431e6d78f0f15df66cc023e2005d1b2abc90853 --- gst/mfldv4l2cam/v4l2camsrc_calls.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/mfldv4l2cam/v4l2camsrc_calls.c b/gst/mfldv4l2cam/v4l2camsrc_calls.c index 849ac17..d6a600a 100644 --- a/gst/mfldv4l2cam/v4l2camsrc_calls.c +++ b/gst/mfldv4l2cam/v4l2camsrc_calls.c @@ -1303,6 +1303,15 @@ gst_v4l2camsrc_format_cmp_func (gconstpointer a, gconstpointer b) gst_v4l2camsrc_format_get_rank (fa); } +static gboolean is_supported_pixelformat(guint32 fourcc) +{ + if(fourcc == V4L2_PIX_FMT_NV12 + || fourcc == V4L2_PIX_FMT_YUV420 + || fourcc == V4L2_PIX_FMT_SGRBG10) + return TRUE; + return FALSE; +} + /****************************************************** * gst_v4l2camsrc_fill_format_list(): * create list of supported capture formats @@ -1331,6 +1340,10 @@ gst_v4l2camsrc_fill_format_list (GstMFLDV4l2CamSrc * v4l2camsrc) goto failed; } } + if(!is_supported_pixelformat(format->pixelformat)) { + GST_LOG_OBJECT(v4l2camsrc, " (skipping format %" GST_FOURCC_FORMAT ")",GST_FOURCC_ARGS (format->pixelformat)); + continue; + } GST_LOG_OBJECT (v4l2camsrc, "index: %u", format->index); GST_LOG_OBJECT (v4l2camsrc, "type: %d", format->type); -- 2.7.4