<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#cce8cf>
<DIV><FONT size=2>hi all:</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I wrote my gst app which used realvideodec 
element like this( ignored some non-significant code):</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>main()</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; ........</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; pthread_creat(&amp;my_thread, null, 
create_pipe_func, null);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; while(1)</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c = 
getchar();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(c = 'b')</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
sleep(10);</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; </FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>create_pipe_func()</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; loop = g_main_loop_new(null, 
false);</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; pipeline = _create_pipeline();//make 
all element and link them, set pad-added callback for delayed link to 
realvideodec sink pad</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; gst_element_set_state(pipeline, 
GST_STATE_PLAYING);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; g_mainn_loop_run(loop);</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>my pipeline is like this:</FONT></DIV>
<DIV><FONT size=2>filesrc&nbsp;--&gt; rmdemux&nbsp;--&gt; 
realvideodec&nbsp;--&gt; fakesink</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>my problem is:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I use the app to play rv4 file, and stream thread blocked on 
close_library().</FONT></DIV>
<DIV><FONT size=2>gst log like this(sorry, I can not copy and paste for some 
reason, so i type some significant logs):</FONT></DIV>
<DIV><FONT 
size=2>------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT 
size=2>gstelement.c:2496:gst_element_set_state_func:&lt;realvideodec0&gt; final: 
set state from NULL to READY</FONT></DIV>
<DIV><FONT size=2>gstrealvideodec.c:456:open_library:&lt;realvideodec0&gt; 
Attempting to open shared library for real video version 2</FONT></DIV>
<DIV><FONT size=2>....</FONT></DIV>
<DIV><FONT size=2>gstrealvideodec.c:557:close_library:&lt;realvideodec0&gt; 
closing library module</FONT></DIV>
<DIV>
<DIV><FONT size=2>gstrealvideodec.c:456:open_library:&lt;realvideodec0&gt; 
Attempting to open shared library for real video version 3</FONT></DIV>
<DIV><FONT size=2>....</FONT></DIV>
<DIV><FONT size=2>gstrealvideodec.c:557:close_library:&lt;realvideodec0&gt; 
closing library module</FONT></DIV>
<DIV><FONT 
size=2>------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>no more things logged. I added some print to glib source code 
and found that <STRONG>dlclose() blocked</STRONG>.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>if &nbsp;i input 'b' now&nbsp;, stream tread unblocked 
and&nbsp;went on correctly.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>If my code like :</FONT></DIV>
<DIV>
<DIV><FONT size=2>main()</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; ........</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; create_pipe_func();</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;</FONT><FONT size=2>&nbsp;&nbsp;&nbsp; 
</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>create_pipe_func()</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; loop = g_main_loop_new(null, 
false);</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; pipeline = _create_pipeline();//make 
all element and link them, set pad-added callback for delayed link to 
realvideodec sink pad</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; gst_element_set_state(pipeline, 
GST_STATE_PLAYING);</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp; g_mainn_loop_run(loop);</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>every thing is ok. </FONT></DIV>
<DIV><FONT size=2>why? </FONT></DIV></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV></BODY></HTML>