[gst-devel] Is this expected?

franchan francis.meyvis at gmail.com
Tue Aug 5 17:23:27 CEST 2008


Hello,

I was writing/running some simple unit tests for a gstreamer application.
Suddenly I could not instantiate the playbin pipeline.

init gstreamer
deinit gstreamer

init gstreamer
try to make playbin -> fails

I made a basic application to show what goes wrong.
Setting GST_DEBUG enough high shows a silly warning:
the second init of gstreamer emits: "already inited"
Yes but after the first init I deinit ...

You might wonder why the heck do so many init/deinits:
It is due to a fixture of each test case/suite ...

#include <gst/gst.h>
#include <iostream>

int
main(int argc, char* argv[])
{
    if ( FALSE == g_thread_supported() )
    {
        g_thread_init(NULL); // threads were not initialized yet
    }

    GstElement*   mPipeline;

    GError* vGErr = NULL;
    gboolean vGST_InitResult;
    vGST_InitResult = gst_init_check(&argc, &argv, &vGErr);
    std::cout << "vGST_InitResult:" << vGST_InitResult << std::endl;
    gst_deinit();

    vGST_InitResult = gst_init_check(&argc, &argv, &vGErr);
    std::cout << "vGST_InitResult:" << vGST_InitResult << std::endl;
    gst_deinit();

    vGST_InitResult = gst_init_check(&argc, &argv, &vGErr);
    std::cout << "vGST_InitResult:" << vGST_InitResult << std::endl;
    //gst_deinit();

    mPipeline = gst_element_factory_make("playbin", "player");
    std::cout << "mPipeline:" << mPipeline << std::endl;

    return 0;
}




More information about the gstreamer-devel mailing list