Hi to all,
I'm currently writing a new plugin for VDR to add a new device corresponding to the triple-play box provided by my ISP (Freebox from FREE french ISP). With this box we can get Live-TV broadcast provided through a RTSP server.
So I wrote a (very early) release of plugin which can read the RTSP stream with the help of the Live555 media library (please see http://www.live555.com/ for more info about this). For now is seems to work. Well only "seems" because the video I get through this plugin is very "choppy" and after a few seconds, the RTSP server gives up and closes the connection (I only get some "buffer" and "clean" messages on the console which seem not really to be errors one).
To help debugging, I replaced the RTSP server URL with a local TS video file (correctly set as it works perfectly with VLC and.MPLAYER for example). Here again is the video very "choppy" so I think my implementation is not good enough...
Actually, I started coding from the demo skybox plugin provided with VDR but I'm not sure how all this works. I understood I have to code a GetTSPacket. Here is how I made it :
1- implement OpenDvr which is declaring some variables
2- implement GetTSPacket this way :
Create a tsBuffer to read more than 188 bytes at a time
tsBuffer = new cTSBuffer(fd_dvr, MEGABYTE(2), CardIndex() + 1);
Read buffer :
Make some PID conversion, if needed, before returning the data
Did I something wrong ? I'm not sure I really understood the relationship between GetTSPacket which wants only 1 packet at a time, and the ringBuffer (implemented by the cTSBuffer class) which reads a lot of data in one shot.
BTW: even if some frames seem to be dropped, I never get any buffer overflow message.
Could someone help me (I can provide some code for analyze purpose if needed) or tell me what can be wrong in the implementation described above ?
Thanks in advance.
Olivier.