/* ZAP utility DVB functions Copyright (C) 2004, 2005 Manu Abraham Copyright (C) 2006 Andrew de Quincey (adq_dvb@lidskialf.net) 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 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 #include #include #include #include #include #include #include #include #include #include #include "zap_dvb.h" #include "zap_ca.h" #define FE_STATUS_PARAMS (DVBFE_INFO_LOCKSTATUS|DVBFE_INFO_SIGNAL_STRENGTH|DVBFE_INFO_BER|DVBFE_INFO_SNR|DVBFE_INFO_UNCORRECTED_BLOCKS) static int dvbthread_shutdown = 0; static pthread_t dvbthread; static int pat_version = -1; static int ca_pmt_version = -1; static void *dvbthread_func(void* arg); static void process_pat(int pat_fd, struct zap_dvb_params *params, int *pmt_fd, struct pollfd *pollfd); static void process_tdt(int tdt_fd); static void process_pmt(int pmt_fd, struct zap_dvb_params *params); static int create_section_filter(int adapter, int demux, uint16_t pid, uint8_t table_id); int zap_dvb_start(struct zap_dvb_params *params) { pthread_create(&dvbthread, NULL, dvbthread_func, (void*) params); return 0; } void zap_dvb_stop(void) { dvbthread_shutdown = 1; pthread_join(dvbthread, NULL); } static void *dvbthread_func(void* arg) { int tune_state = 0; int pat_fd = -1; int pmt_fd = -1; int tdt_fd = -1; struct pollfd pollfds[3]; struct zap_dvb_params *params = (struct zap_dvb_params *) arg; // create PAT filter if ((pat_fd = create_section_filter(params->adapter_id, params->demux_id, TRANSPORT_PAT_PID, stag_mpeg_program_association)) < 0) { fprintf(stderr, "Failed to create PAT section filter\n"); exit(1); } pollfds[0].fd = pat_fd; pollfds[0].events = POLLIN|POLLPRI|POLLERR; // create TDT filter if ((tdt_fd = create_section_filter(params->adapter_id, params->demux_id, TRANSPORT_TDT_PID, stag_dvb_time_date)) < 0) { fprintf(stderr, "Failed to create TDT section filter\n"); exit(1); } pollfds[1].fd = tdt_fd; pollfds[1].events = POLLIN|POLLPRI|POLLERR; // zero PMT filter pollfds[2].fd = 0; pollfds[2].events = 0; // the DVB loop while(!dvbthread_shutdown) { // tune frontend + monitor lock status if (tune_state == 0) { // get the type of frontend struct dvbfe_info result; char *types; memset(&result, 0, sizeof(result)); dvbfe_get_info(
# automatically generated from http://www.digitv.fi/sivu.asp?path=1;8224;9519
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 674000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
T 714000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE