The problem about gst_element_set_state.

hcpwll hcpwll at 163.com
Wed Dec 28 07:00:52 PST 2011


I think the code maybe looks like,

     GstStateChangeReturn ret_get_state;
     GstState state;

       if (player->pipeline)
        {
            gst_element_set_state (player->pipeline, GST_STATE_NULL);
            while (ret_get_state = gst_element_get_state(bin, &state, NULL, 1
					* GST_SECOND) != GST_STATE_CHANGE_FAILURE)
          {
                   if ( GST_STATE_NULL == state)
                  {
                          break;
                  }
          }

            g_object_unref (player->pipeline);
            player->pipeline = NULL;
        }

At 2011-12-28 17:29:24,forestzhu <forest0823 at 126.com> 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..."); >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-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111228/2a4b496c/attachment-0001.html>


More information about the gstreamer-devel mailing list