[gst-devel] Is this expected?
Wim Taymans
wim.taymans at gmail.com
Tue Aug 5 17:35:16 CEST 2008
On Tue, 2008-08-05 at 17:23 +0200, franchan wrote:
> 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 can't use GStreamer anymore after calling gst_deinit(). From the
docs:
* gst_deinit:
*
* Clean up any resources created by GStreamer in gst_init().
*
* It is normally not needed to call this function in a normal
application
* as the resources will automatically be freed when the program
terminates.
* This function is therefore mostly used by testsuites and other memory
* profiling tools.
*
* After this call GStreamer (including this method) should not be used
anymore.
Wim
>
> 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;
> }
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list