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 : qAsConst(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");
154 str = QString(
"TODO South Korean Characters");
156 str = QString(
"unknown character encoding mode(%0)").arg(mode);
187 QString str(
"Caption Service Descriptor ");
192 str.append(QString(
"\n lang(%1) type(%2) ")
194 str.append(QString(
"easy_reader(%1) wide(%2) ")
198 str.append(QString(
"service_num(%1)")
203 str.append(QString(
"line_21_field(%1)").arg(
static_cast<int>(
Line21Field(i))));
231 return "ContentAdvisoryDescriptor::toString(): Not implemented";
236 static const std::array<const std::string,8> s_asd
238 "48kbps",
"44.1kbps",
"32kbps",
"Reserved",
239 "48kbps or 44.1kbps",
"48kbps or 32kbps",
240 "44.1kbps or 32kbps",
"48kbps or 44.1kbps or 32kbps"
247 static const std::array<const std::string,19> s_ebr
249 "=32kbps",
"=40kbps",
"=48kbps",
"=56kbps",
"=64kbps",
250 "=80kbps",
"=96kbps",
"=112kbps",
"=128kbps",
"=160kbps",
251 "=192kbps",
"=224kbps",
"=256kbps",
"=320kbps",
"=384kbps",
252 "=448kbps",
"=512kbps",
"=576kbps",
"=640kbps"
254 static const std::array<const std::string,19> s_ubr
256 "<=32kbps",
"<=40kbps",
"<=48kbps",
"<=56kbps",
"<=64kbps",
257 "<=80kbps",
"<=96kbps",
"<=112kbps",
"<=128kbps",
"<=160kbps",
258 "<=192kbps",
"<=224kbps",
"<=256kbps",
"<=320kbps",
"<=384kbps",
259 "<=448kbps",
"<=512kbps",
"<=576kbps",
"<=640kbps"
263 return QString::fromStdString(s_ebr[
BitRateCode()]);
265 return QString::fromStdString(s_ubr[
BitRateCode()-32]);
266 return {
"Unknown Bit Rate Code"};
271 static const std::array<const std::string,4> s_sms
274 "Not Dolby surround encoded",
275 "Dolby surround encoded",
283 static const std::array<const std::string,16> s_cs
285 "1 + 1",
"1/0",
"2/0",
"3/0",
286 "2/1",
"3/1",
"2/2 ",
"3/2",
287 "1",
"<= 2",
"<= 3",
"<= 4",
288 "<= 5",
"<= 6",
"Reserved",
"Reserved"
290 return QString::fromStdString(s_cs[
Channels()]);
296 str.append(QString(
"AC-3 Audio Stream Descriptor "));
297 str.append(QString(
" full_srv(%1) sample_rate(%2) bit_rate(%3, %4)\n")
302 str.append(QString(
" bsid(%1) bs_mode(%2) channels(%3) Dolby(%4)\n")
314 str.append(QString(
" mainID(%1) ").arg(
MainID()));
316 str.append(QString(
" associated_service(0x%1) ")
321 str.append(QString(
"isLatin-1(%1) ")
323 str.append(QString(
"text_length(%1) ").arg(
TextLength()));
324 str.append(QString(
"text(%1)").arg(
Text()));
356 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)