Parsing Program Association Tables in DVB streamsParseProgramAssociationTable parses a reconstructed PSI table from a DVB MPEG Transport Stream, and outputs a dictionary containing the data in the table. The purpose of the PAT and details of the fields within in are defined in the MPEG systems specification:
Example UsageA simple pipeline to receive, parse and display the Program Association Table in a multiplex: FREQUENCY = 505.833330 feparams = { "inversion" : dvb3.frontend.INVERSION_AUTO, "constellation" : dvb3.frontend.QAM_16, "code_rate_HP" : dvb3.frontend.FEC_3_4, "code_rate_LP" : dvb3.frontend.FEC_3_4, } PAT_PID = 0x0 Pipeline( DVB_Multiplex(FREQUENCY, [PAT_PID], feparams), DVB_Demuxer({ PAT_PID:["outbox"]}), ReassemblePSITables(), ParseProgramAssociationTable(), PrettifyProgramAssociationTable(), ConsoleEchoer(), ).run() BehaviourSend reconstructed PSI table 'sections' to the "inbox" inbox. When all sections of the table have arrived, ParseProgramAssociationTable will parse the table and send it out of its "outbox" outbox. If the table is unchanged since last time it was parsed, then it will not be sent out. Parsed tables are only sent out when they are new or have just changed. The parsed table is sent out as a dictionary data structure, like this: { 'table_id' : 0 'table_type' : 'PAT', 'current' : 1, 'NIT_PID' : 16, 'transport_streams': { 4100: { 4228: 4228, 4351: 4351, 4479: 4479, 4164: 4164, 4415: 4415, 4671: 4671 } }, } This is an instantaneous snapshot of the PAT for Crystal Palace MUX 1 transmission (505.8MHz) in the UK on 20th Dec 2006. If this data is sent on through a PrettifyProgramAssociationTable component, then the equivalent output is a string containing this: PAT received: Table ID : 0 Table is valid for : CURRENT (valid) NIT is in PID : 16 For transport stream id : 4100 For service 4228 : PMT is in PID 4228 For service 4351 : PMT is in PID 4351 For service 4479 : PMT is in PID 4479 For service 4164 : PMT is in PID 4164 For service 4415 : PMT is in PID 4415 For service 4671 : PMT is in PID 4671 ParseProgramAssociationTable can collect the sections of, and then parse, both 'current' and 'next' tables simultaneously. If a shutdownMicroprocess or producerFinished message is received on the "control" inbox, then it will immediately be sent on out of the "signal" outbox and the component will then immediately terminate. How does it work?ParseProgramAssociationTable logs all the table sections it receives, until it determines it has the complete set; then it parses them. If the version number field in any table section changes, then the log is cleared, and the component starts collecting the sections again from scratch. Kamaelia.Device.DVB.Parse.ParseProgramAssociationTable.ParseProgramAssociationTableclass ParseProgramAssociationTable(Axon.Component.component)ParseProgramAssociationTable() -> new ParseProgramAssociationTable component. Send reconstructed PSI table sections to the "inbox" inbox. When a complete table is assembled and parsed, the result is sent out of the "outbox" outbox as a dictionary. Doesn't emit anything again until the version number of the table changes. Outputs both 'current' and 'next' tables. Inboxes
Outboxes
Methods defined hereWarning! You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers. FeedbackGot a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording! Please leave you feedback here in reply to the documentation thread in the Kamaelia blog. -- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.