Go to the documentation of this file.
16 return {
"no compression"};
18 return {
"Huffman Coding using C.4, C.5"};
20 return {
"Huffman Coding using C.6, C.7"};
23 return {
"compression not used by ATSC in North America, unknown"};
37 str.append(QString(
"MultipleStringStructure count(%1)")
42 str.append(QString(
" String #%1 lang(%2:%3)")
47 str.append(QString(
" segment count(%1)").arg(
SegmentCount(i)));
50 str.append(QString(
" Segment #%1 ct(%2) str(%3)").arg(j)
60 for (
uint pref : std::as_const(langPrefs))
61 max_pri = std::max(max_pri, pref);
66 QMap<uint,uint> &langPrefs)
const
73 QMap<uint,uint>::const_iterator it =
75 if ((it != langPrefs.constEnd()) && (*it > match_pri))
100 const unsigned char* buf = (
Offset(i, j)+3);
101 int len =
Bytes(i, j);
114 return QString(
"MSS unknown text compression %1").arg(ct);
122 return tmp.simplified();
126 const unsigned char* buf,
int len,
int mode) {
128 QString str=QString(
"");
130 (9<=mode && mode<=0xe) ||
132 (0x20<=mode && mode<=0x27) ||
133 (0x30<=mode && mode<=0x33)) {
135 for (
int j=0; j<len; j++)
138 LOG(VB_GENERAL, LOG_DEBUG, QString(
"str.append(0x%1:0x%2) -> %3")
139 .arg(mode, 0, 16) .arg(buf[j], 0, 16) .arg(QChar(hb|buf[j])));
142 str.append( QChar( hb|buf[j] ) );
144 }
else if (mode==0x3e) {
146 str=QString(
"TODO SCSU encoding");
147 }
else if (mode==0x3f) {
148 const auto* ustr =
reinterpret_cast<const unsigned short*
>(buf);
149 for (
int j=0; j<(len>>1); j++)
150 str.append( QChar( (ustr[j]<<8) | (ustr[j]>>8) ) );
151 }
else if (0x40<=mode && mode<=0x41) {
152 str = QString(
"TODO Tawain Characters");
153 }
else if (0x48==mode) {
154 str = QString(
"TODO South Korean Characters");
156 str = QString(
"unknown character encoding mode(%0)").arg(mode);
188 QString str(
"Caption Service Descriptor ");
193 str.append(QString(
"\n lang(%1) type(%2) ")
195 str.append(QString(
"easy_reader(%1) wide(%2) ")
199 str.append(QString(
"service_num(%1)")
204 str.append(QString(
"line_21_field(%1)").arg(
static_cast<int>(
Line21Field(i))));
232 return "ContentAdvisoryDescriptor::toString(): Not implemented";
237 static const std::array<const std::string,8> s_asd
239 "48kbps",
"44.1kbps",
"32kbps",
"Reserved",
240 "48kbps or 44.1kbps",
"48kbps or 32kbps",
241 "44.1kbps or 32kbps",
"48kbps or 44.1kbps or 32kbps"
248 static const std::array<const std::string,19> s_ebr
250 "=32kbps",
"=40kbps",
"=48kbps",
"=56kbps",
"=64kbps",
251 "=80kbps",
"=96kbps",
"=112kbps",
"=128kbps",
"=160kbps",
252 "=192kbps",
"=224kbps",
"=256kbps",
"=320kbps",
"=384kbps",
253 "=448kbps",
"=512kbps",
"=576kbps",
"=640kbps"
255 static const std::array<const std::string,19> s_ubr
257 "<=32kbps",
"<=40kbps",
"<=48kbps",
"<=56kbps",
"<=64kbps",
258 "<=80kbps",
"<=96kbps",
"<=112kbps",
"<=128kbps",
"<=160kbps",
259 "<=192kbps",
"<=224kbps",
"<=256kbps",
"<=320kbps",
"<=384kbps",
260 "<=448kbps",
"<=512kbps",
"<=576kbps",
"<=640kbps"
264 return QString::fromStdString(s_ebr[
BitRateCode()]);
266 return QString::fromStdString(s_ubr[
BitRateCode()-32]);
267 return {
"Unknown Bit Rate Code"};
272 static const std::array<const std::string,4> s_sms
275 "Not Dolby surround encoded",
276 "Dolby surround encoded",
284 static const std::array<const std::string,16> s_cs
286 "1 + 1",
"1/0",
"2/0",
"3/0",
287 "2/1",
"3/1",
"2/2 ",
"3/2",
288 "1",
"<= 2",
"<= 3",
"<= 4",
289 "<= 5",
"<= 6",
"Reserved",
"Reserved"
291 return QString::fromStdString(s_cs[
Channels()]);
297 str.append(QString(
"AC-3 Audio Stream Descriptor "));
298 str.append(QString(
" full_srv(%1) sample_rate(%2) bit_rate(%3, %4)\n")
303 str.append(QString(
" bsid(%1) bs_mode(%2) channels(%3) Dolby(%4)\n")
315 str.append(QString(
" mainID(%1) ").arg(
MainID()));
317 str.append(QString(
" associated_service(0x%1) ")
322 str.append(QString(
"isLatin-1(%1) ")
324 str.append(QString(
"text_length(%1) ").arg(
TextLength()));
325 str.append(QString(
"text(%1)").arg(
Text()));
357 return QString(
"ExtendedChannelNameDescriptor: '%1'")
QString toString() const override
static uint maxPriority(const QMap< uint, uint > &langPrefs)
QString LanguageString(uint i) const
const unsigned char * Offset(int i, int j) const
bool IsTextLatin1(void) const
bool EasyReader(int i) const
static int Index(int i, int j)
static uint Index(int i, int j)
uint RatedDimensions(uint i) const
int Mode(int i, int j) const
uint RatingDescriptionLength(uint i) const
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
int LanguageKey(uint i) const
uint StringCount(void) const
const unsigned char * Offset(int i, int j) const
bool WideAspectRatio(int i) const
uint RatingRegionCount(void) const
MultipleStringStructure LongChannelName(void) const
Returns a MultipleStringStructure representing the long name of the associated channel.
bool Line21Field(int i) const
uint BitRateCode(void) const
static QString Uncompressed(const unsigned char *buf, int len, int mode)
uint BasicServiceMode(void) const
uint SurroundMode(void) const
const unsigned char * m_data
QString SurroundModeString(void) const
uint SegmentCount(uint i) const
uint TextLength(void) const
QString ChannelsString(void) const
int CaptionServiceNumber(int i) const
QString toString() const override
QString toString() const override
uint CompressionType(uint i, uint j) const
int Bytes(int i, int j) const
QString toString() const override
uint AServiceFlags(void) const
QString LanguageString(int i) const
const unsigned char * m_data
QString GetFullString(uint i) const
uint GetIndexOfBestMatch(QMap< uint, uint > &langPrefs) const
QString SampleRateCodeString(void) const
uint ServicesCount() const
ISO 639-1 and ISO 639-2 support functions.
int CanonicalLanguageKey(uint i) const
QString GetSegment(uint i, uint j) const
QString CompressionTypeString(uint i, uint j) const
QString BitRateCodeString(void) const
QString GetBestMatch(QMap< uint, uint > &langPrefs) const
uint Channels(void) const
bool FullService(void) const
QString LongChannelNameString(void) const
Convenience function that returns a QString comprising a concatenation of all the segments in the Lon...
QString atsc_huffman1_to_string(const unsigned char *compressed, uint size, uint table_index)
const unsigned char * Offset(int i, int j) const
uint SampleRateCode(void) const
static int Index(int i, int j)