1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added subtable ID and TSDT handling to 'libsi'

This commit is contained in:
Klaus Schmidinger 2004-02-20 13:54:14 +01:00
parent c817c341ce
commit 402184b9da
6 changed files with 90 additions and 8 deletions

View File

@ -2652,7 +2652,7 @@ Video Disk Recorder Revision History
actual CAM type as reported by the CAM. The 'ca.conf' file has been stripped
down to the values 0..4.
2004-02-15: Version 1.3.5
2004-02-20: Version 1.3.5
- Fixed reading the EPG preferred language parameter from 'setup.conf'.
- Fixed switching to a visible programme in case the current channel has neither
@ -2673,3 +2673,4 @@ Video Disk Recorder Revision History
(necessary for the 'sky' plugin).
- Fixed handling receivers in the 'sky' plugin, so that a recording on the same
channel won't interrupt an ongoing Transfer mode.
- Added subtable ID and TSDT handling to 'libsi' (thanks to Marcel Wiesweg).

View File

@ -10,7 +10,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: headers.h 1.2 2003/12/13 10:43:26 kls Exp $
* $Id: headers.h 1.3 2004/02/20 13:49:16 kls Exp $
* *
***************************************************************************/
@ -257,7 +257,48 @@ struct pmt_info {
/*
*
* 4) Network Information Table (NIT):
* 4) Transport Stream Description Table (TSDT):
*
* - The TSDT carries a loop of descriptors that apply to
* the whole transport stream. The syntax and semantics
* of the TSDT are defined in newer versions of ISO/IEC 13818-1.
*
*/
#define TSDT_LEN 8
struct tsdt {
u_char table_id :8;
#if BYTE_ORDER == BIG_ENDIAN
u_char section_syntax_indicator :1;
u_char dummy :1; // has to be 0
u_char :2;
u_char section_length_hi :4;
#else
u_char section_length_hi :4;
u_char :2;
u_char dummy :1; // has to be 0
u_char section_syntax_indicator :1;
#endif
u_char section_length_lo :8;
u_char :8;
u_char :8;
#if BYTE_ORDER == BIG_ENDIAN
u_char :2;
u_char version_number :5;
u_char current_next_indicator :1;
#else
u_char current_next_indicator :1;
u_char version_number :5;
u_char :2;
#endif
u_char section_number :8;
u_char last_section_number :8;
};
/*
*
* 5) Network Information Table (NIT):
*
* - the NIT is intended to provide information about the physical
* network. The syntax and semantics of the NIT are defined in
@ -468,7 +509,7 @@ struct eit {
u_char original_network_id_hi :8;
u_char original_network_id_lo :8;
u_char segment_last_section_number :8;
u_char segment_last_table_id :8;
u_char last_table_id :8;
};
#define EIT_EVENT_LEN 12

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: section.c 1.2 2003/12/13 10:42:14 kls Exp $
* $Id: section.c 1.3 2004/02/20 13:44:59 kls Exp $
* *
***************************************************************************/
@ -76,6 +76,14 @@ void PMT::Stream::Parse() {
streamDescriptors.setData(data+offset, HILO(s->ES_info_length));
}
/*********************** TSDT ***********************/
void TSDT::Parse() {
unsigned int offset=0;
data.setPointerAndOffset<const tsdt>(s, offset);
transportStreamDescriptors.setDataAndOffset(data+offset, getLength()-offset-4, offset);
}
/*********************** NIT ***********************/
int NIT::getNetworkId() const {
@ -161,6 +169,14 @@ int EIT::getOriginalNetworkId() const {
return HILO(s->original_network_id);
}
int EIT::getSegmentLastSectionNumber() const {
return s->segment_last_section_number;
}
int EIT::getLastTableId() const {
return s->last_table_id;
}
bool EIT::isPresentFollowing() const {
return getTableId() == TableIdEIT_presentFollowing || getTableId() == TableIdEIT_presentFollowing_other;
}

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: section.h 1.2 2003/12/13 10:42:15 kls Exp $
* $Id: section.h 1.3 2004/02/20 13:45:45 kls Exp $
* *
***************************************************************************/
@ -77,6 +77,17 @@ private:
const pmt *s;
};
class TSDT : public NumberedSection {
public:
TSDT(const unsigned char *data, bool doCopy=true) : NumberedSection(data, doCopy) {}
TSDT() {}
DescriptorLoop transportStreamDescriptors;
protected:
virtual void Parse();
private:
const tsdt *s;
};
class NIT : public NumberedSection {
public:
NIT(const unsigned char *data, bool doCopy=true) : NumberedSection(data, doCopy) {}
@ -166,6 +177,8 @@ public:
int getServiceId() const;
int getTransportStreamId() const;
int getOriginalNetworkId() const;
int getSegmentLastSectionNumber() const;
int getLastTableId() const;
StructureLoop<Event> eventLoop;
//true if table conveys present/following information, false if it conveys schedule information

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: si.c 1.6 2004/01/24 14:49:00 kls Exp $
* $Id: si.c 1.7 2004/02/20 13:46:12 kls Exp $
* *
***************************************************************************/
@ -61,6 +61,14 @@ bool CRCSection::CheckCRCAndParse() {
return true;
}
int NumberedSection::getTableIdExtension() const {
return getTableIdExtension(data.getData());
}
int NumberedSection::getTableIdExtension(const unsigned char *d) {
return HILO(((const ExtendedSectionHeader *)d)->table_id_extension);
}
bool NumberedSection::getCurrentNextIndicator() const {
return data.getData<ExtendedSectionHeader>()->current_next_indicator;
}

View File

@ -6,7 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: si.h 1.6 2004/01/12 16:19:11 kls Exp $
* $Id: si.h 1.7 2004/02/20 13:47:09 kls Exp $
* *
***************************************************************************/
@ -216,11 +216,14 @@ class NumberedSection : public CRCSection {
public:
NumberedSection(const unsigned char *data, bool doCopy=true) : CRCSection(data, doCopy) {}
NumberedSection() {}
int getTableIdExtension() const;
bool getCurrentNextIndicator() const;
int getVersionNumber() const;
int getSectionNumber() const;
int getLastSectionNumber() const;
bool moreThanOneSection() const { return getLastSectionNumber()>0; }
static int getTableIdExtension(const unsigned char *d);
};
class VariableLengthPart : public Object {