Interface Design Document Version No: 0.1
PSI Filter/Table Manager Interface Design
Interface Design Document
Component Release version Date
PSI Filter/Table Manager
Interface Design Document
0.1 15
th
Mar, 2004
Page 1 of 15
PSI FILTER/TABLE MANAGER INTERFACE DESIGN VERSION 0.1 DATED 15/03/2004
Interface Design Document Version No: 0.1
Table of Contents
1 BACKGROUND............................................................................................3
2 ABSTRACT................................................................................................. 4
3 FEATURES SUPPORTED / NOT SUPPORTED IN RELEASE.................................4
4 ASSUMPTIONS...........................................................................................4
5 SOFTWARE ARCHITECTURE / DATA FLOW.....................................................4
5.1 DATAFLOW DIAGRAM FOR THE DEMONSTRATION................................................................................................4
6 PSI/SI TABLE MANAGER APIS......................................................................5
6.1 GRABPSITABLE............................................................................................................................................... 5
6.2 WAITFORTABLE............................................................................................................................................... 7
7 PSI SECTION FILTER APIS...........................................................................7
7.1 OPENSECTIONFILTER:...................................................................................................................................... 8
7.2 SETSECTIONFILTER:........................................................................................................................................ 9
7.3 ENABLESECTIONFILTER.................................................................................................................................... 9
7.4 DISABLESECTIONFILTER................................................................................................................................. 10
7.5 GETSECTIONFILTERSTATUS...........................................................................................................................10
7.6 SETCONDITIONFORSECTIONINTERRUPTION.....................................................................................................11
7.7 ENABLESECTIONINTERRUPTION:.....................................................................................................................12
7.8 SETSECTIONFILTERNOTIFICATIONFUNCTION().................................................................................................12
7.9 ACKNOWLEDGESECTIONNOTIFICATION............................................................................................................13
7.10 CLEARSECTIONFILTERSTATUS.....................................................................................................................13
7.11 CLOSESECTIONFILTER.................................................................................................................................14
8 KNOWN CONSTRAINTS.............................................................................14
A. APPENDIX A : POSSIBLE ERROR VALUES...................................................15
Page 2 of 15
PSI FILTER/TABLE MANAGER INTERFACE DESIGN VERSION 0.1 DATED 15/03/2004
Interface Design Document Version No: 0.1
1 BACKGROUND
In a MPEG-2 transport stream, each transport packet is tagged with an appropriate PID value
indicating to which elementary stream its payload belongs. There may be many elementary
streams comprising many different programmes. The transport streams include additional
information within the transport stream to explicitly state the relationship between the available
programmes and the PID values of their component elementary streams. Such information is
called Programme Specific Information (PSI) and must be present in every transport stream.
Transport Streams. Program Specific Information is classified into four table structures as shown
in the table below. While these structures may be thought of as simple tables, they shall be
segmented into sections and inserted in Transport Stream packets.
Structure Name Reserved PID # Description
Program
Association
Table
0x00 Associates
Program Number
and Program
Map Table PID
Program Map
Table
Assigned in
thePAT
Specifies PID
values for
components of
one or more
programs
Network
Information
Table
Assigned in the
PAT
Physical network
parameters such
as FDM
frequencies,
Transponder
Numbers, etc.
Conditional
Access Table
0x01 Associates one
or more (private)
EMM streams
each with a
unique PID value
Other than these basic tables defined by MPEG-2 TS standard, there are other quite a few tables
defined by Digital Video Broadcasting Project (DVB) / Advanced Television Systems Committee
(ATSC) or other broadcasting standards which are specific to their standard carrying a lot of
other information regarding the programs.
In order for a set-top box to go through the program recovery and decompression process, the
PSI tables must be sent periodically and with a fast enough repetition rate that a channel-surfing
viewer does not feel that program selection takes too long.
The set-top box needs to continuously monitor the various versions of the incoming tables in the
TS stream. At any moment of the set-top box would be interested in parsing a particular
table/tables only and hence the system is looking for only sections corresponding these table.
Hence the system needs some kind of section filtering support, which can filter out the sections,
which are not desired before these sections are parsed. This helps in reducing the data to be
parsed drastically.
Also since the sections (parts of the tables) repeat very often, sections with duplicate information
are received very frequently. The system needs to look only at the new/particular version of the
section and hence needs the filtering support at some stage in the processing.
Summarizing the above:
PSI sections are rebroadcast continuously.
Reparsing the same PSI section is a waste of resources.
Upper layers must stay registered for most tables in order to detect version changes.
Filtering sections by version number and table ID extension fields can help.
Page 3 of 15
PSI FILTER/TABLE MANAGER INTERFACE DESIGN VERSION 0.1 DATED 15/03/2004
Interface Design Document Version No: 0.1
2 ABSTRACT
This design document declares the interfaces to the PSI filter and PSI table handling software
modules. There are two set of APIs being provided: PSI filter layer APIs and PSI/SI table
handling layers. The PSI table handling layer use the services provided by the PSI filtering layer.
Both the modules have clean interfaces and can be replaced by other modules (if desired). Both
the modules can be plugged out /in independently.
3 FEATURES SUPPORTED / NOT SUPPORTED IN RELEASE
The table handling is restricted to the tables specified by the MPEG-2 system layer for
MPEG-2 transport stream. But the provision has been provided to plug in any other PSI/SI
table handlers.
This PSI filtering code will be capable of handling multi-packet sections.
The CRC check will be performed on sections.
4 ASSUMPTIONS
In the transport stream packet, if there is no new section after a section ends, all the bytes
following will be 0xff.
There are no stuffing bytes between two sections.
No section will have table ID = 0xff.
Bytes with value 0xff would mean stuffing till end.
5 SOFTWARE ARCHITECTURE / DATA FLOW
5.1 Data%ow diagram for the demonstration
The following diagram is a high level view of the interaction of the Table Manager module and
the PSI filtering code.
Page 4 of 15
PSI FILTER/TABLE MANAGER INTERFACE DESIGN VERSION 0.1 DATED 15/03/2004
PSI/SI Table Manager
PSI filtering code
User
Input TS packets
Requests table
Table reported
Requests section
Section reported
Section
Parsers
Use
Interface Design Document Version No: 0.1
A more in depth view of the design of the modules and their interaction is depicted in the
following diagram.
1. User requests the Table Manager for a particular table.
2. The Table Manager in turns requests the PSI filtering code to start capturing the sections
for that particular table.
3. The PSI filtering API calls modify the data structure to reflect the user’s action.
4. The filtering code will receive the TS packets from the TSI driver
5. The filtering code will use the central data structure to filter the sections.
6. Once the code finds a desired section, it reports the section to the Table Manager.
7. The Table Manager calls the appropriate parser for that section and the parser updates
the table structure.
8. When all the sections needed for the table are parsed, the availability of the table is
reported to the user.
6 PSI/SI TABLE MANAGER APIS
These APIs are provided to user to control the operation of PSI/SI Table Manager. The Table
Manager module requests the sections from the PSI filtering code and once it receives a section
it calls the section parser for that particular section. The table manager keeps requesting for
sections from the PSI filtering code till it finds all the sections for the particular table.
6.1 GrabPSITable
Description:
The API is used to grab any particular table from the transport stream. The API in turn
requests the PSI filter code to start capturing the desired sections. On capturing a desired
section the PSI filtering code reports the captured section to the PSI Table Manager. The PSI
Table Manager parses the received section and updates the corresponding table structure.
API Prototype:
TableHandler GrabPSITable(int tableID , int PID , RawTable *tablePtr, TableParsingFunction
parsingFunc )
Page 5 of 15
PSI FILTER/TABLE MANAGER INTERFACE DESIGN VERSION 0.1 DATED 15/03/2004
TS
Input
module
PSI/SI Table
Manager
USER
Filtering code
Read the filter
information
Receives the TS
packets
Requests the
PSI Filtering
code for
particular
section
Reports the section
if the filter matches
Requests the
PSI Table
Manager for
particular table.
Filter API called
by PSI Table
Manager
Section Parsers
Uses
- 1
- 2
- 3
前往页