diff options
author | etobi <git@e-tobi.net> | 2013-09-03 09:48:40 +0200 |
---|---|---|
committer | etobi <git@e-tobi.net> | 2013-09-03 09:48:40 +0200 |
commit | 6b350466c4902c5b137e0efaf1d189128a7f18f5 (patch) | |
tree | a7cf91f9896c0f8c9d8b291114e51f1373940c70 /util/scan/atsc_psip_section.c | |
parent | 6e40287e2f39a80fc72bd8d0fbc1a8334d688c2d (diff) | |
download | linux-dvb-apps-b1e95e2f20b330388550a933376b4c90cabb0740.tar.gz |
Imported Upstream version 1.1.1upstream/1.1.1
Diffstat (limited to 'util/scan/atsc_psip_section.c')
-rw-r--r-- | util/scan/atsc_psip_section.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/util/scan/atsc_psip_section.c b/util/scan/atsc_psip_section.c new file mode 100644 index 0000000..0c50014 --- /dev/null +++ b/util/scan/atsc_psip_section.c @@ -0,0 +1,62 @@ +#include "atsc_psip_section.h" + +struct ATSC_extended_channel_name_descriptor read_ATSC_extended_channel_name_descriptor(const u8 *b) +{ + struct ATSC_extended_channel_name_descriptor v; + v.descriptor_tag = getBits(b, 0, 8); + v.descriptor_length = getBits(b, 8, 8); + v.TODO = getBits(b, 16, 1); + return v; +} + +struct ATSC_service_location_descriptor read_ATSC_service_location_descriptor(const u8 *b) +{ + struct ATSC_service_location_descriptor v; + v.descriptor_tag = getBits(b, 0, 8); + v.descriptor_length = getBits(b, 8, 8); + v.reserved = getBits(b, 16, 3); + v.PCR_PID = getBits(b, 19,13); + v.number_elements = getBits(b, 32, 8); + return v; +} + +struct ATSC_service_location_element read_ATSC_service_location_element(const u8 *b) +{ + struct ATSC_service_location_element v; + v.stream_type = getBits(b, 0, 8); + v.reserved = getBits(b, 8, 3); + v.elementary_PID = getBits(b, 11,13); + v.ISO_639_language_code = getBits(b, 24,24); + return v; +} + +struct tvct_channel read_tvct_channel(const u8 *b) +{ + struct tvct_channel v; + v.short_name0 = getBits(b, 0,16); + v.short_name1 = getBits(b, 16,16); + v.short_name2 = getBits(b, 32,16); + v.short_name3 = getBits(b, 48,16); + v.short_name4 = getBits(b, 64,16); + v.short_name5 = getBits(b, 80,16); + v.short_name6 = getBits(b, 96,16); + v.reserved0 = getBits(b,112, 4); + v.major_channel_number = getBits(b,116,10); + v.minor_channel_number = getBits(b,126,10); + v.modulation_mode = getBits(b,136, 8); + v.carrier_frequency = getBits(b,144,32); + v.channel_TSID = getBits(b,176,16); + v.program_number = getBits(b,192,16); + v.ETM_location = getBits(b,208, 2); + v.access_controlled = getBits(b,210, 1); + v.hidden = getBits(b,211, 1); + v.reserved1 = getBits(b,212, 2); + v.hide_guide = getBits(b,214, 1); + v.reserved2 = getBits(b,215, 3); + v.service_type = getBits(b,218, 6); + v.source_id = getBits(b,224,16); + v.reserved3 = getBits(b,240, 6); + v.descriptors_length = getBits(b,246,10); + return v; +} + |