- fixed console input mode restore
[enigma2.git] / lib / dvb_si / sdt.h
1 /*
2  * $Id: sdt.h,v 1.1 2003-10-17 15:36:38 tmbinc Exp $
3  *
4  * (C) 2002 by Andreas Oberritter <obi@tuxbox.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #ifndef __dvb_table_sdt_h__
23 #define __dvb_table_sdt_h__
24
25 #include <lib/dvb_si/container.h>
26 #include "long_crc_table.h"
27
28 class ServiceDescription : public DescriptorContainer
29 {
30         protected:
31                 unsigned serviceId                              : 16;
32                 unsigned reserved1                              : 6;
33                 unsigned eitScheduleFlag                        : 1;
34                 unsigned eitPresentFollowingFlag                : 1;
35                 unsigned runningStatus                          : 3;
36                 unsigned freeCaMode                             : 1;
37                 unsigned descriptorsLoopLength                  : 12;
38
39         public:
40                 ServiceDescription(const uint8_t * const buffer);
41
42                 uint16_t getServiceId(void) const;
43                 uint8_t getEitScheduleFlag(void) const;
44                 uint8_t getEitPresentFollowingFlag(void) const;
45                 uint8_t getRunningStatus(void) const;
46                 uint8_t getFreeCaMode(void) const;
47 };
48
49 typedef std::vector<ServiceDescription *> ServiceDescriptionVector;
50 typedef ServiceDescriptionVector::iterator ServiceDescriptionIterator;
51 typedef ServiceDescriptionVector::const_iterator ServiceDescriptionConstIterator;
52
53 class ServiceDescriptionTable : public LongCrcTable
54 {
55         protected:
56                 unsigned originalNetworkId                      : 16;
57                 unsigned reserved4                              : 8;
58                 ServiceDescriptionVector description;
59
60         public:
61                 ServiceDescriptionTable(const uint8_t * const buffer);
62                 ~ServiceDescriptionTable(void);
63
64                 static const enum PacketId PID = PID_SDT;
65                 static const enum TableId TID = TID_SDT_ACTUAL;
66                 static const uint32_t TIMEOUT = 3000;
67
68                 uint16_t getOriginalNetworkId(void) const;
69                 uint16_t getTransportStreamId(void) const { return getTableIdExtension(); }
70                 const ServiceDescriptionVector *getDescriptions(void) const;
71 };
72
73 typedef std::vector<ServiceDescriptionTable *> ServiceDescriptionTableVector;
74 typedef ServiceDescriptionTableVector::iterator ServiceDescriptionTableIterator;
75 typedef ServiceDescriptionTableVector::const_iterator ServiceDescriptionTableConstIterator;
76
77 #endif /* __dvb_table_sdt_h__ */