TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
A wrapper class for C++ SectionFile. More...
Public Member Functions | |
__init__ (self, duck) | |
Constructor. | |
binarySize (self) | |
Get the size in bytes of all sections. | |
clear (self) | |
Clear the content of the SectionFile, erase all sections. | |
delete (self) | |
Explicitly free the underlying C++ object. | |
fromBinary (self, data) | |
Load a binary section file from a memory buffer. | |
loadBinary (self, file) | |
Load a binary section file. | |
loadXML (self, file) | |
Load an XML file. | |
reorganizeEITs (self, year=0, month=0, day=0) | |
Reorganize all EIT sections according to ETSI TS 101 211. | |
saveBinary (self, file) | |
Save a binary section file. | |
saveJSON (self, file) | |
Save a JSON file after automated XML-to-JSON conversion. | |
saveXML (self, file) | |
Save an XML file. | |
sectionsCount (self) | |
Get the total number of sections in the file. | |
setCRCValidation (self, mode) | |
Set the CRC32 processing mode when loading binary sections. | |
tablesCount (self) | |
Get the total number of full tables in the file. | |
toBinary (self) | |
Get the binary content of a section file. | |
toJSON (self) | |
Serialize as JSON text. | |
toXML (self) | |
Serialize as XML text. | |
Static Public Attributes | |
int | CRC32_CHECK = 1 |
Check that the value of the CRC32 of the section is correct and fail if it isn't. | |
int | CRC32_COMPUTE = 2 |
Recompute a fresh new CRC32 value based on the content of the section. | |
int | CRC32_IGNORE = 0 |
Ignore the section CRC32 when loading a binary section. | |
A wrapper class for C++ SectionFile.
tsduck.SectionFile.__init__ | ( | self, | |
duck | |||
) |
Constructor.
duck | The tsduck.DuckContext object to use. |
Reimplemented from tsduck.NativeObject.
tsduck.SectionFile.delete | ( | self | ) |
Explicitly free the underlying C++ object.
After this call, the object becomes unusable. Most usages are unpredictable but most likely will do nothing.
Reimplemented from tsduck.NativeObject.
tsduck.SectionFile.clear | ( | self | ) |
Clear the content of the SectionFile, erase all sections.
tsduck.SectionFile.binarySize | ( | self | ) |
Get the size in bytes of all sections.
This would be the size of the corresponding binary file.
tsduck.SectionFile.sectionsCount | ( | self | ) |
Get the total number of sections in the file.
tsduck.SectionFile.tablesCount | ( | self | ) |
Get the total number of full tables in the file.
Orphan sections are not included.
tsduck.SectionFile.setCRCValidation | ( | self, | |
mode | |||
) |
Set the CRC32 processing mode when loading binary sections.
mode | For binary files, how to process the CRC32 of the input sections. Must be one of the CRC32_* values. |
tsduck.SectionFile.fromBinary | ( | self, | |
data | |||
) |
Load a binary section file from a memory buffer.
The loaded sections are added to the content of this object.
data | A bytearray containing the binary data to load. |
tsduck.SectionFile.toBinary | ( | self | ) |
Get the binary content of a section file.
tsduck.SectionFile.loadBinary | ( | self, | |
file | |||
) |
Load a binary section file.
The loaded sections are added to the content of this object.
file | Binary file name. If the file name is empty or "-", the standard input is used. |
tsduck.SectionFile.saveBinary | ( | self, | |
file | |||
) |
Save a binary section file.
[in] | file | Binary file name. If the file name is empty or "-", the standard output is used. |
tsduck.SectionFile.loadXML | ( | self, | |
file | |||
) |
Load an XML file.
The loaded tables are added to the content of this object.
file | XML file name. If the file name starts with "<?xml", this is considered as "inline XML content". If the file name is empty or "-", the standard input is used. |
tsduck.SectionFile.saveXML | ( | self, | |
file | |||
) |
Save an XML file.
[in] | file | XML file name. If the file name is empty or "-", the standard output is used. |
tsduck.SectionFile.saveJSON | ( | self, | |
file | |||
) |
Save a JSON file after automated XML-to-JSON conversion.
[in] | file | JSON file name. If the file name is empty or "-", the standard output is used. |
tsduck.SectionFile.toXML | ( | self | ) |
Serialize as XML text.
tsduck.SectionFile.toJSON | ( | self | ) |
Serialize as JSON text.
tsduck.SectionFile.reorganizeEITs | ( | self, | |
year = 0 , |
|||
month = 0 , |
|||
day = 0 |
|||
) |
Reorganize all EIT sections according to ETSI TS 101 211.
Only one EITp/f subtable is kept per service. It is split in two sections if two events (present and following) are specified. All EIT schedule are kept. But they are completely reorganized. All events are extracted and spread over new EIT sections according to ETSI TS 101 211 rules.
The "last midnight" according to which EIT segments are assigned is derived from parameters year, month and day. If any of them is out or range, the start time of the oldest event in the section file is used as "reference date".
year | Year of the reference time for EIT schedule. This is the "last midnight" according to which EIT segments are assigned. |
month | Month (1..12) of the reference time for EIT schedule. |
day | Day (1..31) of the reference time for EIT schedule. |
|
static |
Ignore the section CRC32 when loading a binary section.
This is the default.