Mailing List archive

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

[linux-dvb] Re: Reconstruct PAT/PMT tables from TS?



Thanks for the info, Johannes.  Some aspects are clearer to me now.  But
I still don't see the whole picture :)

On Sat, Dec 04, 2004 at 05:18:48PM +0100, Johannes Stezenbach wrote:
> Josef Wolf wrote:

> > 1. TS packets that belong to a specific PID can transport only one table.
> wrong; use table_id

Hmm, but table_id is not enough to identify a specific section.  Different
PMT's (in different PID's) all have table_id==2, don't they?  So

- to identify the sections containing PAT, the PID _or_ table_id is
  sufficient.

- to identify the section (it can be only one?) containing the PMT of
  a specific program, PID _and_ table_id are needed _and_ only entries
  with correct program_number should be used.

Is it possible that PMT's for different programs are transported withhin a
single PID?  If it's possible, can they be placed withhin the same section
or would different sections be required?

So (in contrast to EN-300468, section 5.11.1), to uniquely identify a
section following information is needed:

- PID
- table_id (evtl table_id_extension)
- section_number
- version_number
- current_next_indicator

OTOH, to identify a specific _table_ (after complete reconstruction. After
all, sections are only an intermediate step on the way of reconstructing
tables), the PID and the table_id would be sufficient?

> > 5. Sections withhin a table can be replaced independently.
> wrong; when a table changes the version number of all sections is
> incremented; it is invalid to assemble a table from sections with
> different version numbers

OK.

> > 7. Once a section is started, TS packets with the same PID transport
> >    consecutive parts of the section as long as payload_unit_start_indicator
> >    is zero.
> yes (there is also the possibility that one TS contains multiple short
> sections, or the last part of one section and the next section)

I understand the case with multiple short sections.  But how do packets
with the last part of a long section and the start of a new section look
like?  In this case the payload_unit_start_indicator would be set.  This
requires the pointer_field to be present, which points to the start of
the new section.  Would the end of the old section begin directly behind
pointer_field and span up to the start of the new section?

> > 8. Only the last part of a section can contain an adoption field.
> sections contain no adaptation field, TS packets do;
> every TS packet can potentially contain one

OK.  So when a new section begins, the pointer_field is located directly
behind the adaption field?

> There is plenty of source out there that implements this. You might
> want to read some of it.

I tried to find some, but everything I could find (scan utility, libdvb)
request readily assembled sections from the kernel.  So they don't have
any code to assemble them.  OTOH, I'd like not only to write some code,
but also to learn how things fit together.

BTW: On Astra 11954MHz horizontal, I can't find the PID for the NIT in
     the PAT.  I remember the requirement that the PID for the NIT
     should be listed in the PAT with program_number==0.  But I can't
     find anymore where I have read this :-(

     When I request PID 0x10, I can get some data (I have not checked
     whether it is really the NIT, but at least table_id==0x40).
     Shouldn't an entry "0=>0x10" be listed in the PAT?

-- 
Please visit and sign and http://www.ffii.org
-- Josef Wolf -- jw@raven.inka.de --




Home | Main Index | Thread Index