Mailing List archive

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

[linux-dvb] Re: PAT/PMT decoding



Hi,

also RTFM would be a correct answer I'll decoded it manually :-) :

tp header data:
> 47 Sync byte
> 40 payload unit start indicator set -> new section starts within that TP
> 00 PID 0x0000
> 1f  adaption field control = 01 (-> no adaption field, payload only),
continuity counter 0x0f
> 00 pointer field 0x00 (ie section starts right here)

now the section data:
> 00 table id -> PAT
> b0 section_syntax_indicator 1, const '0', reserved '11',
> 2d section length 0x002d (45)
> 07 f3 transport_stream_id
> ef reserved '11', version number 0x17 (23), current_next_indicator '1'
> 00 section_number
> 00 last_section_number (<- so this section 0x00 is the one and only
section (0-based counting!)

now the loop: (until we reach the section_length - crc)
> 00 00 program_number
>e0 10 reserved 3 bits + PID -> 0x10 -> NIT (as program_number == 0)
> 12 08 e1 04 14 56 e1 03 14 78 e1 06 14 79 e1 07 14 ab e1 05
> 15 82 e1 00 16 aa e1 02 16 ac e1 01 the remaining programs

> 94 71 3f de CRC32  (0xde is 45th byte after the section_length byte)
>ff (rest is padded with ff)

> Looking at the structure, the 8th byte above would be the
> section_length, which is apparently 45 in this case (0x2d).
> Transport_stream_id would be 0x07f3, and the version_number would be
> (0xef & 0x3E = decimal 46)
SHR 1 -> current_next_indicator is last bit

.  The next 2 bytes are therefore 00 and 00,
> which represent the section_number and last_section_number.
>
> Since there's no difference in the section numbers, there's no loop to
> iterate through to produce the association tables.

see above. 0 based counting -> 1 section

> So have I decoded that packet wrong?

Yep ;)

For correct assembly you shouldn't decode transport packets but assemble
sections first as most section are contained within more than one transport
packet (even if the section data is less than 184 bytes!)

Matthias



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index