00001 // -*- Mode: c++ -*- 00002 00003 #include "dishdescriptors.h" 00004 #include "atsc_huffman.h" 00005 00006 QString DishEventNameDescriptor::Name(uint compression_type) const 00007 { 00008 if (!HasName()) 00009 return QString::null; 00010 00011 return atsc_huffman2_to_string( 00012 _data + 3, DescriptorLength() - 1, compression_type); 00013 } 00014 00015 const unsigned char *DishEventDescriptionDescriptor::DescriptionRaw(void) const 00016 { 00017 if (DescriptorLength() <= 2) 00018 return NULL; 00019 00020 bool offset = (_data[3] & 0xf8) == 0x80; 00021 return _data + ((offset) ? 4 : 3); 00022 } 00023 00024 uint DishEventDescriptionDescriptor::DescriptionRawLength(void) const 00025 { 00026 if (DescriptorLength() <= 2) 00027 return 0; 00028 00029 bool offset = (_data[3] & 0xf8) == 0x80; 00030 return DescriptorLength() - ((offset) ? 2 : 1); 00031 } 00032 00033 QString DishEventDescriptionDescriptor::Description( 00034 uint compression_type) const 00035 { 00036 const unsigned char *raw = DescriptionRaw(); 00037 uint len = DescriptionRawLength(); 00038 00039 if (raw && len) 00040 return atsc_huffman2_to_string(raw, len, compression_type); 00041 00042 return QString::null; 00043 }
1.5.5