Hey Manas,
The decode demo does NOT do any time synching through
PTS for the video frames it receives - it just reads them and plays them
back as fast as the decoder can process those frames; the reason why it
looks in synch is because the display thread does waitForVsync(), which
acts as a mini scheduler and ensures you display at the native refresh
rate of the output video standard (NTSC = 30fps and PAL = 25fps). So as
you can see, there is no AV synchronizer mechanism in place for you to
do this.
The better way to achieve AV synch is to store the video first with
timestamps in it when you're encoding it (so if you have an AVI file
container, the elementary stream inside should contain PTS to give you
this indicator). Then during playback, you have to design a AV
synchronizer that properly 'releases' frames to the display thread based
on when measurements made between your local clock and the PTS given to
you.
Here's a good document to get you started:
http://www.tcshelp.com/pnx1517_app/MPTK_AVsync.pdf
The basic premise revolves around using kernel sleep calls to make a
thread sleep till the desired time and then release the frame to the
display thread. The 'desired time' is computed based on a known
relationship between the PTS found in the files, and the local time on
your processor. Once you know the delta difference, you can compute the
absolute time till which you'll have to sleep to in order to properly
synchronize the video.
Also note that the DVEVM comes with VCXOs that are controlled by PWM
signals that allow you to control drift using a proportional controller.
By varying the PWM signals, you can speed up and slow down the audio
clock to keep it sync.
Hope it helps,
Jerry Johns
Design Engineer
Nuvation Research Corp - Canada
Tel: (519) 746-2304 ext. 221
www.nuvation.com <http://www.nuvation.com>
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source