<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Fast initialization of MPEGTS ThreadedDemuxer and reducing playback latency in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/Fast-initialization-of-MPEGTS-ThreadedDemuxer-and-reducing/m-p/773397#M985</link>
    <description>I use the IPP Threaded demuxer to read MPEGTS streams over the network. For this I subclassed the DataReader class. When I used this I found the demuxer had a large latency on initialization for network streams (e.g. 5-10 secs). &lt;BR /&gt;This post is to describe the changes I have done to the IPP code to solve this. I would appreciate any feedback, especially from the developers. &lt;BR /&gt;I have posted the relevant code changes only but I would be glad to submit the complete sources if anyone wants.&lt;BR /&gt;Problem:&lt;BR /&gt;The init method would block until the CheckNextData would return not enough buffer (UMC_ERR_NOT_ENOUGH_BUFFER) and then exit the initialization loop and signal init event. &lt;BR /&gt;&lt;BR /&gt;First approach:&lt;BR /&gt;I modified the initialization loop in ThreadRoutine to finish as soon as the tracks that I had asked for in the rules were found:&lt;BR /&gt;// initialization&lt;BR /&gt; while (!m_bStop &amp;amp;&amp;amp; !(m_uiFlags &amp;amp; FLAG_VSPL_FAST_INIT))&lt;BR /&gt; {&lt;BR /&gt; umcRes = m_pDemuxer-&amp;gt;CheckNextData(&amp;amp;data, &amp;amp;uiTrack);&lt;BR /&gt; if (UMC_OK == umcRes)&lt;BR /&gt; { // next access unit is received, check if it's from new track&lt;BR /&gt; if (!m_pRulesState-&amp;gt;m_bIsTriedByRules[uiTrack])&lt;BR /&gt; {&lt;BR /&gt; if (TryTrackByRules(uiTrack))&lt;BR /&gt; { // match some rule, leave it enabled&lt;BR /&gt; m_OnAutoEnable.Lock();&lt;BR /&gt; m_bAutoEnable = true;&lt;BR /&gt; m_OnAutoEnable.Unlock();&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; { // not match to any rule, disable it&lt;BR /&gt; m_pDemuxer-&amp;gt;EnableTrack(uiTrack, 0);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;+++  if (m_pRulesState-&amp;gt;m_iMatchedTracks &amp;gt;= m_pRulesState-&amp;gt;m_iMaxTracks)&lt;BR /&gt;+++   break;&lt;BR /&gt; }&lt;BR /&gt; else if (UMC_WRN_INVALID_STREAM == umcRes)&lt;BR /&gt;&lt;BR /&gt;Drawback:&lt;BR /&gt;This improved the situation but I found that if I asked for 1 audio and 1 video ES and if there was only a video in the stream it would still wait until the buffers were filled up before signaling the Init event. &lt;BR /&gt;&lt;BR /&gt;Second approach:&lt;BR /&gt;So I set the FLAG_VSPL_FAST_INIT flag in the init method. Then I modified the internal demuxer to make a callback when it constructs the first frame of a new track. In the callback I pass the track info which I use to initialize the decoder. I also modified the DemuxerParams through which I set the callback function. The significant part of the modified code is in Demuxer::CheckNextDataForward:&lt;BR /&gt;...&lt;BR /&gt;m_pFC[m_iCurTrack]-&amp;gt;GetLastFrame(data);&lt;BR /&gt; if (m_pFC[m_iCurTrack]-&amp;gt;GetInfo()-&amp;gt;m_iFirstFrameOrder &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; m_pFC[m_iCurTrack]-&amp;gt;GetInfo()-&amp;gt;m_iFirstFrameOrder = m_uiTracksReady;&lt;BR /&gt; m_uiTracksReady += 1;&lt;BR /&gt;&lt;BR /&gt; if(m_pOnNewTrackCallbackFunc)&lt;BR /&gt; {&lt;BR /&gt; m_pOnNewTrackCallbackFunc(m_pOnNewTrackCallbackObj, m_pFC[m_iCurTrack]-&amp;gt;GetInfo(), &lt;BR /&gt; m_iCurTrack);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;....&lt;BR /&gt;</description>
    <pubDate>Mon, 26 Jul 2010 15:51:11 GMT</pubDate>
    <dc:creator>pushkar_p</dc:creator>
    <dc:date>2010-07-26T15:51:11Z</dc:date>
    <item>
      <title>Fast initialization of MPEGTS ThreadedDemuxer and reducing playback latency</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/Fast-initialization-of-MPEGTS-ThreadedDemuxer-and-reducing/m-p/773397#M985</link>
      <description>I use the IPP Threaded demuxer to read MPEGTS streams over the network. For this I subclassed the DataReader class. When I used this I found the demuxer had a large latency on initialization for network streams (e.g. 5-10 secs). &lt;BR /&gt;This post is to describe the changes I have done to the IPP code to solve this. I would appreciate any feedback, especially from the developers. &lt;BR /&gt;I have posted the relevant code changes only but I would be glad to submit the complete sources if anyone wants.&lt;BR /&gt;Problem:&lt;BR /&gt;The init method would block until the CheckNextData would return not enough buffer (UMC_ERR_NOT_ENOUGH_BUFFER) and then exit the initialization loop and signal init event. &lt;BR /&gt;&lt;BR /&gt;First approach:&lt;BR /&gt;I modified the initialization loop in ThreadRoutine to finish as soon as the tracks that I had asked for in the rules were found:&lt;BR /&gt;// initialization&lt;BR /&gt; while (!m_bStop &amp;amp;&amp;amp; !(m_uiFlags &amp;amp; FLAG_VSPL_FAST_INIT))&lt;BR /&gt; {&lt;BR /&gt; umcRes = m_pDemuxer-&amp;gt;CheckNextData(&amp;amp;data, &amp;amp;uiTrack);&lt;BR /&gt; if (UMC_OK == umcRes)&lt;BR /&gt; { // next access unit is received, check if it's from new track&lt;BR /&gt; if (!m_pRulesState-&amp;gt;m_bIsTriedByRules[uiTrack])&lt;BR /&gt; {&lt;BR /&gt; if (TryTrackByRules(uiTrack))&lt;BR /&gt; { // match some rule, leave it enabled&lt;BR /&gt; m_OnAutoEnable.Lock();&lt;BR /&gt; m_bAutoEnable = true;&lt;BR /&gt; m_OnAutoEnable.Unlock();&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; { // not match to any rule, disable it&lt;BR /&gt; m_pDemuxer-&amp;gt;EnableTrack(uiTrack, 0);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;+++  if (m_pRulesState-&amp;gt;m_iMatchedTracks &amp;gt;= m_pRulesState-&amp;gt;m_iMaxTracks)&lt;BR /&gt;+++   break;&lt;BR /&gt; }&lt;BR /&gt; else if (UMC_WRN_INVALID_STREAM == umcRes)&lt;BR /&gt;&lt;BR /&gt;Drawback:&lt;BR /&gt;This improved the situation but I found that if I asked for 1 audio and 1 video ES and if there was only a video in the stream it would still wait until the buffers were filled up before signaling the Init event. &lt;BR /&gt;&lt;BR /&gt;Second approach:&lt;BR /&gt;So I set the FLAG_VSPL_FAST_INIT flag in the init method. Then I modified the internal demuxer to make a callback when it constructs the first frame of a new track. In the callback I pass the track info which I use to initialize the decoder. I also modified the DemuxerParams through which I set the callback function. The significant part of the modified code is in Demuxer::CheckNextDataForward:&lt;BR /&gt;...&lt;BR /&gt;m_pFC[m_iCurTrack]-&amp;gt;GetLastFrame(data);&lt;BR /&gt; if (m_pFC[m_iCurTrack]-&amp;gt;GetInfo()-&amp;gt;m_iFirstFrameOrder &amp;lt; 0)&lt;BR /&gt; {&lt;BR /&gt; m_pFC[m_iCurTrack]-&amp;gt;GetInfo()-&amp;gt;m_iFirstFrameOrder = m_uiTracksReady;&lt;BR /&gt; m_uiTracksReady += 1;&lt;BR /&gt;&lt;BR /&gt; if(m_pOnNewTrackCallbackFunc)&lt;BR /&gt; {&lt;BR /&gt; m_pOnNewTrackCallbackFunc(m_pOnNewTrackCallbackObj, m_pFC[m_iCurTrack]-&amp;gt;GetInfo(), &lt;BR /&gt; m_iCurTrack);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;....&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jul 2010 15:51:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/Fast-initialization-of-MPEGTS-ThreadedDemuxer-and-reducing/m-p/773397#M985</guid>
      <dc:creator>pushkar_p</dc:creator>
      <dc:date>2010-07-26T15:51:11Z</dc:date>
    </item>
  </channel>
</rss>

