00001 // -*- Mode: c++ -*- 00002 #ifndef _PRIVATE_TABLES_H_ 00003 #define _PRIVATE_TABLES_H_ 00004 00005 #include <qstring.h> 00006 #include <stdint.h> // uint32_t 00007 #include "mpegtables.h" 00008 #include "dvbdescriptors.h" 00009 00010 class PremiereContentInformationTable : public PSIPTable 00011 { 00012 public: 00013 PremiereContentInformationTable(const PSIPTable& table) : PSIPTable(table) 00014 { 00015 assert(IsEIT(TableID())); 00016 } 00017 00018 // content_id 32 0.0 00019 uint ContentID(void) const 00020 { return ( psipdata()[0]<<24) | (psipdata()[1]<<16) | 00021 (psipdata()[2]<< 8) | psipdata()[3]; } 00022 00023 // event_duration 24 4.0 00024 uint DurationInSeconds() const 00025 { return ((byteBCD2int(psipdata()[4]) * 3600) + 00026 (byteBCD2int(psipdata()[5]) * 60) + 00027 (byteBCD2int(psipdata()[6]))); } 00028 // descriptor length 8 8.0 00029 uint DescriptorsLength() const 00030 { return ((psipdata()[7] & 0x0F) << 8) | psipdata()[8]; } 00031 00032 uint EventCount(void) const 00033 { return 1; } 00034 00035 // descriptor length x 9.0 00036 const unsigned char* Descriptors() const 00037 { return &psipdata()[9]; } 00038 00039 static bool IsEIT(uint table_id); 00040 00041 private: 00042 mutable vector<const unsigned char*> _ptrs; // used to parse 00043 }; 00044 00045 class PremiereContentPresentationTable : public PSIPTable 00046 { 00047 public: 00048 PremiereContentPresentationTable(const PSIPTable& table) : PSIPTable(table) 00049 { 00050 } 00051 }; 00052 #endif // _PRIVATE_TABLES_H_
1.5.5