[vdr] cReceiver vs cFilter and PTS questions

Patrick Fischer patrick_fischer at gmx.de
Fri Nov 4 16:37:09 CET 2005


I make my own answer :-)

>
> 2. I want to get the PTS from the current V-PID. I have looked at the 
> femon Plugin. This use a cReceiver which gives me an repacked TS with 
> 188byts. I have surched for a Spec. which gives me more informations 
> about the 188Byts.
> The first 16bit (12bit used) are the PID
> 8bit are the (PAYLOAD/ADAPT_FIELD)(don't know what it is)
> 8bit some kind of offset
> ......
>
> then femon sets a pointer to the receved paket+offset (named sb)
> next femon sets a new pointer to sb + sb[8] + 9 (named pay)
> after all pay shows to the video, audio or AC3 data.
>
> But how to get the PTS?

at this way I get a PTS for one PID. Now I need to deal more with 
cReceiver and more PIDs.

Found at libdvbmpeg:


uint64_t cMyReceiver::trans_pts_dts(uint8_t *pts)
{
    uint64_t wts;
   
    wts = ((uint64_t)((pts[0] & 0x0E) << 5) |
           ((pts[1] & 0xFC) >> 2)) << 24;
    wts |= (((pts[1] & 0x03) << 6) |
        ((pts[2] & 0xFC) >> 2)) << 16;
    wts |= (((pts[2] & 0x02) << 6) |
        ((pts[3] & 0xFE) >> 1)) << 8;
    wts |= (((pts[3] & 0x01) << 7) |
        ((pts[4] & 0xFE) >> 1));
    return wts;
}


void cMyReceiver::Receive(uchar *Data, int Length)
{
     int pid = ((Data[1] & 0x1f) << 8) | (Data[2]);
     if (pid == m_VideoPid) {
         uint8_t off = 0;
         if (Data[3] & ADAPT_FIELD) {
            off = Data[4] + 1;
            }
           printf("vpts : %fs\n",trans_pts_dts( (uint8_t*)(Data + 4 + 
off)+9)/90000.);
    }
}

It works fine.



More information about the vdr mailing list