From: wuzw <wu...@ma...> - 2009-11-19 09:46:10
|
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? |