mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
tests: simple-launch-lines: only run jpeg/png tests if elements are available
This commit is contained in:
parent
bbcfc3b9e6
commit
f1972b667e
1 changed files with 22 additions and 13 deletions
|
@ -222,6 +222,15 @@ GST_START_TEST (test_rtp_payloaders)
|
||||||
|
|
||||||
GST_END_TEST;
|
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)
|
GST_START_TEST (test_video_encoders_decoders)
|
||||||
{
|
{
|
||||||
const gchar *s;
|
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 ENC_DEC_PIPELINE_STRING(bufcount, enc, dec) "videotestsrc num-buffers=" bufcount " ! " enc " ! " dec " ! fakesink"
|
||||||
#define DEFAULT_BUFCOUNT "5"
|
#define DEFAULT_BUFCOUNT "5"
|
||||||
|
|
||||||
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "jpegenc", "jpegdec");
|
if (have_elements ("jpegenc", "jpegdec")) {
|
||||||
run_pipeline (setup_pipeline (s), s,
|
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "jpegenc", "jpegdec");
|
||||||
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
run_pipeline (setup_pipeline (s), s,
|
||||||
GST_MESSAGE_UNKNOWN, target_state);
|
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
||||||
|
GST_MESSAGE_UNKNOWN, target_state);
|
||||||
|
}
|
||||||
|
|
||||||
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "pngenc", "pngdec");
|
if (have_elements ("pngenc", "pngdec")) {
|
||||||
run_pipeline (setup_pipeline (s), s,
|
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "pngenc", "pngdec");
|
||||||
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
run_pipeline (setup_pipeline (s), s,
|
||||||
GST_MESSAGE_UNKNOWN, target_state);
|
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
||||||
|
GST_MESSAGE_UNKNOWN, target_state);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (have_elements ("smokeenc", "smokedec")) {
|
||||||
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)) {
|
|
||||||
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "smokeenc", "smokedec");
|
s = ENC_DEC_PIPELINE_STRING (DEFAULT_BUFCOUNT, "smokeenc", "smokedec");
|
||||||
run_pipeline (setup_pipeline (s), s,
|
run_pipeline (setup_pipeline (s), s,
|
||||||
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING),
|
||||||
|
|
Loading…
Reference in a new issue