2 * $Id: eit.cpp,v 1.1 2003-10-17 15:36:37 tmbinc Exp $
4 * (C) 2002-2003 Andreas Oberritter <obi@saftware.de>
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.
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.
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.
22 #include <lib/dvb_si/eit.h>
24 Event::Event(const uint8_t * const buffer)
26 eventId = (buffer[0] << 8) | buffer[1];
27 startTimeMjd = (buffer[2] << 8) | buffer[3];
28 startTimeBcd = (buffer[4] << 16) | (buffer[5] << 8) | buffer[6];
29 duration = (buffer[7] << 16) | (buffer[8] << 8) | buffer[9];
30 runningStatus = (buffer[10] >> 5) & 0x07;
31 freeCaMode = (buffer[10] >> 4) & 0x01;
32 descriptorsLoopLength = ((buffer[10] & 0x0f) << 8) | buffer[11];
34 for (uint16_t i = 12; i < descriptorsLoopLength + 12; i += buffer[i + 1] + 2)
35 descriptor(&buffer[i]);
38 uint16_t Event::getEventId(void) const
43 uint16_t Event::getStartTimeMjd(void) const
48 uint32_t Event::getStartTimeBcd(void) const
53 uint32_t Event::getDuration(void) const
58 uint8_t Event::getRunningStatus(void) const
63 uint8_t Event::getFreeCaMode(void) const
68 EventInformationTable::EventInformationTable(const uint8_t * const buffer) : LongCrcTable(buffer)
70 transportStreamId = (buffer[8] << 8) | buffer[9];
71 originalNetworkId = (buffer[10] << 8) | buffer[11];
72 segmentLastSectionNumber = buffer[12];
73 lastTableId = buffer[13];
75 for (uint16_t i = 14; i < sectionLength - 1; i += (((buffer[i + 10] & 0x0f) << 8) | buffer[i + 11]) + 12)
76 events.push_back(new Event(&buffer[i]));
79 EventInformationTable::~EventInformationTable(void)
81 for (EventIterator i = events.begin(); i != events.end(); ++i)
85 uint16_t EventInformationTable::getTransportStreamId(void) const
87 return transportStreamId;
90 uint16_t EventInformationTable::getOriginalNetworkId(void) const
92 return originalNetworkId;
95 uint8_t EventInformationTable::getLastSectionNumber(void) const
97 return lastSectionNumber;
100 uint8_t EventInformationTable::getLastTableId(void) const
105 const EventVector *EventInformationTable::getEvents(void) const