aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb_si/mosaic_descriptor.h
blob: 43769c01b6b87b606fdf3b7d02309d390e93b317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * $Id$
 *
 * (C) 2002-2003 Andreas Oberritter <obi@saftware.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

#ifndef __dvb_descriptor_mosaic_descriptor_h__
#define __dvb_descriptor_mosaic_descriptor_h__

#include "descriptor.h"

class ElementaryCellField
{
	protected:
		unsigned reserved				: 2;
		unsigned elementaryCellId			: 6;

	public:
		ElementaryCellField(const uint8_t * const buffer);

		uint8_t getElementaryCellId(void) const;
};

typedef std::vector<ElementaryCellField *> ElementaryCellFieldVector;
typedef ElementaryCellFieldVector::iterator ElementaryCellFieldIterator;
typedef ElementaryCellFieldVector::const_iterator ElementaryCellFieldConstIterator;

class MosaicCell
{
	protected:
		unsigned logicalCellId				: 6;
		unsigned reserved				: 7;
		unsigned logicalCellPresentationInfo		: 3;
		unsigned elementaryCellFieldLength		: 8;
		ElementaryCellFieldVector elementaryCellFields;
		unsigned cellLinkageInfo			: 8;
		unsigned bouquetId				: 16;
		unsigned originalNetworkId			: 16;
		unsigned transportStreamId			: 16;
		unsigned serviceId				: 16;
		unsigned eventId				: 16;

	public:
		MosaicCell(const uint8_t * const buffer);
		~MosaicCell(void);

		uint8_t getLogicalCellId(void) const;
		uint8_t getLogicalCellPresentationInfo(void) const;
		const ElementaryCellFieldVector *getElementaryCellFields(void) const;
		uint8_t getCellLinkageInfo(void) const;
		uint16_t getBouquetId(void) const;
		uint16_t getOriginalNetworkId(void) const;
		uint16_t getTransportStreamId(void) const;
		uint16_t getServiceId(void) const;
		uint16_t getEventId(void) const;
};

typedef std::vector<MosaicCell *> MosaicCellVector;
typedef MosaicCellVector::iterator MosaicCellIterator;
typedef MosaicCellVector::const_iterator MosaicCellConstIterator;

class MosaicDescriptor : public Descriptor
{
	protected:
		unsigned mosaicEntryPoint			: 1;
		unsigned numberOfHorizontalElementaryCells	: 3;
		unsigned reserved				: 1;
		unsigned numberOfVerticalElementaryCells	: 3;
		MosaicCellVector mosaicCells;

	public:
		MosaicDescriptor(const uint8_t * const buffer);
		~MosaicDescriptor(void);

		uint8_t getMosaicEntryPoint(void) const;
		uint8_t getNumberOfHorizontalElementaryCells(void) const;
		uint8_t getNumberOfVerticalElementaryCells(void) const;
		const MosaicCellVector *getMosaicCells(void) const;
};

#endif /* __dvb_descriptor_mosaic_descriptor_h__ */