From: Tim-Philipp Müller Date: Fri, 27 May 2016 11:49:32 +0000 (+0100) Subject: tests: add unit test for JPEG-2000 rtp payloader leak X-Git-Tag: 1.19.3~509^2~2751 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaf329d39bef5acdad7748f74b81c7ad2856ae00;p=platform%2Fupstream%2Fgstreamer.git tests: add unit test for JPEG-2000 rtp payloader leak https://bugzilla.gnome.org/show_bug.cgi?id=766870 --- diff --git a/tests/check/pipelines/simple-launch-lines.c b/tests/check/pipelines/simple-launch-lines.c index 84d0f21..e074e49 100644 --- a/tests/check/pipelines/simple-launch-lines.c +++ b/tests/check/pipelines/simple-launch-lines.c @@ -213,6 +213,32 @@ GST_START_TEST (test_rtp_payloaders) GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), GST_MESSAGE_UNKNOWN, target_state); +#define J2K_TEST_FILE_PATH GST_TEST_FILES_PATH G_DIR_SEPARATOR_S "gradient.j2k" +#define J2KCAPS "image/x-jpc,colorspace=sYUV,num-components=3,width=720,height=576,pixel-aspect-ratio=1/1,framerate=30/1" + { + GstElement *pipeline, *src; + GstFlowReturn flow = GST_FLOW_OK; + GstBuffer *buf; + gchar *data; + gsize len; + + s = "appsrc caps=" J2KCAPS " name=src ! rtpj2kpay ! rtpj2kdepay ! fakesink"; + + fail_unless (g_file_get_contents (J2K_TEST_FILE_PATH, &data, &len, NULL)); + buf = gst_buffer_new_wrapped (data, len); + pipeline = setup_pipeline (s); + src = gst_bin_get_by_name (GST_BIN (pipeline), "src"); + g_object_set (src, "format", GST_FORMAT_TIME, NULL); + g_signal_emit_by_name (src, "push-buffer", buf, &flow); + gst_buffer_unref (buf); + fail_unless_equals_int (flow, GST_FLOW_OK); + g_signal_emit_by_name (src, "end-of-stream", &flow); + gst_object_unref (src); + run_pipeline (pipeline, s, + GST_MESSAGE_ANY & ~(GST_MESSAGE_ERROR | GST_MESSAGE_WARNING), + GST_MESSAGE_UNKNOWN, target_state); + } + /*s = FAKESRC " ! ! rtpac3depay ! " FAKESINK */ /*s = FAKESRC " ! ! asteriskh263 ! " FAKESINK; */ /*s = FAKESRC " ! ! rtpmpvdepay ! " FAKESINK; */ diff --git a/tests/files/Makefile.am b/tests/files/Makefile.am index 4872dcb..bd3282b 100644 --- a/tests/files/Makefile.am +++ b/tests/files/Makefile.am @@ -1,6 +1,7 @@ EXTRA_DIST = \ audiotestsrc.flac \ + gradient.j2k \ id3-407349-1.tag \ id3-407349-2.tag \ id3-447000-wcop.tag \ diff --git a/tests/files/gradient.j2k b/tests/files/gradient.j2k new file mode 100644 index 0000000..ad2c94a Binary files /dev/null and b/tests/files/gradient.j2k differ