From: Tim-Philipp Müller Date: Tue, 30 Dec 2014 16:36:02 +0000 (+0000) Subject: tests: simple-launch-lines: only run jpeg/png tests if elements are available X-Git-Tag: 1.19.3~509^2~3940 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1972b667e2cd38b7ae6a73e7f1a979a95ff245a;p=platform%2Fupstream%2Fgstreamer.git tests: simple-launch-lines: only run jpeg/png tests if elements are available --- diff --git a/tests/check/pipelines/simple-launch-lines.c b/tests/check/pipelines/simple-launch-lines.c index cce4f2d..a0dd12e 100644 --- a/tests/check/pipelines/simple-launch-lines.c +++ b/tests/check/pipelines/simple-launch-lines.c @@ -222,6 +222,15 @@ GST_START_TEST (test_rtp_payloaders) GST_END_TEST; +static gboolean +have_elements (const gchar * element1, const gchar * element2) +{ + return gst_registry_check_feature_version (gst_registry_get (), element1, + GST_VERSION_MAJOR, GST_VERSION_MINOR, 0) && + gst_registry_check_feature_version (gst_registry_get (), element2, + GST_VERSION_MAJOR, GST_VERSION_MINOR, 0); +} + GST_START_TEST (test_video_encoders_decoders) { const gchar *s; @@ -232,21 +241,21 @@ GST_START_TEST (test_video_encoders_decoders) #define ENC_DEC_PIPELINE_STRING(bufcount, enc, dec) "videotestsrc num-buffers=" bufcount " ! " enc " ! " dec " ! fakesink" #define DEFAULT_BUFCOUNT "5" - s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "jpegenc", "jpegdec"); - run_pipeline (setup_pipeline (s), s, - GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), - GST_MESSAGE_UNKNOWN, target_state); - - s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "pngenc", "pngdec"); - run_pipeline (setup_pipeline (s), s, - GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), - GST_MESSAGE_UNKNOWN, target_state); + if (have_elements ("jpegenc", "jpegdec")) { + s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "jpegenc", "jpegdec"); + run_pipeline (setup_pipeline (s), s, + GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), + GST_MESSAGE_UNKNOWN, target_state); + } + if (have_elements ("pngenc", "pngdec")) { + s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "pngenc", "pngdec"); + run_pipeline (setup_pipeline (s), s, + GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), + GST_MESSAGE_UNKNOWN, target_state); + } - if (gst_registry_check_feature_version (gst_registry_get (), "smokeenc", - GST_VERSION_MAJOR, GST_VERSION_MINOR, 0) && - gst_registry_check_feature_version (gst_registry_get (), "smokedec", - GST_VERSION_MAJOR, GST_VERSION_MINOR, 0)) { + if (have_elements ("smokeenc", "smokedec")) { s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "smokeenc", "smokedec"); run_pipeline (setup_pipeline (s), s, GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),