<P>
Hi all,<BR>
I have written the simple code for playing audio/video files using decodebin.<BR>
Idea of creating the pipeline is as follows:<BR>
/-----------------------<BR>
1. created the elements filesrc and decodebin. Added & Linked these elements to pipeline and subscribed for callback cb_newpad() with decodebin element.<BR>
2. created the elements audioconvert and alsasink and added these elements to audio bin with ghostpad. (this audio bin is not yet added in the pipeline)<BR>
3. created the element xvimagesink and added this element to video bin with ghostpad. (this video bin is not yet added in the pipeline)<BR>
4. Now setting the pipeline (with partial elements in step 1) to running state.<BR>
4. When getting callback cb_newpad() for pad with mime type "audio/*" then adding the audio bin to pipeline, linking the ghostpad of audio bin with this new pad.<BR>
Once it is added and linked in pipeline, I am synchronizing the state of audio bin with pipeline state using following function:<BR>
gst_element_sync_state_with_parent (audiobin);<BR>
4. When getting callback cb_newpad() for pad for mime type "video/*" then adding the video bin to pipeline, linking the ghostpad of video bin with this new pad.<BR>
Once it is added and linked in pipeline, I am synchronizing the state of video bin with pipeline (parent of video bin) state using following function:<BR>
gst_element_sync_state_with_parent (videobin);<BR>
/------------------------------<BR>
<BR>
When I am trying to play audio file (only audio stream) or video file without audio (only video stream) then this code is perfectly working.<BR>
but facing problem when file contain both audio and video stream.<BR>
It sometime plays perfectly but sometime I am getting EOS (end of stream) notification immediately.<BR>
what is the reason for this behavior.<BR>
I tried to use the following pipeline from command line. it always worked fine:<BR>
$gst-launch-0.10 filesrc location=soccer.avi ! decodebin name="decodebin" decodebin.! xvimagesink decodebin.! audioconvert ! alsasink <BR>
Code is attached in this mail.<BR>
Can someone please point out where could be the problem & please suggest the necessary changes needed?<BR>
Any help would be appreciated. <BR>
Thanks in advance.<BR>
<BR>
Regards,<BR>
Sanjay
</P>
*********************************<br>
Sanjay Kumar Gupta<br>
Motorola India Elecronics Ltd.,<br>
"TSR Towers",H.No. 6-3-1090,<br>
Somajiguda, Raj Bhavan Road,<br>
Hyderabad-500082.<br>
Email: sanjayg@motorola.com<br>
*********************************<br><br>
<a href="http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3"><IMG SRC="http://adworks.rediff.com/cgi-bin/AdWorks/sigimpress.cgi/www.rediff.com/signature-home.htm/1963059423@Middle5?OAS_query=null&PARTNER=3" BORDER=0 VSPACE=0 HSPACE=0></a>