The problem about gst_element_set_state.

Stefan Sauer ensonic at hora-obscura.de
Mon Jan 2 07:07:46 PST 2012


On 12/28/2011 10:29 AM, forestzhu wrote:
> Hi all,
> I met trouble in gsteamer program.
> Sometimes the  program will crash 
> when I use the " gst_element_set_state" to set the pipeline to NULL .
>
> my code likes below:
>
>         if (player->pipeline)
>         {
>             DEBUG_LOG("pipeline=>%p ...",player->pipeline);
> while(GST_STATE_CHANGE_FAILURE == gst_element_set_state (player->pipeline,
> GST_STATE_NULL))
>             DEBUG_LOG("fail to change pipeline state...");
there is no need to do this in a while loop. If it failed once, it will
fail again and agin as you don't do anything to make it work again.

Stefan

> DEBUG_LOG("after set state");
>             sleep(1);
>
>             g_object_unref (player->pipeline);
>             player->pipeline = NULL;
>         }
>
> I confirmed before set_state the player->pipeline 's mem_address is correct
> .
> And the  "DEBUG_LOG("fail to change pipeline state...");" and
> "DEBUG_LOG("after set state");" will not run.
>
> Anyone can give me some informations?
>
> Thanks for any hint!
>
> Regards!
>
>
> forest
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/The-problem-about-gst-element-set-state-tp4239421p4239421.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list