Monday, February 25, 2008

RTP Source Filter Problem in FillBuffer() fn

RTP Source Filter Problem :
------------------------------
I faced the problem in Source Filter's FillBuffer() fn : 1.FillBuffer() fn is not executed repeatedly. But If I removed my code. then it is being called repeatedly.
This is what I did in FillBuffer() fn:
FillBuffer()
{
RTPReceiveVideo();
if(HasMPEG4Frames() == FALSE) { return NOERROR; }
pMediaSample->SetTime(rtStart,rtStop);
};
But After some time, the FillBuffer() execution is stopped.
FillBuffer()
{
pMediaSample->SetTime(rtStart,rtStop);
};
I removed my for RTP receiving and checked whether the FillBuffer() fn is executed continuously or not.
it is working continuously

The Reason is we are not setting the Timestamp to the Media sample if we have not received any video frames. This is caused the problem.
So Modify it as follows:
FillBuffer()
{
RTPReceiveVideo();
if(HasMPEG4Frames() == FALSE)
{
pMediaSample->SetTime(rtStart,rtStop);
//Then only the FillBuffer() repeatedly called.
return NOERROR;
}
pMediaSample->SetTime(rtStart,rtStop);
};

Labels: ,

0 Comments:

Post a Comment

<< Home