Community
cancel
Showing results for 
Search instead for 
Did you mean: 
pushkar_p
Beginner
44 Views

Changes to IPP demuxer code to handle network TS streams

Hello,

I few days back I posted my implementation of CSocketReader derived from UMC::DataReader to play network streams -http://software.intel.com/en-us/forums//topic/60592.

I also made a couple of other changes to the demuxer source code to get it working, which I am attaching here. I would appreciate if a IPP developer can review them and comment if they make sense. Are they worth including in future releases?

Modified files: umc_stream_parser.cpp and umc_threaded_demuxer.cpp in codecdemuxersrc:

umc_stream_parser.cpp - Without these changes the demuxer would not initialize. I made this change long back so cannot explain it off the top of my head. You can diff with the official sources and see the changes.

umc_threaded_demuxer.cpp - This is for quick initialization. In Ipp32u ThreadedDemuxer::ThreadRoutine() the initialization happens when the call to m_pDemuxer->CheckNextData(&data, &uiTrack); in the first while loop returns UMC_ERR_NOT_ENOUGH_BUFFER. For n/w streams this was taking as long as 5 seconds. I figured the code should be changed as follows:

umcRes = m_pDemuxer->CheckNextData(&data, &uiTrack);
if (UMC_OK == umcRes)
{ // next access unit is received, check if it's from new track
if (!m_pRulesState->m_bIsTriedByRules[uiTrack])
{
if (TryTrackByRules(uiTrack))
{ // match some rule, leave it enabled
m_OnAutoEnable.Lock();
m_bAutoEnable = true;
m_OnAutoEnable.Unlock();
}
else
{ // not match to any rule, disable it
m_pDemuxer->EnableTrack(uiTrack, 0);
}
}

// My change to break out of the loop early
if (m_pRulesState->m_iMatchedTracks >= m_pRulesState->m_iMaxTracks)
break;
}

This might not be noticeable on files on disk because the parser is perhaps z ipping through the data, but for a n/w stream it can only get data as fast as the source is sending. I had experimented with setting the FLAG_VSPL_FAST_INIT flag in the splitter params but this would return too soon and when I called GetInfo my video and audio stream info objects would be partially initialized (no video width height available or no audio channels, frequency etc. available) and thus I could not initialize my decoder and renderer objects.

Thank you.

0 Kudos
2 Replies
gossamer
Beginner
44 Views

Quoting - pushkar_p

Hello,

I few days back I posted my implementation of CSocketReader derived from UMC::DataReader to play network streams -http://software.intel.com/en-us/forums//topic/60592.

I also made a couple of other changes to the demuxer source code to get it working, which I am attaching here. I would appreciate if a IPP developer can review them and comment if they make sense. Are they worth including in future releases?

Modified files: umc_stream_parser.cpp and umc_threaded_demuxer.cpp in codecdemuxersrc:

umc_stream_parser.cpp - Without these changes the demuxer would not initialize. I made this change long back so cannot explain it off the top of my head. You can diff with the official sources and see the changes.

I'am trying to implement your socket reader class but i have a problem with it. When i start network player it initialize DataReader in AVSync:Init function but get stuck on initializing splitter.

It stuck somewhere inside Demuxer::GetNextData or CheckNextData .. as it cant recognize mpeg2ts payload or something ... I have made changes to threaded_demuxer file and stream_parser file ...

Do you have any suggestions ?

Thanx

gossamer
Beginner
44 Views

It seems that i have some difficulties with transport stream .. now it works fine in yours, and mine version of socket reader, but both of them has some issues. Mine has limited playback time before access violtaion :) It seems that i have managed to uninitialize buffer somewhere or something similar. Yours on the other hand after half minute of playback or something like that starts to use 100% of processor power and than fails in that way .. Did you encounter similar behaviour ? I'll not blame my player just yet, because it works fine with static files (from hdd).