Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] RE : Re: Nothing good for me... [Was]-> ( Implementing new device, but video is choppy)




Hi,

Thnak you all for your answers.

If understand everything :

1) my SCR isn't correctly set
2) When viewing live TV, I have to get the correct value to set the SCR

So :
There are 4 different Timestamps :
PCR, SCR, PTS, DTS

PCR is the program stream clock
SCR is the decoder clock
PTS / DTS are timestamps to present frames to the user

If a frame is played when SCR == PTS

If SCR > PTS
{
  The decoder skips frames until PTS == SCR 
  In this case, my decoder seems to discard everything except IFRAMEs. 
}
Else if SCR < PTS
{
  The decoder should wait until SCR == PTS 
  In this case it plays the frames according to the speed set in the decoder
}
Else if SCR == PTS
{
  In this case, the decoder should play every frame
}

If this is right, I have to do :
If(isFirstFrame() && (SCR!=PTS))
    SCR = PTS;

Here is the structure I have to fill to feed the decoder :
typedef struct {
unsigned char *Data;	// Buffer to send (Mandatory)
unsigned long Length;	// (Mandatory)
unsigned long long Pts;	// PTS
unsigned long long Dts;	// DTS
unsigned long long Scr;	// To set the STC with the _first_ _video_ packet
} MPEG_DATA

For the moment I only use Data and Length (I haven't used Pts, Dts and Scr)
I haven't set the Pts/Dts field because it seems that the decoder extracts
itself the Pts and/or Dts from the Buffer to replay the video.

So if I understood everything, 

If pmNone { startStream=true; }
If( startStream ) 
{
  startStream=false;
  Scr = extract_pts(Data);
  feed_decoder_with_scr( Data, Length, Scr);
}
Else 
  feed_decoder( Data, Length);


Thank you.




-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index