| 1 |
/* |
| 2 |
* Copyright (C) 2013-2021 Jean-Luc Barrière |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
* See LICENSE.md for more information. |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef TSTABLE_H |
| 9 |
#define TSTABLE_H |
| 10 |
|
| 11 |
#include <inttypes.h> |
| 12 |
#include <cstring> // for memset |
| 13 |
|
| 14 |
// PSI section size (EN 300 468) |
| 15 |
#define TABLE_BUFFER_SIZE 4096 |
| 16 |
|
| 17 |
namespace TSDemux |
| 18 |
{ |
| 19 |
class TSTable |
| 20 |
{ |
| 21 |
public: |
| 22 |
uint8_t table_id; |
| 23 |
uint8_t version; |
| 24 |
uint16_t id; |
| 25 |
uint16_t len; |
| 26 |
uint16_t offset; |
| 27 |
unsigned char buf[TABLE_BUFFER_SIZE]; |
| 28 |
|
| 29 |
TSTable(void) |
| 30 |
: table_id(0xff) |
| 31 |
, version(0xff) |
| 32 |
, id(0xffff) |
| 33 |
, len(0) |
| 34 |
, offset(0) |
| 35 |
{ |
| 36 |
memset(buf, 0, TABLE_BUFFER_SIZE); |
| 37 |
} |
| 38 |
|
| 39 |
void Reset(void) |
| 40 |
{ |
| 41 |
len = 0; |
| 42 |
offset = 0; |
| 43 |
} |
| 44 |
}; |
| 45 |
} |
| 46 |
|
| 47 |
#endif /* TSTABLE_H */ |
| 48 |
|