How can I test my gstreamer plugin? Is there any standard test-suite for gstreamer plugin testing?
Asked Answered
S

2

6

Suppose I have made my gstreamer based plugin. I have installed it and it is working properly with gst-launch application.

But now I want to test my gstreamer plugin. So is there a standard test-suite for such plugin testing?

Are there any media players built with a gstreamer component so I can replace that component with my plugin and test it?

Spectacled answered 18/11, 2011 at 6:7 Comment(3)
I don't quite get what you want to do. Could you please describe further what it is you want to achieve?Symphonia
i have made one plugin element now i want to test is it working proper or not ? so for testing such element is there any standard test-suite availabe in gstreamer ?Spectacled
You might want to consult #gstreamer on irc.freenode.net.Symphonia
B
5

I'm not sure about GStreamer 0.10, which is what I assume this question is about given its age. But for anyone writing a plugin for GStreamer 1.0, here is a very simple unit test suite that utilizes GStreamer's built-in Check framework and the GstCheck module:

// This header will include some GStreamer-specific test utilities, as well as
// the internal Check API
#include <gst/check/gstcheck.h>

// Surround your tests with the GST_START_TEST and GST_END_TEST macros, then
// use the GstCheck and Check APIs
GST_START_TEST(my_test)
{
    ck_assert(0);
}
GST_END_TEST;

// This is a suite initialization function where you should register your tests.
// It must end with "_suite" and traditionally starts with your plugin's
// namespace.
Suite *gst_myplugin_suite(void) {
    Suite *s = suite_create("GstMyPlugin");
    TCase *tc = tcase_create("general");
    tcase_add_test(tc, my_test);
    // Add more tests with tcase_add_test(tc, test_function_name)
    suite_add_tcase(s, tc);
    return s;
}

// This generates an entry point that executes your test suite. The argument
// should be the name of your suite intialization function without "_suite".
GST_CHECK_MAIN(gst_myplugin);

When building your test, you need to link with your plugin* and the gstcheck-1.0 library. Using pkg-config can make things easier:

gcc -o gstmyplugintests `pkg-config --cflags --libs gstreamer-check-1.0` gstmyplugin.so gstmyplugintests.c

When running your tests, remember to tell GStreamer where to look for your plugin:

GST_PLUGIN_PATH=. ./gstmyplugintests

That should be all there is to it!

* Edit: Actually, you only need to link with your plugin if your tests access its internal data structures and functions.

Braxy answered 21/8, 2015 at 16:58 Comment(0)
T
-1

I think this will solve your problem.

Tunic answered 25/11, 2011 at 6:41 Comment(1)
after reading that i have made plugin...!! but there is not enough info for such test suiteSpectacled

© 2022 - 2024 — McMap. All rights reserved.