[vls-devel] Re: vls doesn't stop sending...

Tristan Leteurtre tristan.leteurtre at videolan.org
Tue Nov 26 20:15:53 CET 2002


On Sun, Nov 24, 2002, Heok Kee Oon wrote:
>    Tristan: You previously mentioned about having some
> codes that can display if it's an I, P or B-frame that
> is being sent. Do you still have it? 

Here it is :

char FrameType(u8 * p)
{
       u8 * start;
  
       /* search for the picture_start_code 0x00 00 01 00
          See sect. 6.3.9 of 13818-2 */

       start =  p + 4 ; /* Skip the TS header */

       while( (start=(u8*) memchr(start+1, 0x00,
               (p+188-5 - start)/sizeof(u8))) != NULL)
       {
               if ( (*(start+1) == 0x00) &&
                       (*(start+2) == 0x01) &&
                       (*(start+3) == 0x00))
 
               // Frame type is given in the picture_coding_type field
               // See sect 6.2.3 and table 6.12 of 13818-2
               switch( ( *(start+5)&0x38)>>3)
               {
                       case 1 : return 'I'; break; /* I Frame */
                       case 2 : return 'P'; break; /* P frame */
                       default : return 0; break;
               }
       }

       return 0;
}

(I use it in http://www.videolan.org/vls/sat//DVB-0.9.4-vls-dvbs-1.patch)

-- 
Tristan
-- 
This is the vls-devel mailing-list, see http://www.videolan.org/vls-devel/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vls-devel mailing list