/* * dvbcfg - support for linuxtv configuration files * zap channel file support * * Copyright (C) 2006 Christoph Pfister * Copyright (C) 2005 Andrew de Quincey * * 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 #include #include #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 */
# Channel table for GoianĂ©sia do ParĂ¡ - PA - Brazil
# Source: http://www.portalbsd.com.br/terrestres_channels.php?channels=351

# Physical channel 26
[TV Floresta]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 545142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0