I have a use case of restarting Encoder with different resolution but the
reference count of all elements is not decreasing even after calling stop function(gst_object_unref() & g_main_loop_unref()).. I have added Initialization function ,start function and stop function sudo code. for reference. I am using g_main_loop_new and gst_parse_launch() API's to create element then factory API's Its working fine but reference count is not decrementing. start --> restart wavenc0 --> wavenc1, similarly all the elements COMMAND cPipeline_Desc INITIALIZATION funtion bus = gst_pipeline_get_bus(GST_PIPELINE(m_pstGstConfig->pipeline)); gst_bus_add_watch(bus, bus_call, m_pstGstConfig->loop); gst_object_unref(bus); /* Set the pipeline to "playing" state*/ gst_element_set_state(m_pstGstConfig->pipeline, GST_STATE_PLAYING); RUN function if (m_pstGstConfig->loop != NULL) { printf("\n g loop running \n"); g_main_loop_run(m_pstGstConfig->loop); } STOP function Problem: 1) I have a use case of restarting Encoder with different resolution but the refrence count is not decreasing even after calling stop function 1st Start 00:00:01.886651627 20932 000001EC670D5F00 WARN wavenc gstwavenc.c:1068:gst_wavenc_chain:<wavenc0> Could not reorder channels Restart 0:00:17.125845309 20932 000001EC670D5F00 WARN wavenc gstwavenc.c:1068:gst_wavenc_chain:<wavenc1> Could not reorder channels wavenc0 --> wavenc1, similarly all the elements ----- adi -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
adi
|
Setting pipeline state to NULL state won't remove elements from the pipeline.
gst_element_set_state(m_pstGstConfig->pipeline, GST_STATE_NULL); unref of the object will unref all the elements. gst_object_unref(GST_PIPELINE(m_pstGstConfig->pipeline)); Use gst_bin_remove() function to remove only one element. This function will reduce the ref count of the element by 1. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
This post was updated on .
Hi ShilVin,
Thanks for your inputs, i did the following but still the reference count is increasing, after restart of encoder. To create gstreamer elements i am not using API's like GstElement * gst_element_factory_create () GstElement * gst_element_factory_make (). But instead directly using API's like gst_parse_launch() , g_main_loop_new() and g_main_loop_run(). Maybe there is different way of Unreferencing the Gstreamer Elements ? ? // Create gstreamer loop m_pstGstConfig->loop = g_main_loop_new(NULL, FALSE); sVideoAudioCmd = EncCommand_line(); /* Create gstreamer elements */ m_pstGstConfig->pipeline = gst_parse_launch(m_pstGstConfig->cPipeline_Desc, &gError); g_main_loop_run(m_pstGstConfig->loop); Unreferencing gst_element_set_state((GstElement *)m_pstGstConfig->pipeline, GST_STATE_NULL); gst_object_unref(GST_PIPELINE(m_pstGstConfig->pipeline)); m_pstGstConfig->pipeline = NULL; /* Main Loop */ g_main_loop_quit(m_pstGstConfig->loop); g_main_loop_unref(m_pstGstConfig->loop); m_pstGstConfig->loop = NULL; Can anyone help me to solve the issue , i have attached the Debug log with level 4 {GST_DEBUG=4}, where i am restarting the Encoder 3 times (i called the above code 3 times including Unrefrenceing code) The Reference count value is 0,1,2 in debug log Debug Log File gstreamerDebugLog.txt <http://gstreamer-devel.966125.n4.nabble.com/file/t378175/gstreamerDebugLog.txt> ----- adi -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list gstreamer-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
adi
|
Free forum by Nabble | Edit this page |