| 1 |
/* |
| 2 |
* Copyright (C) 2006-2008 Team MediaPortal |
| 3 |
* http://www.team-mediaportal.com |
| 4 |
* |
| 5 |
* This Program is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2, or (at your option) |
| 8 |
* any later version. |
| 9 |
* |
| 10 |
* This Program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with GNU Make; see the file COPYING. If not, write to |
| 17 |
* the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, |
| 18 |
* MA 02110-1335 USA |
| 19 |
* http://www.gnu.org/copyleft/gpl.html |
| 20 |
* |
| 21 |
*/ |
| 22 |
#pragma once |
| 23 |
#include "os-dependent.h" |
| 24 |
|
| 25 |
#include <vector> |
| 26 |
|
| 27 |
namespace MPTV |
| 28 |
{ |
| 29 |
// This class used to store subtitle stream specific information |
| 30 |
class SubtitlePid |
| 31 |
{ |
| 32 |
public: |
| 33 |
|
| 34 |
SubtitlePid() |
| 35 |
{ |
| 36 |
Pid = -1; |
| 37 |
SubtitleServiceType = -1; |
| 38 |
Lang[0] = 'U'; |
| 39 |
Lang[1] = 'N'; |
| 40 |
Lang[2] = 'K'; |
| 41 |
Lang[3] = 0; |
| 42 |
} |
| 43 |
|
| 44 |
bool operator == (const SubtitlePid& other) const |
| 45 |
{ |
| 46 |
if (Pid != other.Pid |
| 47 |
|| Lang[0] != other.Lang[0] |
| 48 |
|| Lang[1] != other.Lang[1] |
| 49 |
|| Lang[2] != other.Lang[2] |
| 50 |
|| Lang[3] != other.Lang[3]) |
| 51 |
{ |
| 52 |
return false; |
| 53 |
} |
| 54 |
else |
| 55 |
{ |
| 56 |
return true; |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
short Pid; |
| 61 |
short SubtitleServiceType; |
| 62 |
byte Lang[4]; |
| 63 |
}; |
| 64 |
|
| 65 |
// This class used to store audio stream specific information |
| 66 |
class AudioPid |
| 67 |
{ |
| 68 |
public: |
| 69 |
AudioPid() |
| 70 |
{ |
| 71 |
Pid = -1; |
| 72 |
AudioServiceType = -1; |
| 73 |
Lang[0] = 'U'; |
| 74 |
Lang[1] = 'N'; |
| 75 |
Lang[2] = 'K'; |
| 76 |
Lang[3] = 0; |
| 77 |
Lang[4] = 0; |
| 78 |
Lang[5] = 0; |
| 79 |
Lang[6] = 0; |
| 80 |
} |
| 81 |
|
| 82 |
bool operator == (const AudioPid& other) const |
| 83 |
{ |
| 84 |
if (Pid != other.Pid |
| 85 |
|| Lang[0] != other.Lang[0] |
| 86 |
|| Lang[1] != other.Lang[1] |
| 87 |
|| Lang[2] != other.Lang[2] |
| 88 |
|| Lang[3] != other.Lang[3] |
| 89 |
|| Lang[4] != other.Lang[4] |
| 90 |
|| Lang[5] != other.Lang[5] |
| 91 |
|| Lang[6] != other.Lang[6] |
| 92 |
|| AudioServiceType != other.AudioServiceType) |
| 93 |
{ |
| 94 |
return false; |
| 95 |
} |
| 96 |
else |
| 97 |
{ |
| 98 |
return true; |
| 99 |
} |
| 100 |
} |
| 101 |
|
| 102 |
short Pid; |
| 103 |
byte Lang[7]; |
| 104 |
short AudioServiceType; |
| 105 |
}; |
| 106 |
|
| 107 |
// This class used to store video stream specific information |
| 108 |
class VideoPid |
| 109 |
{ |
| 110 |
public: |
| 111 |
VideoPid() |
| 112 |
{ |
| 113 |
Pid = -1; |
| 114 |
VideoServiceType = -1; |
| 115 |
} |
| 116 |
|
| 117 |
bool operator == (const VideoPid& other) const |
| 118 |
{ |
| 119 |
if (Pid != other.Pid |
| 120 |
|| VideoServiceType != other.VideoServiceType) |
| 121 |
{ |
| 122 |
return false; |
| 123 |
} |
| 124 |
else |
| 125 |
{ |
| 126 |
return true; |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 130 |
short Pid; |
| 131 |
int VideoServiceType; |
| 132 |
}; |
| 133 |
|
| 134 |
class TempPid |
| 135 |
{ |
| 136 |
public: |
| 137 |
|
| 138 |
TempPid() |
| 139 |
{ |
| 140 |
Pid = -1; |
| 141 |
Lang[0] = 'U'; |
| 142 |
Lang[1] = 'N'; |
| 143 |
Lang[2] = 'K'; |
| 144 |
Lang[3] = 0; |
| 145 |
Lang[4] = 0; |
| 146 |
Lang[5] = 0; |
| 147 |
Lang[6] = 0; |
| 148 |
} |
| 149 |
|
| 150 |
short Pid; |
| 151 |
byte Lang[7]; |
| 152 |
}; |
| 153 |
|
| 154 |
class CPidTable |
| 155 |
{ |
| 156 |
public: |
| 157 |
|
| 158 |
CPidTable(); |
| 159 |
CPidTable(const CPidTable& pids); |
| 160 |
virtual ~CPidTable(); |
| 161 |
void Reset(); |
| 162 |
|
| 163 |
void LogPIDs(); |
| 164 |
const char* StreamFormatAsString(int streamType); |
| 165 |
|
| 166 |
bool HasTeletextPageInfo(int page); // do we have a TeletextServiceInfo entry for that page |
| 167 |
|
| 168 |
CPidTable& operator = (const CPidTable& pids); |
| 169 |
bool operator==(const CPidTable& other) const; |
| 170 |
|
| 171 |
void Copy(const CPidTable &pids); |
| 172 |
|
| 173 |
unsigned long PcrPid; |
| 174 |
unsigned long PmtPid; |
| 175 |
short TeletextPid; // which PID contains the teletext data |
| 176 |
|
| 177 |
int ServiceId; |
| 178 |
|
| 179 |
std::vector<VideoPid> videoPids; |
| 180 |
std::vector<AudioPid> audioPids; |
| 181 |
std::vector<SubtitlePid> subtitlePids; |
| 182 |
}; |
| 183 |
} |
| 184 |
|