<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> I have a pipeline with a basic pipeline structure like:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> filesrc -> stuff -> tee<o:p></o:p></p>
<p class="MsoNormal"> tee -> queue -> more stuff -> sink1<o:p></o:p></p>
<p class="MsoNormal"> tee -> queue -> even more stuff -> sink2<o:p></o:p></p>
<p class="MsoNormal"> ... <o:p></o:p></p>
<p class="MsoNormal"> tee -> queue -> still more stuff -> sinkN<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The problem is sometimes one of the branches can ‘go wrong’.<o:p></o:p></p>
<p class="MsoNormal">For example if "more stuff" has the wrong kind of audio decoder (in my case mpg123dec instead of something to handle AAC) then sink1 never sinks anything (e.g. if a filesink the file stays empty).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, all the elements seem to keep running and no problem is reported.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The pipeline never receives a EOS on the bus and my program hangs instead of exiting when the filesrc reaches the end of the file.<o:p></o:p></p>
<p class="MsoNormal">I was confused for a long time over this as the last event of interest was as a different queue overrunning though the branch and sink elements of that queue were fine.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there a conventional way of detecting such problems?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">No bus messages leapt out at me and the element all seem to be running.<o:p></o:p></p>
<p class="MsoNormal">Presumably I need to track the buffers or lack thereof getting into the final sink element of each branch?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also I think I might need another (more robust) way of detecting the end of the input stream.<o:p></o:p></p>
<p class="MsoNormal">So if a problem like this does occur I at least know when all the input has been read.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">I think what I need to do is add a PAD_PROBE_TYPE_EVENT_FLUSH probe to the source element to catch EOS events there. Is that right?<o:p></o:p></p>
<p class="MsoNormal">I haven't quite groked how to add the necessary probe.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The probe has to be added after the element is ready or “pad not activated yet” is emitted.<o:p></o:p></p>
<p class="MsoNormal">I tried adding it on receipt of a bus message telling me that the filesrc has gone from ready to paused.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, I don’t see any events from the source probe, least of all an EVENT_EOS.<o:p></o:p></p>
<p class="MsoNormal">If I use PAD_PROBE_TYPE_ALL_BOTH with add_probe I see:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">GStreamer-CRITICAL **: gst_pad_probe_info_get_event: assertion 'info->type & (GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_UPSTREAM)' failed<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any tips?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Bruce.<o:p></o:p></p>
</div>
<br>
<br>
<a href="http://www.kantar.com/disclaimer.html">Kantar Disclaimer</a>
</body>
</html>