【问题标题】:How can I test my gstreamer plugin? Is there any standard test-suite for gstreamer plugin testing?如何测试我的 gstreamer 插件?是否有任何用于 gstreamer 插件测试的标准测试套件?
【发布时间】:2011-11-18 06:07:53
【问题描述】:

假设我已经制作了基于 gstreamer 的插件。我已经安装了它,它与 gst-launch 应用程序一起正常工作。

但现在我想测试我的 gstreamer 插件。那么是否有用于此类插件测试的标准测试套件

是否有任何使用 gstreamer 组件构建的媒体播放器,以便我可以用我的插件替换该组件并对其进行测试?

【问题讨论】:

  • 我不太明白你想要做什么。您能否进一步描述您想要实现的目标?
  • 我已经制作了一个插件元素,现在我想测试它是否正常工作?所以为了测试这样的元素,gstreamer 中是否有任何标准的测试套件可用?
  • 您可能想咨询 irc.freenode.net 上的#gstreamer。

标签: c linux media-player gstreamer multimedia


【解决方案1】:

我不确定 GStreamer 0.10,鉴于它的年龄,我认为这个问题是关于它的。但是对于任何为 GStreamer 1.0 编写插件的人来说,这里有一个非常简单的单元测试套件,它利用了 GStreamer 的内置 Check frameworkGstCheck 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);

在构建测试时,您需要链接您的插件* 和 gstcheck-1.0 库。使用pkg-config 可以让事情变得更简单:

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

运行测试时,记得告诉 GStreamer 在哪里寻找您的插件:

GST_PLUGIN_PATH=. ./gstmyplugintests

应该就是这些了!

* 编辑:实际上,如果您的测试访问其内部数据结构和函数,您只需要链接到您的插件。

【讨论】:

    【解决方案2】:

    我认为this 会解决你的问题。

    【讨论】:

    • 在读到我制作了插件之后...!!但此类测试套件的信息不足
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 2012-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    • 1970-01-01
    相关资源
    最近更新 更多