MythTV  master
premieretables.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 #ifndef _PRIVATE_TABLES_H_
3 #define _PRIVATE_TABLES_H_
4 
5 #include <QString>
6 #include <cstdint> // uint32_t
7 #include "mpegtables.h"
8 #include "dvbdescriptors.h"
9 
11 {
12  public:
13  explicit PremiereContentInformationTable(const PSIPTable& table) : PSIPTable(table)
14  {
15  assert(IsEIT(TableID()));
16  }
17 
18  // content_id 32 0.0
19  uint ContentID(void) const
20  { return ( psipdata()[0]<<24) | (psipdata()[1]<<16) |
21  (psipdata()[2]<< 8) | psipdata()[3]; }
22 
23  // event_duration 24 4.0
25  { return ((byteBCD2int(psipdata()[4]) * 3600) +
26  (byteBCD2int(psipdata()[5]) * 60) +
27  (byteBCD2int(psipdata()[6]))); }
28  // descriptor length 8 8.0
30  { return ((psipdata()[7] & 0x0F) << 8) | psipdata()[8]; }
31 
32  uint EventCount(void) const
33  { return 1; }
34 
35  // descriptor length x 9.0
36  const unsigned char* Descriptors() const
37  { return &psipdata()[9]; }
38 
39  static bool IsEIT(uint table_id);
40 
41  private:
42  mutable vector<const unsigned char*> _ptrs; // used to parse
43 };
44 
46 {
47  public:
48  explicit PremiereContentPresentationTable(const PSIPTable& table) : PSIPTable(table)
49  {
50  }
51 };
52 #endif // _PRIVATE_TABLES_H_
const unsigned char * psipdata(void) const
Definition: mpegtables.h:522
vector< const unsigned char * > _ptrs
PremiereContentPresentationTable(const PSIPTable &table)
unsigned int uint
Definition: compat.h:140
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
Definition: mpegtables.h:371
uint TableID(void) const
Definition: mpegtables.h:479
static bool IsEIT(uint table_id)
#define assert(x)
PremiereContentInformationTable(const PSIPTable &table)
const unsigned char * Descriptors() const
#define byteBCD2int(i)