aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-10-06 20:26:18 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-06 20:26:18 (GMT)
commitc5ebf2d6bd648d078d48601f47015f8393b579d6 (patch)
tree9bbefe7f82be8638a8c3040bb1977ac137cbaf1a
parent00f64095b59ad40ba6e58a92a808569880cad4d2 (diff)
parentde7dce77eef16f5d8faf1bcfd6fce07474f1f893 (diff)
Merge /home/v4l/dvb-apps
* /home/v4l/dvb-apps: (1453 commits) Move everything to their own repository add test_tapdmx, like test_dvr but using DMX_OUT_TSDEMUX_TAP The ATSC A/65C standard (in Section 6.5) allows the "title_length" field in the Event Information Table (EIT) to be set to zero, but the "atsc_epg" program crashes with the following backtrace if that happens: azap gets -p argument lsdvb: An app to list PCI DVB devices cleanups update scan files for fi-* submitted by crope iki.fi update scan file for es-Donostia submitted by tlaurikainen gmail.com update scan file for Thor-1.0W submitted by harald.overas gmail.com update scan file for hr-All submitted by samuel.rakitnican gmail.com update scan file for de-Berlin submitted by Frank.Reimann franksbox.de / wol snafu.de update scan file for de-Berlin submitted by Frank.Reimann franksbox.de update scan file for de-Berlin submitted by aldafu cs.tu-berlin.de update scan files for sk-* submitted by puk007 gmail.com remove outdated scan files fr-* submitted by mossroy free.fr use auto-Default or auto-With167kHzOffsets instead update scan file us-Cable-Standard-center-frequencies-QAM256 submitted by intlvelvet gmail.com fix file permissions update scan file for au-Sydney_North_Shore submited by sollis gmail.com add scan file for sk-Presov submitted by vkristian gmail.com add scan file for ca-AB-Calgary submitted by shadowofdarkness gmail.com ...
-rw-r--r--dvb-apps/COPYING339
-rw-r--r--dvb-apps/COPYING.LGPL502
-rw-r--r--dvb-apps/INSTALL26
-rw-r--r--dvb-apps/Make.rules104
-rw-r--r--dvb-apps/Makefile12
-rw-r--r--dvb-apps/README47
-rw-r--r--dvb-apps/include/audio.h140
-rw-r--r--dvb-apps/include/ca.h90
-rw-r--r--dvb-apps/include/dmx.h154
-rw-r--r--dvb-apps/include/frontend.h648
-rw-r--r--dvb-apps/include/net.h53
-rw-r--r--dvb-apps/include/osd.h142
-rw-r--r--dvb-apps/include/version.h29
-rw-r--r--dvb-apps/include/video.h277
-rw-r--r--dvb-apps/lib/Makefile11
-rw-r--r--dvb-apps/lib/libdvbapi/Makefile25
-rw-r--r--dvb-apps/lib/libdvbapi/dvbaudio.c50
-rw-r--r--dvb-apps/lib/libdvbapi/dvbaudio.h55
-rw-r--r--dvb-apps/lib/libdvbapi/dvbca.c159
-rw-r--r--dvb-apps/lib/libdvbapi/dvbca.h135
-rw-r--r--dvb-apps/lib/libdvbapi/dvbdemux.c255
-rw-r--r--dvb-apps/lib/libdvbapi/dvbdemux.h204
-rw-r--r--dvb-apps/lib/libdvbapi/dvbfe.c574
-rw-r--r--dvb-apps/lib/libdvbapi/dvbfe.h333
-rw-r--r--dvb-apps/lib/libdvbapi/dvbnet.c104
-rw-r--r--dvb-apps/lib/libdvbapi/dvbnet.h87
-rw-r--r--dvb-apps/lib/libdvbapi/dvbvideo.c46
-rw-r--r--dvb-apps/lib/libdvbapi/dvbvideo.h46
-rw-r--r--dvb-apps/lib/libdvbcfg/Makefile18
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_common.c136
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_common.h37
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c282
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h61
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c384
-rw-r--r--dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h77
-rw-r--r--dvb-apps/lib/libdvbcfg/zapchannel.txt72
-rw-r--r--dvb-apps/lib/libdvben50221/Makefile49
-rw-r--r--dvb-apps/lib/libdvben50221/asn_1.c83
-rw-r--r--dvb-apps/lib/libdvben50221/asn_1.h41
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_ai.c191
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_ai.h136
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_auth.c180
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_auth.h123
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_ca.c631
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_ca.h264
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_datetime.c173
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_datetime.h119
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_dvb.c282
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_dvb.h176
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_epg.c167
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_epg.h138
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_lowspeed.c533
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_lowspeed.h219
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_mmi.c1397
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_mmi.h618
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_rm.c307
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_rm.h187
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_smartcard.c296
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_smartcard.h200
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_tags.h104
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_teletext.c141
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_teletext.h107
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_utils.c38
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_app_utils.h112
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_errno.h49
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_session.c1055
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_session.h232
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_stdcam.c54
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_stdcam.h102
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_stdcam_hlci.c216
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_stdcam_llci.c444
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_transport.c1296
-rw-r--r--dvb-apps/lib/libdvben50221/en50221_transport.h234
-rw-r--r--dvb-apps/lib/libdvbmisc/dvbmisc.h72
-rw-r--r--dvb-apps/lib/libdvbsec/Makefile17
-rw-r--r--dvb-apps/lib/libdvbsec/dvbsec_api.c944
-rw-r--r--dvb-apps/lib/libdvbsec/dvbsec_api.h436
-rw-r--r--dvb-apps/lib/libdvbsec/dvbsec_cfg.c366
-rw-r--r--dvb-apps/lib/libdvbsec/dvbsec_cfg.h203
-rw-r--r--dvb-apps/lib/libesg/Makefile27
-rw-r--r--dvb-apps/lib/libesg/TODO18
-rw-r--r--dvb-apps/lib/libesg/bootstrap/Makefile24
-rw-r--r--dvb-apps/lib/libesg/bootstrap/access_descriptor.c115
-rw-r--r--dvb-apps/lib/libesg/bootstrap/access_descriptor.h86
-rw-r--r--dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.c50
-rw-r--r--dvb-apps/lib/libesg/bootstrap/provider_discovery_descriptor.h59
-rw-r--r--dvb-apps/lib/libesg/encapsulation/Makefile28
-rw-r--r--dvb-apps/lib/libesg/encapsulation/auxiliary_data.h62
-rw-r--r--dvb-apps/lib/libesg/encapsulation/container.c206
-rw-r--r--dvb-apps/lib/libesg/encapsulation/container.h94
-rw-r--r--dvb-apps/lib/libesg/encapsulation/data_repository.c53
-rw-r--r--dvb-apps/lib/libesg/encapsulation/data_repository.h59
-rw-r--r--dvb-apps/lib/libesg/encapsulation/fragment_management_information.c118
-rw-r--r--dvb-apps/lib/libesg/encapsulation/fragment_management_information.h96
-rw-r--r--dvb-apps/lib/libesg/encapsulation/string_repository.c54
-rw-r--r--dvb-apps/lib/libesg/encapsulation/string_repository.h60
-rw-r--r--dvb-apps/lib/libesg/representation/Makefile26
-rw-r--r--dvb-apps/lib/libesg/representation/bim_decoder_init.h40
-rw-r--r--dvb-apps/lib/libesg/representation/encapsulated_bim_esg_xml_fragment.h40
-rw-r--r--dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.c70
-rw-r--r--dvb-apps/lib/libesg/representation/encapsulated_textual_esg_xml_fragment.h60
-rw-r--r--dvb-apps/lib/libesg/representation/init_message.c112
-rw-r--r--dvb-apps/lib/libesg/representation/init_message.h80
-rw-r--r--dvb-apps/lib/libesg/representation/textual_decoder_init.c128
-rw-r--r--dvb-apps/lib/libesg/representation/textual_decoder_init.h104
-rw-r--r--dvb-apps/lib/libesg/transport/Makefile22
-rw-r--r--dvb-apps/lib/libesg/transport/session_partition_declaration.c253
-rw-r--r--dvb-apps/lib/libesg/transport/session_partition_declaration.h139
-rw-r--r--dvb-apps/lib/libesg/types.c37
-rw-r--r--dvb-apps/lib/libesg/types.h53
-rw-r--r--dvb-apps/lib/libesg/xml/provider_discovery_descriptor.xsd22
-rw-r--r--dvb-apps/lib/libucsi/Makefile34
-rw-r--r--dvb-apps/lib/libucsi/atsc/Makefile55
-rw-r--r--dvb-apps/lib/libucsi/atsc/ac3_descriptor.h112
-rw-r--r--dvb-apps/lib/libucsi/atsc/atsc_text.c743
-rw-r--r--dvb-apps/lib/libucsi/atsc/caption_service_descriptor.h137
-rw-r--r--dvb-apps/lib/libucsi/atsc/component_name_descriptor.h92
-rw-r--r--dvb-apps/lib/libucsi/atsc/content_advisory_descriptor.h235
-rw-r--r--dvb-apps/lib/libucsi/atsc/cvct_section.c77
-rw-r--r--dvb-apps/lib/libucsi/atsc/cvct_section.h228
-rw-r--r--dvb-apps/lib/libucsi/atsc/dcc_arriving_request_descriptor.h107
-rw-r--r--dvb-apps/lib/libucsi/atsc/dcc_departing_request_descriptor.h108
-rw-r--r--dvb-apps/lib/libucsi/atsc/dccsct_section.c109
-rw-r--r--dvb-apps/lib/libucsi/atsc/dccsct_section.h327
-rw-r--r--dvb-apps/lib/libucsi/atsc/dcct_section.c96
-rw-r--r--dvb-apps/lib/libucsi/atsc/dcct_section.h380
-rw-r--r--dvb-apps/lib/libucsi/atsc/descriptor.h68
-rw-r--r--dvb-apps/lib/libucsi/atsc/eit_section.c71
-rw-r--r--dvb-apps/lib/libucsi/atsc/eit_section.h191
-rw-r--r--dvb-apps/lib/libucsi/atsc/ett_section.c42
-rw-r--r--dvb-apps/lib/libucsi/atsc/ett_section.h91
-rw-r--r--dvb-apps/lib/libucsi/atsc/extended_channel_name_descriptor.h92
-rw-r--r--dvb-apps/lib/libucsi/atsc/genre_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/atsc/mgt_section.c76
-rw-r--r--dvb-apps/lib/libucsi/atsc/mgt_section.h215
-rw-r--r--dvb-apps/lib/libucsi/atsc/rc_descriptor.h83
-rw-r--r--dvb-apps/lib/libucsi/atsc/rrt_section.c108
-rw-r--r--dvb-apps/lib/libucsi/atsc/rrt_section.h379
-rw-r--r--dvb-apps/lib/libucsi/atsc/section.h84
-rw-r--r--dvb-apps/lib/libucsi/atsc/service_location_descriptor.h141
-rw-r--r--dvb-apps/lib/libucsi/atsc/stt_section.c42
-rw-r--r--dvb-apps/lib/libucsi/atsc/stt_section.h105
-rw-r--r--dvb-apps/lib/libucsi/atsc/stuffing_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/atsc/time_shifted_service_descriptor.h136
-rw-r--r--dvb-apps/lib/libucsi/atsc/tvct_section.c81
-rw-r--r--dvb-apps/lib/libucsi/atsc/tvct_section.h227
-rw-r--r--dvb-apps/lib/libucsi/atsc/types.c71
-rw-r--r--dvb-apps/lib/libucsi/atsc/types.h227
-rw-r--r--dvb-apps/lib/libucsi/crc32.c89
-rw-r--r--dvb-apps/lib/libucsi/crc32.h58
-rw-r--r--dvb-apps/lib/libucsi/descriptor.h129
-rw-r--r--dvb-apps/lib/libucsi/dvb/Makefile123
-rw-r--r--dvb-apps/lib/libucsi/dvb/ac3_descriptor.h88
-rw-r--r--dvb-apps/lib/libucsi/dvb/adaptation_field_data_descriptor.h62
-rw-r--r--dvb-apps/lib/libucsi/dvb/ait_application_descriptor.h204
-rw-r--r--dvb-apps/lib/libucsi/dvb/ait_application_icons_descriptor.h157
-rw-r--r--dvb-apps/lib/libucsi/dvb/ait_application_name_descriptor.h145
-rw-r--r--dvb-apps/lib/libucsi/dvb/ait_external_application_authorisation_descriptor.h125
-rw-r--r--dvb-apps/lib/libucsi/dvb/ancillary_data_descriptor.h67
-rw-r--r--dvb-apps/lib/libucsi/dvb/announcement_support_descriptor.h219
-rw-r--r--dvb-apps/lib/libucsi/dvb/application_signalling_descriptor.h124
-rw-r--r--dvb-apps/lib/libucsi/dvb/bat_section.c77
-rw-r--r--dvb-apps/lib/libucsi/dvb/bat_section.h211
-rw-r--r--dvb-apps/lib/libucsi/dvb/bouquet_name_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/ca_identifier_descriptor.h94
-rw-r--r--dvb-apps/lib/libucsi/dvb/cable_delivery_descriptor.h70
-rw-r--r--dvb-apps/lib/libucsi/dvb/cell_frequency_link_descriptor.h190
-rw-r--r--dvb-apps/lib/libucsi/dvb/cell_list_descriptor.h201
-rw-r--r--dvb-apps/lib/libucsi/dvb/component_descriptor.h147
-rw-r--r--dvb-apps/lib/libucsi/dvb/content_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/content_identifier_descriptor.h233
-rw-r--r--dvb-apps/lib/libucsi/dvb/country_availability_descriptor.h120
-rw-r--r--dvb-apps/lib/libucsi/dvb/data_broadcast_descriptor.h139
-rw-r--r--dvb-apps/lib/libucsi/dvb/data_broadcast_id_descriptor.h221
-rw-r--r--dvb-apps/lib/libucsi/dvb/default_authority_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/descriptor.h230
-rw-r--r--dvb-apps/lib/libucsi/dvb/dit_section.c32
-rw-r--r--dvb-apps/lib/libucsi/dvb/dit_section.h54
-rw-r--r--dvb-apps/lib/libucsi/dvb/dsng_descriptor.h80
-rw-r--r--dvb-apps/lib/libucsi/dvb/eit_section.c63
-rw-r--r--dvb-apps/lib/libucsi/dvb/eit_section.h160
-rw-r--r--dvb-apps/lib/libucsi/dvb/extended_event_descriptor.h232
-rw-r--r--dvb-apps/lib/libucsi/dvb/frequency_list_descriptor.h107
-rw-r--r--dvb-apps/lib/libucsi/dvb/int_section.c79
-rw-r--r--dvb-apps/lib/libucsi/dvb/int_section.h245
-rw-r--r--dvb-apps/lib/libucsi/dvb/ip_mac_platform_name_descriptor.h87
-rw-r--r--dvb-apps/lib/libucsi/dvb/ip_mac_platform_provider_name_descriptor.h87
-rw-r--r--dvb-apps/lib/libucsi/dvb/ip_mac_stream_location_descriptor.h73
-rw-r--r--dvb-apps/lib/libucsi/dvb/linkage_descriptor.h480
-rw-r--r--dvb-apps/lib/libucsi/dvb/local_time_offset_descriptor.h127
-rw-r--r--dvb-apps/lib/libucsi/dvb/mhp_data_broadcast_id_descriptor.h110
-rw-r--r--dvb-apps/lib/libucsi/dvb/mosaic_descriptor.h324
-rw-r--r--dvb-apps/lib/libucsi/dvb/mpe_fec_section.h73
-rw-r--r--dvb-apps/lib/libucsi/dvb/multilingual_bouquet_name_descriptor.h145
-rw-r--r--dvb-apps/lib/libucsi/dvb/multilingual_component_descriptor.h149
-rw-r--r--dvb-apps/lib/libucsi/dvb/multilingual_network_name_descriptor.h145
-rw-r--r--dvb-apps/lib/libucsi/dvb/multilingual_service_name_descriptor.h197
-rw-r--r--dvb-apps/lib/libucsi/dvb/network_name_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/nit_section.c78
-rw-r--r--dvb-apps/lib/libucsi/dvb/nit_section.h207
-rw-r--r--dvb-apps/lib/libucsi/dvb/nvod_reference_descriptor.h125
-rw-r--r--dvb-apps/lib/libucsi/dvb/parental_rating_descriptor.h135
-rw-r--r--dvb-apps/lib/libucsi/dvb/partial_transport_stream_descriptor.h68
-rw-r--r--dvb-apps/lib/libucsi/dvb/pdc_descriptor.h64
-rw-r--r--dvb-apps/lib/libucsi/dvb/private_data_specifier_descriptor.h63
-rw-r--r--dvb-apps/lib/libucsi/dvb/related_content_descriptor.h56
-rw-r--r--dvb-apps/lib/libucsi/dvb/rnt_rar_over_dvb_stream_descriptor.h110
-rw-r--r--dvb-apps/lib/libucsi/dvb/rnt_rar_over_ip_descriptor.h87
-rw-r--r--dvb-apps/lib/libucsi/dvb/rnt_rnt_scan_descriptor.h125
-rw-r--r--dvb-apps/lib/libucsi/dvb/rst_section.c47
-rw-r--r--dvb-apps/lib/libucsi/dvb/rst_section.h110
-rw-r--r--dvb-apps/lib/libucsi/dvb/s2_satellite_delivery_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/satellite_delivery_descriptor.h73
-rw-r--r--dvb-apps/lib/libucsi/dvb/scrambling_descriptor.h61
-rw-r--r--dvb-apps/lib/libucsi/dvb/sdt_section.c60
-rw-r--r--dvb-apps/lib/libucsi/dvb/sdt_section.h157
-rw-r--r--dvb-apps/lib/libucsi/dvb/section.h108
-rw-r--r--dvb-apps/lib/libucsi/dvb/service_availability_descriptor.h98
-rw-r--r--dvb-apps/lib/libucsi/dvb/service_descriptor.h163
-rw-r--r--dvb-apps/lib/libucsi/dvb/service_identifier_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/service_list_descriptor.h122
-rw-r--r--dvb-apps/lib/libucsi/dvb/service_move_descriptor.h67
-rw-r--r--dvb-apps/lib/libucsi/dvb/short_event_descriptor.h135
-rw-r--r--dvb-apps/lib/libucsi/dvb/short_smoothing_buffer_descriptor.h87
-rw-r--r--dvb-apps/lib/libucsi/dvb/sit_section.c69
-rw-r--r--dvb-apps/lib/libucsi/dvb/sit_section.h173
-rw-r--r--dvb-apps/lib/libucsi/dvb/st_section.c29
-rw-r--r--dvb-apps/lib/libucsi/dvb/st_section.h77
-rw-r--r--dvb-apps/lib/libucsi/dvb/stream_identifier_descriptor.h61
-rw-r--r--dvb-apps/lib/libucsi/dvb/stuffing_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/subtitling_descriptor.h126
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ip_address_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ip_slash_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ip_source_slash_descriptor.h118
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ipv6_address_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ipv6_slash_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/dvb/target_ipv6_source_slash_descriptor.h118
-rw-r--r--dvb-apps/lib/libucsi/dvb/tdt_section.c33
-rw-r--r--dvb-apps/lib/libucsi/dvb/tdt_section.h54
-rw-r--r--dvb-apps/lib/libucsi/dvb/telephone_descriptor.h150
-rw-r--r--dvb-apps/lib/libucsi/dvb/teletext_descriptor.h127
-rw-r--r--dvb-apps/lib/libucsi/dvb/terrestrial_delivery_descriptor.h77
-rw-r--r--dvb-apps/lib/libucsi/dvb/time_shifted_event_descriptor.h65
-rw-r--r--dvb-apps/lib/libucsi/dvb/time_shifted_service_descriptor.h63
-rw-r--r--dvb-apps/lib/libucsi/dvb/time_slice_fec_identifier_descriptor.h94
-rw-r--r--dvb-apps/lib/libucsi/dvb/tot_section.c50
-rw-r--r--dvb-apps/lib/libucsi/dvb/tot_section.h97
-rw-r--r--dvb-apps/lib/libucsi/dvb/transport_stream_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/dvb/tva_container_section.c33
-rw-r--r--dvb-apps/lib/libucsi/dvb/tva_container_section.h90
-rw-r--r--dvb-apps/lib/libucsi/dvb/tva_id_descriptor.h124
-rw-r--r--dvb-apps/lib/libucsi/dvb/types.c270
-rw-r--r--dvb-apps/lib/libucsi/dvb/types.h127
-rw-r--r--dvb-apps/lib/libucsi/dvb/vbi_data_descriptor.h186
-rw-r--r--dvb-apps/lib/libucsi/dvb/vbi_teletext_descriptor.h116
-rw-r--r--dvb-apps/lib/libucsi/endianops.h128
-rw-r--r--dvb-apps/lib/libucsi/mpeg/Makefile66
-rw-r--r--dvb-apps/lib/libucsi/mpeg/audio_stream_descriptor.h65
-rw-r--r--dvb-apps/lib/libucsi/mpeg/ca_descriptor.h91
-rw-r--r--dvb-apps/lib/libucsi/mpeg/cat_section.c34
-rw-r--r--dvb-apps/lib/libucsi/mpeg/cat_section.h94
-rw-r--r--dvb-apps/lib/libucsi/mpeg/content_labelling_descriptor.h356
-rw-r--r--dvb-apps/lib/libucsi/mpeg/copyright_descriptor.h89
-rw-r--r--dvb-apps/lib/libucsi/mpeg/data_stream_alignment_descriptor.h73
-rw-r--r--dvb-apps/lib/libucsi/mpeg/datagram_section.h81
-rw-r--r--dvb-apps/lib/libucsi/mpeg/descriptor.h102
-rw-r--r--dvb-apps/lib/libucsi/mpeg/external_es_id_descriptor.h63
-rw-r--r--dvb-apps/lib/libucsi/mpeg/fmc_descriptor.h122
-rw-r--r--dvb-apps/lib/libucsi/mpeg/fmxbuffer_size_descriptor.h83
-rw-r--r--dvb-apps/lib/libucsi/mpeg/hierarchy_descriptor.h83
-rw-r--r--dvb-apps/lib/libucsi/mpeg/ibp_descriptor.h65
-rw-r--r--dvb-apps/lib/libucsi/mpeg/iod_descriptor.h87
-rw-r--r--dvb-apps/lib/libucsi/mpeg/iso_639_language_descriptor.h124
-rw-r--r--dvb-apps/lib/libucsi/mpeg/maximum_bitrate_descriptor.h64
-rw-r--r--dvb-apps/lib/libucsi/mpeg/metadata_descriptor.h472
-rw-r--r--dvb-apps/lib/libucsi/mpeg/metadata_pointer_descriptor.h360
-rw-r--r--dvb-apps/lib/libucsi/mpeg/metadata_section.c27
-rw-r--r--dvb-apps/lib/libucsi/mpeg/metadata_section.h122
-rw-r--r--dvb-apps/lib/libucsi/mpeg/metadata_std_descriptor.h72
-rw-r--r--dvb-apps/lib/libucsi/mpeg/mpeg4_audio_descriptor.h61
-rw-r--r--dvb-apps/lib/libucsi/mpeg/mpeg4_video_descriptor.h61
-rw-r--r--dvb-apps/lib/libucsi/mpeg/multiplex_buffer_descriptor.h65
-rw-r--r--dvb-apps/lib/libucsi/mpeg/multiplex_buffer_utilization_descriptor.h67
-rw-r--r--dvb-apps/lib/libucsi/mpeg/muxcode_descriptor.h82
-rw-r--r--dvb-apps/lib/libucsi/mpeg/odsmt_section.c80
-rw-r--r--dvb-apps/lib/libucsi/mpeg/odsmt_section.h224
-rw-r--r--dvb-apps/lib/libucsi/mpeg/pat_section.c46
-rw-r--r--dvb-apps/lib/libucsi/mpeg/pat_section.h118
-rw-r--r--dvb-apps/lib/libucsi/mpeg/pmt_section.c71
-rw-r--r--dvb-apps/lib/libucsi/mpeg/pmt_section.h188
-rw-r--r--dvb-apps/lib/libucsi/mpeg/private_data_indicator_descriptor.h63
-rw-r--r--dvb-apps/lib/libucsi/mpeg/registration_descriptor.h91
-rw-r--r--dvb-apps/lib/libucsi/mpeg/section.h60
-rw-r--r--dvb-apps/lib/libucsi/mpeg/sl_descriptor.h63
-rw-r--r--dvb-apps/lib/libucsi/mpeg/smoothing_buffer_descriptor.h66
-rw-r--r--dvb-apps/lib/libucsi/mpeg/std_descriptor.h62
-rw-r--r--dvb-apps/lib/libucsi/mpeg/system_clock_descriptor.h65
-rw-r--r--dvb-apps/lib/libucsi/mpeg/target_background_grid_descriptor.h66
-rw-r--r--dvb-apps/lib/libucsi/mpeg/tsdt_section.c34
-rw-r--r--dvb-apps/lib/libucsi/mpeg/tsdt_section.h94
-rw-r--r--dvb-apps/lib/libucsi/mpeg/types.h127
-rw-r--r--dvb-apps/lib/libucsi/mpeg/video_stream_descriptor.h101
-rw-r--r--dvb-apps/lib/libucsi/mpeg/video_window_descriptor.h64
-rw-r--r--dvb-apps/lib/libucsi/section.h253
-rw-r--r--dvb-apps/lib/libucsi/section_buf.c173
-rw-r--r--dvb-apps/lib/libucsi/section_buf.h124
-rw-r--r--dvb-apps/lib/libucsi/testrecord.txt146
-rw-r--r--dvb-apps/lib/libucsi/transport_packet.c256
-rw-r--r--dvb-apps/lib/libucsi/transport_packet.h195
-rw-r--r--dvb-apps/lib/libucsi/types.h36
-rw-r--r--dvb-apps/test/Makefile42
-rw-r--r--dvb-apps/test/README50
-rw-r--r--dvb-apps/test/dia7
-rw-r--r--dvb-apps/test/diseqc.c143
-rw-r--r--dvb-apps/test/evtest.c251
-rw-r--r--dvb-apps/test/hex_dump.c62
-rw-r--r--dvb-apps/test/hex_dump.h28
-rw-r--r--dvb-apps/test/libdvbcfg/Makefile12
-rw-r--r--dvb-apps/test/libdvbcfg/dvbcfg_test.c100
-rw-r--r--dvb-apps/test/libdvbcfg/test_zapchannels.txt446
-rw-r--r--dvb-apps/test/libdvben50221/Makefile14
-rw-r--r--dvb-apps/test/libdvben50221/test-app.c854
-rw-r--r--dvb-apps/test/libdvben50221/test-session.c171
-rw-r--r--dvb-apps/test/libdvben50221/test-transport.c144
-rw-r--r--dvb-apps/test/libdvbsec/Makefile12
-rw-r--r--dvb-apps/test/libdvbsec/dvbsec_test.c85
-rw-r--r--dvb-apps/test/libdvbsec/test_sec.txt28
-rw-r--r--dvb-apps/test/libesg/Makefile12
-rw-r--r--dvb-apps/test/libesg/samples/ESGProviderDiscoveryDescriptor.xml13
-rw-r--r--dvb-apps/test/libesg/testesg.c563
-rw-r--r--dvb-apps/test/libucsi/Makefile13
-rw-r--r--dvb-apps/test/libucsi/testucsi.c3528
-rw-r--r--dvb-apps/test/lnb.c101
-rw-r--r--dvb-apps/test/lnb.h22
-rw-r--r--dvb-apps/test/sendburst.c55
-rw-r--r--dvb-apps/test/set22k.c50
-rw-r--r--dvb-apps/test/setpid.c86
-rw-r--r--dvb-apps/test/setvoltage.c47
-rw-r--r--dvb-apps/test/szap2.c767
-rw-r--r--dvb-apps/test/test.c280
-rw-r--r--dvb-apps/test/test_audio.c344
-rw-r--r--dvb-apps/test/test_av.c574
-rw-r--r--dvb-apps/test/test_av_play.c654
-rw-r--r--dvb-apps/test/test_dvr.c163
-rw-r--r--dvb-apps/test/test_dvr_play.c143
-rw-r--r--dvb-apps/test/test_front.c327
-rw-r--r--dvb-apps/test/test_pes.c137
-rw-r--r--dvb-apps/test/test_sec_ne.c164
-rw-r--r--dvb-apps/test/test_sections.c196
-rw-r--r--dvb-apps/test/test_stc.c73
-rw-r--r--dvb-apps/test/test_stillimage.c102
-rw-r--r--dvb-apps/test/test_switch.c355
-rw-r--r--dvb-apps/test/test_tapdmx.c160
-rw-r--r--dvb-apps/test/test_tt.c204
-rw-r--r--dvb-apps/test/test_vevent.c125
-rw-r--r--dvb-apps/test/test_video.c366
-rw-r--r--dvb-apps/util/Makefile21
-rw-r--r--dvb-apps/util/alevt/COPYRIGHT297
-rw-r--r--dvb-apps/util/alevt/ChangeLog535
-rw-r--r--dvb-apps/util/alevt/EXPORT.HOWTO84
-rw-r--r--dvb-apps/util/alevt/Makefile130
-rw-r--r--dvb-apps/util/alevt/README72
-rw-r--r--dvb-apps/util/alevt/README.OLD78
-rw-r--r--dvb-apps/util/alevt/ReadmeGR28
-rw-r--r--dvb-apps/util/alevt/TODO12
-rw-r--r--dvb-apps/util/alevt/alevt-cap.153
-rw-r--r--dvb-apps/util/alevt/alevt-cap.c280
-rw-r--r--dvb-apps/util/alevt/alevt-date.141
-rw-r--r--dvb-apps/util/alevt/alevt-date.c225
-rw-r--r--dvb-apps/util/alevt/alevt.160
-rw-r--r--dvb-apps/util/alevt/alevt.desktop9
-rw-r--r--dvb-apps/util/alevt/bdf2xbm.c212
-rw-r--r--dvb-apps/util/alevt/cache.c229
-rw-r--r--dvb-apps/util/alevt/cache.h41
-rw-r--r--dvb-apps/util/alevt/dllist.h55
-rw-r--r--dvb-apps/util/alevt/exp-gfx.c258
-rw-r--r--dvb-apps/util/alevt/exp-html.c299
-rw-r--r--dvb-apps/util/alevt/exp-txt.c226
-rw-r--r--dvb-apps/util/alevt/export.c364
-rw-r--r--dvb-apps/util/alevt/export.h66
-rw-r--r--dvb-apps/util/alevt/fdset.c97
-rw-r--r--dvb-apps/util/alevt/fdset.h28
-rw-r--r--dvb-apps/util/alevt/font.c5
-rw-r--r--dvb-apps/util/alevt/font.h19
-rw-r--r--dvb-apps/util/alevt/hamm.c229
-rw-r--r--dvb-apps/util/alevt/hamm.h7
-rw-r--r--dvb-apps/util/alevt/help.c83
-rw-r--r--dvb-apps/util/alevt/help.h8
-rw-r--r--dvb-apps/util/alevt/icon.xbm17
-rw-r--r--dvb-apps/util/alevt/lang.c393
-rw-r--r--dvb-apps/util/alevt/lang.h28
-rw-r--r--dvb-apps/util/alevt/main.c221
-rw-r--r--dvb-apps/util/alevt/misc.c66
-rw-r--r--dvb-apps/util/alevt/misc.h32
-rw-r--r--dvb-apps/util/alevt/os.h7
-rw-r--r--dvb-apps/util/alevt/search.c127
-rw-r--r--dvb-apps/util/alevt/search.h16
-rw-r--r--dvb-apps/util/alevt/ui.c721
-rw-r--r--dvb-apps/util/alevt/ui.h35
-rw-r--r--dvb-apps/util/alevt/vbi.c942
-rw-r--r--dvb-apps/util/alevt/vbi.h47
-rw-r--r--dvb-apps/util/alevt/vt.h62
-rw-r--r--dvb-apps/util/alevt/vt900.out29
-rw-r--r--dvb-apps/util/alevt/vt901.out29
-rw-r--r--dvb-apps/util/alevt/vt902.out29
-rw-r--r--dvb-apps/util/alevt/vt903.out29
-rw-r--r--dvb-apps/util/alevt/vt904.out29
-rw-r--r--dvb-apps/util/alevt/vt905.out29
-rw-r--r--dvb-apps/util/alevt/vt906.out29
-rw-r--r--dvb-apps/util/alevt/vt907.out29
-rw-r--r--dvb-apps/util/alevt/vt908.out29
-rw-r--r--dvb-apps/util/alevt/vt909.out29
-rw-r--r--dvb-apps/util/alevt/vt910.out29
-rw-r--r--dvb-apps/util/alevt/vt911.out29
-rw-r--r--dvb-apps/util/alevt/vt912.out29
-rw-r--r--dvb-apps/util/alevt/vt913.out29
-rw-r--r--dvb-apps/util/alevt/vt914.out29
-rw-r--r--dvb-apps/util/alevt/vt915.out29
-rw-r--r--dvb-apps/util/alevt/vtxt-iso8859-7.bdf5768
-rw-r--r--dvb-apps/util/alevt/vtxt-koi8.bdf5906
-rw-r--r--dvb-apps/util/alevt/vtxt-latin-1.bdf5906
-rw-r--r--dvb-apps/util/alevt/vtxt-latin-2.bdf5906
-rw-r--r--dvb-apps/util/alevt/xio.c1156
-rw-r--r--dvb-apps/util/alevt/xio.h80
-rw-r--r--dvb-apps/util/atsc_epg/Makefile16
-rw-r--r--dvb-apps/util/atsc_epg/README12
-rw-r--r--dvb-apps/util/atsc_epg/atsc_epg.c1251
-rw-r--r--dvb-apps/util/av7110_loadkeys/Makefile23
-rw-r--r--dvb-apps/util/av7110_loadkeys/README63
-rw-r--r--dvb-apps/util/av7110_loadkeys/activy.rcmm53
-rw-r--r--dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c196
-rw-r--r--dvb-apps/util/av7110_loadkeys/galaxis.rcmm50
-rw-r--r--dvb-apps/util/av7110_loadkeys/generate-keynames.sh37
-rw-r--r--dvb-apps/util/av7110_loadkeys/hauppauge.rc524
-rw-r--r--dvb-apps/util/av7110_loadkeys/hauppauge2.rc540
-rw-r--r--dvb-apps/util/av7110_loadkeys/hauppauge_grey.rc539
-rw-r--r--dvb-apps/util/av7110_loadkeys/input_fake.h81
-rw-r--r--dvb-apps/util/av7110_loadkeys/mbo_81095-code_562.rc539
-rw-r--r--dvb-apps/util/av7110_loadkeys/medion_088.rc536
-rw-r--r--dvb-apps/util/av7110_loadkeys/medion_155.rc535
-rw-r--r--dvb-apps/util/av7110_loadkeys/philips.rc532
-rw-r--r--dvb-apps/util/av7110_loadkeys/philips1358.rc537
-rw-r--r--dvb-apps/util/av7110_loadkeys/technotrend.rc541
-rw-r--r--dvb-apps/util/dib3000-watch/Makefile13
-rw-r--r--dvb-apps/util/dib3000-watch/README.dib3000-watch29
-rw-r--r--dvb-apps/util/dib3000-watch/dib-i2c.h43
-rw-r--r--dvb-apps/util/dib3000-watch/dib3000-watch.c296
-rw-r--r--dvb-apps/util/dib3000-watch/dib3000-watch.h46
-rw-r--r--dvb-apps/util/dib3000-watch/dib3000.h56
-rw-r--r--dvb-apps/util/dib3000-watch/make-i2c-dev6
-rw-r--r--dvb-apps/util/dst-utils/Makefile13
-rw-r--r--dvb-apps/util/dst-utils/dst_test.c258
-rw-r--r--dvb-apps/util/dvbdate/Makefile15
-rw-r--r--dvb-apps/util/dvbdate/dvbdate.c400
-rw-r--r--dvb-apps/util/dvbnet/Makefile15
-rw-r--r--dvb-apps/util/dvbnet/dvbnet.c207
-rw-r--r--dvb-apps/util/dvbnet/net_start.pl24
-rw-r--r--dvb-apps/util/dvbnet/net_start.sh15
-rw-r--r--dvb-apps/util/dvbscan/Makefile22
-rw-r--r--dvb-apps/util/dvbscan/dvbscan.c370
-rw-r--r--dvb-apps/util/dvbscan/dvbscan.h136
-rw-r--r--dvb-apps/util/dvbscan/dvbscan_atsc.c30
-rw-r--r--dvb-apps/util/dvbscan/dvbscan_dvb.c30
-rw-r--r--dvb-apps/util/dvbscan/dvbscan_structutils.c99
-rw-r--r--dvb-apps/util/dvbtraffic/Makefile15
-rw-r--r--dvb-apps/util/dvbtraffic/dvbtraffic.c150
-rw-r--r--dvb-apps/util/femon/Makefile15
-rw-r--r--dvb-apps/util/femon/femon.c224
-rw-r--r--dvb-apps/util/gnutv/Makefile21
-rw-r--r--dvb-apps/util/gnutv/gnutv.c375
-rw-r--r--dvb-apps/util/gnutv/gnutv.h37
-rw-r--r--dvb-apps/util/gnutv/gnutv_ca.c404
-rw-r--r--dvb-apps/util/gnutv/gnutv_ca.h40
-rw-r--r--dvb-apps/util/gnutv/gnutv_data.c483
-rw-r--r--dvb-apps/util/gnutv/gnutv_data.h39
-rw-r--r--dvb-apps/util/gnutv/gnutv_dvb.c376
-rw-r--r--dvb-apps/util/gnutv/gnutv_dvb.h44
-rw-r--r--dvb-apps/util/gotox/Makefile17
-rw-r--r--dvb-apps/util/gotox/gotox.c145
-rw-r--r--dvb-apps/util/lsdvb/Makefile11
-rw-r--r--dvb-apps/util/lsdvb/lsdvb.c323
-rw-r--r--dvb-apps/util/scan/Makefile41
-rw-r--r--dvb-apps/util/scan/README20
-rw-r--r--dvb-apps/util/scan/atsc/ca-AB-Calgary15
-rw-r--r--dvb-apps/util/scan/atsc/us-ATSC-center-frequencies-8VSB70
-rw-r--r--dvb-apps/util/scan/atsc/us-CA-SF-Bay-Area16
-rw-r--r--dvb-apps/util/scan/atsc/us-Cable-EIA-542-HRC-center-frequencies-QAM256142
-rw-r--r--dvb-apps/util/scan/atsc/us-Cable-EIA-542-IRC-center_frequencies-QAM256142
-rw-r--r--dvb-apps/util/scan/atsc/us-Cable-HRC-center-frequencies-QAM256142
-rw-r--r--dvb-apps/util/scan/atsc/us-Cable-IRC-center-frequencies-QAM256142
-rw-r--r--dvb-apps/util/scan/atsc/us-Cable-Standard-center-frequencies-QAM256176
-rw-r--r--dvb-apps/util/scan/atsc/us-ID-Boise8
-rw-r--r--dvb-apps/util/scan/atsc/us-MA-Boston13
-rw-r--r--dvb-apps/util/scan/atsc/us-MI-Lansing7
-rw-r--r--dvb-apps/util/scan/atsc/us-NTSC-center-frequencies-8VSB70
-rw-r--r--dvb-apps/util/scan/atsc/us-PA-Philadelphia16
-rw-r--r--dvb-apps/util/scan/atsc_psip_section.pl76
-rw-r--r--dvb-apps/util/scan/diseqc.c103
-rw-r--r--dvb-apps/util/scan/diseqc.h24
-rw-r--r--dvb-apps/util/scan/dump-vdr.c190
-rw-r--r--dvb-apps/util/scan/dump-vdr.h38
-rw-r--r--dvb-apps/util/scan/dump-zap.c125
-rw-r--r--dvb-apps/util/scan/dump-zap.h19
-rw-r--r--dvb-apps/util/scan/dvb-c/at-Innsbruck8
-rw-r--r--dvb-apps/util/scan/dvb-c/at-Kabel-Braunau26
-rw-r--r--dvb-apps/util/scan/dvb-c/at-Kabelsignal38
-rw-r--r--dvb-apps/util/scan/dvb-c/at-KarrerNet26
-rw-r--r--dvb-apps/util/scan/dvb-c/at-Liwest31
-rw-r--r--dvb-apps/util/scan/dvb-c/at-SalzburgAG8
-rw-r--r--dvb-apps/util/scan/dvb-c/at-Vienna3
-rw-r--r--dvb-apps/util/scan/dvb-c/be-IN.DI-Integan16
-rw-r--r--dvb-apps/util/scan/dvb-c/br-Net-Digital6
-rw-r--r--dvb-apps/util/scan/dvb-c/ch-Rega-Sense34
-rw-r--r--dvb-apps/util/scan/dvb-c/ch-Video20005
-rw-r--r--dvb-apps/util/scan/dvb-c/ch-Zuerich-cablecom3
-rw-r--r--dvb-apps/util/scan/dvb-c/ch-unknown3
-rw-r--r--dvb-apps/util/scan/dvb-c/cz-Moravianet24
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Berlin5
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Brandenburg-Havel30
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Kabel_BW16
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Muenchen27
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Primacom28
-rw-r--r--dvb-apps/util/scan/dvb-c/de-Unitymedia36
-rw-r--r--dvb-apps/util/scan/dvb-c/de-iesy20
-rw-r--r--dvb-apps/util/scan/dvb-c/de-komro-Rosenheim30
-rw-r--r--dvb-apps/util/scan/dvb-c/de-neftv34
-rw-r--r--dvb-apps/util/scan/dvb-c/dk-Aarhus-Antenneforening2
-rw-r--r--dvb-apps/util/scan/dvb-c/dk-Copenhagen-AFDK11
-rw-r--r--dvb-apps/util/scan/dvb-c/dk-Odense10
-rw-r--r--dvb-apps/util/scan/dvb-c/es-Euskaltel19
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-HTV4
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-Joensuu-Tikka13
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-TTV4
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-Turku23
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-dna34
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-jkl10
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-sonera12
-rw-r--r--dvb-apps/util/scan/dvb-c/fi-vaasa-oncable13
-rw-r--r--dvb-apps/util/scan/dvb-c/fr-noos-numericable41
-rw-r--r--dvb-apps/util/scan/dvb-c/hu-Digikabel25
-rw-r--r--dvb-apps/util/scan/dvb-c/lu-Ettelbruck-ACE20
-rw-r--r--dvb-apps/util/scan/dvb-c/nl-REKAM-CAIW_Gouda4
-rw-r--r--dvb-apps/util/scan/dvb-c/nl-Ziggo14
-rw-r--r--dvb-apps/util/scan/dvb-c/nl-Ziggo-Zwolle26
-rw-r--r--dvb-apps/util/scan/dvb-c/no-Oslo-CanalDigital13
-rw-r--r--dvb-apps/util/scan/dvb-c/no-Oslo-Get22
-rw-r--r--dvb-apps/util/scan/dvb-c/se-Gothnet23
-rw-r--r--dvb-apps/util/scan/dvb-c/se-comhem25
-rw-r--r--dvb-apps/util/scan/dvb-h/README3
-rw-r--r--dvb-apps/util/scan/dvb-h/fi-Helsinki2
-rw-r--r--dvb-apps/util/scan/dvb-h/fi-Oulu2
-rw-r--r--dvb-apps/util/scan/dvb-h/fi-Oulu-Nokia-devel4
-rw-r--r--dvb-apps/util/scan/dvb-h/fi-Turku2
-rw-r--r--dvb-apps/util/scan/dvb-s/ABS1-75.0E10
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC1-103w5
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC2-85w6
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC3-87w10
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC4-101w10
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC5-79w5
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC6-72w44
-rw-r--r--dvb-apps/util/scan/dvb-s/AMC9-83w18
-rw-r--r--dvb-apps/util/scan/dvb-s/Agila2_C-146.0E60
-rw-r--r--dvb-apps/util/scan/dvb-s/Amazonas-61.0W54
-rw-r--r--dvb-apps/util/scan/dvb-s/Amos-4w48
-rw-r--r--dvb-apps/util/scan/dvb-s/Anik-F1-107.3W7
-rw-r--r--dvb-apps/util/scan/dvb-s/Apstar6_C-134.0E15
-rw-r--r--dvb-apps/util/scan/dvb-s/AsiaSat2_C-100.5E51
-rw-r--r--dvb-apps/util/scan/dvb-s/AsiaSat3S_C-105.5E102
-rw-r--r--dvb-apps/util/scan/dvb-s/Asiasat4_C-122.2E27
-rw-r--r--dvb-apps/util/scan/dvb-s/Astra-19.2E3
-rw-r--r--dvb-apps/util/scan/dvb-s/Astra-23.5E66
-rw-r--r--dvb-apps/util/scan/dvb-s/Astra-28.2E186
-rw-r--r--dvb-apps/util/scan/dvb-s/Atlantic-Bird-1-12.5W30
-rw-r--r--dvb-apps/util/scan/dvb-s/Atlantic-Bird-3-5.0W4
-rw-r--r--dvb-apps/util/scan/dvb-s/BrasilSat-B1-75.0W11
-rw-r--r--dvb-apps/util/scan/dvb-s/BrasilSat-B2-65.0W34
-rw-r--r--dvb-apps/util/scan/dvb-s/BrasilSat-B3-84.0W85
-rw-r--r--dvb-apps/util/scan/dvb-s/BrasilSat-B4-70.0W39
-rw-r--r--dvb-apps/util/scan/dvb-s/Chinastar1_C-87.5E15
-rw-r--r--dvb-apps/util/scan/dvb-s/Estrela-do-Sul-63.0W27
-rw-r--r--dvb-apps/util/scan/dvb-s/Eurobird1-28.5E5
-rw-r--r--dvb-apps/util/scan/dvb-s/Eurobird9-9.0E16
-rw-r--r--dvb-apps/util/scan/dvb-s/EutelsatW2-16E59
-rw-r--r--dvb-apps/util/scan/dvb-s/Express-3A-11.0W4
-rw-r--r--dvb-apps/util/scan/dvb-s/ExpressAM1-40.0E5
-rw-r--r--dvb-apps/util/scan/dvb-s/ExpressAM2-80.0E35
-rw-r--r--dvb-apps/util/scan/dvb-s/ExpressAM22-53.0E9
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy10R-123w10
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy11-91w49
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy25-97w19
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy26-93w58
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy27-129w4
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy28-89w41
-rw-r--r--dvb-apps/util/scan/dvb-s/Galaxy3C-95w4
-rw-r--r--dvb-apps/util/scan/dvb-s/Hispasat-30.0W43
-rw-r--r--dvb-apps/util/scan/dvb-s/Hotbird-13.0E96
-rw-r--r--dvb-apps/util/scan/dvb-s/IA5-97w18
-rw-r--r--dvb-apps/util/scan/dvb-s/IA6-93w61
-rw-r--r--dvb-apps/util/scan/dvb-s/IA7-129w4
-rw-r--r--dvb-apps/util/scan/dvb-s/IA8-89w34
-rw-r--r--dvb-apps/util/scan/dvb-s/Insat2E_C-83.0E93
-rw-r--r--dvb-apps/util/scan/dvb-s/Insat3A_C-93.5E66
-rw-r--r--dvb-apps/util/scan/dvb-s/Insat4A_C-83.0E93
-rw-r--r--dvb-apps/util/scan/dvb-s/Insat4B_C-93.5E51
-rw-r--r--dvb-apps/util/scan/dvb-s/Intel4-72.0E6
-rw-r--r--dvb-apps/util/scan/dvb-s/Intel904-60.0E13
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-1002-1.0W20
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-11-43.0W4
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-1R-45.0W44
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-3R-43.0W35
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-6B-43.0W17
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-705-50.0W7
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-707-53.0W5
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-805-55.5W67
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-9-58.0W58
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-903-34.5W7
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-905-24.5W9
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat-907-27.5W9
-rw-r--r--dvb-apps/util/scan/dvb-s/Intelsat8_C-166.0E39
-rw-r--r--dvb-apps/util/scan/dvb-s/JCSat3A_C-128.0E18
-rw-r--r--dvb-apps/util/scan/dvb-s/Measat3_C-91.5E54
-rw-r--r--dvb-apps/util/scan/dvb-s/NSS-10-37.5W12
-rw-r--r--dvb-apps/util/scan/dvb-s/NSS-7-22.0W25
-rw-r--r--dvb-apps/util/scan/dvb-s/NSS-806-40.5W108
-rw-r--r--dvb-apps/util/scan/dvb-s/Nahuel-1-71.8W11
-rw-r--r--dvb-apps/util/scan/dvb-s/Nilesat101+102-7.0W41
-rw-r--r--dvb-apps/util/scan/dvb-s/OptusC1-156E20
-rw-r--r--dvb-apps/util/scan/dvb-s/OptusD1-160.0E4
-rw-r--r--dvb-apps/util/scan/dvb-s/PAS-43.0W6
-rw-r--r--dvb-apps/util/scan/dvb-s/PalapaC2_C-113.0E39
-rw-r--r--dvb-apps/util/scan/dvb-s/SBS6-74w4
-rw-r--r--dvb-apps/util/scan/dvb-s/ST1_C-80.0E27
-rw-r--r--dvb-apps/util/scan/dvb-s/Satmex-5-116.8W72
-rw-r--r--dvb-apps/util/scan/dvb-s/Satmex-6-113.0W19
-rw-r--r--dvb-apps/util/scan/dvb-s/Sirius-5.0E62
-rw-r--r--dvb-apps/util/scan/dvb-s/Telecom2-8.0W17
-rw-r--r--dvb-apps/util/scan/dvb-s/Telkom1_C-108.0E48
-rw-r--r--dvb-apps/util/scan/dvb-s/Telstar10_C-76.5E63
-rw-r--r--dvb-apps/util/scan/dvb-s/Telstar12-15.0W26
-rw-r--r--dvb-apps/util/scan/dvb-s/Telstar18_C-138.0E18
-rw-r--r--dvb-apps/util/scan/dvb-s/Thaicom1A_C-120.0E24
-rw-r--r--dvb-apps/util/scan/dvb-s/Thaicom2_C-78.5E33
-rw-r--r--dvb-apps/util/scan/dvb-s/Thaicom5_C-78.5E69
-rw-r--r--dvb-apps/util/scan/dvb-s/Thor-1.0W65
-rw-r--r--dvb-apps/util/scan/dvb-s/Turksat-42.0E104
-rw-r--r--dvb-apps/util/scan/dvb-s/Vinasat1_C-132.0E12
-rw-r--r--dvb-apps/util/scan/dvb-s/Yamal201-90.0E48
-rw-r--r--dvb-apps/util/scan/dvb-t/ad-Andorra6
-rw-r--r--dvb-apps/util/scan/dvb-t/at-Official24
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Adelaide14
-rw-r--r--dvb-apps/util/scan/dvb-t/au-AdelaideFoothills12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Ballarat12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Bendigo41
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Brisbane14
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Cairns12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Canberra-Black-Mt12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Coonabarabran16
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Darwin9
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Devonport19
-rw-r--r--dvb-apps/util/scan/dvb-t/au-FraserCoast-Bundaberg12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-GoldCoast21
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Goulburn-Rocky_Hill19
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Hervey_Bay-Ghost_Hill16
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Hobart12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Mackay14
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Melbourne12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Melbourne-Upwey12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-MidNorthCoast22
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Newcastle12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Perth12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Perth_Roleystone12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-SpencerGulf8
-rw-r--r--dvb-apps/util/scan/dvb-t/au-SunshineCoast12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Sutherland20
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Sydney_Kings_Cross14
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Sydney_North_Shore16
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Tamworth38
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Townsville12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-WaggaWagga12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-Wollongong40
-rw-r--r--dvb-apps/util/scan/dvb-t/au-canberra12
-rw-r--r--dvb-apps/util/scan/dvb-t/au-unknown3
-rw-r--r--dvb-apps/util/scan/dvb-t/auto-Australia110
-rw-r--r--dvb-apps/util/scan/dvb-t/auto-Default65
-rw-r--r--dvb-apps/util/scan/dvb-t/auto-Italy72
-rw-r--r--dvb-apps/util/scan/dvb-t/auto-Taiwan18
-rw-r--r--dvb-apps/util/scan/dvb-t/auto-With167kHzOffsets165
-rw-r--r--dvb-apps/util/scan/dvb-t/ax-Smedsbole13
-rw-r--r--dvb-apps/util/scan/dvb-t/be-All8
-rw-r--r--dvb-apps/util/scan/dvb-t/ch-All32
-rw-r--r--dvb-apps/util/scan/dvb-t/ch-Citycable18
-rw-r--r--dvb-apps/util/scan/dvb-t/ch-Geneva16
-rw-r--r--dvb-apps/util/scan/dvb-t/cz-All41
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Baden-Wuerttemberg19
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Bayern40
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Berlin12
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Brandenburg7
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Bremen9
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Hamburg12
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Hessen19
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Mecklenburg-Vorpommern12
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Niedersachsen39
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Nordrhein-Westfalen27
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Rheinland-Pfalz12
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Saarland7
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Sachsen14
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Sachsen-Anhalt12
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Schleswig-Holstein18
-rw-r--r--dvb-apps/util/scan/dvb-t/de-Thueringen10
-rw-r--r--dvb-apps/util/scan/dvb-t/dk-All23
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Albacete14
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Alfabia11
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Alicante9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Alpicat8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Asturias8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-BaixoMinho16
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Bilbao6
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Cadiz8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Carceres10
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Collserola12
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Donostia13
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Granada8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Huesca8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Las_Palmas18
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Lugo9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Madrid22
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Malaga9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Muros-Noia9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Mussara8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Pamplona9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Rocacorba6
-rw-r--r--dvb-apps/util/scan/dvb-t/es-SC_Tenerife18
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Santander7
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Santiago_de_Compostela9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Sevilla23
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Tenerife14
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Valencia9
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Valladolid7
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Vilamarxant4
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Vitoria-Gasteiz8
-rw-r--r--dvb-apps/util/scan/dvb-t/es-Zaragoza7
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Aanekoski6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Aanekoski_Konginkangas6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ahtari4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ala-Vuokki4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Alajarvi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ammansaari4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Anjalankoski6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Enontekio_Raattama4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Espoo6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Eurajoki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Fiskars6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Haapavesi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hameenkyro_Kyroskoski6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hameenlinna_Painokangas5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hanko6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hartola5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Haukela5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Heinavesi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Heinola6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hetta4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hossa4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Houtskari6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hyrynsalmi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hyrynsalmi_Kyparavaara5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hyrynsalmi_Paljakka5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Hyvinkaa_Musta-Mannisto6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ii_Raiskio4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Iisalmi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ikaalinen6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ikaalinen_Riitiala6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Inari4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Inari_Janispaa4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Inari_Naatamo4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ivalo_Saarineitamovaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jalasjarvi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jamsa_Kaipola6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jamsa_Kuorevesi_Halli6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jamsa_Matkosvuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jamsa_Ouninpohja5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jamsankoski6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Joensuu_Vestinkallio5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Joroinen_Puukkola-Huutokoski5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Joutsa_Lankia6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Joutseno6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Juntusranta4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Juupajoki_Kopsamo5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Juva6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Jyvaskyla6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kaavi_Luikonlahti5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kajaani_Pollyvaara5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kalajoki5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kangaslampi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kangasniemi_Turkinmaki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kankaanpaa6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Karigasniemi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Karkkila6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Karstula5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Karvia5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kaunispaa4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kemijarvi_Suomutunturi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kerimaki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Keuruu6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Keuruu_Haapamaki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kihnio6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kiihtelysvaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kilpisjarvi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kittila_Sirkka_Levitunturi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kolari_Vuolittaja4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Koli6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Korpilahti_Vaarunvuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Korppoo6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kruunupyy6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuhmo_Iivantiira5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuhmo_Lentiira5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuhmoinen6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuhmoinen_Harjunsalmi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuhmoinen_Puukkoinen5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuopio6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kustavi_Viherlahti6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kuttanen4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Kyyjarvi_Noposenaho5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Lahti6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Lapua6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Laukaa6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Laukaa_Vihtavuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Lavia_Lavianjarvi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Lieksa_Konnanvaara6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Lohja6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Loimaa6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Luhanka6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Luopioinen6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Mantta6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Mantyharju5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Mikkeli6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Muonio_Olostunturi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Mustasaari3
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Myllylahti4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nilsia6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nilsia_Keski-Siikajarvi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nilsia_Pisa5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nokia6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nokia_Siuro_Linnavuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nummi-Pusula_Hyonola6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Nurmes_Kortevaara5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Orivesi_Langelmaki_Talviainen5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Oulu6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Padasjoki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Padasjoki_Arrakoski6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Paltamo_Kivesvaara5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Parikkala6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Parkano_Sopukallio6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pello4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pello_Ratasvaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Perho6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pernaja5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pieksamaki_Halkokumpu5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pihtipudas5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Porvoo_Suomenkyla6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Posio4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pudasjarvi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pudasjarvi_Hirvaskoski4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pudasjarvi_Iso-Syote5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Puolanka6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pyhatunturi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pyhavuori5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Pylkonmaki_Karankajarvi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Raahe_Mestauskallio6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Raahe_Piehinki5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ranua_Haasionmaa4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ranua_Leppiaho4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rautavaara_Angervikko6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rautjarvi_Simpele5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ristijarvi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Ala-Nampa_Yli-Nampa_Rantalaki4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Kaihuanvaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Marasenkallio4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Marrasjarvi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Meltaus_Sorviselka4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Rovaniemi_Sonka4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ruka5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ruovesi_Storminiemi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Saarijarvi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Saarijarvi_Kalmari5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Saarijarvi_Mahlu5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salla_Hirvasvaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salla_Ihistysjanka4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salla_Naruska4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salla_Sallatunturi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salla_Sarivaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Salo_Isokyla6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Savukoski_Martti4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Savukoski_Tanhua4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Siilinjarvi6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Sipoo_Norrkulla6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Sodankyla_Pittiovaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Sulkava_Vaatalanmaki5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Sysma_Liikola6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Taivalkoski4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Taivalkoski_Taivalvaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Tammela6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Tammisaari6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Tampere6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Tampere_Pyynikki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Tervola5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Turku6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Nuorgam_Njallavaara4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Nuorgam_raja4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Nuvvus4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Outakoski4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Polvarniemi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Rovisuvanto4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Utsjoki_Tenola4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Uusikaupunki_Orivo6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vaajakoski5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vaala5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vaasa5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Valtimo5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vammala_Jyranvuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vammala_Roismala5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vammala_Savi5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vantaa_Hakunila6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Varpaisjarvi_Honkamaki6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Virrat_Lappavuori6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vuokatti6
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Vuotso4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ylitornio_Ainiovaara5
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Ylitornio_Raanujarvi4
-rw-r--r--dvb-apps/util/scan/dvb-t/fi-Yllas4
-rw-r--r--dvb-apps/util/scan/dvb-t/fr-Bordeaux9
-rw-r--r--dvb-apps/util/scan/dvb-t/gr-Athens5
-rw-r--r--dvb-apps/util/scan/dvb-t/hk-HongKong18
-rw-r--r--dvb-apps/util/scan/dvb-t/hr-All30
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Bekescsaba17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Budapest17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Csavoly-Kiskoros17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Gerecse17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Gyor-Tatabanya17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Kabhegy-Mor-Siofok17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Karcag17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Kekes-Ozd17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Kiskoros17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Komadi-Debrecen17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Nagykanizsa-Kaposvar17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Pecs-Uzd17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Salgotarjan17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Sopron17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Szentes-Szeged17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Tokaj-Kazincbarcika17
-rw-r--r--dvb-apps/util/scan/dvb-t/hu-Vasvar17
-rw-r--r--dvb-apps/util/scan/dvb-t/il-All5
-rw-r--r--dvb-apps/util/scan/dvb-t/ir-Tehran4
-rw-r--r--dvb-apps/util/scan/dvb-t/is-Reykjavik29
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Aosta21
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Bari18
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Bologna28
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Bolzano5
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Cagliari23
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Caivano17
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Catania27
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Conero8
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Firenze20
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Genova12
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Livorno15
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Milano49
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Modena50
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Montevergine18
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Pagnacco27
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Palermo23
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Pescara15
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Pisa18
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Roma16
-rw-r--r--dvb-apps/util/scan/dvb-t/it-S-Stefano_al_mare19
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Sassari33
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Torino13
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Trieste23
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Varese16
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Venezia19
-rw-r--r--dvb-apps/util/scan/dvb-t/it-Verona19
-rw-r--r--dvb-apps/util/scan/dvb-t/lt-All39
-rw-r--r--dvb-apps/util/scan/dvb-t/lu-All5
-rw-r--r--dvb-apps/util/scan/dvb-t/lv-Riga25
-rw-r--r--dvb-apps/util/scan/dvb-t/nl-All42
-rw-r--r--dvb-apps/util/scan/dvb-t/no-Trondelag_Stjordal7
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-AucklandInfill10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-AucklandWaiatarua10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Christchurch10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Dunedin10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Hamilton10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-HawkesBayMtErin10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-HawkesBayNapier10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Manawatu10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Tauranga10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-Waikato10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-WellingtonInfill10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-WellingtonKaukau10
-rw-r--r--dvb-apps/util/scan/dvb-t/nz-WellingtonNgarara10
-rw-r--r--dvb-apps/util/scan/dvb-t/pl-Rzeszow3
-rw-r--r--dvb-apps/util/scan/dvb-t/pl-Warszawa4
-rw-r--r--dvb-apps/util/scan/dvb-t/pl-Wroclaw3
-rw-r--r--dvb-apps/util/scan/dvb-t/ro-Bucharest5
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Alvdalen_Brunnsberg3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Alvdalsasen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Alvsbyn7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Amot3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ange_Snoberg6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Angebo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Angelholm_Vegeholm7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Arvidsjaur_Jultrask6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Aspeboda3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Atvidaberg4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Avesta_Krylbo4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Backefors7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bankeryd4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bergsjo_Balleberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bergvik3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bollebygd4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bollnas6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Boras_Dalsjofors7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Boras_Sjobo4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Borlange_Idkerberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Borlange_Nygardarna4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bottnaryd_Ryd3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bromsebro4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Bruzaholm3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Byxelkrok4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Dadran3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Dalfors3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Dalstuga3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Degerfors6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Delary3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Djura3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Drevdagen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Duvnas3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Duvnas_Basna3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Edsbyn3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Emmaboda_Balshult6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Enviken4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Fagersta4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Falerum_Centrum3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Falun_Lovberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Farila3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Faro_Ajkerstrask4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Farosund_Bunge7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Filipstad_Klockarhojden6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Finnveden6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Fredriksberg3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Fritsla3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Furudal3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gallivare6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Garpenberg_Kuppgarden3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gavle_Skogmur6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gnarp3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gnesta4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gnosjo_Marieholm3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Goteborg_Brudaremossen7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Goteborg_Slattadamm7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gullbrandstorp3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gunnarsbo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Gusum3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hagfors_Varmullsasen6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hallaryd3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hallbo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Halmstad_Hamnen4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Halmstad_Oskarstrom6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Harnosand_Harnon6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hassela3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Havdhem7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hedemora3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Helsingborg_Olympia7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hennan3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hestra_Aspas3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hjo_Grevback3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hofors6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hogfors3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hogsby_Virstad4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Holsbybrunn_Holsbyholm3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Horby_Sallerup9
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Horken3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hudiksvall_Forsa6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Hudiksvall_Galgberget4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Huskvarna3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Idre3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ingatorp3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ingvallsbenning3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Irevik4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Jamjo4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Jarnforsen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Jarvso3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Jokkmokk_Tjalmejaure6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Jonkoping_Bondberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kalix6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Karbole3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Karlsborg_Vaberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Karlshamn6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Karlskrona_Vamo6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Karlstad_Sormon9
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kaxholmen_Vistakulle3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kinnastrom3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kiruna_Kirunavaara6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kisa7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Knared3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kopmanholmen6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kopparberg4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kramfors_Lugnvik6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kristinehamn_Utsiktsberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kungsater3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Kungsberget_GI3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Langshyttan3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Langshyttan_Engelsfors3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Leksand_Karingberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lerdala3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lilltjara_Digerberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Limedsforsen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lindshammar_Ramkvilla3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Linkoping_Vattentornet7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ljugarn4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Loffstrand6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lonneberga4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lorstrand3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ludvika_Bjorkasen4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lumsheden_Trekanten3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Lycksele_Knaften6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Mahult3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Malmo_Jagersro7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Malung4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Mariannelund3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Markaryd_Hualtet4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Matfors6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Molndal_Vasterberget7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Mora_Eldris6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Motala_Ervasteby7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Mullsjo_Torestorp4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Nassjo6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Navekvarn3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Norrahammar3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Norrkoping_Krokek7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Norrtalje_Sodra_Bergen7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Nykoping3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Orebro_Lockhyttan7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ornskoldsvik_As7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Oskarshamn6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ostersund_Brattasen7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Osthammar_Valo7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Overkalix6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Oxberg3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Pajala6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Paulistom3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Rattvik3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Rengsjo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Rorbacksnas3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sagmyra3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Salen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Salfjallet3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sarna_Mickeltemplet3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Satila3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Saxdalen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Siljansnas_Uvberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Skarstad3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Skattungbyn3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Skelleftea7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Skene_Nycklarberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Skovde7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Smedjebacken_Uvberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Soderhamn4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Soderkoping4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sodertalje_Ragnhildsborg8
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Solleftea_Hallsta6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Solleftea_Multra6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sorsjon3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Stockholm_Marieberg7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Stockholm_Nacka8
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Stora_Skedvi3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Storfjaten3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Storuman6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Stromstad7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Styrsjobo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sundborn3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sundsbruk6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sundsvall_S_Stadsberget7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sunne_Blabarskullen6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Svartnas3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Sveg_Brickan6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Taberg3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tandadalen3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tasjo6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tollsjo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Torsby_Bada6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tranas_Bredkarr4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tranemo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Transtrand_Bolheden4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Traryd_Betas4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Trollhattan7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Trosa4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Tystberga3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Uddevalla_Herrestad7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ullared3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ulricehamn4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ulvshyttan_Porjus3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Uppsala_Rickomberga3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Uppsala_Vedyxa7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vaddo_Elmsta4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Valdemarsvik4
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vannas_Granlundsberget6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vansbro_Hummelberget3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Varberg_Grimeton6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vasteras_Lillharad7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vastervik_Farhult6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vaxbo3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vessigebro3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vetlanda_Nye3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vikmanshyttan3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Virserum6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Visby_Follingbo7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Visby_Hamnen7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Visingso3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Vislanda_Nydala6
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Voxna3
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Ystad_Metallgatan7
-rw-r--r--dvb-apps/util/scan/dvb-t/se-Yttermalung3
-rw-r--r--dvb-apps/util/scan/dvb-t/si-Ljubljana5
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-BanskaBystrica9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-BanskaStiavnica9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Bardejov9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Bratislava9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Cadca9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Detva9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Hnusta9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Kosice9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-KralovskyChlmec9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Krompachy9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Lucenec9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Medzev9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Namestovo9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Nitra9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Poprad10
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-PovazskaBystrica9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Presov9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Prievidza9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Revuca9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Roznava9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Ruzomberok9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Snina9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-StaraLubovna9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Sturovo9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Trencin9
-rw-r--r--dvb-apps/util/scan/dvb-t/sk-Zilina9
-rw-r--r--dvb-apps/util/scan/dvb-t/tw-Kaohsiung6
-rw-r--r--dvb-apps/util/scan/dvb-t/tw-Taipei7
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Aberdare15
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Angus10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BeaconHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Belmont10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Bilsdale10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BlackHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Blaenplwyf10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BluebellHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Bressay10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BrierleyHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BristolIlchesterCres10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BristolKingsWeston10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Bromsgrove10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-BrougherMountain10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Caldbeck10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-CaradonHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Carmel10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Chatton10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Chesterfield10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Craigkelly10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-CrystalPalace10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Darvel10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Divis10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Dover14
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Durris10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Eitshal10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-EmleyMoor10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Fenham10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Fenton10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Ferryside8
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Guildford10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Hannington10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Hastings10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Heathfield10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-HemelHempstead10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-HuntshawCross13
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Idle10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-KeelylangHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Keighley10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-KilveyHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-KnockMore10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Lancaster10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-LarkStoke10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Limavady10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Llanddona10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Malvern10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Mendip10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Midhurst10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Moel-y-Parc10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Nottingham10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-OliversMount10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Oxford10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-PendleForest10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Plympton10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-PontopPike10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Pontypool10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Presely10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Redruth13
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Reigate10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-RidgeHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Rosemarkie10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Rosneath10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Rowridge10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-RumsterForest10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Saddleworth10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Salisbury10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-SandyHeath10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Selkirk10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Sheffield10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-StocklandHill9
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Storeton13
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Sudbury12
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-SuttonColdfield10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Tacolneston10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-TheWrekin15
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Torosay10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-TunbridgeWells10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Waltham10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-Wenvoe10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-WhitehawkHill10
-rw-r--r--dvb-apps/util/scan/dvb-t/uk-WinterHill9
-rw-r--r--dvb-apps/util/scan/dvb-t/vn-Hanoi5
-rw-r--r--dvb-apps/util/scan/dvb-t/vn-Thaibinh5
-rw-r--r--dvb-apps/util/scan/list.h140
-rw-r--r--dvb-apps/util/scan/lnb.c109
-rw-r--r--dvb-apps/util/scan/lnb.h22
-rw-r--r--dvb-apps/util/scan/scan.c2753
-rw-r--r--dvb-apps/util/scan/scan.h28
-rw-r--r--dvb-apps/util/scan/section.c25
-rw-r--r--dvb-apps/util/scan/section.h14
-rw-r--r--dvb-apps/util/scan/section_generate.pl92
-rw-r--r--dvb-apps/util/szap/Makefile18
-rw-r--r--dvb-apps/util/szap/README52
-rw-r--r--dvb-apps/util/szap/azap.c404
-rwxr-xr-xdvb-apps/util/szap/channels-conf/atsc/make_atsc_chanconf.pl110
-rw-r--r--dvb-apps/util/szap/channels-conf/atsc/us-Raleigh-Durham8
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-c/de-Berlin171
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-s/Astra-19.2E226
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-s/Astra-28.2E522
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-s/BrasilSat-B3-84.0W39
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/au-Adelaide28
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/au-Brisbane29
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/au-Hobart18
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/au-Melbourne17
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/au-Sydney-NorthShore31
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/cz-Praha16
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Berlin47
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Braunschweig25
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Bremen25
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Koeln-Bonn23
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Leipzig7
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Luebeck22
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Rhein-Main6
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/de-Ruhrgebiet46
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/es-Alpicat19
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/es-Collserola19
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/es-Madrid26
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/es-Mussara19
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/uk-Crystal-Palace67
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/uk-Hannington28
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/uk-Oxford41
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/uk-Reigate51
-rw-r--r--dvb-apps/util/szap/channels-conf/dvb-t/uk-Sandy-Heath12
-rw-r--r--dvb-apps/util/szap/czap.c406
-rw-r--r--dvb-apps/util/szap/lnb.c101
-rw-r--r--dvb-apps/util/szap/lnb.h22
-rw-r--r--dvb-apps/util/szap/szap.c629
-rw-r--r--dvb-apps/util/szap/tzap.c708
-rw-r--r--dvb-apps/util/szap/util.c126
-rw-r--r--dvb-apps/util/szap/util.h24
-rw-r--r--dvb-apps/util/ttusb_dec_reset/Makefile19
-rw-r--r--dvb-apps/util/ttusb_dec_reset/README28
-rw-r--r--dvb-apps/util/ttusb_dec_reset/ttusb_dec_reset.c55
-rw-r--r--dvb-apps/util/zap/Makefile20
-rw-r--r--dvb-apps/util/zap/zap.c226
-rw-r--r--dvb-apps/util/zap/zap_ca.c198
-rw-r--r--dvb-apps/util/zap/zap_ca.h37
-rw-r--r--dvb-apps/util/zap/zap_dvb.c353
-rw-r--r--dvb-apps/util/zap/zap_dvb.h41
1390 files changed, 116266 insertions, 0 deletions
diff --git a/dvb-apps/COPYING b/dvb-apps/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/dvb-apps/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/dvb-apps/COPYING.LGPL b/dvb-apps/COPYING.LGPL
new file mode 100644
index 0000000..9c6a6cc
--- /dev/null
+++ b/dvb-apps/COPYING.LGPL
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/dvb-apps/INSTALL b/dvb-apps/INSTALL
new file mode 100644
index 0000000..27a11a0
--- /dev/null
+++ b/dvb-apps/INSTALL
@@ -0,0 +1,26 @@
+Requirements:
+
+For ttusb_dec_reset, you will need libusb.
+
+Building:
+
+Simply type
+$ make
+
+Build options
+ static=1 - Build all applications statically.
+ V=1 - Verbose output during build.
+ ttusb_dec_reset=1 - Build the optional ttusb_dec_reset.
+
+Installing:
+
+Install libraries and utils to /usr/[bin,include,lib,share]
+$ make install
+
+Install options
+ prefix=<...> - basic installation dir [default: /usr]
+ bindir=<...> - installation dir for applications [default: $(prefix)/bin]
+ includedir=<...> - installation dir for include files [default: $(prefix)/include]
+ libdir=<...> - installation dir for applications [default: $(prefix)/lib]
+ sharedir=<...> - installation dir for shared data [default: $(prefix)/share]
+ DESTDIR=<...> - prefix for all files, useful for packaging
diff --git a/dvb-apps/Make.rules b/dvb-apps/Make.rules
new file mode 100644
index 0000000..3410d7b
--- /dev/null
+++ b/dvb-apps/Make.rules
@@ -0,0 +1,104 @@
+# build rules for linuxtv.org dvb-apps
+
+CFLAGS ?= -g -Wall -W -Wshadow -Wpointer-arith -Wstrict-prototypes
+
+ifneq ($(lib_name),)
+
+# additional rules for libraries
+
+CFLAGS_LIB ?= -fPIC
+CFLAGS += $(CFLAGS_LIB)
+
+libraries = $(lib_name).so $(lib_name).a
+
+.PHONY: library
+
+library: $(libraries)
+
+$(libraries): $(objects)
+
+endif
+
+prerequisites = $(subst .o,.d,$(objects)) $(addsuffix .d,$(binaries))
+
+.PHONY: clean install
+
+ifeq ($(static),1)
+LDFLAGS += -static
+endif
+
+prefix ?= /usr
+
+bindir ?= $(prefix)/bin
+includedir ?= $(prefix)/include
+libdir ?= $(prefix)/lib
+sharedir ?= $(prefix)/share
+
+ifneq ($(DESTDIR),)
+DESTDIR := $(DESTDIR)/
+endif
+
+ifeq ($(V),1)
+%.o: %.c
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -MMD -o $@ $< $(filter-out %.h %.c,$^)
+%: %.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
+%: %.c
+ $(CC) $(CPPFLAGS) $(CFLAGS) -MMD $(LDFLAGS) -o $@ $< $(filter-out %.h %.c,$^) $(LOADLIBES) $(LDLIBS)
+%.so:
+ $(CC) -shared -o $@ $^
+%.a:
+ $(AR) rcs $@ $^
+clean::
+ $(RM) -f $(prerequisites) $(objects) $(libraries) $(binaries) $(removing) *~
+install::
+ifneq ($(includes),)
+ mkdir -p $(DESTDIR)$(includedir)/$(lib_name)
+ install -m 644 $(includes) $(DESTDIR)$(includedir)/$(lib_name)/
+endif
+ifneq ($(libraries),)
+ mkdir -p $(DESTDIR)$(libdir)
+ install -m 644 $(libraries) $(DESTDIR)$(libdir)/
+endif
+ifneq ($(inst_bin),)
+ mkdir -p $(DESTDIR)$(bindir)
+ install -m 755 $(inst_bin) $(DESTDIR)$(bindir)/
+endif
+else
+%.o: %.c
+ @echo CC $@
+ @$(CC) -c $(CPPFLAGS) $(CFLAGS) -MMD -o $@ $< $(filter-out %.h %.c,$^)
+%: %.o
+ @echo CC $@
+ @$(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
+%: %.c
+ @echo CC $@
+ @$(CC) $(CPPFLAGS) $(CFLAGS) -MMD $(LDFLAGS) -o $@ $< $(filter-out %.h %.c,$^) $(LOADLIBES) $(LDLIBS)
+%.so:
+ @echo CC $@
+ @$(CC) -shared -o $@ $^
+%.a:
+ @echo AR $@
+ @$(AR) rcs $@ $^
+clean::
+ @echo cleaning
+ @$(RM) -f $(prerequisites) $(objects) $(libraries) $(binaries) $(removing) *~
+install::
+ifneq ($(includes),)
+ @echo installing headers
+ @mkdir -p $(DESTDIR)$(includedir)/$(lib_name)
+ @install -m 644 $(includes) $(DESTDIR)$(includedir)/$(lib_name)/
+endif
+ifneq ($(libraries),)
+ @echo installing libraries
+ @mkdir -p $(DESTDIR)$(libdir)
+ @install -m 644 $(libraries) $(DESTDIR)$(libdir)/
+endif
+ifneq ($(inst_bin),)
+ @echo installing binaries
+ @mkdir -p $(DESTDIR)$(bindir)
+ @install -m 755 $(inst_bin) $(DESTDIR)$(bindir)/
+endif
+endif
+
+-include $(prerequisites)
diff --git a/dvb-apps/Makefile b/dvb-apps/Makefile
new file mode 100644
index 0000000..0ca84b0
--- /dev/null
+++ b/dvb-apps/Makefile
@@ -0,0 +1,12 @@
+# Makefile for linuxtv.org dvb-apps
+
+.PHONY: all clean install update
+
+all clean install:
+ $(MAKE) -C lib $@
+ $(MAKE) -C test $@
+ $(MAKE) -C util $@
+
+update:
+ @echo "Pulling changes & updating from master repository"
+ hg pull -u
diff --git a/dvb-apps/README b/dvb-apps/README
new file mode 100644
index 0000000..0870a66
--- /dev/null
+++ b/dvb-apps/README
@@ -0,0 +1,47 @@
+linuxtv-dvb-apps-1.?
+======================
+
+Linux DVB API applications and utilities.
+
+All applications support the DVB-S, DVB-C, DVB-T, and ATSC standards.
+
+Main User Applications:
+util/scan - Scan for channels on your digital TV device.
+util/gnutv - Tune, watch and stream your TV.
+
+General Utilities:
+util/dvbdate - Set your clock from digital TV.
+util/dvbnet - Control digital data network interfaces.
+util/dvbtraffic - Monitor traffic on a digital device.
+util/femon - Monitor the tuning on a digital TV device.
+util/zap - *Just* tunes a digital device - really intended for developers.
+util/gotox - Simple Rotor control utility
+util/alevt - Teletext capture and display utility
+
+Hardware Specific Utilities:
+util/av7110_loadkeys - Load remote keys into an av7110 based card
+util/dib3000-watch - Monitor DIB3000 demodulators
+util/dst-utils - Utilities for DST based cards.
+util/ttusb_dec_reset - Reset a TechnoTrends TTUSB DEC device.
+
+Libraries:
+lib/libdvbapi - Interface library to digital TV devices.
+lib/libdvbcfg - Library to parse/create digital TV channel configuration files.
+lib/libdvbsec - Library for Satellite Equipment Control operations.
+lib/libucsi - Fast MPEG2 Transport Stream SI table parsing library.
+lib/libdvben50221- Complete implementation of a Cenelec EN 50221 CAM stack.
+lib/libdvbmisc - Miscellaneous utilities used by the other libraries.
+
+Various testing applications also live in test.
+
+For convenience, dvb-apps contains a copy of the DVB API include
+files as they are contained in the linuxtv-dvb-1.? release
+and the 2.6.x Linux kernel.
+
+AleVT is not compiled by the main Makefile, because it depends on external
+libraries which might not be available in your system (see util/alevt/README for
+details). If you have the required libraries, to compile AleVT go to util/alevt/
+and type "make".
+
+Johannes Stezenbach <js@convergence.de>
+Andrew de Quincey <adq_dvb@lidskialf.net>
diff --git a/dvb-apps/include/audio.h b/dvb-apps/include/audio.h
new file mode 100644
index 0000000..89412e1
--- /dev/null
+++ b/dvb-apps/include/audio.h
@@ -0,0 +1,140 @@
+/*
+ * audio.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBAUDIO_H_
+#define _DVBAUDIO_H_
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
+
+typedef enum {
+ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
+ AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */
+} audio_stream_source_t;
+
+
+typedef enum {
+ AUDIO_STOPPED, /* Device is stopped */
+ AUDIO_PLAYING, /* Device is currently playing */
+ AUDIO_PAUSED /* Device is paused */
+} audio_play_state_t;
+
+
+typedef enum {
+ AUDIO_STEREO,
+ AUDIO_MONO_LEFT,
+ AUDIO_MONO_RIGHT,
+ AUDIO_MONO,
+ AUDIO_STEREO_SWAPPED
+} audio_channel_select_t;
+
+
+typedef struct audio_mixer {
+ unsigned int volume_left;
+ unsigned int volume_right;
+ // what else do we need? bass, pass-through, ...
+} audio_mixer_t;
+
+
+typedef struct audio_status {
+ int AV_sync_state; /* sync audio and video? */
+ int mute_state; /* audio is muted */
+ audio_play_state_t play_state; /* current playback state */
+ audio_stream_source_t stream_source; /* current stream source */
+ audio_channel_select_t channel_select; /* currently selected channel */
+ int bypass_mode; /* pass on audio data to */
+ audio_mixer_t mixer_state; /* current mixer state */
+} audio_status_t; /* separate decoder hardware */
+
+
+typedef
+struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */
+ int vocal1; /* into left and right t at 70% each */
+ int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
+ int melody; /* mixed into the left channel and */
+ /* Vocal2 into the right channel at 100% each. */
+ /* if Melody is non-zero, the melody channel gets mixed*/
+} audio_karaoke_t; /* into left and right */
+
+
+typedef uint16_t audio_attributes_t;
+/* bits: descr. */
+/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */
+/* 12 multichannel extension */
+/* 11-10 audio type (0=not spec, 1=language included) */
+/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */
+/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */
+/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */
+/* 2- 0 number of audio channels (n+1 channels) */
+
+
+/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */
+#define AUDIO_CAP_DTS 1
+#define AUDIO_CAP_LPCM 2
+#define AUDIO_CAP_MP1 4
+#define AUDIO_CAP_MP2 8
+#define AUDIO_CAP_MP3 16
+#define AUDIO_CAP_AAC 32
+#define AUDIO_CAP_OGG 64
+#define AUDIO_CAP_SDDS 128
+#define AUDIO_CAP_AC3 256
+
+#define AUDIO_STOP _IO('o', 1)
+#define AUDIO_PLAY _IO('o', 2)
+#define AUDIO_PAUSE _IO('o', 3)
+#define AUDIO_CONTINUE _IO('o', 4)
+#define AUDIO_SELECT_SOURCE _IO('o', 5)
+#define AUDIO_SET_MUTE _IO('o', 6)
+#define AUDIO_SET_AV_SYNC _IO('o', 7)
+#define AUDIO_SET_BYPASS_MODE _IO('o', 8)
+#define AUDIO_CHANNEL_SELECT _IO('o', 9)
+#define AUDIO_GET_STATUS _IOR('o', 10, audio_status_t)
+
+#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int)
+#define AUDIO_CLEAR_BUFFER _IO('o', 12)
+#define AUDIO_SET_ID _IO('o', 13)
+#define AUDIO_SET_MIXER _IOW('o', 14, audio_mixer_t)
+#define AUDIO_SET_STREAMTYPE _IO('o', 15)
+#define AUDIO_SET_EXT_ID _IO('o', 16)
+#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t)
+#define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t)
+
+/**
+ * AUDIO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define AUDIO_GET_PTS _IOR('o', 19, __u64)
+#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
+
+#endif /* _DVBAUDIO_H_ */
diff --git a/dvb-apps/include/ca.h b/dvb-apps/include/ca.h
new file mode 100644
index 0000000..c18537f
--- /dev/null
+++ b/dvb-apps/include/ca.h
@@ -0,0 +1,90 @@
+/*
+ * ca.h
+ *
+ * Copyright (C) 2000 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBCA_H_
+#define _DVBCA_H_
+
+/* slot interface types and info */
+
+typedef struct ca_slot_info {
+ int num; /* slot number */
+
+ int type; /* CA interface this slot supports */
+#define CA_CI 1 /* CI high level interface */
+#define CA_CI_LINK 2 /* CI link layer level interface */
+#define CA_CI_PHYS 4 /* CI physical layer level interface */
+#define CA_DESCR 8 /* built-in descrambler */
+#define CA_SC 128 /* simple smart card interface */
+
+ unsigned int flags;
+#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
+#define CA_CI_MODULE_READY 2
+} ca_slot_info_t;
+
+
+/* descrambler types and info */
+
+typedef struct ca_descr_info {
+ unsigned int num; /* number of available descramblers (keys) */
+ unsigned int type; /* type of supported scrambling system */
+#define CA_ECD 1
+#define CA_NDS 2
+#define CA_DSS 4
+} ca_descr_info_t;
+
+typedef struct ca_caps {
+ unsigned int slot_num; /* total number of CA card and module slots */
+ unsigned int slot_type; /* OR of all supported types */
+ unsigned int descr_num; /* total number of descrambler slots (keys) */
+ unsigned int descr_type; /* OR of all supported types */
+} ca_caps_t;
+
+/* a message to/from a CI-CAM */
+typedef struct ca_msg {
+ unsigned int index;
+ unsigned int type;
+ unsigned int length;
+ unsigned char msg[256];
+} ca_msg_t;
+
+typedef struct ca_descr {
+ unsigned int index;
+ unsigned int parity; /* 0 == even, 1 == odd */
+ unsigned char cw[8];
+} ca_descr_t;
+
+typedef struct ca_pid {
+ unsigned int pid;
+ int index; /* -1 == disable*/
+} ca_pid_t;
+
+#define CA_RESET _IO('o', 128)
+#define CA_GET_CAP _IOR('o', 129, ca_caps_t)
+#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t)
+#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t)
+#define CA_GET_MSG _IOR('o', 132, ca_msg_t)
+#define CA_SEND_MSG _IOW('o', 133, ca_msg_t)
+#define CA_SET_DESCR _IOW('o', 134, ca_descr_t)
+#define CA_SET_PID _IOW('o', 135, ca_pid_t)
+
+#endif
diff --git a/dvb-apps/include/dmx.h b/dvb-apps/include/dmx.h
new file mode 100644
index 0000000..c6a2353
--- /dev/null
+++ b/dvb-apps/include/dmx.h
@@ -0,0 +1,154 @@
+/*
+ * dmx.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBDMX_H_
+#define _DVBDMX_H_
+
+#include <asm/types.h>
+#ifdef __KERNEL__
+#include <linux/time.h>
+#else
+#include <time.h>
+#endif
+
+
+#define DMX_FILTER_SIZE 16
+
+typedef enum
+{
+ DMX_OUT_DECODER, /* Streaming directly to decoder. */
+ DMX_OUT_TAP, /* Output going to a memory buffer */
+ /* (to be retrieved via the read command).*/
+ DMX_OUT_TS_TAP /* Output multiplexed into a new TS */
+ /* (to be retrieved by reading from the */
+ /* logical DVR device). */
+} dmx_output_t;
+
+
+typedef enum
+{
+ DMX_IN_FRONTEND, /* Input from a front-end device. */
+ DMX_IN_DVR /* Input from the logical DVR device. */
+} dmx_input_t;
+
+
+typedef enum
+{
+ DMX_PES_AUDIO0,
+ DMX_PES_VIDEO0,
+ DMX_PES_TELETEXT0,
+ DMX_PES_SUBTITLE0,
+ DMX_PES_PCR0,
+
+ DMX_PES_AUDIO1,
+ DMX_PES_VIDEO1,
+ DMX_PES_TELETEXT1,
+ DMX_PES_SUBTITLE1,
+ DMX_PES_PCR1,
+
+ DMX_PES_AUDIO2,
+ DMX_PES_VIDEO2,
+ DMX_PES_TELETEXT2,
+ DMX_PES_SUBTITLE2,
+ DMX_PES_PCR2,
+
+ DMX_PES_AUDIO3,
+ DMX_PES_VIDEO3,
+ DMX_PES_TELETEXT3,
+ DMX_PES_SUBTITLE3,
+ DMX_PES_PCR3,
+
+ DMX_PES_OTHER
+} dmx_pes_type_t;
+
+#define DMX_PES_AUDIO DMX_PES_AUDIO0
+#define DMX_PES_VIDEO DMX_PES_VIDEO0
+#define DMX_PES_TELETEXT DMX_PES_TELETEXT0
+#define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0
+#define DMX_PES_PCR DMX_PES_PCR0
+
+
+typedef struct dmx_filter
+{
+ __u8 filter[DMX_FILTER_SIZE];
+ __u8 mask[DMX_FILTER_SIZE];
+ __u8 mode[DMX_FILTER_SIZE];
+} dmx_filter_t;
+
+
+struct dmx_sct_filter_params
+{
+ __u16 pid;
+ dmx_filter_t filter;
+ __u32 timeout;
+ __u32 flags;
+#define DMX_CHECK_CRC 1
+#define DMX_ONESHOT 2
+#define DMX_IMMEDIATE_START 4
+#define DMX_KERNEL_CLIENT 0x8000
+};
+
+
+struct dmx_pes_filter_params
+{
+ __u16 pid;
+ dmx_input_t input;
+ dmx_output_t output;
+ dmx_pes_type_t pes_type;
+ __u32 flags;
+};
+
+typedef struct dmx_caps {
+ __u32 caps;
+ int num_decoders;
+} dmx_caps_t;
+
+typedef enum {
+ DMX_SOURCE_FRONT0 = 0,
+ DMX_SOURCE_FRONT1,
+ DMX_SOURCE_FRONT2,
+ DMX_SOURCE_FRONT3,
+ DMX_SOURCE_DVR0 = 16,
+ DMX_SOURCE_DVR1,
+ DMX_SOURCE_DVR2,
+ DMX_SOURCE_DVR3
+} dmx_source_t;
+
+struct dmx_stc {
+ unsigned int num; /* input : which STC? 0..N */
+ unsigned int base; /* output: divisor for stc to get 90 kHz clock */
+ __u64 stc; /* output: stc in 'base'*90 kHz units */
+};
+
+
+#define DMX_START _IO('o', 41)
+#define DMX_STOP _IO('o', 42)
+#define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
+#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
+#define DMX_SET_BUFFER_SIZE _IO('o', 45)
+#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
+#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
+#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
+#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
+
+#endif /*_DVBDMX_H_*/
diff --git a/dvb-apps/include/frontend.h b/dvb-apps/include/frontend.h
new file mode 100644
index 0000000..71abc24
--- /dev/null
+++ b/dvb-apps/include/frontend.h
@@ -0,0 +1,648 @@
+/*
+ * frontend.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * Ralph Metzler <ralph@convergence.de>
+ * Holger Waechtler <holger@convergence.de>
+ * Andre Draszik <ad@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * Copyright (C) Manu Abraham <abraham.manu@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBFRONTEND_H_
+#define _DVBFRONTEND_H_
+
+#include <asm/types.h>
+
+
+typedef enum fe_type {
+ FE_QPSK,
+ FE_QAM,
+ FE_OFDM,
+ FE_ATSC
+} fe_type_t;
+
+
+typedef enum fe_caps {
+ FE_IS_STUPID = 0,
+ FE_CAN_INVERSION_AUTO = 0x1,
+ FE_CAN_FEC_1_2 = 0x2,
+ FE_CAN_FEC_2_3 = 0x4,
+ FE_CAN_FEC_3_4 = 0x8,
+ FE_CAN_FEC_4_5 = 0x10,
+ FE_CAN_FEC_5_6 = 0x20,
+ FE_CAN_FEC_6_7 = 0x40,
+ FE_CAN_FEC_7_8 = 0x80,
+ FE_CAN_FEC_8_9 = 0x100,
+ FE_CAN_FEC_AUTO = 0x200,
+ FE_CAN_QPSK = 0x400,
+ FE_CAN_QAM_16 = 0x800,
+ FE_CAN_QAM_32 = 0x1000,
+ FE_CAN_QAM_64 = 0x2000,
+ FE_CAN_QAM_128 = 0x4000,
+ FE_CAN_QAM_256 = 0x8000,
+ FE_CAN_QAM_AUTO = 0x10000,
+ FE_CAN_TRANSMISSION_MODE_AUTO = 0x20000,
+ FE_CAN_BANDWIDTH_AUTO = 0x40000,
+ FE_CAN_GUARD_INTERVAL_AUTO = 0x80000,
+ FE_CAN_HIERARCHY_AUTO = 0x100000,
+ FE_CAN_8VSB = 0x200000,
+ FE_CAN_16VSB = 0x400000,
+ FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending)
+ FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
+ FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output
+} fe_caps_t;
+
+
+struct dvb_frontend_info {
+ char name[128];
+ fe_type_t type;
+ __u32 frequency_min;
+ __u32 frequency_max;
+ __u32 frequency_stepsize;
+ __u32 frequency_tolerance;
+ __u32 symbol_rate_min;
+ __u32 symbol_rate_max;
+ __u32 symbol_rate_tolerance; /* ppm */
+ __u32 notifier_delay; /* DEPRECATED */
+ fe_caps_t caps;
+};
+
+
+/**
+ * Check out the DiSEqC bus spec available on http://www.eutelsat.org/ for
+ * the meaning of this struct...
+ */
+struct dvb_diseqc_master_cmd {
+ __u8 msg [6]; /* { framing, address, command, data [3] } */
+ __u8 msg_len; /* valid values are 3...6 */
+};
+
+
+struct dvb_diseqc_slave_reply {
+ __u8 msg [4]; /* { framing, data [3] } */
+ __u8 msg_len; /* valid values are 0...4, 0 means no msg */
+ int timeout; /* return from ioctl after timeout ms with */
+}; /* errorcode when no message was received */
+
+
+typedef enum fe_sec_voltage {
+ SEC_VOLTAGE_13,
+ SEC_VOLTAGE_18,
+ SEC_VOLTAGE_OFF
+} fe_sec_voltage_t;
+
+
+typedef enum fe_sec_tone_mode {
+ SEC_TONE_ON,
+ SEC_TONE_OFF
+} fe_sec_tone_mode_t;
+
+
+typedef enum fe_sec_mini_cmd {
+ SEC_MINI_A,
+ SEC_MINI_B
+} fe_sec_mini_cmd_t;
+
+
+typedef enum fe_status {
+ FE_HAS_SIGNAL = 0x01, /* found something above the noise level */
+ FE_HAS_CARRIER = 0x02, /* found a DVB signal */
+ FE_HAS_VITERBI = 0x04, /* FEC is stable */
+ FE_HAS_SYNC = 0x08, /* found sync bytes */
+ FE_HAS_LOCK = 0x10, /* everything's working... */
+ FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */
+ FE_REINIT = 0x40 /* frontend was reinitialized, */
+} fe_status_t; /* application is recommended to reset */
+ /* DiSEqC, tone and parameters */
+
+typedef enum fe_spectral_inversion {
+ INVERSION_OFF,
+ INVERSION_ON,
+ INVERSION_AUTO
+} fe_spectral_inversion_t;
+
+
+typedef enum fe_code_rate {
+ FEC_NONE = 0,
+ FEC_1_2,
+ FEC_2_3,
+ FEC_3_4,
+ FEC_4_5,
+ FEC_5_6,
+ FEC_6_7,
+ FEC_7_8,
+ FEC_8_9,
+ FEC_AUTO
+} fe_code_rate_t;
+
+
+typedef enum fe_modulation {
+ QPSK,
+ QAM_16,
+ QAM_32,
+ QAM_64,
+ QAM_128,
+ QAM_256,
+ QAM_AUTO,
+ VSB_8,
+ VSB_16
+} fe_modulation_t;
+
+typedef enum fe_transmit_mode {
+ TRANSMISSION_MODE_2K,
+ TRANSMISSION_MODE_8K,
+ TRANSMISSION_MODE_AUTO
+} fe_transmit_mode_t;
+
+typedef enum fe_bandwidth {
+ BANDWIDTH_8_MHZ,
+ BANDWIDTH_7_MHZ,
+ BANDWIDTH_6_MHZ,
+ BANDWIDTH_AUTO
+} fe_bandwidth_t;
+
+
+typedef enum fe_guard_interval {
+ GUARD_INTERVAL_1_32,
+ GUARD_INTERVAL_1_16,
+ GUARD_INTERVAL_1_8,
+ GUARD_INTERVAL_1_4,
+ GUARD_INTERVAL_AUTO
+} fe_guard_interval_t;
+
+
+typedef enum fe_hierarchy {
+ HIERARCHY_NONE,
+ HIERARCHY_1,
+ HIERARCHY_2,
+ HIERARCHY_4,
+ HIERARCHY_AUTO
+} fe_hierarchy_t;
+
+
+struct dvb_qpsk_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+};
+
+struct dvb_qam_parameters {
+ __u32 symbol_rate; /* symbol rate in Symbols per second */
+ fe_code_rate_t fec_inner; /* forward error correction (see above) */
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_vsb_parameters {
+ fe_modulation_t modulation; /* modulation type (see above) */
+};
+
+struct dvb_ofdm_parameters {
+ fe_bandwidth_t bandwidth;
+ fe_code_rate_t code_rate_HP; /* high priority stream code rate */
+ fe_code_rate_t code_rate_LP; /* low priority stream code rate */
+ fe_modulation_t constellation; /* modulation type (see above) */
+ fe_transmit_mode_t transmission_mode;
+ fe_guard_interval_t guard_interval;
+ fe_hierarchy_t hierarchy_information;
+};
+
+
+struct dvb_frontend_parameters {
+ __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */
+ /* intermediate frequency in kHz for QPSK */
+ fe_spectral_inversion_t inversion;
+ union {
+ struct dvb_qpsk_parameters qpsk;
+ struct dvb_qam_parameters qam;
+ struct dvb_ofdm_parameters ofdm;
+ struct dvb_vsb_parameters vsb;
+ } u;
+};
+
+
+/**
+ * When set, this flag will disable any zigzagging or other "normal" tuning
+ * behaviour. Additionally, there will be no automatic monitoring of the lock
+ * status, and hence no frontend events will be generated. If a frontend device
+ * is closed, this flag will be automatically turned off when the device is
+ * reopened read-write.
+ */
+#define FE_TUNE_MODE_ONESHOT 0x01
+
+
+#define FE_GET_INFO _IOR('o', 61, struct dvb_frontend_info)
+
+#define FE_DISEQC_RESET_OVERLOAD _IO('o', 62)
+#define FE_DISEQC_SEND_MASTER_CMD _IOW('o', 63, struct dvb_diseqc_master_cmd)
+#define FE_DISEQC_RECV_SLAVE_REPLY _IOR('o', 64, struct dvb_diseqc_slave_reply)
+#define FE_DISEQC_SEND_BURST _IO('o', 65) /* fe_sec_mini_cmd_t */
+
+#define FE_SET_TONE _IO('o', 66) /* fe_sec_tone_mode_t */
+#define FE_SET_VOLTAGE _IO('o', 67) /* fe_sec_voltage_t */
+#define FE_ENABLE_HIGH_LNB_VOLTAGE _IO('o', 68) /* int */
+
+#define FE_READ_STATUS _IOR('o', 69, fe_status_t)
+#define FE_READ_BER _IOR('o', 70, __u32)
+#define FE_READ_SIGNAL_STRENGTH _IOR('o', 71, __u16)
+#define FE_READ_SNR _IOR('o', 72, __u16)
+#define FE_READ_UNCORRECTED_BLOCKS _IOR('o', 73, __u32)
+
+#define FE_SET_FRONTEND _IOW('o', 76, struct dvb_frontend_parameters)
+#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
+#define FE_SET_FRONTEND_TUNE_MODE _IO('o', 81) /* unsigned int */
+
+#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
+
+/*
+ * References:
+ * DVB-S : EN 300 421
+ * DVB-S2: EN 302 307, TR 102 376, EN 301 210
+ * DVB-C : EN 300 429
+ * DVB-T : EN 300 744
+ * DVB-H : EN 300 304
+ * ATSC : A/53A
+ */
+
+/*
+ * Delivery Systems
+ * needs to set/queried for multistandard frontends
+ */
+enum dvbfe_delsys {
+ DVBFE_DELSYS_DVBS = (1 << 0),
+ DVBFE_DELSYS_DSS = (1 << 1),
+ DVBFE_DELSYS_DVBS2 = (1 << 2),
+ DVBFE_DELSYS_DVBC = (1 << 3),
+ DVBFE_DELSYS_DVBT = (1 << 4),
+ DVBFE_DELSYS_DVBH = (1 << 5),
+ DVBFE_DELSYS_ATSC = (1 << 6),
+ DVBFE_DELSYS_DUMMY = (1 << 31)
+};
+#define DVBFE_GET_DELSYS _IOR('o', 82, enum dvbfe_delsys)
+#define DVBFE_SET_DELSYS _IOW('o', 87, enum dvbfe_delsys)
+
+/* Modulation types */
+enum dvbfe_modulation {
+ DVBFE_MOD_NONE = (0 << 0),
+ DVBFE_MOD_BPSK = (1 << 0),
+ DVBFE_MOD_QPSK = (1 << 1),
+ DVBFE_MOD_OQPSK = (1 << 2),
+ DVBFE_MOD_8PSK = (1 << 3),
+ DVBFE_MOD_16APSK = (1 << 4),
+ DVBFE_MOD_32APSK = (1 << 5),
+ DVBFE_MOD_QAM4 = (1 << 6),
+ DVBFE_MOD_QAM16 = (1 << 7),
+ DVBFE_MOD_QAM32 = (1 << 8),
+ DVBFE_MOD_QAM64 = (1 << 9),
+ DVBFE_MOD_QAM128 = (1 << 10),
+ DVBFE_MOD_QAM256 = (1 << 11),
+ DVBFE_MOD_QAM512 = (1 << 12),
+ DVBFE_MOD_QAM1024 = (1 << 13),
+ DVBFE_MOD_QAMAUTO = (1 << 14),
+ DVBFE_MOD_OFDM = (1 << 15),
+ DVBFE_MOD_COFDM = (1 << 16),
+ DVBFE_MOD_VSB8 = (1 << 17),
+ DVBFE_MOD_VSB16 = (1 << 18),
+ DVBFE_MOD_AUTO = (1 << 31)
+};
+
+/*
+ * Convolution Code Rate (Viterbi Inner Code Rate)
+ * DVB-S2 uses LDPC. Information on LDPC can be found at
+ * http://www.ldpc-codes.com
+ */
+enum dvbfe_fec {
+ DVBFE_FEC_NONE = (0 << 0),
+ DVBFE_FEC_1_4 = (1 << 0),
+ DVBFE_FEC_1_3 = (1 << 1),
+ DVBFE_FEC_2_5 = (1 << 2),
+ DVBFE_FEC_1_2 = (1 << 3),
+ DVBFE_FEC_3_5 = (1 << 4),
+ DVBFE_FEC_2_3 = (1 << 5),
+ DVBFE_FEC_3_4 = (1 << 6),
+ DVBFE_FEC_4_5 = (1 << 7),
+ DVBFE_FEC_5_6 = (1 << 8),
+ DVBFE_FEC_6_7 = (1 << 9),
+ DVBFE_FEC_7_8 = (1 << 10),
+ DVBFE_FEC_8_9 = (1 << 11),
+ DVBFE_FEC_9_10 = (1 << 12),
+ DVBFE_FEC_AUTO = (1 << 31)
+};
+
+/* Frontend Inversion (I/Q Swap) */
+enum dvbfe_inversion {
+ DVBFE_INVERSION_OFF = 0,
+ DVBFE_INVERSION_ON = 1,
+ DVBFE_INVERSION_AUTO = 2
+};
+
+/* DVB-S parameters */
+struct dvbs_params {
+ __u32 symbol_rate;
+
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+};
+
+/* DSS parameters */
+struct dss_params {
+ __u32 symbol_rate;
+
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+};
+
+/*
+ * Rolloff Rate (Nyquist Filter Rolloff)
+ * NOTE: DVB-S2 has rates of 0.20, 0.25, 0.35
+ * Values are x100
+ * Applies to DVB-S2
+ */
+enum dvbfe_rolloff {
+ DVBFE_ROLLOFF_35 = 0,
+ DVBFE_ROLLOFF_25 = 1,
+ DVBFE_ROLLOFF_20 = 2,
+ DVBFE_ROLLOFF_UNKNOWN = 3
+};
+
+/* DVB-S2 parameters */
+struct dvbs2_params {
+ __u32 symbol_rate;
+
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+
+ /* Informational fields only */
+ enum dvbfe_rolloff rolloff;
+
+ __u8 matype_1;
+ __u8 matype_2;
+ __u8 upl_1;
+ __u8 upl_2;
+ __u8 dfl_1;
+ __u8 dfl_2;
+ __u8 sync;
+ __u8 syncd_1;
+ __u8 syncd_2;
+
+ __u8 pad[32];
+};
+
+/* DVB-C parameters */
+struct dvbc_params {
+ __u32 symbol_rate;
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+};
+
+/* DVB-T Channel bandwidth */
+enum dvbfe_bandwidth {
+ DVBFE_BANDWIDTH_8_MHZ = (1 << 0),
+ DVBFE_BANDWIDTH_7_MHZ = (1 << 1),
+ DVBFE_BANDWIDTH_6_MHZ = (1 << 2),
+ DVBFE_BANDWIDTH_5_MHZ = (1 << 3),
+ DVBFE_BANDWIDTH_AUTO = (1 << 31)
+};
+
+/* DVB-T/DVB-H transmission mode */
+enum dvbfe_transmission_mode {
+ DVBFE_TRANSMISSION_MODE_2K = (1 << 0),
+ DVBFE_TRANSMISSION_MODE_4K = (1 << 1),
+ DVBFE_TRANSMISSION_MODE_8K = (1 << 2),
+ DVBFE_TRANSMISSION_MODE_AUTO = (1 << 31)
+};
+
+/* DVB-T/DVB-H Guard interval */
+enum dvbfe_guard_interval {
+ DVBFE_GUARD_INTERVAL_1_32 = (1 << 1),
+ DVBFE_GUARD_INTERVAL_1_16 = (1 << 2),
+ DVBFE_GUARD_INTERVAL_1_8 = (1 << 3),
+ DVBFE_GUARD_INTERVAL_1_4 = (1 << 4),
+ DVBFE_GUARD_INTERVAL_AUTO = (1 << 31)
+};
+
+/* DVB-T/DVB-H Hierarchial modulation */
+enum dvbfe_hierarchy {
+ DVBFE_HIERARCHY_OFF = (1 << 0),
+ DVBFE_HIERARCHY_ON = (1 << 1),
+ DVBFE_HIERARCHY_AUTO = (1 << 2)
+};
+
+/* DVB-T/DVB-H Rolloff's */
+enum dvbfe_alpha {
+ DVBFE_ALPHA_1 = (1 << 0),
+ DVBFE_ALPHA_2 = (1 << 1),
+ DVBFE_ALPHA_4 = (1 << 2)
+};
+
+/* Stream priority (Hierachial coding) */
+enum dvbfe_stream_priority {
+ DVBFE_STREAM_PRIORITY_HP = (0 << 0),
+ DVBFE_STREAM_PRIORITY_LP = (1 << 0)
+};
+
+/* DVB-T parameters */
+struct dvbt_params {
+ enum dvbfe_modulation constellation;
+ enum dvbfe_bandwidth bandwidth;
+ enum dvbfe_fec code_rate_HP;
+ enum dvbfe_fec code_rate_LP;
+ enum dvbfe_transmission_mode transmission_mode;
+ enum dvbfe_guard_interval guard_interval;
+ enum dvbfe_hierarchy hierarchy;
+ enum dvbfe_alpha alpha;
+ enum dvbfe_stream_priority priority;
+
+ __u8 pad[32];
+};
+
+/* DVB-H Interleaver type */
+enum dvbfe_interleaver {
+ DVBFE_INTERLEAVER_NATIVE = (1 << 0),
+ DVBFE_INTERLEAVER_INDEPTH = (1 << 1),
+ DVBFE_INTERLEAVER_AUTO = (1 << 31)
+};
+
+/* DVB-H MPE-FEC Indicator */
+enum dvbfe_mpefec {
+ DVBFE_MPEFEC_OFF = (1 << 0),
+ DVBFE_MPEFEC_ON = (1 << 1)
+};
+
+/* DVB-H Timeslicing Indicator */
+enum dvbfe_timeslicing {
+ DVBFE_TIMESLICING_OFF = (1 << 0),
+ DVBFE_TIMESLICING_ON = (1 << 1)
+};
+
+/* DVB-H parameters */
+struct dvbh_params {
+ enum dvbfe_modulation constellation;
+ enum dvbfe_fec code_rate_HP;
+ enum dvbfe_fec code_rate_LP;
+ enum dvbfe_transmission_mode transmission_mode;
+ enum dvbfe_guard_interval guard_interval;
+ enum dvbfe_hierarchy hierarchy;
+ enum dvbfe_alpha alpha;
+ enum dvbfe_interleaver interleaver;
+ enum dvbfe_mpefec mpefec;
+ enum dvbfe_timeslicing timeslicing;
+ enum dvbfe_stream_priority priority;
+
+ __u32 bandwidth;
+ __u8 pad[32];
+};
+
+/* ATSC parameters */
+struct atsc_params {
+ enum dvbfe_modulation modulation;
+
+ __u8 pad[32];
+};
+
+/* DVB Frontend Tuning Parameters */
+struct dvbfe_params {
+ __u32 frequency;
+ enum fe_spectral_inversion inversion;
+ enum dvbfe_delsys delivery;
+
+ __u8 pad[32];
+
+ union {
+ struct dvbs_params dvbs;
+ struct dss_params dss;
+ struct dvbs2_params dvbs2;
+ struct dvbc_params dvbc;
+ struct dvbt_params dvbt;
+ struct dvbh_params dvbh;
+ struct atsc_params atsc;
+
+ __u8 pad[128];
+ } delsys;
+};
+#define DVBFE_SET_PARAMS _IOW('o', 83, struct dvbfe_params)
+#define DVBFE_GET_PARAMS _IOWR('o', 84, struct dvbfe_params)
+
+/* DVB-S capability bitfields */
+struct dvbfe_dvbs_info {
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+};
+
+/* DSS capability bitfields */
+struct dvbfe_dss_info {
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+};
+
+/* DVB-S2 capability bitfields */
+struct dvbfe_dvbs2_info {
+ enum dvbfe_modulation modulation;
+ enum dvbfe_fec fec;
+
+ __u8 pad[32];
+};
+
+/* DVB-C capability bitfields */
+struct dvbfe_dvbc_info {
+ enum dvbfe_modulation modulation;
+};
+
+/* DVB-T capability bitfields */
+struct dvbfe_dvbt_info {
+ enum dvbfe_modulation modulation;
+ enum dvbfe_stream_priority stream_priority;
+
+ __u8 pad[32];
+};
+
+/* DVB-H capability bitfields */
+struct dvbfe_dvbh_info {
+ enum dvbfe_modulation modulation;
+ enum dvbfe_stream_priority stream_priority;
+
+ __u8 pad[32];
+};
+
+/* ATSC capability bitfields */
+struct dvbfe_atsc_info {
+ enum dvbfe_modulation modulation;
+
+ __u8 pad[32];
+};
+
+/* DVB Frontend related Information */
+struct dvbfe_info {
+ char name[128];
+
+ union {
+ struct dvbfe_dvbs_info dvbs;
+ struct dvbfe_dss_info dss;
+ struct dvbfe_dvbs2_info dvbs2;
+ struct dvbfe_dvbc_info dvbc;
+ struct dvbfe_dvbt_info dvbt;
+ struct dvbfe_dvbh_info dvbh;
+ struct dvbfe_atsc_info atsc;
+
+ __u8 pad[128];
+ } delsys;
+
+ __u32 frequency_min;
+ __u32 frequency_max;
+ __u32 frequency_step;
+ __u32 frequency_tolerance;
+ __u32 symbol_rate_min;
+ __u32 symbol_rate_max;
+ __u32 symbol_rate_tolerance;
+
+ enum fe_spectral_inversion inversion;
+
+ __u8 pad[128];
+};
+#define DVBFE_GET_INFO _IOR('o', 85, struct dvbfe_info)
+
+enum dvbfe_status {
+ DVBFE_HAS_SIGNAL = (1 << 0), /* something above noise floor */
+ DVBFE_HAS_CARRIER = (1 << 1), /* Signal found */
+ DVBFE_HAS_VITERBI = (1 << 2), /* FEC is stable */
+ DVBFE_HAS_SYNC = (1 << 3), /* SYNC found */
+ DVBFE_HAS_LOCK = (1 << 4), /* OK .. */
+ DVBFE_TIMEDOUT = (1 << 5), /* no lock in last ~2 s */
+ DVBFE_STATUS_DUMMY = (1 << 31)
+};
+
+/* DVB Frontend events */
+struct dvbfe_events {
+ enum dvbfe_status status;
+
+ __u8 pad[32];
+};
+
+struct dvb_frontend_event {
+ fe_status_t status;
+ struct dvb_frontend_parameters parameters;
+};
+#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
+
+struct dvbfe_event {
+ struct dvbfe_events fe_events;
+ struct dvbfe_params fe_params;
+};
+#define DVBFE_GET_EVENT _IOR('o', 86, struct dvbfe_event)
+
+#endif /*_DVBFRONTEND_H_*/
diff --git a/dvb-apps/include/net.h b/dvb-apps/include/net.h
new file mode 100644
index 0000000..5be474b
--- /dev/null
+++ b/dvb-apps/include/net.h
@@ -0,0 +1,53 @@
+/*
+ * net.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBNET_H_
+#define _DVBNET_H_
+
+#include <asm/types.h>
+
+
+struct dvb_net_if {
+ __u16 pid;
+ __u16 if_num;
+ __u8 feedtype;
+#define DVB_NET_FEEDTYPE_MPE 0 /* multi protocol encapsulation */
+#define DVB_NET_FEEDTYPE_ULE 1 /* ultra lightweight encapsulation */
+};
+
+
+#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if)
+#define NET_REMOVE_IF _IO('o', 53)
+#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if)
+
+
+/* binary compatibility cruft: */
+struct __dvb_net_if_old {
+ __u16 pid;
+ __u16 if_num;
+};
+#define __NET_ADD_IF_OLD _IOWR('o', 52, struct __dvb_net_if_old)
+#define __NET_GET_IF_OLD _IOWR('o', 54, struct __dvb_net_if_old)
+
+
+#endif /*_DVBNET_H_*/
diff --git a/dvb-apps/include/osd.h b/dvb-apps/include/osd.h
new file mode 100644
index 0000000..5d2961c
--- /dev/null
+++ b/dvb-apps/include/osd.h
@@ -0,0 +1,142 @@
+/*
+ * osd.h
+ *
+ * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de>
+ * & Marcus Metzler <marcus@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Lesser Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBOSD_H_
+#define _DVBOSD_H_
+
+typedef enum {
+ // All functions return -2 on "not open"
+ OSD_Close=1, // ()
+ // Disables OSD and releases the buffers
+ // returns 0 on success
+ OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
+ // Opens OSD with this size and bit depth
+ // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
+ OSD_Show, // ()
+ // enables OSD mode
+ // returns 0 on success
+ OSD_Hide, // ()
+ // disables OSD mode
+ // returns 0 on success
+ OSD_Clear, // ()
+ // Sets all pixel to color 0
+ // returns 0 on success
+ OSD_Fill, // (color)
+ // Sets all pixel to color <col>
+ // returns 0 on success
+ OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
+ // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
+ // R,G,B: 0..255
+ // R=Red, G=Green, B=Blue
+ // opacity=0: pixel opacity 0% (only video pixel shows)
+ // opacity=1..254: pixel opacity as specified in header
+ // opacity=255: pixel opacity 100% (only OSD pixel shows)
+ // returns 0 on success, -1 on error
+ OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
+ // Set a number of entries in the palette
+ // sets the entries "firstcolor" through "lastcolor" from the array "data"
+ // data has 4 byte for each color:
+ // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
+ OSD_SetTrans, // (transparency{color})
+ // Sets transparency of mixed pixel (0..15)
+ // returns 0 on success
+ OSD_SetPixel, // (x0,y0,color)
+ // sets pixel <x>,<y> to color number <col>
+ // returns 0 on success, -1 on error
+ OSD_GetPixel, // (x0,y0)
+ // returns color number of pixel <x>,<y>, or -1
+ OSD_SetRow, // (x0,y0,x1,data)
+ // fills pixels x0,y through x1,y with the content of data[]
+ // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
+ OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
+ // fills pixels x0,y0 through x1,y1 with the content of data[]
+ // inc contains the width of one line in the data block,
+ // inc<=0 uses blockwidth as linewidth
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillRow, // (x0,y0,x1,color)
+ // fills pixels x0,y through x1,y with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_FillBlock, // (x0,y0,x1,y1,color)
+ // fills pixels x0,y0 through x1,y1 with the color <col>
+ // returns 0 on success, -1 on clipping all pixel
+ OSD_Line, // (x0,y0,x1,y1,color)
+ // draw a line from x0,y0 to x1,y1 with the color <col>
+ // returns 0 on success
+ OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
+ // fills parameters with the picture dimensions and the pixel aspect ratio
+ // returns 0 on success
+ OSD_Test, // ()
+ // draws a test picture. for debugging purposes only
+ // returns 0 on success
+// TODO: remove "test" in final version
+ OSD_Text, // (x0,y0,size,color,text)
+ OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
+ OSD_MoveWindow, // move current window to (x0, y0)
+ OSD_OpenRaw, // Open other types of OSD windows
+} OSD_Command;
+
+typedef struct osd_cmd_s {
+ OSD_Command cmd;
+ int x0;
+ int y0;
+ int x1;
+ int y1;
+ int color;
+ void *data;
+} osd_cmd_t;
+
+/* OSD_OpenRaw: set 'color' to desired window type */
+typedef enum {
+ OSD_BITMAP1, /* 1 bit bitmap */
+ OSD_BITMAP2, /* 2 bit bitmap */
+ OSD_BITMAP4, /* 4 bit bitmap */
+ OSD_BITMAP8, /* 8 bit bitmap */
+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
+ OSD_CURSOR /* Cursor */
+} osd_raw_window_t;
+
+typedef struct osd_cap_s {
+ int cmd;
+#define OSD_CAP_MEMSIZE 1 /* memory size */
+ long val;
+} osd_cap_t;
+
+
+#define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t)
+#define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t)
+
+#endif
diff --git a/dvb-apps/include/version.h b/dvb-apps/include/version.h
new file mode 100644
index 0000000..2dd76c8
--- /dev/null
+++ b/dvb-apps/include/version.h
@@ -0,0 +1,29 @@
+/*
+ * version.h
+ *
+ * Copyright (C) 2000 Holger Waechtler <holger@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVERSION_H_
+#define _DVBVERSION_H_
+
+#define DVB_API_VERSION 3
+#define DVB_API_VERSION_MINOR 3
+
+#endif /*_DVBVERSION_H_*/
diff --git a/dvb-apps/include/video.h b/dvb-apps/include/video.h
new file mode 100644
index 0000000..317ba6b
--- /dev/null
+++ b/dvb-apps/include/video.h
@@ -0,0 +1,277 @@
+/*
+ * video.h
+ *
+ * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
+ * & Ralph Metzler <ralph@convergence.de>
+ * for convergence integrated media GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _DVBVIDEO_H_
+#define _DVBVIDEO_H_
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <asm/types.h>
+#include <stdint.h>
+#include <time.h>
+#endif
+
+
+typedef enum {
+ VIDEO_FORMAT_4_3, /* Select 4:3 format */
+ VIDEO_FORMAT_16_9, /* Select 16:9 format. */
+ VIDEO_FORMAT_221_1 /* 2.21:1 */
+} video_format_t;
+
+
+typedef enum {
+ VIDEO_SYSTEM_PAL,
+ VIDEO_SYSTEM_NTSC,
+ VIDEO_SYSTEM_PALN,
+ VIDEO_SYSTEM_PALNc,
+ VIDEO_SYSTEM_PALM,
+ VIDEO_SYSTEM_NTSC60,
+ VIDEO_SYSTEM_PAL60,
+ VIDEO_SYSTEM_PALM60
+} video_system_t;
+
+
+typedef enum {
+ VIDEO_PAN_SCAN, /* use pan and scan format */
+ VIDEO_LETTER_BOX, /* use letterbox format */
+ VIDEO_CENTER_CUT_OUT /* use center cut out format */
+} video_displayformat_t;
+
+typedef struct {
+ int w;
+ int h;
+ video_format_t aspect_ratio;
+} video_size_t;
+
+typedef enum {
+ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
+ VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
+ comes from the user through the write
+ system call */
+} video_stream_source_t;
+
+
+typedef enum {
+ VIDEO_STOPPED, /* Video is stopped */
+ VIDEO_PLAYING, /* Video is currently playing */
+ VIDEO_FREEZED /* Video is freezed */
+} video_play_state_t;
+
+
+/* Decoder commands */
+#define VIDEO_CMD_PLAY (0)
+#define VIDEO_CMD_STOP (1)
+#define VIDEO_CMD_FREEZE (2)
+#define VIDEO_CMD_CONTINUE (3)
+
+/* Flags for VIDEO_CMD_FREEZE */
+#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
+
+/* Flags for VIDEO_CMD_STOP */
+#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
+#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
+
+/* Play input formats: */
+/* The decoder has no special format requirements */
+#define VIDEO_PLAY_FMT_NONE (0)
+/* The decoder requires full GOPs */
+#define VIDEO_PLAY_FMT_GOP (1)
+
+/* The structure must be zeroed before use by the application
+ This ensures it can be extended safely in the future. */
+struct video_command {
+ __u32 cmd;
+ __u32 flags;
+ union {
+ struct {
+ __u64 pts;
+ } stop;
+
+ struct {
+ /* 0 or 1000 specifies normal speed,
+ 1 specifies forward single stepping,
+ -1 specifies backward single stepping,
+ >1: playback at speed/1000 of the normal speed,
+ <-1: reverse playback at (-speed/1000) of the normal speed. */
+ __s32 speed;
+ __u32 format;
+ } play;
+
+ struct {
+ __u32 data[16];
+ } raw;
+ };
+};
+
+/* FIELD_UNKNOWN can be used if the hardware does not know whether
+ the Vsync is for an odd, even or progressive (i.e. non-interlaced)
+ field. */
+#define VIDEO_VSYNC_FIELD_UNKNOWN (0)
+#define VIDEO_VSYNC_FIELD_ODD (1)
+#define VIDEO_VSYNC_FIELD_EVEN (2)
+#define VIDEO_VSYNC_FIELD_PROGRESSIVE (3)
+
+struct video_event {
+ int32_t type;
+#define VIDEO_EVENT_SIZE_CHANGED 1
+#define VIDEO_EVENT_FRAME_RATE_CHANGED 2
+#define VIDEO_EVENT_DECODER_STOPPED 3
+#define VIDEO_EVENT_VSYNC 4
+ time_t timestamp;
+ union {
+ video_size_t size;
+ unsigned int frame_rate; /* in frames per 1000sec */
+ unsigned char vsync_field; /* unknown/odd/even/progressive */
+ } u;
+};
+
+
+struct video_status {
+ int video_blank; /* blank video on freeze? */
+ video_play_state_t play_state; /* current state of playback */
+ video_stream_source_t stream_source; /* current source (demux/memory) */
+ video_format_t video_format; /* current aspect ratio of stream*/
+ video_displayformat_t display_format;/* selected cropping mode */
+};
+
+
+struct video_still_picture {
+ char *iFrame; /* pointer to a single iframe in memory */
+ int32_t size;
+};
+
+
+typedef
+struct video_highlight {
+ int active; /* 1=show highlight, 0=hide highlight */
+ uint8_t contrast1; /* 7- 4 Pattern pixel contrast */
+ /* 3- 0 Background pixel contrast */
+ uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */
+ /* 3- 0 Emphasis pixel-1 contrast */
+ uint8_t color1; /* 7- 4 Pattern pixel color */
+ /* 3- 0 Background pixel color */
+ uint8_t color2; /* 7- 4 Emphasis pixel-2 color */
+ /* 3- 0 Emphasis pixel-1 color */
+ uint32_t ypos; /* 23-22 auto action mode */
+ /* 21-12 start y */
+ /* 9- 0 end y */
+ uint32_t xpos; /* 23-22 button color number */
+ /* 21-12 start x */
+ /* 9- 0 end x */
+} video_highlight_t;
+
+
+typedef struct video_spu {
+ int active;
+ int stream_id;
+} video_spu_t;
+
+
+typedef struct video_spu_palette { /* SPU Palette information */
+ int length;
+ uint8_t *palette;
+} video_spu_palette_t;
+
+
+typedef struct video_navi_pack {
+ int length; /* 0 ... 1024 */
+ uint8_t data[1024];
+} video_navi_pack_t;
+
+
+typedef uint16_t video_attributes_t;
+/* bits: descr. */
+/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
+/* 13-12 TV system (0=525/60, 1=625/50) */
+/* 11-10 Aspect ratio (0=4:3, 3=16:9) */
+/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
+/* 7 line 21-1 data present in GOP (1=yes, 0=no) */
+/* 6 line 21-2 data present in GOP (1=yes, 0=no) */
+/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
+/* 2 source letterboxed (1=yes, 0=no) */
+/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */
+
+
+/* bit definitions for capabilities: */
+/* can the hardware decode MPEG1 and/or MPEG2? */
+#define VIDEO_CAP_MPEG1 1
+#define VIDEO_CAP_MPEG2 2
+/* can you send a system and/or program stream to video device?
+ (you still have to open the video and the audio device but only
+ send the stream to the video device) */
+#define VIDEO_CAP_SYS 4
+#define VIDEO_CAP_PROG 8
+/* can the driver also handle SPU, NAVI and CSS encoded data?
+ (CSS API is not present yet) */
+#define VIDEO_CAP_SPU 16
+#define VIDEO_CAP_NAVI 32
+#define VIDEO_CAP_CSS 64
+
+
+#define VIDEO_STOP _IO('o', 21)
+#define VIDEO_PLAY _IO('o', 22)
+#define VIDEO_FREEZE _IO('o', 23)
+#define VIDEO_CONTINUE _IO('o', 24)
+#define VIDEO_SELECT_SOURCE _IO('o', 25)
+#define VIDEO_SET_BLANK _IO('o', 26)
+#define VIDEO_GET_STATUS _IOR('o', 27, struct video_status)
+#define VIDEO_GET_EVENT _IOR('o', 28, struct video_event)
+#define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29)
+#define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture)
+#define VIDEO_FAST_FORWARD _IO('o', 31)
+#define VIDEO_SLOWMOTION _IO('o', 32)
+#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int)
+#define VIDEO_CLEAR_BUFFER _IO('o', 34)
+#define VIDEO_SET_ID _IO('o', 35)
+#define VIDEO_SET_STREAMTYPE _IO('o', 36)
+#define VIDEO_SET_FORMAT _IO('o', 37)
+#define VIDEO_SET_SYSTEM _IO('o', 38)
+#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t)
+#define VIDEO_SET_SPU _IOW('o', 50, video_spu_t)
+#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t)
+#define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t)
+#define VIDEO_SET_ATTRIBUTES _IO('o', 53)
+#define VIDEO_GET_SIZE _IOR('o', 55, video_size_t)
+#define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int)
+
+/**
+ * VIDEO_GET_PTS
+ *
+ * Read the 33 bit presentation time stamp as defined
+ * in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
+ *
+ * The PTS should belong to the currently played
+ * frame if possible, but may also be a value close to it
+ * like the PTS of the last decoded frame or the last PTS
+ * extracted by the PES parser.
+ */
+#define VIDEO_GET_PTS _IOR('o', 57, __u64)
+
+/* Read the number of displayed frames since the decoder was started */
+#define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64)
+
+#define VIDEO_COMMAND _IOWR('o', 59, struct video_command)
+#define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command)
+
+#endif /*_DVBVIDEO_H_*/
diff --git a/dvb-apps/lib/Makefile b/dvb-apps/lib/Makefile
new file mode 100644
index 0000000..3389628
--- /dev/null
+++ b/dvb-apps/lib/Makefile
@@ -0,0 +1,11 @@
+# Makefile for linuxtv.org dvb-apps/lib
+
+.PHONY: all clean install
+
+all clean install:
+ $(MAKE) -C libdvbapi $@
+ $(MAKE) -C libdvbcfg $@
+ $(MAKE) -C libdvben50221 $@
+ $(MAKE) -C libdvbsec $@
+ $(MAKE) -C libesg $@
+ $(MAKE) -C libucsi $@
diff --git a/dvb-apps/lib/libdvbapi/Makefile b/dvb-apps/lib/libdvbapi/Makefile
new file mode 100644
index 0000000..0ed96ec
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/Makefile
@@ -0,0 +1,25 @@
+# Makefile for linuxtv.org dvb-apps/lib/libdvbapi
+
+includes = dvbaudio.h \
+ dvbca.h \
+ dvbdemux.h \
+ dvbfe.h \
+ dvbnet.h \
+ dvbvideo.h
+
+objects = dvbaudio.o \
+ dvbca.o \
+ dvbdemux.o \
+ dvbfe.o \
+ dvbnet.o \
+ dvbvideo.o
+
+lib_name = libdvbapi
+
+CPPFLAGS += -I../../lib
+
+.PHONY: all
+
+all: library
+
+include ../../Make.rules
diff --git a/dvb-apps/lib/libdvbapi/dvbaudio.c b/dvb-apps/lib/libdvbapi/dvbaudio.c
new file mode 100644
index 0000000..72b4d70
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbaudio.c
@@ -0,0 +1,50 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/dvb/audio.h>
+#include <errno.h>
+#include "dvbaudio.h"
+
+int dvbaudio_open(int adapter, int audiodeviceid)
+{
+ char filename[PATH_MAX+1];
+ int fd;
+
+ sprintf(filename, "/dev/dvb/adapter%i/audio%i", adapter, audiodeviceid);
+ if ((fd = open(filename, O_RDWR)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.audio%i", adapter, audiodeviceid);
+ fd = open(filename, O_RDWR);
+ }
+
+ return fd;
+}
+
+int dvbaudio_set_bypass(int fd, int bypass)
+{
+ return ioctl(fd, AUDIO_SET_BYPASS_MODE, bypass);
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbaudio.h b/dvb-apps/lib/libdvbapi/dvbaudio.h
new file mode 100644
index 0000000..36f6a55
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbaudio.h
@@ -0,0 +1,55 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBAUDIO_H
+#define LIBDVBAUDIO_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * Open a DVB audio device.
+ *
+ * @param adapter DVB adapter ID.
+ * @param audiodeviceid Id of audio device of that adapter to open.
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbaudio_open(int adapter, int audiodeviceid);
+
+/**
+ * Control audio bypass - i.e. output decoded audio, or the raw bitstream (e.g. AC3).
+ *
+ * @param fd Audio device opened with dvbaudio_open().
+ * @param bypass 1=> enable bypass, 0=> disable.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbaudio_set_bypass(int fd, int bypass);
+
+// FIXME: this is a stub library
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBAUDIO_H
diff --git a/dvb-apps/lib/libdvbapi/dvbca.c b/dvb-apps/lib/libdvbapi/dvbca.c
new file mode 100644
index 0000000..8261cd2
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbca.c
@@ -0,0 +1,159 @@
+/*
+ * libdvbca - interface onto raw CA devices
+ *
+ * Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <linux/dvb/ca.h>
+#include "dvbca.h"
+
+
+int dvbca_open(int adapter, int cadevice)
+{
+ char filename[PATH_MAX+1];
+ int fd;
+
+ sprintf(filename, "/dev/dvb/adapter%i/ca%i", adapter, cadevice);
+ if ((fd = open(filename, O_RDWR)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.ca%i", adapter, cadevice);
+ fd = open(filename, O_RDWR);
+ }
+
+ return fd;
+}
+
+int dvbca_reset(int fd, uint8_t slot)
+{
+ return ioctl(fd, CA_RESET, (1 << slot));
+}
+
+int dvbca_get_interface_type(int fd, uint8_t slot)
+{
+ ca_slot_info_t info;
+
+ info.num = slot;
+ if (ioctl(fd, CA_GET_SLOT_INFO, &info))
+ return -1;
+
+ if (info.type & CA_CI_LINK)
+ return DVBCA_INTERFACE_LINK;
+ if (info.type & CA_CI)
+ return DVBCA_INTERFACE_HLCI;
+
+ return -1;
+}
+
+int dvbca_get_cam_state(int fd, uint8_t slot)
+{
+ ca_slot_info_t info;
+
+ info.num = slot;
+ if (ioctl(fd, CA_GET_SLOT_INFO, &info))
+ return -1;
+
+ if (info.flags == 0)
+ return DVBCA_CAMSTATE_MISSING;
+ if (info.flags & CA_CI_MODULE_READY)
+ return DVBCA_CAMSTATE_READY;
+ if (info.flags & CA_CI_MODULE_PRESENT)
+ return DVBCA_CAMSTATE_INITIALISING;
+
+ return -1;
+}
+
+int dvbca_link_write(int fd, uint8_t slot, uint8_t connection_id,
+ uint8_t *data, uint16_t data_length)
+{
+ uint8_t *buf = malloc(data_length + 2);
+ if (buf == NULL)
+ return -1;
+
+ buf[0] = slot;
+ buf[1] = connection_id;
+ memcpy(buf+2, data, data_length);
+
+ int result = write(fd, buf, data_length+2);
+ free(buf);
+ return result;
+}
+
+int dvbca_link_read(int fd, uint8_t *slot, uint8_t *connection_id,
+ uint8_t *data, uint16_t data_length)
+{
+ int size;
+
+ uint8_t *buf = malloc(data_length + 2);
+ if (buf == NULL)
+ return -1;
+
+ if ((size = read(fd, buf, data_length+2)) < 2)
+ return -1;
+
+ *slot = buf[0];
+ *connection_id = buf[1];
+ memcpy(data, buf+2, size-2);
+ free(buf);
+
+ return size - 2;
+}
+
+int dvbca_hlci_write(int fd, uint8_t *data, uint16_t data_length)
+{
+ struct ca_msg msg;
+
+ if (data_length > 256) {
+ return -1;
+ }
+ memset(&msg, 0, sizeof(msg));
+ msg.length = data_length;
+
+ memcpy(msg.msg, data, data_length);
+
+ return ioctl(fd, CA_SEND_MSG, &msg);
+}
+
+int dvbca_hlci_read(int fd, uint32_t app_tag, uint8_t *data,
+ uint16_t data_length)
+{
+ struct ca_msg msg;
+
+ if (data_length > 256) {
+ data_length = 256;
+ }
+ memset(&msg, 0, sizeof(msg));
+ msg.length = data_length;
+ msg.msg[0] = app_tag >> 16;
+ msg.msg[1] = app_tag >> 8;
+ msg.msg[2] = app_tag;
+
+ int status = ioctl(fd, CA_GET_MSG, &msg);
+ if (status < 0) return status;
+
+ if (msg.length > data_length) msg.length = data_length;
+ memcpy(data, msg.msg, msg.length);
+ return msg.length;
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbca.h b/dvb-apps/lib/libdvbapi/dvbca.h
new file mode 100644
index 0000000..c65423b
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbca.h
@@ -0,0 +1,135 @@
+/*
+ * libdvbca - interface onto raw CA devices
+ *
+ * Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBCA_H
+#define LIBDVBCA_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * The types of CA interface we support.
+ */
+#define DVBCA_INTERFACE_LINK 0
+#define DVBCA_INTERFACE_HLCI 1
+
+/**
+ * States a CAM in a slot can be in.
+ */
+#define DVBCA_CAMSTATE_MISSING 0
+#define DVBCA_CAMSTATE_INITIALISING 1
+#define DVBCA_CAMSTATE_READY 2
+
+
+/**
+ * Open a CA device. Multiple CAMs can be accessed through a CA device.
+ *
+ * @param adapter Index of the DVB adapter.
+ * @param cadevice Index of the CA device on that adapter (usually 0).
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbca_open(int adapter, int cadevice);
+
+/**
+ * Reset a CAM.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param slot Slot where the requested CAM is in.
+ * @return 0 on success, -1 on failure.
+ */
+extern int dvbca_reset(int fd, uint8_t slot);
+
+/**
+ * Get the interface type of a CAM.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param slot Slot where the requested CAM is in.
+ * @return One of the DVBCA_INTERFACE_* values, or -1 on failure.
+ */
+extern int dvbca_get_interface_type(int fd, uint8_t slot);
+
+/**
+ * Get the state of a CAM.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param slot Slot where the requested CAM is in.
+ * @return One of the DVBCA_CAMSTATE_* values, or -1 on failure.
+ */
+extern int dvbca_get_cam_state(int fd, uint8_t slot);
+
+/**
+ * Write a message to a CAM using a link-layer interface.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param slot Slot where the requested CAM is in.
+ * @param connection_id Connection ID of the message.
+ * @param data Data to write.
+ * @param data_length Number of bytes to write.
+ * @return 0 on success, or -1 on failure.
+ */
+extern int dvbca_link_write(int fd, uint8_t slot, uint8_t connection_id,
+ uint8_t *data, uint16_t data_length);
+
+/**
+ * Read a message from a CAM using a link-layer interface.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param slot Slot where the responding CAM is in.
+ * @param connection_id Destination for the connection ID the message came from.
+ * @param data Data that was read.
+ * @param data_length Max number of bytes to read.
+ * @return Number of bytes read on success, or -1 on failure.
+ */
+extern int dvbca_link_read(int fd, uint8_t *slot, uint8_t *connection_id,
+ uint8_t *data, uint16_t data_length);
+
+// FIXME how do we determine which CAM slot of a CA is meant?
+/**
+ * Write a message to a CAM using an HLCI interface.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param data Data to write.
+ * @param data_length Number of bytes to write.
+ * @return 0 on success, or -1 on failure.
+ */
+extern int dvbca_hlci_write(int fd, uint8_t *data, uint16_t data_length);
+
+// FIXME how do we determine which CAM slot of a CA is meant?
+/**
+ * Read a message from a CAM using an HLCI interface.
+ *
+ * @param fd File handle opened with dvbca_open.
+ * @param app_tag Application layer tag giving the message type to read.
+ * @param data Data that was read.
+ * @param data_length Max number of bytes to read.
+ * @return Number of bytes read on success, or -1 on failure.
+ */
+extern int dvbca_hlci_read(int fd, uint32_t app_tag, uint8_t *data,
+ uint16_t data_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBCA_H
diff --git a/dvb-apps/lib/libdvbapi/dvbdemux.c b/dvb-apps/lib/libdvbapi/dvbdemux.c
new file mode 100644
index 0000000..a882af6
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbdemux.c
@@ -0,0 +1,255 @@
+/*
+ * libdvbdemux - a DVB demux library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <linux/dvb/dmx.h>
+#include "dvbdemux.h"
+
+
+int dvbdemux_open_demux(int adapter, int demuxdevice, int nonblocking)
+{
+ char filename[PATH_MAX+1];
+ int flags = O_RDWR;
+ int fd;
+
+ if (nonblocking)
+ flags |= O_NONBLOCK;
+
+ sprintf(filename, "/dev/dvb/adapter%i/demux%i", adapter, demuxdevice);
+ if ((fd = open(filename, flags)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.demux%i", adapter, demuxdevice);
+ fd = open(filename, flags);
+ }
+
+ return fd;
+}
+
+int dvbdemux_open_dvr(int adapter, int dvrdevice, int readonly, int nonblocking)
+{
+ char filename[PATH_MAX+1];
+ int flags = O_RDWR;
+ int fd;
+
+ if (readonly)
+ flags = O_RDONLY;
+ if (nonblocking)
+ flags |= O_NONBLOCK;
+
+ sprintf(filename, "/dev/dvb/adapter%i/dvr%i", adapter, dvrdevice);
+ if ((fd = open(filename, flags)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.dvr%i", adapter, dvrdevice);
+ fd = open(filename, flags);
+ }
+
+ return fd;
+}
+
+int dvbdemux_set_section_filter(int fd, int pid,
+ uint8_t filter[18], uint8_t mask[18],
+ int start, int checkcrc)
+{
+ struct dmx_sct_filter_params sctfilter;
+
+ memset(&sctfilter, 0, sizeof(sctfilter));
+ sctfilter.pid = pid;
+ memcpy(sctfilter.filter.filter, filter, 1);
+ memcpy(sctfilter.filter.filter+1, filter+3, 15);
+ memcpy(sctfilter.filter.mask, mask, 1);
+ memcpy(sctfilter.filter.mask+1, mask+3, 15);
+ memset(sctfilter.filter.mode, 0, 16);
+ if (start)
+ sctfilter.flags |= DMX_IMMEDIATE_START;
+ if (checkcrc)
+ sctfilter.flags |= DMX_CHECK_CRC;
+
+ return ioctl(fd, DMX_SET_FILTER, &sctfilter);
+}
+
+int dvbdemux_set_pes_filter(int fd, int pid,
+ int input, int output,
+ int pestype,
+ int start)
+{
+ struct dmx_pes_filter_params filter;
+
+ memset(&filter, 0, sizeof(filter));
+ filter.pid = pid;
+
+ switch(input) {
+ case DVBDEMUX_INPUT_FRONTEND:
+ filter.input = DMX_IN_FRONTEND;
+ break;
+
+ case DVBDEMUX_INPUT_DVR:
+ filter.input = DMX_IN_DVR;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ switch(output) {
+ case DVBDEMUX_OUTPUT_DECODER:
+ filter.output = DMX_OUT_DECODER;
+ break;
+
+ case DVBDEMUX_OUTPUT_DEMUX:
+ filter.output = DMX_OUT_TAP;
+ break;
+
+ case DVBDEMUX_OUTPUT_DVR:
+ filter.output = DMX_OUT_TS_TAP;
+ break;
+
+#ifdef DMX_OUT_TSDEMUX_TAP
+ case DVBDEMUX_OUTPUT_TS_DEMUX:
+ filter.output = DMX_OUT_TSDEMUX_TAP;
+ break;
+#endif
+
+ default:
+ return -EINVAL;
+ }
+
+ switch(pestype) {
+ case DVBDEMUX_PESTYPE_AUDIO:
+ filter.pes_type = DMX_PES_AUDIO;
+ break;
+
+ case DVBDEMUX_PESTYPE_VIDEO:
+ filter.pes_type = DMX_PES_VIDEO;
+ break;
+
+ case DVBDEMUX_PESTYPE_TELETEXT:
+ filter.pes_type = DMX_PES_TELETEXT;
+ break;
+
+ case DVBDEMUX_PESTYPE_SUBTITLE:
+ filter.pes_type = DMX_PES_SUBTITLE;
+ break;
+
+ case DVBDEMUX_PESTYPE_PCR:
+ filter.pes_type = DMX_PES_PCR;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ if (start)
+ filter.flags |= DMX_IMMEDIATE_START;
+
+ return ioctl(fd, DMX_SET_PES_FILTER, &filter);
+}
+
+int dvbdemux_set_pid_filter(int fd, int pid,
+ int input, int output,
+ int start)
+{
+ struct dmx_pes_filter_params filter;
+
+ memset(&filter, 0, sizeof(filter));
+ if (pid == -1)
+ filter.pid = 0x2000;
+ else
+ filter.pid = pid;
+
+ switch(input) {
+ case DVBDEMUX_INPUT_FRONTEND:
+ filter.input = DMX_IN_FRONTEND;
+ break;
+
+ case DVBDEMUX_INPUT_DVR:
+ filter.input = DMX_IN_DVR;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ switch(output) {
+ case DVBDEMUX_OUTPUT_DECODER:
+ filter.output = DMX_OUT_DECODER;
+ break;
+
+ case DVBDEMUX_OUTPUT_DEMUX:
+ filter.output = DMX_OUT_TAP;
+ break;
+
+ case DVBDEMUX_OUTPUT_DVR:
+ filter.output = DMX_OUT_TS_TAP;
+ break;
+
+#ifdef DMX_OUT_TSDEMUX_TAP
+ case DVBDEMUX_OUTPUT_TS_DEMUX:
+ filter.output = DMX_OUT_TSDEMUX_TAP;
+ break;
+#endif
+
+ default:
+ return -EINVAL;
+ }
+
+ filter.pes_type = DMX_PES_OTHER;
+
+ if (start)
+ filter.flags |= DMX_IMMEDIATE_START;
+
+ return ioctl(fd, DMX_SET_PES_FILTER, &filter);
+}
+
+int dvbdemux_start(int fd)
+{
+ return ioctl(fd, DMX_START);
+}
+
+int dvbdemux_stop(int fd)
+{
+ return ioctl(fd, DMX_STOP);
+}
+
+int dvbdemux_get_stc(int fd, uint64_t *stc)
+{
+ struct dmx_stc _stc;
+ int result;
+
+ memset(stc, 0, sizeof(_stc));
+ if ((result = ioctl(fd, DMX_GET_STC, &_stc)) != 0) {
+ return result;
+ }
+
+ *stc = _stc.stc / _stc.base;
+ return 0;
+}
+
+int dvbdemux_set_buffer(int fd, int bufsize)
+{
+ return ioctl(fd, DMX_SET_BUFFER_SIZE, bufsize);
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbdemux.h b/dvb-apps/lib/libdvbapi/dvbdemux.h
new file mode 100644
index 0000000..808ee80
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbdemux.h
@@ -0,0 +1,204 @@
+/*
+ * libdvbdemux - a DVB demux library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBDEMUX_H
+#define LIBDVBDEMUX_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * Source of the data to be demuxed.
+ *
+ * FRONTEND. The data will be read from the frontend on the adapter.
+ *
+ * DVR. The data will be read from the DVR device of the adapter (of course,
+ * you need to write data TO the DVR device as well).
+ */
+#define DVBDEMUX_INPUT_FRONTEND 0
+#define DVBDEMUX_INPUT_DVR 1
+
+/**
+ * Destination of the demuxed data.
+ *
+ * DECODER. Sends the data directly to a hardware decoder (if present).
+ *
+ * DEMUX. Sends the PID stream to the current demux file descriptor. HOWEVER, the
+ * data will be the payload *only* - transport stream headers will be stripped.
+ *
+ * DVR sends the data to the DVR device. The data will be the complete transport
+ * stream packets with headers intact. Note: if multiple filters specify
+ * DVBDEMUX_OUTPUT_DVR, the individual PID streams will be re-multiplexed
+ * together.
+ */
+#define DVBDEMUX_OUTPUT_DECODER 0
+#define DVBDEMUX_OUTPUT_DEMUX 1
+#define DVBDEMUX_OUTPUT_DVR 2
+#define DVBDEMUX_OUTPUT_TS_DEMUX 3
+
+/**
+ * PES types.
+ */
+#define DVBDEMUX_PESTYPE_AUDIO 0
+#define DVBDEMUX_PESTYPE_VIDEO 1
+#define DVBDEMUX_PESTYPE_TELETEXT 2
+#define DVBDEMUX_PESTYPE_SUBTITLE 3
+#define DVBDEMUX_PESTYPE_PCR 4
+
+
+/**
+ * Open a demux device. Can be called multiple times. These let you setup a
+ * single filter per FD. It can can also be read() from if you use a section
+ * filter, or create a pes_filter or raw_filter with output DVBDEMUX_OUTPUT_DEMUX.
+ *
+ * @param adapter Index of the DVB adapter.
+ * @param demuxdevice Index of the demux device on that adapter (usually 0).
+ * @param nonblocking If 1, frontend will be opened in nonblocking mode.
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbdemux_open_demux(int adapter, int demuxdevice, int nonblocking);
+
+/**
+ * Open a DVR device. May be opened for writing or reading once.
+ * It is used to either write() transport stream data to be demuxed
+ * (if input == DVBDEMUX_INPUT_DVR), or to read() a stream of demuxed data
+ * (if output == DVBDEMUX_OUTPUT_DVR).
+ *
+ * Note, all demux filters with output set to DVBDEMUX_OUTPUT_DVR will be
+ * multiplexed together and output their data on this device.
+ *
+ * @param adapter Index of the DVB adapter.
+ * @param dvrdevice Index of the dvr device on that adapter (usually 0)
+ * @param readonly If 1, frontend will be opened in readonly mode only.
+ * @param nonblocking If 1, frontend will be opened in nonblocking mode.
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbdemux_open_dvr(int adapter, int dvrdevice, int readonly, int nonblocking);
+
+/**
+ * Set filter for the first 18 bytes of decoded SI table sections. Note that
+ * bytes 1 and 2 are _not_ filtered since they contain the length field.
+ *
+ * Conceptually, the driver computes the following for each filtered bit.
+ *
+ * (filter[X].bit[Y] & mask[X].bit[Y]) == (header[X].bit[Y] & mask[X].bit[Y])
+ *
+ * Any sections which do not match this criteria for every bit will be discarded.
+ *
+ * The SI data is always read from the frontend, and is always returned by
+ * read()ing the demux fd. FIXME: check this statement!
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @param pid PID of the stream.
+ * @param filter The filter values of the first 18 bytes of the desired sections.
+ * @param mask Bitmask indicating which bits in the filter array should be tested
+ * (if a bit is 1, it will be tested).
+ * @param start If 1, the filter will be started immediately. Otherwise you must
+ * call dvbdemux_start() manually.
+ * @param checkcrc If 1, the driver will check the CRC on the table sections.
+ * Any bad sections will be dropped.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_set_section_filter(int fd, int pid,
+ uint8_t filter[18], uint8_t mask[18],
+ int start, int checkcrc);
+
+/**
+ * Set filter for a stream of PES data. This call can only used for cards
+ * equipped with a hardware decoder.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @param pid PID of the stream.
+ * @param input One of DVBDEMUX_INPUT_*.
+ * @param output One of DVBDEMUX_OUTPUT_*.
+ * @param pestype One of DVBDEMUX_PESTYPE_* - this tells the decoder the type
+ * of data in this stream.
+ * @param start If 1, the filter will be started immediately. Otherwise you must
+ * call dvbdemux_start() manually.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_set_pes_filter(int fd, int pid,
+ int input, int output,
+ int pestype,
+ int start);
+
+/**
+ * Create a pid filter - this will extract transport stream packets for a
+ * specified PID.
+ *
+ * Note: The wildcard PID can only be used on "budget" cards.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @param pid PID to retrieve, or use -1 as a wildcard for ALL PIDs.
+ * @param input One of DVBDEMUX_INPUT_*.
+ * @param output One of DVBDEMUX_OUTPUT_*.
+ * @param start If 1, the filter will be started immediately. Otherwise you must
+ * call dvbdemux_start() manually.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_set_pid_filter(int fd, int pid,
+ int input, int output,
+ int start);
+
+/**
+ * Start a demux going.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_start(int fd);
+
+/**
+ * Stop a demux.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_stop(int fd);
+
+/**
+ * Retrieve the current STC from the demux. This call can only used for cards
+ * equipped with a hardware decoder.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @param stc Where to put the retrieved STC value (in 90kHz clock).
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_get_stc(int fd, uint64_t *stc);
+
+/**
+ * Change the internal buffer size used by the demuxer. The default buffer size
+ * is 8192 bytes. Can only be used if the demux in question is stopped.
+ *
+ * @param fd FD as opened with dvbdemux_open_demux() above.
+ * @param bufsize New buffer size to use.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbdemux_set_buffer(int fd, int bufsize);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBDEMUX_H
diff --git a/dvb-apps/lib/libdvbapi/dvbfe.c b/dvb-apps/lib/libdvbapi/dvbfe.c
new file mode 100644
index 0000000..98104c9
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbfe.c
@@ -0,0 +1,574 @@
+/*
+ * libdvbfe - a DVB frontend library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ * Copyright (C) 2005 Manu Abraham <abraham.manu@gmail.com>
+ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <sys/poll.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <linux/dvb/frontend.h>
+#include <libdvbmisc/dvbmisc.h>
+#include "dvbfe.h"
+
+int verbose = 0;
+
+static int dvbfe_spectral_inversion_to_kapi[][2] =
+{
+ { DVBFE_INVERSION_OFF, INVERSION_OFF },
+ { DVBFE_INVERSION_ON, INVERSION_ON },
+ { DVBFE_INVERSION_AUTO, INVERSION_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_code_rate_to_kapi[][2] =
+{
+ { DVBFE_FEC_NONE, FEC_NONE },
+ { DVBFE_FEC_1_2, FEC_1_2 },
+ { DVBFE_FEC_2_3, FEC_2_3 },
+ { DVBFE_FEC_3_4, FEC_3_4 },
+ { DVBFE_FEC_4_5, FEC_4_5 },
+ { DVBFE_FEC_5_6, FEC_5_6 },
+ { DVBFE_FEC_6_7, FEC_6_7 },
+ { DVBFE_FEC_7_8, FEC_7_8 },
+ { DVBFE_FEC_8_9, FEC_8_9 },
+ { DVBFE_FEC_AUTO, FEC_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_dvbt_const_to_kapi[][2] =
+{
+ { DVBFE_DVBT_CONST_QPSK, FE_QPSK },
+ { DVBFE_DVBT_CONST_QAM_16, QAM_16 },
+ { DVBFE_DVBT_CONST_QAM_32, QAM_32 },
+ { DVBFE_DVBT_CONST_QAM_64, QAM_64 },
+ { DVBFE_DVBT_CONST_QAM_128, QAM_128 },
+ { DVBFE_DVBT_CONST_QAM_256, QAM_256 },
+ { DVBFE_DVBT_CONST_AUTO, QAM_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_dvbc_mod_to_kapi[][2] =
+{
+ { DVBFE_DVBC_MOD_QAM_16, QAM_16 },
+ { DVBFE_DVBC_MOD_QAM_32, QAM_32 },
+ { DVBFE_DVBC_MOD_QAM_64, QAM_64 },
+ { DVBFE_DVBC_MOD_QAM_128, QAM_128 },
+ { DVBFE_DVBC_MOD_QAM_256, QAM_256 },
+ { DVBFE_DVBC_MOD_AUTO, QAM_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_atsc_mod_to_kapi[][2] =
+{
+ { DVBFE_ATSC_MOD_QAM_64, QAM_64 },
+ { DVBFE_ATSC_MOD_QAM_256, QAM_256 },
+ { DVBFE_ATSC_MOD_VSB_8, VSB_8 },
+ { DVBFE_ATSC_MOD_VSB_16, VSB_16 },
+ { DVBFE_ATSC_MOD_AUTO, QAM_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_dvbt_transmit_mode_to_kapi[][2] =
+{
+ { DVBFE_DVBT_TRANSMISSION_MODE_2K, TRANSMISSION_MODE_2K },
+ { DVBFE_DVBT_TRANSMISSION_MODE_8K, TRANSMISSION_MODE_8K },
+ { DVBFE_DVBT_TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_dvbt_bandwidth_to_kapi[][2] =
+{
+ { DVBFE_DVBT_BANDWIDTH_8_MHZ, BANDWIDTH_8_MHZ },
+ { DVBFE_DVBT_BANDWIDTH_7_MHZ, BANDWIDTH_7_MHZ },
+ { DVBFE_DVBT_BANDWIDTH_6_MHZ, BANDWIDTH_6_MHZ },
+ { DVBFE_DVBT_BANDWIDTH_AUTO, BANDWIDTH_AUTO },
+ { -1, -1 }
+};
+
+static int dvbfe_dvbt_guard_interval_to_kapi[][2] =
+{
+ { DVBFE_DVBT_GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_32},
+ { DVBFE_DVBT_GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_16},
+ { DVBFE_DVBT_GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_8},
+ { DVBFE_DVBT_GUARD_INTERVAL_1_4, GUARD_INTERVAL_1_4},
+ { DVBFE_DVBT_GUARD_INTERVAL_AUTO, GUARD_INTERVAL_AUTO},
+ { -1, -1 }
+};
+
+static int dvbfe_dvbt_hierarchy_to_kapi[][2] =
+{
+ { DVBFE_DVBT_HIERARCHY_NONE, HIERARCHY_NONE },
+ { DVBFE_DVBT_HIERARCHY_1, HIERARCHY_1 },
+ { DVBFE_DVBT_HIERARCHY_2, HIERARCHY_2 },
+ { DVBFE_DVBT_HIERARCHY_4, HIERARCHY_4 },
+ { DVBFE_DVBT_HIERARCHY_AUTO, HIERARCHY_AUTO },
+ { -1, -1 }
+};
+
+
+static int lookupval(int val, int reverse, int table[][2])
+{
+ int i =0;
+
+ while(table[i][0] != -1) {
+ if (!reverse) {
+ if (val == table[i][0]) {
+ return table[i][1];
+ }
+ } else {
+ if (val == table[i][1]) {
+ return table[i][0];
+ }
+ }
+ i++;
+ }
+
+ return -1;
+}
+
+
+struct dvbfe_handle {
+ int fd;
+ enum dvbfe_type type;
+ char *name;
+};
+
+struct dvbfe_handle *dvbfe_open(int adapter, int frontend, int readonly)
+{
+ char filename[PATH_MAX+1];
+ struct dvbfe_handle *fehandle;
+ int fd;
+ struct dvb_frontend_info info;
+
+ // flags
+ int flags = O_RDWR;
+ if (readonly) {
+ flags = O_RDONLY;
+ }
+
+ // open it (try normal /dev structure first)
+ sprintf(filename, "/dev/dvb/adapter%i/frontend%i", adapter, frontend);
+ if ((fd = open(filename, flags)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.frontend%i", adapter, frontend);
+ if ((fd = open(filename, flags)) < 0) {
+ return NULL;
+ }
+ }
+
+ // determine fe type
+ if (ioctl(fd, FE_GET_INFO, &info)) {
+ close(fd);
+ return NULL;
+ }
+
+ // setup structure
+ fehandle = (struct dvbfe_handle*) malloc(sizeof(struct dvbfe_handle));
+ memset(fehandle, 0, sizeof(struct dvbfe_handle));
+ fehandle->fd = fd;
+ switch(info.type) {
+ case FE_QPSK:
+ fehandle->type = DVBFE_TYPE_DVBS;
+ break;
+
+ case FE_QAM:
+ fehandle->type = DVBFE_TYPE_DVBC;
+ break;
+
+ case FE_OFDM:
+ fehandle->type = DVBFE_TYPE_DVBT;
+ break;
+
+ case FE_ATSC:
+ fehandle->type = DVBFE_TYPE_ATSC;
+ break;
+ }
+ fehandle->name = strndup(info.name, sizeof(info.name));
+
+ // done
+ return fehandle;
+}
+
+void dvbfe_close(struct dvbfe_handle *fehandle)
+{
+ close(fehandle->fd);
+ free(fehandle->name);
+ free(fehandle);
+}
+
+extern int dvbfe_get_info(struct dvbfe_handle *fehandle,
+ enum dvbfe_info_mask querymask,
+ struct dvbfe_info *result,
+ enum dvbfe_info_querytype querytype,
+ int timeout)
+{
+ int returnval = 0;
+ struct dvb_frontend_event kevent;
+ int ok = 0;
+
+ result->name = fehandle->name;
+ result->type = fehandle->type;
+
+ switch(querytype) {
+ case DVBFE_INFO_QUERYTYPE_IMMEDIATE:
+ if (querymask & DVBFE_INFO_LOCKSTATUS) {
+ if (!ioctl(fehandle->fd, FE_READ_STATUS, &kevent.status)) {
+ returnval |= DVBFE_INFO_LOCKSTATUS;
+ }
+ }
+ if (querymask & DVBFE_INFO_FEPARAMS) {
+ if (!ioctl(fehandle->fd, FE_GET_FRONTEND, &kevent.parameters)) {
+ returnval |= DVBFE_INFO_FEPARAMS;
+ }
+ }
+ break;
+
+ case DVBFE_INFO_QUERYTYPE_LOCKCHANGE:
+ {
+ struct pollfd pollfd;
+ pollfd.fd = fehandle->fd;
+ pollfd.events = POLLIN | POLLERR;
+
+ ok = 1;
+ if (poll(&pollfd, 1, timeout) < 0)
+ ok = 0;
+ if (pollfd.revents & POLLERR)
+ ok = 0;
+ if (!(pollfd.revents & POLLIN))
+ ok = 0;
+ }
+
+ if (ok &&
+ ((querymask & DVBFE_INFO_LOCKSTATUS) ||
+ (querymask & DVBFE_INFO_FEPARAMS))) {
+ if (!ioctl(fehandle->fd, FE_GET_EVENT, &kevent)) {
+ if (querymask & DVBFE_INFO_LOCKSTATUS)
+ returnval |= DVBFE_INFO_LOCKSTATUS;
+ if (querymask & DVBFE_INFO_FEPARAMS)
+ returnval |= DVBFE_INFO_FEPARAMS;
+ }
+ }
+ break;
+ }
+
+ if (returnval & DVBFE_INFO_LOCKSTATUS) {
+ result->signal = kevent.status & FE_HAS_SIGNAL ? 1 : 0;
+ result->carrier = kevent.status & FE_HAS_CARRIER ? 1 : 0;
+ result->viterbi = kevent.status & FE_HAS_VITERBI ? 1 : 0;
+ result->sync = kevent.status & FE_HAS_SYNC ? 1 : 0;
+ result->lock = kevent.status & FE_HAS_LOCK ? 1 : 0;
+ }
+
+ if (returnval & DVBFE_INFO_FEPARAMS) {
+ result->feparams.frequency = kevent.parameters.frequency;
+ result->feparams.inversion = lookupval(kevent.parameters.inversion, 1, dvbfe_spectral_inversion_to_kapi);
+ switch(fehandle->type) {
+ case FE_QPSK:
+ result->feparams.u.dvbs.symbol_rate = kevent.parameters.u.qpsk.symbol_rate;
+ result->feparams.u.dvbs.fec_inner =
+ lookupval(kevent.parameters.u.qpsk.fec_inner, 1, dvbfe_code_rate_to_kapi);
+ break;
+
+ case FE_QAM:
+ result->feparams.u.dvbc.symbol_rate = kevent.parameters.u.qam.symbol_rate;
+ result->feparams.u.dvbc.fec_inner =
+ lookupval(kevent.parameters.u.qam.fec_inner, 1, dvbfe_code_rate_to_kapi);
+ result->feparams.u.dvbc.modulation =
+ lookupval(kevent.parameters.u.qam.modulation, 1, dvbfe_dvbc_mod_to_kapi);
+ break;
+
+ case FE_OFDM:
+ result->feparams.u.dvbt.bandwidth =
+ lookupval(kevent.parameters.u.ofdm.bandwidth, 1, dvbfe_dvbt_bandwidth_to_kapi);
+ result->feparams.u.dvbt.code_rate_HP =
+ lookupval(kevent.parameters.u.ofdm.code_rate_HP, 1, dvbfe_code_rate_to_kapi);
+ result->feparams.u.dvbt.code_rate_LP =
+ lookupval(kevent.parameters.u.ofdm.code_rate_LP, 1, dvbfe_code_rate_to_kapi);
+ result->feparams.u.dvbt.constellation =
+ lookupval(kevent.parameters.u.ofdm.constellation, 1, dvbfe_dvbt_const_to_kapi);
+ result->feparams.u.dvbt.transmission_mode =
+ lookupval(kevent.parameters.u.ofdm.transmission_mode, 1, dvbfe_dvbt_transmit_mode_to_kapi);
+ result->feparams.u.dvbt.guard_interval =
+ lookupval(kevent.parameters.u.ofdm.guard_interval, 1, dvbfe_dvbt_guard_interval_to_kapi);
+ result->feparams.u.dvbt.hierarchy_information =
+ lookupval(kevent.parameters.u.ofdm.hierarchy_information, 1, dvbfe_dvbt_hierarchy_to_kapi);
+ break;
+
+ case FE_ATSC:
+ result->feparams.u.atsc.modulation =
+ lookupval(kevent.parameters.u.vsb.modulation, 1, dvbfe_atsc_mod_to_kapi);
+ break;
+ }
+ }
+
+ if (querymask & DVBFE_INFO_BER) {
+ if (!ioctl(fehandle->fd, FE_READ_BER, &result->ber))
+ returnval |= DVBFE_INFO_BER;
+ }
+ if (querymask & DVBFE_INFO_SIGNAL_STRENGTH) {
+ if (!ioctl(fehandle->fd, FE_READ_SIGNAL_STRENGTH, &result->signal_strength))
+ returnval |= DVBFE_INFO_SIGNAL_STRENGTH;
+ }
+ if (querymask & DVBFE_INFO_SNR) {
+ if (!ioctl(fehandle->fd, FE_READ_SNR, &result->snr))
+ returnval |= DVBFE_INFO_SNR;
+ }
+ if (querymask & DVBFE_INFO_UNCORRECTED_BLOCKS) {
+ if (!ioctl(fehandle->fd, FE_READ_UNCORRECTED_BLOCKS, &result->ucblocks))
+ returnval |= DVBFE_INFO_UNCORRECTED_BLOCKS;
+ }
+
+ // done
+ return returnval;
+}
+
+int dvbfe_set(struct dvbfe_handle *fehandle,
+ struct dvbfe_parameters *params,
+ int timeout)
+{
+ struct dvb_frontend_parameters kparams;
+ int res;
+ struct timeval endtime;
+ fe_status_t status;
+
+ kparams.frequency = params->frequency;
+ kparams.inversion = lookupval(params->inversion, 0, dvbfe_spectral_inversion_to_kapi);
+ switch(fehandle->type) {
+ case FE_QPSK:
+ kparams.u.qpsk.symbol_rate = params->u.dvbs.symbol_rate;
+ kparams.u.qpsk.fec_inner = lookupval(params->u.dvbs.fec_inner, 0, dvbfe_code_rate_to_kapi);
+ break;
+
+ case FE_QAM:
+ kparams.u.qam.symbol_rate = params->u.dvbc.symbol_rate;
+ kparams.u.qam.fec_inner = lookupval(params->u.dvbc.fec_inner, 0, dvbfe_code_rate_to_kapi);
+ kparams.u.qam.modulation = lookupval(params->u.dvbc.modulation, 0, dvbfe_dvbc_mod_to_kapi);
+ break;
+
+ case FE_OFDM:
+ kparams.u.ofdm.bandwidth = lookupval(params->u.dvbt.bandwidth, 0, dvbfe_dvbt_bandwidth_to_kapi);
+ kparams.u.ofdm.code_rate_HP = lookupval(params->u.dvbt.code_rate_HP, 0, dvbfe_code_rate_to_kapi);
+ kparams.u.ofdm.code_rate_LP = lookupval(params->u.dvbt.code_rate_LP, 0, dvbfe_code_rate_to_kapi);
+ kparams.u.ofdm.constellation = lookupval(params->u.dvbt.constellation, 0, dvbfe_dvbt_const_to_kapi);
+ kparams.u.ofdm.transmission_mode =
+ lookupval(params->u.dvbt.transmission_mode, 0, dvbfe_dvbt_transmit_mode_to_kapi);
+ kparams.u.ofdm.guard_interval =
+ lookupval(params->u.dvbt.guard_interval, 0, dvbfe_dvbt_guard_interval_to_kapi);
+ kparams.u.ofdm.hierarchy_information =
+ lookupval(params->u.dvbt.hierarchy_information, 0, dvbfe_dvbt_hierarchy_to_kapi);
+ break;
+
+ case FE_ATSC:
+ kparams.u.vsb.modulation = lookupval(params->u.atsc.modulation, 0, dvbfe_atsc_mod_to_kapi);
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ // set it and check for error
+ res = ioctl(fehandle->fd, FE_SET_FRONTEND, &kparams);
+ if (res)
+ return res;
+
+ // 0 => return immediately
+ if (timeout == 0) {
+ return 0;
+ }
+
+ /* calculate timeout */
+ if (timeout > 0) {
+ gettimeofday(&endtime, NULL);
+ timeout *= 1000;
+ endtime.tv_sec += timeout / 1000000;
+ endtime.tv_usec += timeout % 1000000;
+ }
+
+ /* wait for a lock */
+ while(1) {
+ /* has it locked? */
+ if (!ioctl(fehandle->fd, FE_READ_STATUS, &status)) {
+ if (status & FE_HAS_LOCK) {
+ break;
+ }
+ }
+
+ /* check for timeout */
+ if (timeout > 0) {
+ struct timeval curtime;
+ gettimeofday(&curtime, NULL);
+ if ((curtime.tv_sec > endtime.tv_sec) ||
+ ((curtime.tv_sec == endtime.tv_sec) && (curtime.tv_usec >= endtime.tv_usec))) {
+ break;
+ }
+ }
+
+ /* delay for a bit */
+ usleep(100000);
+ }
+
+ /* exit */
+ if (status & FE_HAS_LOCK)
+ return 0;
+ return -ETIMEDOUT;
+}
+
+int dvbfe_get_pollfd(struct dvbfe_handle *handle)
+{
+ return handle->fd;
+}
+
+int dvbfe_set_22k_tone(struct dvbfe_handle *fehandle, enum dvbfe_sec_tone_mode tone)
+{
+ int ret = 0;
+
+ switch (tone) {
+ case DVBFE_SEC_TONE_OFF:
+ ret = ioctl(fehandle->fd, FE_SET_TONE, SEC_TONE_OFF);
+ break;
+ case DVBFE_SEC_TONE_ON:
+ ret = ioctl(fehandle->fd, FE_SET_TONE, SEC_TONE_ON);
+ break;
+ default:
+ print(verbose, ERROR, 1, "Invalid command !");
+ break;
+ }
+ if (ret == -1)
+ print(verbose, ERROR, 1, "IOCTL failed !");
+
+ return ret;
+}
+
+int dvbfe_set_tone_data_burst(struct dvbfe_handle *fehandle, enum dvbfe_sec_mini_cmd minicmd)
+{
+ int ret = 0;
+
+ switch (minicmd) {
+ case DVBFE_SEC_MINI_A:
+ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_BURST, SEC_MINI_A);
+ break;
+ case DVBFE_SEC_MINI_B:
+ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_BURST, SEC_MINI_B);
+ break;
+ default:
+ print(verbose, ERROR, 1, "Invalid command");
+ break;
+ }
+ if (ret == -1)
+ print(verbose, ERROR, 1, "IOCTL failed");
+
+ return ret;
+}
+
+int dvbfe_set_voltage(struct dvbfe_handle *fehandle, enum dvbfe_sec_voltage voltage)
+{
+ int ret = 0;
+
+ switch (voltage) {
+ case DVBFE_SEC_VOLTAGE_OFF:
+ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_OFF);
+ break;
+ case DVBFE_SEC_VOLTAGE_13:
+ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_13);
+ break;
+ case DVBFE_SEC_VOLTAGE_18:
+ ret = ioctl(fehandle->fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18);
+ break;
+ default:
+ print(verbose, ERROR, 1, "Invalid command");
+ break;
+ }
+ if (ret == -1)
+ print(verbose, ERROR, 1, "IOCTL failed");
+
+ return ret;
+}
+
+int dvbfe_set_high_lnb_voltage(struct dvbfe_handle *fehandle, int on)
+{
+ switch (on) {
+ case 0:
+ ioctl(fehandle->fd, FE_ENABLE_HIGH_LNB_VOLTAGE, 0);
+ break;
+ default:
+ ioctl(fehandle->fd, FE_ENABLE_HIGH_LNB_VOLTAGE, 1);
+ break;
+ }
+ return 0;
+}
+
+int dvbfe_do_dishnetworks_legacy_command(struct dvbfe_handle *fehandle, unsigned int cmd)
+{
+ int ret = 0;
+
+ ret = ioctl(fehandle->fd, FE_DISHNETWORK_SEND_LEGACY_CMD, cmd);
+ if (ret == -1)
+ print(verbose, ERROR, 1, "IOCTL failed");
+
+ return ret;
+}
+
+int dvbfe_do_diseqc_command(struct dvbfe_handle *fehandle, uint8_t *data, uint8_t len)
+{
+ int ret = 0;
+ struct dvb_diseqc_master_cmd diseqc_message;
+
+ if (len > 6)
+ return -EINVAL;
+
+ diseqc_message.msg_len = len;
+ memcpy(diseqc_message.msg, data, len);
+
+ ret = ioctl(fehandle->fd, FE_DISEQC_SEND_MASTER_CMD, &diseqc_message);
+ if (ret == -1)
+ print(verbose, ERROR, 1, "IOCTL failed");
+
+ return ret;
+}
+
+int dvbfe_diseqc_read(struct dvbfe_handle *fehandle, int timeout, unsigned char *buf, unsigned int len)
+{
+ struct dvb_diseqc_slave_reply reply;
+ int result;
+
+ if (len > 4)
+ len = 4;
+
+ reply.timeout = timeout;
+ reply.msg_len = len;
+
+ if ((result = ioctl(fehandle->fd, FE_DISEQC_RECV_SLAVE_REPLY, reply)) != 0)
+ return result;
+
+ if (reply.msg_len < len)
+ len = reply.msg_len;
+ memcpy(buf, reply.msg, len);
+
+ return len;
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbfe.h b/dvb-apps/lib/libdvbapi/dvbfe.h
new file mode 100644
index 0000000..69cb05b
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbfe.h
@@ -0,0 +1,333 @@
+/*
+ * libdvbfe - a DVB frontend library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ * Copyright (C) 2005 Manu Abraham <abraham.manu@gmail.com>
+ * Copyright (C) 2005 Kenneth Aafloy (kenneth@linuxtv.org)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBFE_H
+#define LIBDVBFE_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * The types of frontend we support.
+ */
+enum dvbfe_type {
+ DVBFE_TYPE_DVBS,
+ DVBFE_TYPE_DVBC,
+ DVBFE_TYPE_DVBT,
+ DVBFE_TYPE_ATSC,
+};
+
+enum dvbfe_spectral_inversion {
+ DVBFE_INVERSION_OFF,
+ DVBFE_INVERSION_ON,
+ DVBFE_INVERSION_AUTO
+};
+
+enum dvbfe_code_rate {
+ DVBFE_FEC_NONE,
+ DVBFE_FEC_1_2,
+ DVBFE_FEC_2_3,
+ DVBFE_FEC_3_4,
+ DVBFE_FEC_4_5,
+ DVBFE_FEC_5_6,
+ DVBFE_FEC_6_7,
+ DVBFE_FEC_7_8,
+ DVBFE_FEC_8_9,
+ DVBFE_FEC_AUTO
+};
+
+enum dvbfe_dvbt_const {
+ DVBFE_DVBT_CONST_QPSK,
+ DVBFE_DVBT_CONST_QAM_16,
+ DVBFE_DVBT_CONST_QAM_32,
+ DVBFE_DVBT_CONST_QAM_64,
+ DVBFE_DVBT_CONST_QAM_128,
+ DVBFE_DVBT_CONST_QAM_256,
+ DVBFE_DVBT_CONST_AUTO
+};
+
+enum dvbfe_dvbc_mod {
+ DVBFE_DVBC_MOD_QAM_16,
+ DVBFE_DVBC_MOD_QAM_32,
+ DVBFE_DVBC_MOD_QAM_64,
+ DVBFE_DVBC_MOD_QAM_128,
+ DVBFE_DVBC_MOD_QAM_256,
+ DVBFE_DVBC_MOD_AUTO,
+};
+
+enum dvbfe_atsc_mod {
+ DVBFE_ATSC_MOD_QAM_64,
+ DVBFE_ATSC_MOD_QAM_256,
+ DVBFE_ATSC_MOD_VSB_8,
+ DVBFE_ATSC_MOD_VSB_16,
+ DVBFE_ATSC_MOD_AUTO
+};
+
+enum dvbfe_dvbt_transmit_mode {
+ DVBFE_DVBT_TRANSMISSION_MODE_2K,
+ DVBFE_DVBT_TRANSMISSION_MODE_8K,
+ DVBFE_DVBT_TRANSMISSION_MODE_AUTO
+};
+
+enum dvbfe_dvbt_bandwidth {
+ DVBFE_DVBT_BANDWIDTH_8_MHZ,
+ DVBFE_DVBT_BANDWIDTH_7_MHZ,
+ DVBFE_DVBT_BANDWIDTH_6_MHZ,
+ DVBFE_DVBT_BANDWIDTH_AUTO
+};
+
+enum dvbfe_dvbt_guard_interval {
+ DVBFE_DVBT_GUARD_INTERVAL_1_32,
+ DVBFE_DVBT_GUARD_INTERVAL_1_16,
+ DVBFE_DVBT_GUARD_INTERVAL_1_8,
+ DVBFE_DVBT_GUARD_INTERVAL_1_4,
+ DVBFE_DVBT_GUARD_INTERVAL_AUTO
+};
+
+enum dvbfe_dvbt_hierarchy {
+ DVBFE_DVBT_HIERARCHY_NONE,
+ DVBFE_DVBT_HIERARCHY_1,
+ DVBFE_DVBT_HIERARCHY_2,
+ DVBFE_DVBT_HIERARCHY_4,
+ DVBFE_DVBT_HIERARCHY_AUTO
+};
+
+/**
+ * Structure used to store and communicate frontend parameters.
+ */
+struct dvbfe_parameters {
+ uint32_t frequency;
+ enum dvbfe_spectral_inversion inversion;
+ union {
+ struct {
+ uint32_t symbol_rate;
+ enum dvbfe_code_rate fec_inner;
+ } dvbs;
+
+ struct {
+ uint32_t symbol_rate;
+ enum dvbfe_code_rate fec_inner;
+ enum dvbfe_dvbc_mod modulation;
+ } dvbc;
+
+ struct {
+ enum dvbfe_dvbt_bandwidth bandwidth;
+ enum dvbfe_code_rate code_rate_HP;
+ enum dvbfe_code_rate code_rate_LP;
+ enum dvbfe_dvbt_const constellation;
+ enum dvbfe_dvbt_transmit_mode transmission_mode;
+ enum dvbfe_dvbt_guard_interval guard_interval;
+ enum dvbfe_dvbt_hierarchy hierarchy_information;
+ } dvbt;
+
+ struct {
+ enum dvbfe_atsc_mod modulation;
+ } atsc;
+ } u;
+};
+
+enum dvbfe_sec_voltage {
+ DVBFE_SEC_VOLTAGE_13,
+ DVBFE_SEC_VOLTAGE_18,
+ DVBFE_SEC_VOLTAGE_OFF
+};
+
+enum dvbfe_sec_tone_mode {
+ DVBFE_SEC_TONE_ON,
+ DVBFE_SEC_TONE_OFF
+};
+
+enum dvbfe_sec_mini_cmd {
+ DVBFE_SEC_MINI_A,
+ DVBFE_SEC_MINI_B
+};
+
+/**
+ * Mask of values used in the dvbfe_get_info() call.
+ */
+enum dvbfe_info_mask {
+ DVBFE_INFO_LOCKSTATUS = 0x01,
+ DVBFE_INFO_FEPARAMS = 0x02,
+ DVBFE_INFO_BER = 0x04,
+ DVBFE_INFO_SIGNAL_STRENGTH = 0x08,
+ DVBFE_INFO_SNR = 0x10,
+ DVBFE_INFO_UNCORRECTED_BLOCKS = 0x20,
+};
+
+/**
+ * Structure containing values used by the dvbfe_get_info() call.
+ */
+struct dvbfe_info {
+ enum dvbfe_type type; /* always retrieved */
+ const char *name; /* always retrieved */
+ unsigned int signal : 1; /* } DVBFE_INFO_LOCKSTATUS */
+ unsigned int carrier : 1; /* } */
+ unsigned int viterbi : 1; /* } */
+ unsigned int sync : 1; /* } */
+ unsigned int lock : 1; /* } */
+ struct dvbfe_parameters feparams; /* DVBFE_INFO_FEPARAMS */
+ uint32_t ber; /* DVBFE_INFO_BER */
+ uint16_t signal_strength; /* DVBFE_INFO_SIGNAL_STRENGTH */
+ uint16_t snr; /* DVBFE_INFO_SNR */
+ uint32_t ucblocks; /* DVBFE_INFO_UNCORRECTED_BLOCKS */
+};
+
+/**
+ * Possible types of query used in dvbfe_get_info.
+ *
+ * DVBFE_INFO_QUERYTYPE_IMMEDIATE - interrogate frontend for most up to date values.
+ * DVBFE_INFO_QUERYTYPE_LOCKCHANGE - return details from queued lock status
+ * change events, or wait for one to occur
+ * if none are queued.
+ */
+enum dvbfe_info_querytype {
+ DVBFE_INFO_QUERYTYPE_IMMEDIATE,
+ DVBFE_INFO_QUERYTYPE_LOCKCHANGE,
+};
+
+
+/**
+ * Frontend handle datatype.
+ */
+struct dvbfe_handle;
+
+/**
+ * Open a DVB frontend.
+ *
+ * @param adapter DVB adapter ID.
+ * @param frontend Frontend ID of that adapter to open.
+ * @param readonly If 1, frontend will be opened in readonly mode only.
+ * @return A handle on success, or NULL on failure.
+ */
+extern struct dvbfe_handle *dvbfe_open(int adapter, int frontend, int readonly);
+
+/**
+ * Close a DVB frontend.
+ *
+ * @param fehandle Handle opened with dvbfe_open().
+ */
+extern void dvbfe_close(struct dvbfe_handle *handle);
+
+/**
+ * Set the frontend tuning parameters.
+ *
+ * Note: this function provides only the basic tuning operation; you might want to
+ * investigate dvbfe_set_sec() in sec.h for a unified device tuning operation.
+ *
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param params Params to set.
+ * @param timeout <0 => wait forever for lock. 0=>return immediately, >0=>
+ * number of milliseconds to wait for a lock.
+ * @return 0 on locked (or if timeout==0 and everything else worked), or
+ * nonzero on failure (including no lock).
+ */
+extern int dvbfe_set(struct dvbfe_handle *fehandle,
+ struct dvbfe_parameters *params,
+ int timeout);
+
+/**
+ * Retrieve information about the frontend.
+ *
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param querymask ORed bitmask of desired DVBFE_INFO_* values.
+ * @param result Where to put the retrieved results.
+ * @param querytype Type of query requested.
+ * @param timeout Timeout in ms to use if querytype==lockchange (0=>no timeout, <0=> wait forever).
+ * @return ORed bitmask of DVBFE_INFO_* indicating which values were read successfully.
+ */
+extern int dvbfe_get_info(struct dvbfe_handle *fehandle,
+ enum dvbfe_info_mask querymask,
+ struct dvbfe_info *result,
+ enum dvbfe_info_querytype querytype,
+ int timeout);
+
+/**
+ * Get a file descriptor for polling for lock status changes.
+ *
+ * @param fehandle Handle opened with dvbfe_open().
+ * @return FD for polling.
+ */
+extern int dvbfe_get_pollfd(struct dvbfe_handle *handle);
+
+/**
+ * Tone/Data Burst control
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param tone, SEC_TONE_ON/SEC_TONE_OFF
+ */
+extern int dvbfe_set_22k_tone(struct dvbfe_handle *handle, enum dvbfe_sec_tone_mode tone);
+
+/**
+ * 22khz Tone control
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param adapter, minicmd, SEC_MINI_A/SEC_MINI_B
+ */
+extern int dvbfe_set_tone_data_burst(struct dvbfe_handle *handle, enum dvbfe_sec_mini_cmd minicmd);
+
+/**
+ * Voltage control
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param polarization, SEC_VOLTAGE_13/SEC_VOLTAGE_18/SEC_VOLTAGE_OFF
+ */
+extern int dvbfe_set_voltage(struct dvbfe_handle *handle, enum dvbfe_sec_voltage voltage);
+
+/**
+ * High LNB voltage control (increases voltage by 1v to compensate for long cables)
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param on 1 to enable, 0 to disable.
+ */
+extern int dvbfe_set_high_lnb_voltage(struct dvbfe_handle *fehandle, int on);
+
+/**
+ * Send a legacy Dish Networks command
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param cmd, the command to send
+ */
+extern int dvbfe_do_dishnetworks_legacy_command(struct dvbfe_handle *handle, unsigned int cmd);
+
+/**
+ * Send a DiSEqC Command
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param data, a pointer to am array containing the data to be sent.
+ * @param len Length of data in bytes, max 6 bytes.
+ */
+extern int dvbfe_do_diseqc_command(struct dvbfe_handle *handle, uint8_t *data, uint8_t len);
+
+/**
+ * Read a DISEQC response from the frontend.
+ *
+ * @param fehandle Handle opened with dvbfe_open().
+ * @param timeout Timeout for DISEQC response.
+ * @param buf Buffer to store response in.
+ * @param len Number of bytes in buffer.
+ * @return >= 0 on success (number of received bytes), <0 on failure.
+ */
+extern int dvbfe_diseqc_read(struct dvbfe_handle *fehandle, int timeout, unsigned char *buf, unsigned int len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBFE_H
diff --git a/dvb-apps/lib/libdvbapi/dvbnet.c b/dvb-apps/lib/libdvbapi/dvbnet.c
new file mode 100644
index 0000000..f0f08f9
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbnet.c
@@ -0,0 +1,104 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/dvb/net.h>
+#include <errno.h>
+#include "dvbnet.h"
+
+int dvbnet_open(int adapter, int netdeviceid)
+{
+ char filename[PATH_MAX+1];
+ int fd;
+
+ sprintf(filename, "/dev/dvb/adapter%i/net%i", adapter, netdeviceid);
+ if ((fd = open(filename, O_RDWR)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.net%i", adapter, netdeviceid);
+ fd = open(filename, O_RDWR);
+ }
+
+ return fd;
+}
+
+int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation)
+{
+ struct dvb_net_if params;
+ int status;
+
+ memset(&params, 0, sizeof(params));
+ params.pid = pid;
+
+ switch(encapsulation) {
+ case DVBNET_ENCAP_MPE:
+ params.feedtype = DVB_NET_FEEDTYPE_MPE;
+ break;
+
+ case DVBNET_ENCAP_ULE:
+ params.feedtype = DVB_NET_FEEDTYPE_ULE;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ status = ioctl(fd, NET_ADD_IF, &params);
+ if (status < 0)
+ return status;
+ return params.if_num;
+}
+
+int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation)
+{
+ struct dvb_net_if info;
+ int res;
+
+ memset(&info, 0, sizeof(struct dvb_net_if));
+ info.if_num = ifnum;
+
+ if ((res = ioctl(fd, NET_GET_IF, &info)) < 0)
+ return res;
+
+ *pid = info.pid;
+ switch(info.feedtype) {
+ case DVB_NET_FEEDTYPE_MPE:
+ *encapsulation = DVBNET_ENCAP_MPE;
+ break;
+
+ case DVB_NET_FEEDTYPE_ULE:
+ *encapsulation = DVBNET_ENCAP_ULE;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ return 0;
+}
+
+int dvbnet_remove_interface(int fd, int ifnum)
+{
+ return ioctl(fd, NET_REMOVE_IF, ifnum);
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbnet.h b/dvb-apps/lib/libdvbapi/dvbnet.h
new file mode 100644
index 0000000..287919f
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbnet.h
@@ -0,0 +1,87 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBNET_H
+#define LIBDVBNET_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * Possible encapsulations of data.
+ */
+enum dvbnet_encap {
+ DVBNET_ENCAP_MPE,
+ DVBNET_ENCAP_ULE,
+};
+
+/**
+ * The maximum allowed number of dvb network devices per adapter netdevice.
+ */
+#define DVBNET_MAX_INTERFACES 10
+
+/**
+ * Open a DVB net interface.
+ *
+ * @param adapter DVB adapter ID.
+ * @param netdeviceid Network control interface of that adapter to open.
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbnet_open(int adapter, int netdeviceid);
+
+/**
+ * Create a new DVBNET interface.
+ *
+ * @param fd FD opened with libdvbnet_open().
+ * @param pid PID of the stream containing the network data.
+ * @param encapsulation Encapsulation type of the stream (one of DVBNET_ENCAP_*).
+ * @return Index of new interface on success, < 0 on failure.
+ */
+extern int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation);
+
+/**
+ * Get details of a DVBNET interface.
+ *
+ * @param fd FD opened with libdvbnet_open().
+ * @param ifnum Index of interface to retrieve.
+ * @param pid The PID of the interface.
+ * @param encapsulation The encapsulation of the interface (DVBNET_ENCAP_*).
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation);
+
+/**
+ * Remove a DVBNET interface.
+ *
+ * @param fd FD opened with libdvbnet_open().
+ * @param ifnum Index of interface to remove.
+ * @return 0 on success, nonzero on failure.
+ */
+extern int dvbnet_remove_interface(int fd, int ifnum);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBNET_H
diff --git a/dvb-apps/lib/libdvbapi/dvbvideo.c b/dvb-apps/lib/libdvbapi/dvbvideo.c
new file mode 100644
index 0000000..f1ffbe8
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbvideo.c
@@ -0,0 +1,46 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/param.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/types.h>
+#include <linux/dvb/video.h>
+#include <errno.h>
+#include "dvbvideo.h"
+
+int dvbvideo_open(int adapter, int videodeviceid)
+{
+ char filename[PATH_MAX+1];
+ int fd;
+
+ sprintf(filename, "/dev/dvb/adapter%i/video%i", adapter, videodeviceid);
+ if ((fd = open(filename, O_RDWR)) < 0) {
+ // if that failed, try a flat /dev structure
+ sprintf(filename, "/dev/dvb%i.video%i", adapter, videodeviceid);
+ fd = open(filename, O_RDWR);
+ }
+
+ return fd;
+}
diff --git a/dvb-apps/lib/libdvbapi/dvbvideo.h b/dvb-apps/lib/libdvbapi/dvbvideo.h
new file mode 100644
index 0000000..cc49914
--- /dev/null
+++ b/dvb-apps/lib/libdvbapi/dvbvideo.h
@@ -0,0 +1,46 @@
+/*
+ * libdvbnet - a DVB network support library
+ *
+ * Copyright (C) 2005 Andrew de Quincey (adq_dvb@lidskialf.net)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef LIBDVBVIDEO_H
+#define LIBDVBVIDEO_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdint.h>
+
+/**
+ * Open a DVB video device.
+ *
+ * @param adapter DVB adapter ID.
+ * @param videodeviceid Id of video device of that adapter to open.
+ * @return A unix file descriptor on success, or -1 on failure.
+ */
+extern int dvbvideo_open(int adapter, int videodeviceid);
+
+// FIXME: this is a stub library
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LIBDVBVIDEO_H
diff --git a/dvb-apps/lib/libdvbcfg/Makefile b/dvb-apps/lib/libdvbcfg/Makefile
new file mode 100644
index 0000000..5e5e365
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/Makefile
@@ -0,0 +1,18 @@
+# Makefile for linuxtv.org dvb-apps/lib/libdvbcfg
+
+includes = dvbcfg_zapchannel.h \
+ dvbcfg_scanfile.h
+
+objects = dvbcfg_zapchannel.o \
+ dvbcfg_scanfile.o \
+ dvbcfg_common.o
+
+lib_name = libdvbcfg
+
+CPPFLAGS += -I../../lib
+
+.PHONY: all
+
+all: library
+
+include ../../Make.rules
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_common.c b/dvb-apps/lib/libdvbcfg/dvbcfg_common.c
new file mode 100644
index 0000000..1609e51
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_common.c
@@ -0,0 +1,136 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * common functions
+ *
+ * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
+ * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include "dvbcfg_common.h"
+
+int dvbcfg_parse_int(char **text, char *tokens)
+{
+ char *start = *text;
+ char *stop = *text;
+ int value;
+
+ while (*stop != '\0') {
+ if (strchr(tokens, *stop) != NULL) {
+ *stop = '\0';
+ stop++;
+ break;
+ }
+ stop++;
+ }
+
+ if (sscanf(start, "%i", &value) == 1) {
+ *text = stop;
+ return value;
+ }
+
+ *text = NULL;
+ return -1;
+}
+
+int dvbcfg_parse_char(char **text, char *tokens)
+{
+ char *start = *text;
+ char *stop = *text;
+ char value;
+
+ while (*stop != '\0') {
+ if (strchr(tokens, *stop) != NULL) {
+ *stop = '\0';
+ stop++;
+ break;
+ }
+ stop++;
+ }
+
+ if (sscanf(start, "%c", &value) == 1) {
+ *text = stop;
+ return value;
+ }
+
+ *text = NULL;
+ return -1;
+}
+
+int dvbcfg_parse_setting(char **text, char *tokens, const struct dvbcfg_setting *settings)
+{
+ char *start = *text;
+ char *stop = *text;
+
+ while (*stop != '\0') {
+ if (strchr(tokens, *stop) != NULL) {
+ *stop = '\0';
+ stop++;
+ break;
+ }
+ stop++;
+ }
+
+ while (settings->name) {
+ if (strcmp(start, settings->name) == 0) {
+ *text = stop;
+ return settings->value;
+ }
+ settings++;
+ }
+
+ *text = NULL;
+ return -1;
+}
+
+void dvbcfg_parse_string(char **text, char *tokens, char *dest, unsigned long size)
+{
+ char *start = *text;
+ char *stop = *text;
+ unsigned long length;
+
+ while ((*stop != '\0') && (strchr(tokens, *stop) == NULL))
+ stop++;
+
+ length = (stop - start) + 1;
+
+ if (length <= size) {
+ if (strchr(tokens, *stop) != NULL) {
+ *stop = '\0';
+ *text = stop + 1;
+ } else
+ *text = stop;
+ memcpy(dest, start, length);
+ return;
+ }
+
+ *text = NULL;
+ return;
+}
+
+const char *dvbcfg_lookup_setting(unsigned int setting, const struct dvbcfg_setting *settings)
+{
+ while (settings->name) {
+ if (setting == settings->value)
+ return settings->name;
+ settings++;
+ }
+
+ return NULL;
+}
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_common.h b/dvb-apps/lib/libdvbcfg/dvbcfg_common.h
new file mode 100644
index 0000000..2b5e876
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_common.h
@@ -0,0 +1,37 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * common functions
+ *
+ * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
+ * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef DVBCFG_COMMON_H
+#define DVBCFG_COMMON_H 1
+
+struct dvbcfg_setting {
+ const char *name;
+ unsigned int value;
+};
+
+extern int dvbcfg_parse_int(char **text, char *tokens);
+extern int dvbcfg_parse_char(char **text, char *tokens);
+extern int dvbcfg_parse_setting(char **text, char *tokens, const struct dvbcfg_setting *settings);
+extern void dvbcfg_parse_string(char **text, char *tokens, char *dest, unsigned long size);
+extern const char *dvbcfg_lookup_setting(unsigned int setting, const struct dvbcfg_setting *settings);
+
+#endif
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c b/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c
new file mode 100644
index 0000000..ec305a4
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.c
@@ -0,0 +1,282 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * scan channel file support
+ *
+ * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
+ * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define _GNU_SOURCE
+
+#include <malloc.h>
+#include <ctype.h>
+
+#include "dvbcfg_scanfile.h"
+#include "dvbcfg_common.h"
+
+static const struct dvbcfg_setting dvbcfg_fec_list[] = {
+ { "1/2", DVBFE_FEC_1_2 },
+ { "2/3", DVBFE_FEC_2_3 },
+ { "3/4", DVBFE_FEC_3_4 },
+ { "4/5", DVBFE_FEC_4_5 },
+ { "5/6", DVBFE_FEC_5_6 },
+ { "6/7", DVBFE_FEC_6_7 },
+ { "7/8", DVBFE_FEC_7_8 },
+ { "8/9", DVBFE_FEC_8_9 },
+ { "AUTO", DVBFE_FEC_AUTO },
+ { "NONE", DVBFE_FEC_NONE },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_dvbc_modulation_list[] = {
+ { "QAM16", DVBFE_DVBC_MOD_QAM_16 },
+ { "QAM32", DVBFE_DVBC_MOD_QAM_32 },
+ { "QAM64", DVBFE_DVBC_MOD_QAM_64 },
+ { "QAM128", DVBFE_DVBC_MOD_QAM_128 },
+ { "QAM256", DVBFE_DVBC_MOD_QAM_256 },
+ { "AUTO", DVBFE_DVBC_MOD_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_bandwidth_list[] = {
+ { "6MHz", DVBFE_DVBT_BANDWIDTH_6_MHZ },
+ { "7MHz", DVBFE_DVBT_BANDWIDTH_7_MHZ },
+ { "8MHz", DVBFE_DVBT_BANDWIDTH_8_MHZ },
+ { "AUTO", DVBFE_DVBT_BANDWIDTH_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_constellation_list[] = {
+ { "QAM16", DVBFE_DVBT_CONST_QAM_16 },
+ { "QAM32", DVBFE_DVBT_CONST_QAM_32 },
+ { "QAM64", DVBFE_DVBT_CONST_QAM_64 },
+ { "QAM128", DVBFE_DVBT_CONST_QAM_128 },
+ { "QAM256", DVBFE_DVBT_CONST_QAM_256 },
+ { "QPSK", DVBFE_DVBT_CONST_QPSK },
+ { "AUTO", DVBFE_DVBT_CONST_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_transmission_mode_list[] = {
+ { "2k", DVBFE_DVBT_TRANSMISSION_MODE_2K },
+ { "8k", DVBFE_DVBT_TRANSMISSION_MODE_8K },
+ { "AUTO", DVBFE_DVBT_TRANSMISSION_MODE_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_guard_interval_list[] = {
+ { "1/32", DVBFE_DVBT_GUARD_INTERVAL_1_32 },
+ { "1/16", DVBFE_DVBT_GUARD_INTERVAL_1_16 },
+ { "1/8", DVBFE_DVBT_GUARD_INTERVAL_1_8 },
+ { "1/4", DVBFE_DVBT_GUARD_INTERVAL_1_4 },
+ { "AUTO", DVBFE_DVBT_GUARD_INTERVAL_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_hierarchy_list[] = {
+ { "1", DVBFE_DVBT_HIERARCHY_1 },
+ { "2", DVBFE_DVBT_HIERARCHY_2 },
+ { "4", DVBFE_DVBT_HIERARCHY_4 },
+ { "AUTO", DVBFE_DVBT_HIERARCHY_AUTO },
+ { "NONE", DVBFE_DVBT_HIERARCHY_NONE },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_atsc_modulation_list[] = {
+ { "8VSB", DVBFE_ATSC_MOD_VSB_8 },
+ { "16VSB", DVBFE_ATSC_MOD_VSB_16 },
+ { "QAM64", DVBFE_ATSC_MOD_QAM_64 },
+ { "QAM256", DVBFE_ATSC_MOD_QAM_256 },
+ { NULL, 0 }
+};
+
+int dvbcfg_scanfile_parse(FILE *file, dvbcfg_scancallback callback, void *private_data)
+{
+ char *line_buf = NULL;
+ size_t line_size = 0;
+ int line_len = 0;
+ int ret_val = 0;
+
+ while ((line_len = getline(&line_buf, &line_size, file)) > 0) {
+ char *line_tmp = line_buf;
+ char *line_pos = line_buf;
+ struct dvbcfg_scanfile tmp;
+
+ /* remove newline and comments (started with hashes) */
+ while ((*line_tmp != '\0') && (*line_tmp != '\n') && (*line_tmp != '#'))
+ line_tmp++;
+ *line_tmp = '\0';
+
+ /* always use inversion auto */
+ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO;
+
+ /* parse frontend type */
+ switch(dvbcfg_parse_char(&line_pos, " ")) {
+ case 'T':
+ tmp.fe_type = DVBFE_TYPE_DVBT;
+ break;
+ case 'C':
+ tmp.fe_type = DVBFE_TYPE_DVBC;
+ break;
+ case 'S':
+ tmp.fe_type = DVBFE_TYPE_DVBS;
+ break;
+ case 'A':
+ tmp.fe_type = DVBFE_TYPE_ATSC;
+ break;
+ default:
+ continue;
+ }
+
+ /* parse frontend specific settings */
+ switch (tmp.fe_type) {
+ case DVBFE_TYPE_ATSC:
+
+ /* parse frequency */
+ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* modulation */
+ tmp.fe_params.u.atsc.modulation =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_atsc_modulation_list);
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBC:
+
+ /* parse frequency */
+ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* symbol rate */
+ tmp.fe_params.u.dvbc.symbol_rate = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* fec */
+ tmp.fe_params.u.dvbc.fec_inner =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* modulation */
+ tmp.fe_params.u.dvbc.modulation =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_dvbc_modulation_list);
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBS:
+
+ /* parse frequency */
+ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* polarization */
+ tmp.polarization = tolower(dvbcfg_parse_char(&line_pos, " "));
+ if (!line_pos)
+ continue;
+ if ((tmp.polarization != 'h') &&
+ (tmp.polarization != 'v') &&
+ (tmp.polarization != 'l') &&
+ (tmp.polarization != 'r'))
+ continue;
+
+ /* symbol rate */
+ tmp.fe_params.u.dvbs.symbol_rate = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* fec */
+ tmp.fe_params.u.dvbc.fec_inner =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBT:
+
+ /* parse frequency */
+ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, " ");
+ if (!line_pos)
+ continue;
+
+ /* bandwidth */
+ tmp.fe_params.u.dvbt.bandwidth =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_bandwidth_list);
+ if (!line_pos)
+ continue;
+
+ /* fec hp */
+ tmp.fe_params.u.dvbt.code_rate_HP =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* fec lp */
+ tmp.fe_params.u.dvbt.code_rate_LP =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* constellation */
+ tmp.fe_params.u.dvbt.constellation =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_constellation_list);
+ if (!line_pos)
+ continue;
+
+ /* transmission mode */
+ tmp.fe_params.u.dvbt.transmission_mode =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_transmission_mode_list);
+ if (!line_pos)
+ continue;
+
+ /* guard interval */
+ tmp.fe_params.u.dvbt.guard_interval =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_guard_interval_list);
+ if (!line_pos)
+ continue;
+
+ /* hierarchy */
+ tmp.fe_params.u.dvbt.hierarchy_information =
+ dvbcfg_parse_setting(&line_pos, " ", dvbcfg_hierarchy_list);
+ if (!line_pos)
+ continue;
+
+ break;
+ }
+
+ /* invoke callback */
+ if ((ret_val = callback(&tmp, private_data)) != 0) {
+ if (ret_val < 0)
+ ret_val = 0;
+ break;
+ }
+ }
+
+ if (line_buf)
+ free(line_buf);
+
+ return ret_val;
+}
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h b/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h
new file mode 100644
index 0000000..d7a20b1
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_scanfile.h
@@ -0,0 +1,61 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * scan channel file support
+ *
+ * Copyright (C) 2006 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef DVBCFG_SCANFILE_H
+#define DVBCFG_SCANFILE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libdvbapi/dvbfe.h>
+#include <stdio.h>
+
+struct dvbcfg_scanfile {
+ enum dvbfe_type fe_type;
+ struct dvbfe_parameters fe_params;
+ char polarization; /* l,r,v,h - only used for dvb-s */
+};
+
+/**
+ * Callback used in dvbcfg_scanfile_parse()
+ *
+ * @param channel Selected channel
+ * @param private_data Private data for the callback
+ * @return 0 to continue, other values to stop (values > 0 are forwarded; see below)
+ */
+typedef int (*dvbcfg_scancallback)(struct dvbcfg_scanfile *channel, void *private_data);
+
+/**
+ * Parse a linuxtv scan file
+ *
+ * @param file Linuxtv scan file
+ * @param callback Callback called for each scan entry
+ * @param private_data Private data for the callback
+ * @return on success 0 or value from the callback if it's > 0, error code on failure
+ */
+extern int dvbcfg_scanfile_parse(FILE *file, dvbcfg_scancallback callback, void *private_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DVBCFG_SCANFILE_H */
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c b/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c
new file mode 100644
index 0000000..2c2605e
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.c
@@ -0,0 +1,384 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * zap channel file support
+ *
+ * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
+ * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define _GNU_SOURCE
+
+#include <malloc.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "dvbcfg_zapchannel.h"
+#include "dvbcfg_common.h"
+
+static const struct dvbcfg_setting dvbcfg_inversion_list[] = {
+ { "INVERSION_ON", DVBFE_INVERSION_ON },
+ { "INVERSION_OFF", DVBFE_INVERSION_OFF },
+ { "INVERSION_AUTO", DVBFE_INVERSION_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_fec_list[] = {
+ { "FEC_1_2", DVBFE_FEC_1_2 },
+ { "FEC_2_3", DVBFE_FEC_2_3 },
+ { "FEC_3_4", DVBFE_FEC_3_4 },
+ { "FEC_4_5", DVBFE_FEC_4_5 },
+ { "FEC_5_6", DVBFE_FEC_5_6 },
+ { "FEC_6_7", DVBFE_FEC_6_7 },
+ { "FEC_7_8", DVBFE_FEC_7_8 },
+ { "FEC_8_9", DVBFE_FEC_8_9 },
+ { "FEC_AUTO", DVBFE_FEC_AUTO },
+ { "FEC_NONE", DVBFE_FEC_NONE },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_dvbc_modulation_list[] = {
+ { "QAM_16", DVBFE_DVBC_MOD_QAM_16 },
+ { "QAM_32", DVBFE_DVBC_MOD_QAM_32 },
+ { "QAM_64", DVBFE_DVBC_MOD_QAM_64 },
+ { "QAM_128", DVBFE_DVBC_MOD_QAM_128 },
+ { "QAM_256", DVBFE_DVBC_MOD_QAM_256 },
+ { "QAM_AUTO", DVBFE_DVBC_MOD_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_bandwidth_list[] = {
+ { "BANDWIDTH_6_MHZ", DVBFE_DVBT_BANDWIDTH_6_MHZ },
+ { "BANDWIDTH_7_MHZ", DVBFE_DVBT_BANDWIDTH_7_MHZ },
+ { "BANDWIDTH_8_MHZ", DVBFE_DVBT_BANDWIDTH_8_MHZ },
+ { "BANDWIDTH_AUTO", DVBFE_DVBT_BANDWIDTH_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_constellation_list[] = {
+ { "QAM_16", DVBFE_DVBT_CONST_QAM_16 },
+ { "QAM_32", DVBFE_DVBT_CONST_QAM_32 },
+ { "QAM_64", DVBFE_DVBT_CONST_QAM_64 },
+ { "QAM_128", DVBFE_DVBT_CONST_QAM_128 },
+ { "QAM_256", DVBFE_DVBT_CONST_QAM_256 },
+ { "QPSK", DVBFE_DVBT_CONST_QPSK },
+ { "QAM_AUTO", DVBFE_DVBT_CONST_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_transmission_mode_list[] = {
+ { "TRANSMISSION_MODE_2K", DVBFE_DVBT_TRANSMISSION_MODE_2K },
+ { "TRANSMISSION_MODE_8K", DVBFE_DVBT_TRANSMISSION_MODE_8K },
+ { "TRANSMISSION_MODE_AUTO", DVBFE_DVBT_TRANSMISSION_MODE_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_guard_interval_list[] = {
+ { "GUARD_INTERVAL_1_32", DVBFE_DVBT_GUARD_INTERVAL_1_32 },
+ { "GUARD_INTERVAL_1_16", DVBFE_DVBT_GUARD_INTERVAL_1_16 },
+ { "GUARD_INTERVAL_1_8", DVBFE_DVBT_GUARD_INTERVAL_1_8 },
+ { "GUARD_INTERVAL_1_4", DVBFE_DVBT_GUARD_INTERVAL_1_4 },
+ { "GUARD_INTERVAL_AUTO", DVBFE_DVBT_GUARD_INTERVAL_AUTO },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_hierarchy_list[] = {
+ { "HIERARCHY_1", DVBFE_DVBT_HIERARCHY_1 },
+ { "HIERARCHY_2", DVBFE_DVBT_HIERARCHY_2 },
+ { "HIERARCHY_4", DVBFE_DVBT_HIERARCHY_4 },
+ { "HIERARCHY_AUTO", DVBFE_DVBT_HIERARCHY_AUTO },
+ { "HIERARCHY_NONE", DVBFE_DVBT_HIERARCHY_NONE },
+ { NULL, 0 }
+};
+
+static const struct dvbcfg_setting dvbcfg_atsc_modulation_list[] = {
+ { "8VSB", DVBFE_ATSC_MOD_VSB_8 },
+ { "16VSB", DVBFE_ATSC_MOD_VSB_16 },
+ { "QAM_64", DVBFE_ATSC_MOD_QAM_64 },
+ { "QAM_256", DVBFE_ATSC_MOD_QAM_256 },
+ { NULL, 0 }
+};
+
+int dvbcfg_zapchannel_parse(FILE *file, dvbcfg_zapcallback callback, void *private_data)
+{
+ char *line_buf = NULL;
+ size_t line_size = 0;
+ int line_len = 0;
+ int ret_val = 0;
+
+ while ((line_len = getline(&line_buf, &line_size, file)) > 0) {
+ char *line_tmp = line_buf;
+ char *line_pos = line_buf;
+ struct dvbcfg_zapchannel tmp;
+
+ /* remove newline and comments (started with hashes) */
+ while ((*line_tmp != '\0') && (*line_tmp != '\n') && (*line_tmp != '#'))
+ line_tmp++;
+ *line_tmp = '\0';
+
+ /* parse name */
+ dvbcfg_parse_string(&line_pos, ":", tmp.name, sizeof(tmp.name));
+ if (!line_pos)
+ continue;
+
+ /* parse frequency */
+ tmp.fe_params.frequency = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos)
+ continue;
+
+ /* try to determine frontend type */
+ if (strstr(line_pos, ":FEC_")) {
+ if (strstr(line_pos, ":HIERARCHY_"))
+ tmp.fe_type = DVBFE_TYPE_DVBT;
+ else
+ tmp.fe_type = DVBFE_TYPE_DVBC;
+ } else {
+ if (strstr(line_pos, "VSB:") || strstr(line_pos, "QAM_"))
+ tmp.fe_type = DVBFE_TYPE_ATSC;
+ else
+ tmp.fe_type = DVBFE_TYPE_DVBS;
+ }
+
+ /* parse frontend specific settings */
+ switch (tmp.fe_type) {
+ case DVBFE_TYPE_ATSC:
+ /* inversion */
+ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO;
+
+ /* modulation */
+ tmp.fe_params.u.atsc.modulation =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_atsc_modulation_list);
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBC:
+ /* inversion */
+ tmp.fe_params.inversion =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_inversion_list);
+ if (!line_pos)
+ continue;
+
+ /* symbol rate */
+ tmp.fe_params.u.dvbc.symbol_rate = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos)
+ continue;
+
+ /* fec */
+ tmp.fe_params.u.dvbc.fec_inner =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* modulation */
+ tmp.fe_params.u.dvbc.modulation =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_dvbc_modulation_list);
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBS:
+ /* adjust frequency */
+ tmp.fe_params.frequency *= 1000;
+
+ /* inversion */
+ tmp.fe_params.inversion = DVBFE_INVERSION_AUTO;
+
+ /* fec */
+ tmp.fe_params.u.dvbs.fec_inner = DVBFE_FEC_AUTO;
+
+ /* polarization */
+ tmp.polarization = tolower(dvbcfg_parse_char(&line_pos, ":"));
+ if (!line_pos)
+ continue;
+ if ((tmp.polarization != 'h') &&
+ (tmp.polarization != 'v') &&
+ (tmp.polarization != 'l') &&
+ (tmp.polarization != 'r'))
+ continue;
+
+ /* satellite switch position */
+ tmp.diseqc_switch = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos)
+ continue;
+
+ /* symbol rate */
+ tmp.fe_params.u.dvbs.symbol_rate =
+ dvbcfg_parse_int(&line_pos, ":") * 1000;
+ if (!line_pos)
+ continue;
+
+ break;
+
+ case DVBFE_TYPE_DVBT:
+ /* inversion */
+ tmp.fe_params.inversion =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_inversion_list);
+ if (!line_pos)
+ continue;
+
+ /* bandwidth */
+ tmp.fe_params.u.dvbt.bandwidth =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_bandwidth_list);
+ if (!line_pos)
+ continue;
+
+ /* fec hp */
+ tmp.fe_params.u.dvbt.code_rate_HP =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* fec lp */
+ tmp.fe_params.u.dvbt.code_rate_LP =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_fec_list);
+ if (!line_pos)
+ continue;
+
+ /* constellation */
+ tmp.fe_params.u.dvbt.constellation =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_constellation_list);
+ if (!line_pos)
+ continue;
+
+ /* transmission mode */
+ tmp.fe_params.u.dvbt.transmission_mode =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_transmission_mode_list);
+ if (!line_pos)
+ continue;
+
+ /* guard interval */
+ tmp.fe_params.u.dvbt.guard_interval =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_guard_interval_list);
+ if (!line_pos)
+ continue;
+
+ /* hierarchy */
+ tmp.fe_params.u.dvbt.hierarchy_information =
+ dvbcfg_parse_setting(&line_pos, ":", dvbcfg_hierarchy_list);
+ if (!line_pos)
+ continue;
+
+ break;
+ }
+
+ /* parse video and audio pids and service id */
+ tmp.video_pid = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos)
+ continue;
+ tmp.audio_pid = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos)
+ continue;
+ tmp.service_id = dvbcfg_parse_int(&line_pos, ":");
+ if (!line_pos) /* old files don't have a service id */
+ tmp.service_id = 0;
+
+ /* invoke callback */
+ if ((ret_val = callback(&tmp, private_data)) != 0) {
+ if (ret_val < 0)
+ ret_val = 0;
+ break;
+ }
+ }
+
+ if (line_buf)
+ free(line_buf);
+
+ return ret_val;
+}
+
+int dvbcfg_zapchannel_save(FILE *file, dvbcfg_zapcallback callback, void *private_data)
+{
+ int ret_val = 0;
+ struct dvbcfg_zapchannel tmp;
+
+ while ((ret_val = callback(&tmp, private_data)) == 0) {
+ /* name */
+ if ((ret_val = fprintf(file, "%s:", tmp.name)) < 0)
+ return ret_val;
+
+ /* frontend specific settings */
+ switch (tmp.fe_type) {
+ case DVBFE_TYPE_ATSC:
+ if ((ret_val = fprintf(file, "%i:%s:",
+ tmp.fe_params.frequency,
+ dvbcfg_lookup_setting(tmp.fe_params.u.atsc.modulation,
+ dvbcfg_atsc_modulation_list))) < 0)
+ return ret_val;
+
+ break;
+
+ case DVBFE_TYPE_DVBC:
+ if ((ret_val = fprintf(file, "%i:%s:%i:%s:%s:",
+ tmp.fe_params.frequency,
+ dvbcfg_lookup_setting(tmp.fe_params.inversion,
+ dvbcfg_inversion_list),
+ tmp.fe_params.u.dvbc.symbol_rate,
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbc.fec_inner,
+ dvbcfg_fec_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbc.modulation,
+ dvbcfg_dvbc_modulation_list))) < 0)
+ return ret_val;
+
+ break;
+
+ case DVBFE_TYPE_DVBS:
+ if ((ret_val = fprintf(file, "%i:%c:%i:%i:",
+ tmp.fe_params.frequency / 1000,
+ tolower(tmp.polarization),
+ tmp.diseqc_switch,
+ tmp.fe_params.u.dvbs.symbol_rate / 1000)) < 0)
+ return ret_val;
+
+ break;
+ case DVBFE_TYPE_DVBT:
+ if ((ret_val = fprintf(file, "%i:%s:%s:%s:%s:%s:%s:%s:%s:",
+ tmp.fe_params.frequency,
+ dvbcfg_lookup_setting(tmp.fe_params.inversion,
+ dvbcfg_inversion_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.bandwidth,
+ dvbcfg_bandwidth_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.code_rate_HP,
+ dvbcfg_fec_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.code_rate_LP,
+ dvbcfg_fec_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.constellation,
+ dvbcfg_constellation_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.transmission_mode,
+ dvbcfg_transmission_mode_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.guard_interval,
+ dvbcfg_guard_interval_list),
+ dvbcfg_lookup_setting(tmp.fe_params.u.dvbt.hierarchy_information,
+ dvbcfg_hierarchy_list))) < 0)
+ return ret_val;
+
+ break;
+ }
+
+ /* video and audio pids and service id */
+ if ((ret_val = fprintf(file, "%i:%i:%i\n",
+ tmp.video_pid, tmp.audio_pid, tmp.service_id)) < 0)
+ return ret_val;
+
+ }
+
+ if (ret_val < 0)
+ ret_val = 0;
+
+ return ret_val;
+}
diff --git a/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h b/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h
new file mode 100644
index 0000000..67ec62e
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/dvbcfg_zapchannel.h
@@ -0,0 +1,77 @@
+/*
+ * dvbcfg - support for linuxtv configuration files
+ * zap channel file support
+ *
+ * Copyright (C) 2006 Christoph Pfister <christophpfister@gmail.com>
+ * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef DVBCFG_ZAPCHANNEL_H
+#define DVBCFG_ZAPCHANNEL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libdvbapi/dvbfe.h>
+#include <stdio.h>
+
+struct dvbcfg_zapchannel {
+ char name[128];
+ int video_pid;
+ int audio_pid;
+ int service_id;
+ enum dvbfe_type fe_type;
+ struct dvbfe_parameters fe_params;
+ char polarization; /* l,r,v,h - only used for dvb-s */
+ int diseqc_switch; /* only used for dvb-s */
+};
+
+/**
+ * Callback used in dvbcfg_zapchannel_parse() and dvbcfg_zapchannel_save()
+ *
+ * @param channel Selected channel
+ * @param private_data Private data for the callback
+ * @return 0 to continue, other values to stop (values > 0 are forwarded; see below)
+ */
+typedef int (*dvbcfg_zapcallback)(struct dvbcfg_zapchannel *channel, void *private_data);
+
+/**
+ * Parse a linuxtv channel file
+ *
+ * @param file Linuxtv channel file
+ * @param callback Callback called for each channel
+ * @param private_data Private data for the callback
+ * @return on success 0 or value from the callback if it's > 0, error code on failure
+ */
+extern int dvbcfg_zapchannel_parse(FILE *file, dvbcfg_zapcallback callback, void *private_data);
+
+/**
+ * Save to a linuxtv channel file
+ *
+ * @param file Linuxtv channel file
+ * @param callback Callback called for each channel
+ * @param private_data Private data for the callback
+ * @return on success 0 or value from the callback if it's > 0, error code on failure
+ */
+extern int dvbcfg_zapchannel_save(FILE *file, dvbcfg_zapcallback callback, void *private_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DVBCFG_ZAPCHANNEL_H */
diff --git a/dvb-apps/lib/libdvbcfg/zapchannel.txt b/dvb-apps/lib/libdvbcfg/zapchannel.txt
new file mode 100644
index 0000000..cdfdb87
--- /dev/null
+++ b/dvb-apps/lib/libdvbcfg/zapchannel.txt
@@ -0,0 +1,72 @@
+/**
+ * The zapchannel file format specifies tuning parameters for channels. Each line describes
+ * a single channel, and consists of multiple options separated by ':'. The exact
+ * format of each line depends on the DVB type of the channel (i.e. DVBS, DVBT, DVBC, or ATSC).
+ *
+ * Note: the lines have been split across multiple lines in the following due to length issues.
+ *
+ * The format for DVBT channels is:
+ *
+ * <name>:<frequency>:<inversion>:<bandwidth>:<fec_hp>:<fec_lp>:
+ * <constellation>:<transmission>:<guard_interval>:<hierarchy>:
+ * <video_pid>:<audio_pid>:<channel_number>
+ *
+ * name: name of the channel
+ * frequency: frequency in Hz
+ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO.
+ * bandwidth: one of BANDWIDTH_6_MHZ, BANDWIDTH_7_MHZ, or BANDWIDTH_8_MHZ.
+ * fec_hp: FEC of the high priority stream, one of: FEC_1_2, FEC_2_3,
+ * FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8, FEC_8_9, or FEC_AUTO.
+ * fec_lp: FEC of the low priority stream, one of: FEC_1_2, FEC_2_3,
+ * FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7, FEC_7_8, FEC_8_9, FEC_AUTO, or FEC_NONE.
+ * constellation: one of QPSK, QAM_128, QAM_16, QAM_256, QAM_32, or QAM_64.
+ * transmission: one of TRANSMISSION_MODE_2K, or TRANSMISSION_MODE_8K.
+ * guard_interval: one of GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, or GUARD_INTERVAL_1_4.
+ * hierarchy: one of HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, or HIERARCHY_4.
+ * video_pid: PID of the video stream.
+ * audio_pid: PID of the audio stream.
+ * channel_number: Transport stream channel number of the program.
+ *
+ * DVBC:
+ *
+ * <name>:<frequency>:<inversion>:<symbol_rate>:<fec>:
+ * <modulation>:<video_pid>:<audio_pid>:<channel_number>
+ *
+ * name: name of the channel
+ * frequency: frequency in Hz
+ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO.
+ * symbol_rate: Symbol rate of the channel in ksyms.
+ * fec: One of: FEC_1_2, FEC_2_3, FEC_3_4, FEC_4_5, FEC_5_6, FEC_6_7,
+ * FEC_7_8, FEC_8_9, or FEC_AUTO.
+ * modulation: one of QAM_16, QAM_32, QAM_64, QAM_128, QAM_256, QAM_AUTO.
+ * video_pid: PID of the video stream.
+ * audio_pid: PID of the audio stream.
+ * channel_number: Transport stream channel number of the program.
+ *
+ * DVBS:
+ *
+ * <name>:<frequency>:<polarization>:<satellite_switches>:<symbol_rate>:<video_pid>:<audio_pid>:<channel_number>
+ *
+ * name: name of the channel
+ * frequency: frequency in kHz
+ * polarization: one of H,V,L, or R.
+ * satellite_switches: Treated as a 2 bit value controlling switches in SEC equipment:
+ * bit 0: controls "satellite switch", 0: A, 1: B
+ * bit 1: controls "switch option", 0: A, 1: B
+ * symbol_rate: Symbol rate of the channel in ksyms.
+ * video_pid: PID of the video stream.
+ * audio_pid: PID of the audio stream.
+ * channel_number: Transport stream channel number of the program.
+ *
+ * ATSC:
+ *
+ * <name>:<frequency>:<inversion>:<modulation>:<video_pid>:<audio_pid>:<channel_number>
+ *
+ * name: name of the channel
+ * frequency: frequency in GHz
+ * inversion: one of INVERSION_OFF, INVERSION_ON, or INVERSION_AUTO.
+ * modulation: one of 8VSB, 16VSB, QAM_64, or QAM_256.
+ * video_pid: PID of the video stream.
+ * audio_pid: PID of the audio stream.
+ * channel_number: Transport stream channel number of the program.
+ */
diff --git a/dvb-apps/lib/libdvben50221/Makefile b/dvb-apps/lib/libdvben50221/Makefile
new file mode 100644
index 0000000..797ea2a
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/Makefile
@@ -0,0 +1,49 @@
+# Makefile for linuxtv.org dvb-apps/lib/libdvben50221
+
+includes = asn_1.h \
+ en50221_app_ai.h \
+ en50221_app_auth.h \
+ en50221_app_ca.h \
+ en50221_app_datetime.h \
+ en50221_app_dvb.h \
+ en50221_app_epg.h \
+ en50221_app_lowspeed.h \
+ en50221_app_mmi.h \
+ en50221_app_rm.h \
+ en50221_app_smartcard.h \
+ en50221_app_tags.h \
+ en50221_app_teletext.h \
+ en50221_app_utils.h \
+ en50221_errno.h \
+ en50221_session.h \
+ en50221_stdcam.h \
+ en50221_transport.h
+
+objects = asn_1.o \
+ en50221_app_ai.o \
+ en50221_app_auth.o \
+ en50221_app_ca.o \
+ en50221_app_datetime.o \
+ en50221_app_dvb.o \
+ en50221_app_epg.o \
+ en50221_app_lowspeed.o \
+ en50221_app_mmi.o \
+ en50221_app_rm.o \
+ en50221_app_smartcard.o \
+ en50221_app_teletext.o \
+ en50221_app_utils.o \
+ en50221_session.o \
+ en50221_stdcam.o \
+ en50221_stdcam_hlci.o \
+ en50221_stdcam_llci.o \
+ en50221_transport.o
+
+lib_name = libdvben50221
+
+CPPFLAGS += -I../../lib -DLOG_LEVEL=1 # FIXME
+
+.PHONY: all
+
+all: library
+
+include ../../Make.rules
diff --git a/dvb-apps/lib/libdvben50221/asn_1.c b/dvb-apps/lib/libdvben50221/asn_1.c
new file mode 100644
index 0000000..803eb60
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/asn_1.c
@@ -0,0 +1,83 @@
+/*
+ ASN.1 routines, implementation for libdvben50221
+ an implementation for the High Level Common Interface
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <stdio.h>
+#include "asn_1.h"
+
+int asn_1_decode(uint16_t * length, uint8_t * asn_1_array,
+ uint32_t asn_1_array_len)
+{
+ uint8_t length_field;
+
+ if (asn_1_array_len < 1)
+ return -1;
+ length_field = asn_1_array[0];
+
+ if (length_field < 0x80) {
+ // there is only one word
+ *length = length_field & 0x7f;
+ return 1;
+ } else if (length_field == 0x81) {
+ if (asn_1_array_len < 2)
+ return -1;
+
+ *length = asn_1_array[1];
+ return 2;
+ } else if (length_field == 0x82) {
+ if (asn_1_array_len < 3)
+ return -1;
+
+ *length = (asn_1_array[1] << 8) | asn_1_array[2];
+ return 3;
+ }
+
+ return -1;
+}
+
+int asn_1_encode(uint16_t length, uint8_t * asn_1_array,
+ uint32_t asn_1_array_len)
+{
+ if (length < 0x80) {
+ if (asn_1_array_len < 1)
+ return -1;
+
+ asn_1_array[0] = length & 0x7f;
+ return 1;
+ } else if (length < 0x100) {
+ if (asn_1_array_len < 2)
+ return -1;
+
+ asn_1_array[0] = 0x81;
+ asn_1_array[1] = length;
+ return 2;
+ } else {
+ if (asn_1_array_len < 3)
+ return -1;
+
+ asn_1_array[0] = 0x82;
+ asn_1_array[1] = length >> 8;
+ asn_1_array[2] = length;
+ return 3;
+ }
+
+ // never reached
+}
diff --git a/dvb-apps/lib/libdvben50221/asn_1.h b/dvb-apps/lib/libdvben50221/asn_1.h
new file mode 100644
index 0000000..c8774db
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/asn_1.h
@@ -0,0 +1,41 @@
+/*
+ ASN.1 routines, implementation for libdvben50221
+ an implementation for the High Level Common Interface
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __ASN_1_H__
+#define __ASN_1_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <stdint.h>
+
+int asn_1_decode(uint16_t * length, uint8_t * asn_1_array,
+ uint32_t asn_1_array_len);
+int asn_1_encode(uint16_t length, uint8_t * asn_1_array,
+ uint32_t asn_1_array_len);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_ai.c b/dvb-apps/lib/libdvben50221/en50221_app_ai.c
new file mode 100644
index 0000000..b7ded66
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_ai.c
@@ -0,0 +1,191 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <string.h>
+#include <libdvbmisc/dvbmisc.h>
+#include <pthread.h>
+#include "en50221_app_ai.h"
+#include "en50221_app_tags.h"
+#include "asn_1.h"
+
+struct en50221_app_ai {
+ struct en50221_app_send_functions *funcs;
+
+ en50221_app_ai_callback callback;
+ void *callback_arg;
+
+ pthread_mutex_t lock;
+};
+
+static int en50221_app_ai_parse_app_info(struct en50221_app_ai *ai,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data,
+ uint32_t data_length);
+
+
+struct en50221_app_ai *en50221_app_ai_create(struct en50221_app_send_functions *funcs)
+{
+ struct en50221_app_ai *ai = NULL;
+
+ // create structure and set it up
+ ai = malloc(sizeof(struct en50221_app_ai));
+ if (ai == NULL) {
+ return NULL;
+ }
+ ai->funcs = funcs;
+ ai->callback = NULL;
+
+ pthread_mutex_init(&ai->lock, NULL);
+
+ // done
+ return ai;
+}
+
+void en50221_app_ai_destroy(struct en50221_app_ai *ai)
+{
+ pthread_mutex_destroy(&ai->lock);
+ free(ai);
+}
+
+void en50221_app_ai_register_callback(struct en50221_app_ai *ai,
+ en50221_app_ai_callback callback,
+ void *arg)
+{
+ pthread_mutex_lock(&ai->lock);
+ ai->callback = callback;
+ ai->callback_arg = arg;
+ pthread_mutex_unlock(&ai->lock);
+}
+
+int en50221_app_ai_enquiry(struct en50221_app_ai *ai,
+ uint16_t session_number)
+{
+ uint8_t data[4];
+
+ data[0] = (TAG_APP_INFO_ENQUIRY >> 16) & 0xFF;
+ data[1] = (TAG_APP_INFO_ENQUIRY >> 8) & 0xFF;
+ data[2] = TAG_APP_INFO_ENQUIRY & 0xFF;
+ data[3] = 0;
+
+ return ai->funcs->send_data(ai->funcs->arg, session_number, data, 4);
+}
+
+int en50221_app_ai_entermenu(struct en50221_app_ai *ai,
+ uint16_t session_number)
+{
+ uint8_t data[4];
+
+ data[0] = (TAG_ENTER_MENU >> 16) & 0xFF;
+ data[1] = (TAG_ENTER_MENU >> 8) & 0xFF;
+ data[2] = TAG_ENTER_MENU & 0xFF;
+ data[3] = 0;
+
+ return ai->funcs->send_data(ai->funcs->arg, session_number, data, 4);
+}
+
+int en50221_app_ai_message(struct en50221_app_ai *ai,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint32_t resource_id,
+ uint8_t * data, uint32_t data_length)
+{
+ (void) resource_id;
+
+ // get the tag
+ if (data_length < 3) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2];
+
+ switch (tag) {
+ case TAG_APP_INFO:
+ return en50221_app_ai_parse_app_info(ai, slot_id,
+ session_number,
+ data + 3,
+ data_length - 3);
+ }
+
+ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag);
+ return -1;
+}
+
+
+
+
+
+
+
+static int en50221_app_ai_parse_app_info(struct en50221_app_ai *ai,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data,
+ uint32_t data_length)
+{
+ // parse the length field
+ int length_field_len;
+ uint16_t asn_data_length;
+ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) {
+ print(LOG_LEVEL, ERROR, 1,
+ "Received data with invalid length from module on slot %02x\n",
+ slot_id);
+ return -1;
+ }
+ // check it
+ if (asn_data_length < 6) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ if (asn_data_length > (data_length - length_field_len)) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ uint8_t *app_info = data + length_field_len;
+
+ // parse the fields
+ uint8_t application_type = app_info[0];
+ uint16_t application_manufacturer = (app_info[1] << 8) | app_info[2];
+ uint16_t manufacturer_code = (app_info[3] << 8) | app_info[4];
+ uint8_t menu_string_length = app_info[5];
+ uint8_t *menu_string = app_info + 6;
+
+ // check the menu_string_length
+ if (menu_string_length > (asn_data_length - 6)) {
+ print(LOG_LEVEL, ERROR, 1,
+ "Received bad menu string length - adjusting\n");
+ menu_string_length = asn_data_length - 6;
+ }
+ // tell the app
+ pthread_mutex_lock(&ai->lock);
+ en50221_app_ai_callback cb = ai->callback;
+ void *cb_arg = ai->callback_arg;
+ pthread_mutex_unlock(&ai->lock);
+ if (cb) {
+ return cb(cb_arg, slot_id, session_number,
+ application_type, application_manufacturer,
+ manufacturer_code, menu_string_length,
+ menu_string);
+ }
+ return 0;
+}
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_ai.h b/dvb-apps/lib/libdvben50221/en50221_app_ai.h
new file mode 100644
index 0000000..18b5cd2
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_ai.h
@@ -0,0 +1,136 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __EN50221_APPLICATION_AI_H__
+#define __EN50221_APPLICATION_AI_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <libdvben50221/en50221_app_utils.h>
+
+#define EN50221_APP_AI_RESOURCEID MKRID(2,1,1)
+
+#define APPLICATION_TYPE_CA 0x01
+#define APPLICATION_TYPE_EPG 0x02
+
+/**
+ * Type definition for application callback function - called when we receive
+ * an application info object.
+ *
+ * @param arg Private argument.
+ * @param slot_id Slot id concerned.
+ * @param session_number Resource id concerned.
+ * @param application_type Type of application.
+ * @param application_manufacturer Manufacturer of application.
+ * @param manufacturer_code Manufacturer specific code.
+ * @param menu_string_length Length of menu string.
+ * @param menu_string The menu string itself.
+ * @return 0 on success, -1 on failure.
+ */
+typedef int (*en50221_app_ai_callback) (void *arg,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t application_type,
+ uint16_t application_manufacturer,
+ uint16_t manufacturer_code,
+ uint8_t menu_string_length,
+ uint8_t * menu_string);
+
+/**
+ * Opaque type representing an application information resource.
+ */
+struct en50221_app_ai;
+
+/**
+ * Create an instance of an application information resource.
+ *
+ * @param funcs Send functions to use.
+ * @return Instance, or NULL on failure.
+ */
+extern struct en50221_app_ai *en50221_app_ai_create(struct en50221_app_send_functions *funcs);
+
+/**
+ * Destroy an instance of an application information resource.
+ *
+ * @param ai Instance to destroy.
+ */
+extern void en50221_app_ai_destroy(struct en50221_app_ai *ai);
+
+/**
+ * Register a callback for reception of application_info objects.
+ *
+ * @param ai Application information instance.
+ * @param callback Callback function.
+ * @param arg Private argument passed during calls to the callback.
+ */
+extern void en50221_app_ai_register_callback(struct en50221_app_ai *ai,
+ en50221_app_ai_callback,
+ void *arg);
+
+/**
+ * send a enquiry for the app_info provided by a module
+ *
+ * @param ai Application information instance.
+ * @param session_number Session to send on.
+ * @return 0 on success, -1 on failure.
+ */
+extern int en50221_app_ai_enquiry(struct en50221_app_ai *ai,
+ uint16_t session_number);
+
+/**
+ * send a enter_menu tag, this will make the application
+ * open a new MMI session to provide a Menu, or so.
+ *
+ * @param ai Application information instance.
+ * @param session_number Session to send on.
+ * @return 0 on success, -1 on failure.
+ */
+extern int en50221_app_ai_entermenu(struct en50221_app_ai *ai,
+ uint16_t session_number);
+
+/**
+ * Pass data received for this resource into it for parsing.
+ *
+ * @param ai Application information instance.
+ * @param slot_id Slot ID concerned.
+ * @param session_number Session number concerned.
+ * @param resource_id Resource ID concerned.
+ * @param data The data.
+ * @param data_length Length of data in bytes.
+ * @return 0 on success, -1 on failure.
+ */
+extern int en50221_app_ai_message(struct en50221_app_ai *ai,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint32_t resource_id,
+ uint8_t *data,
+ uint32_t data_length);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_auth.c b/dvb-apps/lib/libdvben50221/en50221_app_auth.c
new file mode 100644
index 0000000..a8902c1
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_auth.c
@@ -0,0 +1,180 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <string.h>
+#include <libdvbmisc/dvbmisc.h>
+#include <pthread.h>
+#include "en50221_app_auth.h"
+#include "en50221_app_tags.h"
+#include "asn_1.h"
+
+struct en50221_app_auth {
+ struct en50221_app_send_functions *funcs;
+
+ en50221_app_auth_request_callback callback;
+ void *callback_arg;
+
+ pthread_mutex_t lock;
+};
+
+static int en50221_app_auth_parse_request(struct en50221_app_auth *private,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data,
+ uint32_t data_length);
+
+
+struct en50221_app_auth *en50221_app_auth_create(struct en50221_app_send_functions *funcs)
+{
+ struct en50221_app_auth *auth = NULL;
+
+ // create structure and set it up
+ auth = malloc(sizeof(struct en50221_app_auth));
+ if (auth == NULL) {
+ return NULL;
+ }
+ auth->funcs = funcs;
+ auth->callback = NULL;
+
+ pthread_mutex_init(&auth->lock, NULL);
+
+ // done
+ return auth;
+}
+
+void en50221_app_auth_destroy(struct en50221_app_auth *auth)
+{
+ pthread_mutex_destroy(&auth->lock);
+ free(auth);
+}
+
+void en50221_app_auth_register_request_callback(struct en50221_app_auth *auth,
+ en50221_app_auth_request_callback callback, void *arg)
+{
+ pthread_mutex_lock(&auth->lock);
+ auth->callback = callback;
+ auth->callback_arg = arg;
+ pthread_mutex_unlock(&auth->lock);
+}
+
+int en50221_app_auth_send(struct en50221_app_auth *auth,
+ uint16_t session_number,
+ uint16_t auth_protocol_id, uint8_t * auth_data,
+ uint32_t auth_data_length)
+{
+ uint8_t buf[10];
+
+ // the header
+ buf[0] = (TAG_AUTH_RESP >> 16) & 0xFF;
+ buf[1] = (TAG_AUTH_RESP >> 8) & 0xFF;
+ buf[2] = TAG_AUTH_RESP & 0xFF;
+
+ // encode the length field
+ int length_field_len;
+ if ((length_field_len = asn_1_encode(auth_data_length + 2, buf + 3, 3)) < 0) {
+ return -1;
+ }
+ // the phase_id
+ buf[3 + length_field_len] = auth_protocol_id >> 8;
+ buf[3 + length_field_len + 1] = auth_protocol_id;
+
+ // build the iovecs
+ struct iovec iov[2];
+ iov[0].iov_base = buf;
+ iov[0].iov_len = 3 + length_field_len + 2;
+ iov[1].iov_base = auth_data;
+ iov[1].iov_len = auth_data_length;
+
+ // sendit
+ return auth->funcs->send_datav(auth->funcs->arg, session_number,
+ iov, 2);
+}
+
+int en50221_app_auth_message(struct en50221_app_auth *auth,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint32_t resource_id,
+ uint8_t * data, uint32_t data_length)
+{
+ (void) resource_id;
+
+ // get the tag
+ if (data_length < 3) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2];
+
+ switch (tag) {
+ case TAG_AUTH_REQ:
+ return en50221_app_auth_parse_request(auth, slot_id,
+ session_number,
+ data + 3,
+ data_length - 3);
+ }
+
+ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag);
+ return -1;
+}
+
+
+
+static int en50221_app_auth_parse_request(struct en50221_app_auth *auth,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data,
+ uint32_t data_length)
+{
+ // first of all, decode the length field
+ uint16_t asn_data_length;
+ int length_field_len;
+ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) {
+ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n");
+ return -1;
+ }
+ // check it
+ if (asn_data_length < 2) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ if (asn_data_length > (data_length - length_field_len)) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ uint8_t *auth_data = data + length_field_len;
+
+ // process it
+ uint16_t auth_protocol_id = (auth_data[0] << 8) | auth_data[1];
+
+ // tell the app
+ pthread_mutex_lock(&auth->lock);
+ en50221_app_auth_request_callback cb = auth->callback;
+ void *cb_arg = auth->callback_arg;
+ pthread_mutex_unlock(&auth->lock);
+ if (cb) {
+ return cb(cb_arg, slot_id, session_number,
+ auth_protocol_id, auth_data + 2,
+ asn_data_length - 2);
+ }
+ return 0;
+}
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_auth.h b/dvb-apps/lib/libdvben50221/en50221_app_auth.h
new file mode 100644
index 0000000..2b1d2e7
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_auth.h
@@ -0,0 +1,123 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#ifndef __EN50221_APPLICATION_auth_H__
+#define __EN50221_APPLICATION_auth_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <libdvben50221/en50221_app_utils.h>
+
+#define EN50221_APP_AUTH_RESOURCEID MKRID(16,1,1)
+
+/**
+ * Type definition for request - called when we receive a auth request from a CAM.
+ *
+ * @param arg Private argument.
+ * @param slot_id Slot id concerned.
+ * @param session_number Session number concerned.
+ * @param auth_protocol_id Auth protocol id.
+ * @param auth_data Data for the request.
+ * @param auth_data_lenghth Number of bytes.
+ * @return 0 on success, -1 on failure.
+ */
+typedef int (*en50221_app_auth_request_callback) (void *arg,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint16_t auth_protcol_id,
+ uint8_t *auth_data,
+ uint32_t auth_data_length);
+
+/**
+ * Opaque type representing a auth resource.
+ */
+struct en50221_app_auth;
+
+/**
+ * Create an instance of the auth resource.
+ *
+ * @param funcs Send functions to use.
+ * @return Instance, or NULL on failure.
+ */
+extern struct en50221_app_auth *en50221_app_auth_create(struct en50221_app_send_functions *funcs);
+
+/**
+ * Destroy an instance of the auth resource.
+ *
+ * @param auth Instance to destroy.
+ */
+extern void en50221_app_auth_destroy(struct en50221_app_auth *auth);
+
+/**
+ * Register the callback for when we receive a request.
+ *
+ * @param auth auth resource instance.
+ * @param callback The callback. Set to NULL to remove the callback completely.
+ * @param arg Private data passed as arg0 of the callback.
+ */
+extern void en50221_app_auth_register_request_callback(struct en50221_app_auth *auth,
+ en50221_app_auth_request_callback callback,
+ void *arg);
+
+/**
+ * Send an auth response to the CAM.
+ *
+ * @param auth auth resource instance.
+ * @param session_number Session number to send it on.
+ * @param auth_protocol_id Auth protocol id.
+ * @param auth_data Auth data.
+ * @param auth_data_length Number of bytes.
+ * @return 0 on success, -1 on failure.
+ */
+extern int en50221_app_auth_send(struct en50221_app_auth *auth,
+ uint16_t session_number,
+ uint16_t auth_protocol_id,
+ uint8_t *auth_data,
+ uint32_t auth_data_length);
+
+/**
+ * Pass data received for this resource into it for parsing.
+ *
+ * @param auth Authentication instance.
+ * @param slot_id Slot ID concerned.
+ * @param session_number Session number concerned.
+ * @param resource_id Resource ID concerned.
+ * @param data The data.
+ * @param data_length Length of data in bytes.
+ * @return 0 on success, -1 on failure.
+ */
+extern int en50221_app_auth_message(struct en50221_app_auth *auth,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint32_t resource_id,
+ uint8_t *data,
+ uint32_t data_length);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_ca.c b/dvb-apps/lib/libdvben50221/en50221_app_ca.c
new file mode 100644
index 0000000..22d4499
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_ca.c
@@ -0,0 +1,631 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <string.h>
+#include <libdvbmisc/dvbmisc.h>
+#include <pthread.h>
+#include <libucsi/mpeg/descriptor.h>
+#include "en50221_app_ca.h"
+#include "asn_1.h"
+
+// tags supported by this resource
+#define TAG_CA_INFO_ENQUIRY 0x9f8030
+#define TAG_CA_INFO 0x9f8031
+#define TAG_CA_PMT 0x9f8032
+#define TAG_CA_PMT_REPLY 0x9f8033
+
+struct en50221_app_ca {
+ struct en50221_app_send_functions *funcs;
+
+ en50221_app_ca_info_callback ca_info_callback;
+ void *ca_info_callback_arg;
+
+ en50221_app_ca_pmt_reply_callback ca_pmt_reply_callback;
+ void *ca_pmt_reply_callback_arg;
+
+ pthread_mutex_t lock;
+};
+
+struct ca_pmt_descriptor {
+ uint8_t *descriptor;
+ uint16_t length;
+
+ struct ca_pmt_descriptor *next;
+};
+
+struct ca_pmt_stream {
+ uint8_t stream_type;
+ uint16_t pid;
+ struct ca_pmt_descriptor *descriptors;
+ uint32_t descriptors_length;
+ uint32_t descriptors_count;
+
+ struct ca_pmt_stream *next;
+};
+
+static int en50221_ca_extract_pmt_descriptors(struct mpeg_pmt_section *pmt,
+ struct ca_pmt_descriptor **outdescriptors);
+static int en50221_ca_extract_streams(struct mpeg_pmt_section *pmt,
+ struct ca_pmt_stream **outstreams);
+static void en50221_ca_try_move_pmt_descriptors(struct ca_pmt_descriptor **pmt_descriptors,
+ struct ca_pmt_stream **pmt_streams);
+static uint32_t en50221_ca_calculate_length(struct ca_pmt_descriptor *pmt_descriptors,
+ uint32_t *pmt_descriptors_length,
+ struct ca_pmt_stream *pmt_streams);
+static int en50221_app_ca_parse_info(struct en50221_app_ca *ca,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data, uint32_t data_length);
+static int en50221_app_ca_parse_reply(struct en50221_app_ca *ca,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data,
+ uint32_t data_length);
+
+
+
+struct en50221_app_ca *en50221_app_ca_create(struct en50221_app_send_functions *funcs)
+{
+ struct en50221_app_ca *ca = NULL;
+
+ // create structure and set it up
+ ca = malloc(sizeof(struct en50221_app_ca));
+ if (ca == NULL) {
+ return NULL;
+ }
+ ca->funcs = funcs;
+ ca->ca_info_callback = NULL;
+ ca->ca_pmt_reply_callback = NULL;
+
+ pthread_mutex_init(&ca->lock, NULL);
+
+ // done
+ return ca;
+}
+
+void en50221_app_ca_destroy(struct en50221_app_ca *ca)
+{
+ pthread_mutex_destroy(&ca->lock);
+ free(ca);
+}
+
+void en50221_app_ca_register_info_callback(struct en50221_app_ca *ca,
+ en50221_app_ca_info_callback
+ callback, void *arg)
+{
+ pthread_mutex_lock(&ca->lock);
+ ca->ca_info_callback = callback;
+ ca->ca_info_callback_arg = arg;
+ pthread_mutex_unlock(&ca->lock);
+}
+
+void en50221_app_ca_register_pmt_reply_callback(struct en50221_app_ca *ca,
+ en50221_app_ca_pmt_reply_callback
+ callback, void *arg)
+{
+ pthread_mutex_lock(&ca->lock);
+ ca->ca_pmt_reply_callback = callback;
+ ca->ca_pmt_reply_callback_arg = arg;
+ pthread_mutex_unlock(&ca->lock);
+}
+
+int en50221_app_ca_info_enq(struct en50221_app_ca *ca,
+ uint16_t session_number)
+{
+ uint8_t data[4];
+
+ data[0] = (TAG_CA_INFO_ENQUIRY >> 16) & 0xFF;
+ data[1] = (TAG_CA_INFO_ENQUIRY >> 8) & 0xFF;
+ data[2] = TAG_CA_INFO_ENQUIRY & 0xFF;
+ data[3] = 0;
+ return ca->funcs->send_data(ca->funcs->arg, session_number, data, 4);
+}
+
+int en50221_app_ca_pmt(struct en50221_app_ca *ca,
+ uint16_t session_number,
+ uint8_t * ca_pmt, uint32_t ca_pmt_length)
+{
+ uint8_t buf[10];
+
+ // set up the tag
+ buf[0] = (TAG_CA_PMT >> 16) & 0xFF;
+ buf[1] = (TAG_CA_PMT >> 8) & 0xFF;
+ buf[2] = TAG_CA_PMT & 0xFF;
+
+ // encode the length field
+ int length_field_len;
+ if ((length_field_len = asn_1_encode(ca_pmt_length, buf + 3, 3)) < 0) {
+ return -1;
+ }
+ // build the iovecs
+ struct iovec iov[2];
+ iov[0].iov_base = buf;
+ iov[0].iov_len = 3 + length_field_len;
+ iov[1].iov_base = ca_pmt;
+ iov[1].iov_len = ca_pmt_length;
+
+ // create the data and send it
+ return ca->funcs->send_datav(ca->funcs->arg, session_number, iov, 2);
+}
+
+int en50221_app_ca_message(struct en50221_app_ca *ca,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint32_t resource_id,
+ uint8_t * data, uint32_t data_length)
+{
+ (void) resource_id;
+
+ // get the tag
+ if (data_length < 3) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ uint32_t tag = (data[0] << 16) | (data[1] << 8) | data[2];
+
+ switch (tag) {
+ case TAG_CA_INFO:
+ return en50221_app_ca_parse_info(ca, slot_id,
+ session_number, data + 3,
+ data_length - 3);
+ case TAG_CA_PMT_REPLY:
+ return en50221_app_ca_parse_reply(ca, slot_id,
+ session_number, data + 3,
+ data_length - 3);
+ }
+
+ print(LOG_LEVEL, ERROR, 1, "Received unexpected tag %x\n", tag);
+ return -1;
+}
+
+int en50221_ca_format_pmt(struct mpeg_pmt_section *pmt, uint8_t * data,
+ uint32_t data_length, int move_ca_descriptors,
+ uint8_t ca_pmt_list_management,
+ uint8_t ca_pmt_cmd_id)
+{
+ struct ca_pmt_descriptor *pmt_descriptors = NULL;
+ uint32_t pmt_descriptors_length = 0;
+ struct ca_pmt_stream *pmt_streams = NULL;
+ uint32_t total_required_length = 0;
+ struct ca_pmt_descriptor *cur_d;
+ struct ca_pmt_stream *cur_s;
+ int result = -1;
+
+ // extract the descriptors and streams
+ if (en50221_ca_extract_pmt_descriptors(pmt, &pmt_descriptors))
+ goto cleanup;
+ if (en50221_ca_extract_streams(pmt, &pmt_streams))
+ goto cleanup;
+
+ // try and merge them if we have no PMT descriptors
+ if ((pmt_descriptors == NULL) && move_ca_descriptors) {
+ en50221_ca_try_move_pmt_descriptors(&pmt_descriptors,
+ &pmt_streams);
+ }
+ // calculate the length of all descriptors/streams and the total length required
+ total_required_length =
+ en50221_ca_calculate_length(pmt_descriptors,
+ &pmt_descriptors_length,
+ pmt_streams);
+
+ // ensure we were supplied with enough data
+ if (total_required_length > data_length) {
+ goto cleanup;
+ }
+ // format the start of the PMT
+ uint32_t data_pos = 0;
+ data[data_pos++] = ca_pmt_list_management;
+ data[data_pos++] = mpeg_pmt_section_program_number(pmt) >> 8;
+ data[data_pos++] = mpeg_pmt_section_program_number(pmt);
+ data[data_pos++] =
+ (pmt->head.version_number << 1) | pmt->head.
+ current_next_indicator;
+ data[data_pos++] = (pmt_descriptors_length >> 8) & 0x0f;
+ data[data_pos++] = pmt_descriptors_length;
+
+ // append the PMT descriptors
+ if (pmt_descriptors_length) {
+ data[data_pos++] = ca_pmt_cmd_id;
+ cur_d = pmt_descriptors;
+ while (cur_d) {
+ memcpy(data + data_pos, cur_d->descriptor,
+ cur_d->length);
+ data_pos += cur_d->length;
+ cur_d = cur_d->next;
+ }
+ }
+ // now, append the streams
+ cur_s = pmt_streams;
+ while (cur_s) {
+ data[data_pos++] = cur_s->stream_type;
+ data[data_pos++] = (cur_s->pid >> 8) & 0x1f;
+ data[data_pos++] = cur_s->pid;
+ data[data_pos++] = (cur_s->descriptors_length >> 8) & 0x0f;
+ data[data_pos++] = cur_s->descriptors_length;
+
+ // append the stream descriptors
+ if (cur_s->descriptors_length) {
+ data[data_pos++] = ca_pmt_cmd_id;
+ cur_d = cur_s->descriptors;
+ while (cur_d) {
+ memcpy(data + data_pos, cur_d->descriptor,
+ cur_d->length);
+ data_pos += cur_d->length;
+ cur_d = cur_d->next;
+ }
+ }
+ cur_s = cur_s->next;
+ }
+ result = data_pos;
+
+
+ cleanup:
+ // free the PMT descriptors
+ cur_d = pmt_descriptors;
+ while (cur_d) {
+ struct ca_pmt_descriptor *next = cur_d->next;
+ free(cur_d);
+ cur_d = next;
+ }
+
+ // free the streams
+ cur_s = pmt_streams;
+ while (cur_s) {
+ struct ca_pmt_stream *next_s = cur_s->next;
+
+ // free the stream descriptors
+ cur_d = cur_s->descriptors;
+ while (cur_d) {
+ struct ca_pmt_descriptor *next_d = cur_d->next;
+ free(cur_d);
+ cur_d = next_d;
+ }
+
+ free(cur_s);
+ cur_s = next_s;
+ }
+ return result;
+}
+
+
+
+
+
+
+
+static int en50221_ca_extract_pmt_descriptors(struct mpeg_pmt_section *pmt,
+ struct ca_pmt_descriptor **outdescriptors)
+{
+ struct ca_pmt_descriptor *descriptors = NULL;
+ struct ca_pmt_descriptor *descriptors_tail = NULL;
+ struct ca_pmt_descriptor *cur_d;
+
+ struct descriptor *cur_descriptor;
+ mpeg_pmt_section_descriptors_for_each(pmt, cur_descriptor) {
+ if (cur_descriptor->tag == dtag_mpeg_ca) {
+ // create a new structure for this one
+ struct ca_pmt_descriptor *new_d =
+ malloc(sizeof(struct ca_pmt_descriptor));
+ if (new_d == NULL) {
+ goto error_exit;
+ }
+ new_d->descriptor = (uint8_t *) cur_descriptor;
+ new_d->length = cur_descriptor->len + 2;
+ new_d->next = NULL;
+
+ // append it to the list
+ if (descriptors == NULL) {
+ descriptors = new_d;
+ } else {
+ descriptors_tail->next = new_d;
+ }
+ descriptors_tail = new_d;
+ }
+ }
+ *outdescriptors = descriptors;
+ return 0;
+
+error_exit:
+ cur_d = descriptors;
+ while (cur_d) {
+ struct ca_pmt_descriptor *next = cur_d->next;
+ free(cur_d);
+ cur_d = next;
+ }
+ return -1;
+}
+
+static int en50221_ca_extract_streams(struct mpeg_pmt_section *pmt,
+ struct ca_pmt_stream **outstreams)
+{
+ struct ca_pmt_stream *streams = NULL;
+ struct ca_pmt_stream *streams_tail = NULL;
+ struct mpeg_pmt_stream *cur_stream;
+ struct descriptor *cur_descriptor;
+ struct ca_pmt_stream *cur_s;
+
+ mpeg_pmt_section_streams_for_each(pmt, cur_stream) {
+ struct ca_pmt_descriptor *descriptors_tail = NULL;
+
+ // create a new structure
+ struct ca_pmt_stream *new_s =
+ malloc(sizeof(struct ca_pmt_stream));
+ if (new_s == NULL) {
+ goto exit_cleanup;
+ }
+ new_s->stream_type = cur_stream->stream_type;
+ new_s->pid = cur_stream->pid;
+ new_s->descriptors = NULL;
+ new_s->next = NULL;
+ new_s->descriptors_count = 0;
+
+ // append it to the list
+ if (streams == NULL) {
+ streams = new_s;
+ } else {
+ streams_tail->next = new_s;
+ }
+ streams_tail = new_s;
+
+ // now process the descriptors
+ mpeg_pmt_stream_descriptors_for_each(cur_stream,
+ cur_descriptor) {
+ if (cur_descriptor->tag == dtag_mpeg_ca) {
+ // create a new structure
+ struct ca_pmt_descriptor *new_d =
+ malloc(sizeof(struct ca_pmt_descriptor));
+ if (new_d == NULL) {
+ goto exit_cleanup;
+ }
+ new_d->descriptor =
+ (uint8_t *) cur_descriptor;
+ new_d->length = cur_descriptor->len + 2;
+ new_d->next = NULL;
+
+ // append it to the list
+ if (new_s->descriptors == NULL) {
+ new_s->descriptors = new_d;
+ } else {
+ descriptors_tail->next = new_d;
+ }
+ descriptors_tail = new_d;
+ new_s->descriptors_count++;
+ }
+ }
+ }
+ *outstreams = streams;
+ return 0;
+
+exit_cleanup:
+ // free the streams
+ cur_s = streams;
+ while (cur_s) {
+ struct ca_pmt_stream *next_s = cur_s->next;
+
+ // free the stream descriptors
+ struct ca_pmt_descriptor *cur_d = cur_s->descriptors;
+ while (cur_d) {
+ struct ca_pmt_descriptor *next_d = cur_d->next;
+ free(cur_d);
+ cur_d = next_d;
+ }
+
+ free(cur_s);
+ cur_s = next_s;
+ }
+ return -1;
+}
+
+static void en50221_ca_try_move_pmt_descriptors(struct ca_pmt_descriptor **pmt_descriptors,
+ struct ca_pmt_stream **pmt_streams)
+{
+ // get the first stream
+ struct ca_pmt_stream *first_stream = *pmt_streams;
+ if (first_stream == NULL)
+ return;
+
+ // Check that all the other streams with CA descriptors have exactly the same CA descriptors
+ struct ca_pmt_stream *cur_stream = first_stream->next;
+ while (cur_stream) {
+ // if there are differing numbers of descriptors, exit right now
+ if (cur_stream->descriptors_count != first_stream->descriptors_count)
+ return;
+
+ // now verify the descriptors match
+ struct ca_pmt_descriptor *cur_descriptor = cur_stream->descriptors;
+ struct ca_pmt_descriptor *first_cur_descriptor = first_stream->descriptors;
+ while (cur_descriptor) {
+ // check the descriptors are the same length
+ if (cur_descriptor->length != first_cur_descriptor->length)
+ return;
+
+ // check their contents match
+ if (memcmp(cur_descriptor->descriptor,
+ first_cur_descriptor->descriptor,
+ cur_descriptor->length)) {
+ return;
+ }
+ // move to next
+ cur_descriptor = cur_descriptor->next;
+ first_cur_descriptor = first_cur_descriptor->next;
+ }
+
+ // move to next
+ cur_stream = cur_stream->next;
+ }
+
+ // if we end up here, all descriptors in all streams matched
+
+ // hook the first stream's descriptors into the PMT's
+ *pmt_descriptors = first_stream->descriptors;
+ first_stream->descriptors = NULL;
+ first_stream->descriptors_count = 0;
+
+ // now free up all the descriptors in the other streams
+ cur_stream = first_stream->next;
+ while (cur_stream) {
+ struct ca_pmt_descriptor *cur_descriptor = cur_stream->descriptors;
+ while (cur_descriptor) {
+ struct ca_pmt_descriptor *next = cur_descriptor->next;
+ free(cur_descriptor);
+ cur_descriptor = next;
+ }
+ cur_stream->descriptors = NULL;
+ cur_stream->descriptors_count = 0;
+ cur_stream = cur_stream->next;
+ }
+}
+
+static uint32_t en50221_ca_calculate_length(struct ca_pmt_descriptor *pmt_descriptors,
+ uint32_t *pmt_descriptors_length,
+ struct ca_pmt_stream *pmt_streams)
+{
+ uint32_t total_required_length = 6; // header
+ struct ca_pmt_stream *cur_s;
+
+ // calcuate the PMT descriptors length
+ (*pmt_descriptors_length) = 0;
+ struct ca_pmt_descriptor *cur_d = pmt_descriptors;
+ while (cur_d) {
+ (*pmt_descriptors_length) += cur_d->length;
+ cur_d = cur_d->next;
+ }
+
+ // add on 1 byte for the ca_pmt_cmd_id if we have some descriptors.
+ if (*pmt_descriptors_length)
+ (*pmt_descriptors_length)++;
+
+ // update the total required length
+ total_required_length += *pmt_descriptors_length;
+
+ // calculate the length of descriptors in the streams
+ cur_s = pmt_streams;
+ while (cur_s) {
+ // calculate the size of descriptors in this stream
+ cur_s->descriptors_length = 0;
+ cur_d = cur_s->descriptors;
+ while (cur_d) {
+ cur_s->descriptors_length += cur_d->length;
+ cur_d = cur_d->next;
+ }
+
+ // add on 1 byte for the ca_pmt_cmd_id if we have some descriptors.
+ if (cur_s->descriptors_length)
+ cur_s->descriptors_length++;
+
+ // update the total required length;
+ total_required_length += 5 + cur_s->descriptors_length;
+
+ cur_s = cur_s->next;
+ }
+
+ // done
+ return total_required_length;
+}
+
+static int en50221_app_ca_parse_info(struct en50221_app_ca *ca,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data, uint32_t data_length)
+{
+ // first of all, decode the length field
+ uint16_t asn_data_length;
+ int length_field_len;
+ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) {
+ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n");
+ return -1;
+ }
+ // check it
+ if (asn_data_length > (data_length - length_field_len)) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ data += length_field_len;
+
+ // parse
+ uint32_t ca_id_count = asn_data_length / 2;
+
+ // byteswap the IDs
+ uint16_t *ids = (uint16_t *) data;
+ uint32_t i;
+ for (i = 0; i < ca_id_count; i++) {
+ bswap16(data);
+ data += 2;
+ }
+
+ // tell the app
+ pthread_mutex_lock(&ca->lock);
+ en50221_app_ca_info_callback cb = ca->ca_info_callback;
+ void *cb_arg = ca->ca_info_callback_arg;
+ pthread_mutex_unlock(&ca->lock);
+ if (cb) {
+ return cb(cb_arg, slot_id, session_number, ca_id_count,
+ ids);
+ }
+ return 0;
+}
+
+static int en50221_app_ca_parse_reply(struct en50221_app_ca *ca,
+ uint8_t slot_id,
+ uint16_t session_number,
+ uint8_t * data, uint32_t data_length)
+{
+ // first of all, decode the length field
+ uint16_t asn_data_length;
+ int length_field_len;
+ if ((length_field_len = asn_1_decode(&asn_data_length, data, data_length)) < 0) {
+ print(LOG_LEVEL, ERROR, 1, "ASN.1 decode error\n");
+ return -1;
+ }
+ // check it
+ if (asn_data_length < 4) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ if (asn_data_length > (data_length - length_field_len)) {
+ print(LOG_LEVEL, ERROR, 1, "Received short data\n");
+ return -1;
+ }
+ data += length_field_len;
+ data_length -= length_field_len;
+
+ // process the reply table to fix endian issues
+ uint32_t pos = 4;
+ bswap16(data);
+ while (pos < asn_data_length) {
+ bswap16(data + pos);
+ pos += 3;
+ }
+
+ // tell the app
+ pthread_mutex_lock(&ca->lock);
+ en50221_app_ca_pmt_reply_callback cb = ca->ca_pmt_reply_callback;
+ void *cb_arg = ca->ca_pmt_reply_callback_arg;
+ pthread_mutex_unlock(&ca->lock);
+ if (cb) {
+ return cb(cb_arg, slot_id, session_number,
+ (struct en50221_app_pmt_reply *) data,
+ asn_data_length);
+ }
+ return 0;
+}
diff --git a/dvb-apps/lib/libdvben50221/en50221_app_ca.h b/dvb-apps/lib/libdvben50221/en50221_app_ca.h
new file mode 100644
index 0000000..7405b06
--- /dev/null
+++ b/dvb-apps/lib/libdvben50221/en50221_app_ca.h
@@ -0,0 +1,264 @@
+/*
+ en50221 encoder An implementation for libdvb
+ an implementation for the en50221 transport layer
+
+ Copyright (C) 2004, 2005 Manu Abraham <abraham.manu@gmail.com>
+ Copyright (C) 2005 Julian Scheel (julian at jusst dot de)
+ Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net)
<