hi all:
I wrote my gst app which used realvideodec
element like this( ignored some non-significant code):
main()
{
........
pthread_creat(&my_thread, null,
create_pipe_func, null);
while(1)
{
c =
getchar();
if(c = 'b')
{
sleep(10);
}
}
}
create_pipe_func()
{
loop = g_main_loop_new(null,
false);
pipeline = _create_pipeline();//make
all element and link them, set pad-added callback for delayed link to
realvideodec sink pad
gst_element_set_state(pipeline,
GST_STATE_PLAYING);
g_mainn_loop_run(loop);
}
my pipeline is like this:
filesrc --> rmdemux -->
realvideodec --> fakesink
my problem is:
I use the app to play rv4 file, and stream thread blocked on
close_library().
gst log like this(sorry, I can not copy and paste for some
reason, so i type some significant logs):
------------------------------------------------------------------------------------------------
gstelement.c:2496:gst_element_set_state_func:<realvideodec0> final:
set state from NULL to READY
gstrealvideodec.c:456:open_library:<realvideodec0>
Attempting to open shared library for real video version 2
....
gstrealvideodec.c:557:close_library:<realvideodec0>
closing library module
gstrealvideodec.c:456:open_library:<realvideodec0>
Attempting to open shared library for real video version 3
....
gstrealvideodec.c:557:close_library:<realvideodec0>
closing library module
------------------------------------------------------------------------------------------------
no more things logged. I added some print to glib source code
and found that dlclose() blocked.
if i input 'b' now , stream tread unblocked
and went on correctly.
If my code like :
main()
{
........
create_pipe_func();
}
create_pipe_func()
{
loop = g_main_loop_new(null,
false);
pipeline = _create_pipeline();//make
all element and link them, set pad-added callback for delayed link to
realvideodec sink pad
gst_element_set_state(pipeline,
GST_STATE_PLAYING);
g_mainn_loop_run(loop);
} every thing is ok.
why? ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi,
Am Donnerstag, den 19.11.2009, 17:44 +0800 schrieb wuzw: > hi all: > I wrote my gst app which used realvideodec element like > this( ignored some non-significant code): > > main() > { > ........ > pthread_creat(&my_thread, null, create_pipe_func, null); > > while(1) > { > c = getchar(); > > if(c = 'b') > { > sleep(10); > } > } > > } > > create_pipe_func() > { > loop = g_main_loop_new(null, false); > pipeline = _create_pipeline();//make all element and link them, > set pad-added callback for delayed link to realvideodec sink pad > gst_element_set_state(pipeline, GST_STATE_PLAYING); > > g_mainn_loop_run(loop); > } > > my pipeline is like this: > filesrc --> rmdemux --> realvideodec --> fakesink > > my problem is: > > I use the app to play rv4 file, and stream thread blocked on > close_library(). > gst log like this(sorry, I can not copy and paste for some reason, so > i type some significant logs): > ------------------------------------------------------------------------------------------------ > gstelement.c:2496:gst_element_set_state_func:<realvideodec0> final: > set state from NULL to READY > gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open > shared library for real video version 2 > .... > gstrealvideodec.c:557:close_library:<realvideodec0> closing library > module > gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open > shared library for real video version 3 > .... > gstrealvideodec.c:557:close_library:<realvideodec0> closing library > module > ------------------------------------------------------------------------------------------------ > > no more things logged. I added some print to glib source code and > found that dlclose() blocked. > > if i input 'b' now , stream tread unblocked and went on correctly. > > > > > If my code like : > main() > { > ........ > create_pipe_func(); > > > } > > create_pipe_func() > { > loop = g_main_loop_new(null, false); > pipeline = _create_pipeline();//make all element and link them, > set pad-added callback for delayed link to realvideodec sink pad > gst_element_set_state(pipeline, GST_STATE_PLAYING); > > g_mainn_loop_run(loop); > } > > every thing is ok. > why? > Have you initialized glib-threading? main () { ... g_thread_init( NULL ); gst_init( &argc, &argv ); ... } Maybe it's safer to use the glib threading functions - at least it works for me. lukas ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
----- Original Message ----- From: "Lukas Ruetz" <[hidden email]> To: "Discussion of the development of GStreamer" <[hidden email]> Sent: Thursday, November 19, 2009 6:56 PM Subject: Re: [gst-devel] realvideodec element blocked when close_library (in transition of NULL to READY), why? > Hi, > > Am Donnerstag, den 19.11.2009, 17:44 +0800 schrieb wuzw: > > hi all: > > I wrote my gst app which used realvideodec element like > > this( ignored some non-significant code): > > > > main() > > { > > ........ > > pthread_creat(&my_thread, null, create_pipe_func, null); > > > > while(1) > > { > > c = getchar(); > > > > if(c = 'b') > > { > > sleep(10); > > } > > } > > > > } > > > > create_pipe_func() > > { > > loop = g_main_loop_new(null, false); > > pipeline = _create_pipeline();//make all element and link them, > > set pad-added callback for delayed link to realvideodec sink pad > > gst_element_set_state(pipeline, GST_STATE_PLAYING); > > > > g_mainn_loop_run(loop); > > } > > > > my pipeline is like this: > > filesrc --> rmdemux --> realvideodec --> fakesink > > > > my problem is: > > > > I use the app to play rv4 file, and stream thread blocked on > > close_library(). > > gst log like this(sorry, I can not copy and paste for some reason, so > > i type some significant logs): > > ------------------------------------------------------------------------------------------------ > > gstelement.c:2496:gst_element_set_state_func:<realvideodec0> final: > > set state from NULL to READY > > gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open > > shared library for real video version 2 > > .... > > gstrealvideodec.c:557:close_library:<realvideodec0> closing library > > module > > gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open > > shared library for real video version 3 > > .... > > gstrealvideodec.c:557:close_library:<realvideodec0> closing library > > module > > ------------------------------------------------------------------------------------------------ > > > > no more things logged. I added some print to glib source code and > > found that dlclose() blocked. > > > > if i input 'b' now , stream tread unblocked and went on correctly. > > > > > > > > > > If my code like : > > main() > > { > > ........ > > create_pipe_func(); > > > > > > } > > > > create_pipe_func() > > { > > loop = g_main_loop_new(null, false); > > pipeline = _create_pipeline();//make all element and link them, > > set pad-added callback for delayed link to realvideodec sink pad > > gst_element_set_state(pipeline, GST_STATE_PLAYING); > > > > g_mainn_loop_run(loop); > > } > > > > every thing is ok. > > why? > > > > Have you initialized glib-threading? > > main () { > ... > g_thread_init( NULL ); > gst_init( &argc, &argv ); > ... > } > > Maybe it's safer to use the glib threading functions - at least it works > for me. > > lukas > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > new code like this: main () { ... g_thread_init( NULL ); gst_init( &argc, &argv ); g_thread = g_tread_create(create_pipeline_func, null, true, &error); ... } % export GST_DEBUG_LEVEL=4 % ./tmp.x log : GST_PLUGIN_LOADING gstpluginfeature.c:105:gst_plugin_feature_load : loading plugin for feature 0x80ca090; 'pipelinet' *** glic-detected*** tmp.x : double free or corruption (out): 0x08161958 *** % export GST_DEBUG_LEVEL=5 % ./tmp.x log (the same as previously happened): gstelement.c:2496:gst_element_set_state_func:<realvideodec0> final: set state from NULL to READY gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open shared library for real video version 2 .... gstrealvideodec.c:557:close_library:<realvideodec0> closing library module gstrealvideodec.c:456:open_library:<realvideodec0> Attempting to open shared library for real video version 3 .... gstrealvideodec.c:557:close_library:<realvideodec0> closing library module ------------------------------------------------------------------------------------------------ no more things logged. I added some print to glib source code and found that dlclose() blocked. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |