sys/dvb/: Add DVB-C support. Special thanks to Christian Schaller for a testing ground.

Original commit message from CVS:
* sys/dvb/gstdvbsrc.c:
* sys/dvb/parsechannels.c:
Add DVB-C support. Special thanks to Christian Schaller
for a testing ground.
This commit is contained in:
Zaheer Abbas Merali 2008-03-01 12:49:13 +00:00
parent adf2d86155
commit 8be7f45f67
4 changed files with 80 additions and 10 deletions

View file

@ -1,3 +1,10 @@
2008-03-01 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/dvb/gstdvbsrc.c:
* sys/dvb/parsechannels.c:
Add DVB-C support. Special thanks to Christian Schaller
for a testing ground.
2008-02-28 Zaheer Abbas Merali <zaheerabbas at merali dot org> 2008-02-28 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* gst/mpegtsparse/mpegtsparse.c: * gst/mpegtsparse/mpegtsparse.c:

2
common

@ -1 +1 @@
Subproject commit e746d20ef536a73aea9964666c7d5f6d5c9465df Subproject commit 4fa1159996900100f3a1cd3b43d7f0f027310cdb

View file

@ -396,7 +396,7 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass)
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_HP, g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_HP,
g_param_spec_enum ("code-rate-hp", g_param_spec_enum ("code-rate-hp",
"code-rate-hp", "code-rate-hp",
"High Priority Code Rate (DVB-T and DVB-S)", "High Priority Code Rate (DVB-T, DVB-S and DVB-C)",
GST_TYPE_DVBSRC_CODE_RATE, FEC_AUTO, G_PARAM_READWRITE)); GST_TYPE_DVBSRC_CODE_RATE, FEC_AUTO, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_LP, g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_LP,
@ -414,7 +414,7 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass)
g_object_class_install_property (gobject_class, ARG_DVBSRC_MODULATION, g_object_class_install_property (gobject_class, ARG_DVBSRC_MODULATION,
g_param_spec_enum ("modulation", g_param_spec_enum ("modulation",
"modulation", "modulation",
"Modulation (DVB-T)", "Modulation (DVB-T and DVB-C)",
GST_TYPE_DVBSRC_MODULATION, 1, G_PARAM_READWRITE)); GST_TYPE_DVBSRC_MODULATION, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
@ -432,7 +432,7 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass)
g_object_class_install_property (gobject_class, ARG_DVBSRC_INVERSION, g_object_class_install_property (gobject_class, ARG_DVBSRC_INVERSION,
g_param_spec_enum ("inversion", g_param_spec_enum ("inversion",
"inversion", "inversion",
"Inversion Information (DVB-T)", "Inversion Information (DVB-T and DVB-C)",
GST_TYPE_DVBSRC_INVERSION, 1, G_PARAM_READWRITE)); GST_TYPE_DVBSRC_INVERSION, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
@ -1134,7 +1134,6 @@ diseqc_send_msg (int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
GST_ERROR ("Sending diseqc command failed"); GST_ERROR ("Sending diseqc command failed");
return; return;
} }
//usleep (cmd->wait * 1000); //usleep (cmd->wait * 1000);
usleep (15 * 1000); usleep (15 * 1000);
@ -1278,10 +1277,10 @@ gst_dvbsrc_tune (GstDvbSrc * object)
case FE_QAM: case FE_QAM:
GST_INFO_OBJECT (object, "Tuning DVB-C to %d, srate=%d", freq, sym_rate); GST_INFO_OBJECT (object, "Tuning DVB-C to %d, srate=%d", freq, sym_rate);
feparams.frequency = freq; feparams.frequency = freq;
feparams.inversion = INVERSION_OFF; feparams.inversion = object->inversion;
/*feparams.u.qam.fec_inner = FEC_AUTO; feparams.u.qam.fec_inner = object->code_rate_hp;
feparams.u.qam.modulation = object->modulation; feparams.u.qam.modulation = object->modulation;
feparams.u.qam.symbol_rate = sym_rate; */ feparams.u.qam.symbol_rate = sym_rate;
break; break;
default: default:
g_error ("Unknown frontend type: %d", object->adapter_type); g_error ("Unknown frontend type: %d", object->adapter_type);

View file

@ -42,6 +42,9 @@ parse_channels_conf_from_file (const gchar * filename)
gchar *satellite[] = { "polarity", "diseqc-source", gchar *satellite[] = { "polarity", "diseqc-source",
"symbol-rate" "symbol-rate"
}; };
gchar *cable[] = { "inversion", "symbol-rate", "code-rate-hp",
"modulation"
};
int i; int i;
GHashTable *res = NULL; GHashTable *res = NULL;
@ -86,6 +89,18 @@ parse_channels_conf_from_file (const gchar * filename)
g_hash_table_insert (params, g_strdup ("frequency"), g_hash_table_insert (params, g_strdup ("frequency"),
g_strdup (fields[1])); g_strdup (fields[1]));
parsed = TRUE; parsed = TRUE;
} else if (numfields == 9) {
/* cable */
int j;
g_hash_table_insert (params, g_strdup ("type"), g_strdup ("cable"));
for (j = 2; j <= 5; j++) {
g_hash_table_insert (params, g_strdup (cable[j - 2]),
g_strdup (fields[j]));
}
g_hash_table_insert (params, g_strdup ("frequency"),
g_strdup (fields[1]));
parsed = TRUE;
} }
if (parsed) { if (parsed) {
g_hash_table_insert (params, g_strdup ("sid"), g_hash_table_insert (params, g_strdup ("sid"),
@ -287,8 +302,57 @@ set_properties_for_channel (GObject * dvbbasebin, const gchar * channel_name)
g_object_set (dvbbasebin, "symbol-rate", atoi (val), NULL); g_object_set (dvbbasebin, "symbol-rate", atoi (val), NULL);
else else
ret = FALSE; ret = FALSE;
} } else if (strcmp (type, "cable") == 0) {
gchar *val;
ret = TRUE;
val = g_hash_table_lookup (params, "symbol-rate");
if (val)
g_object_set (dvbbasebin, "symbol-rate", atoi (val) / 1000, NULL);
val = g_hash_table_lookup (params, "modulation");
if (strcmp (val, "QPSK") == 0)
g_object_set (dvbbasebin, "modulation", 0, NULL);
else if (strcmp (val, "QAM_16") == 0)
g_object_set (dvbbasebin, "modulation", 1, NULL);
else if (strcmp (val, "QAM_32") == 0)
g_object_set (dvbbasebin, "modulation", 2, NULL);
else if (strcmp (val, "QAM_64") == 0)
g_object_set (dvbbasebin, "modulation", 3, NULL);
else if (strcmp (val, "QAM_128") == 0)
g_object_set (dvbbasebin, "modulation", 4, NULL);
else if (strcmp (val, "QAM_256") == 0)
g_object_set (dvbbasebin, "modulation", 5, NULL);
else
g_object_set (dvbbasebin, "modulation", 6, NULL);
val = g_hash_table_lookup (params, "code-rate-hp");
if (strcmp (val, "FEC_NONE") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 0, NULL);
else if (strcmp (val, "FEC_1_2") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 1, NULL);
else if (strcmp (val, "FEC_2_3") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 2, NULL);
else if (strcmp (val, "FEC_3_4") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 3, NULL);
else if (strcmp (val, "FEC_4_5") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 4, NULL);
else if (strcmp (val, "FEC_5_6") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 5, NULL);
else if (strcmp (val, "FEC_6_7") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 6, NULL);
else if (strcmp (val, "FEC_7_8") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 7, NULL);
else if (strcmp (val, "FEC_8_9") == 0)
g_object_set (dvbbasebin, "code-rate-hp", 8, NULL);
else
g_object_set (dvbbasebin, "code-rate-hp", 9, NULL);
val = g_hash_table_lookup (params, "inversion");
if (strcmp (val, "INVERSION_OFF") == 0)
g_object_set (dvbbasebin, "inversion", 0, NULL);
else if (strcmp (val, "INVERSION_ON") == 0)
g_object_set (dvbbasebin, "inversion", 1, NULL);
else
g_object_set (dvbbasebin, "inversion", 2, NULL);
}
} }
destroy_channels_hash (channels); destroy_channels_hash (channels);
} }