diff options
-rw-r--r-- | ChangeLog | 7 | ||||
m--------- | common | 0 | ||||
-rw-r--r-- | sys/dvb/gstdvbsrc.c | 15 | ||||
-rw-r--r-- | sys/dvb/parsechannels.c | 66 |
4 files changed, 79 insertions, 9 deletions
@@ -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> * gst/mpegtsparse/mpegtsparse.c: diff --git a/common b/common -Subproject e746d20ef536a73aea9964666c7d5f6d5c9465d +Subproject 4fa1159996900100f3a1cd3b43d7f0f027310cd diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c index 671f9954..37dee1a0 100644 --- a/sys/dvb/gstdvbsrc.c +++ b/sys/dvb/gstdvbsrc.c @@ -396,7 +396,7 @@ gst_dvbsrc_class_init (GstDvbSrcClass * klass) g_object_class_install_property (gobject_class, ARG_DVBSRC_CODE_RATE_HP, g_param_spec_enum ("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)); 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_param_spec_enum ("modulation", "modulation", - "Modulation (DVB-T)", + "Modulation (DVB-T and DVB-C)", GST_TYPE_DVBSRC_MODULATION, 1, G_PARAM_READWRITE)); 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_param_spec_enum ("inversion", "inversion", - "Inversion Information (DVB-T)", + "Inversion Information (DVB-T and DVB-C)", GST_TYPE_DVBSRC_INVERSION, 1, G_PARAM_READWRITE)); 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"); return; } - //usleep (cmd->wait * 1000); usleep (15 * 1000); @@ -1278,10 +1277,10 @@ gst_dvbsrc_tune (GstDvbSrc * object) case FE_QAM: GST_INFO_OBJECT (object, "Tuning DVB-C to %d, srate=%d", freq, sym_rate); feparams.frequency = freq; - feparams.inversion = INVERSION_OFF; - /*feparams.u.qam.fec_inner = FEC_AUTO; - feparams.u.qam.modulation = object->modulation; - feparams.u.qam.symbol_rate = sym_rate; */ + feparams.inversion = object->inversion; + feparams.u.qam.fec_inner = object->code_rate_hp; + feparams.u.qam.modulation = object->modulation; + feparams.u.qam.symbol_rate = sym_rate; break; default: g_error ("Unknown frontend type: %d", object->adapter_type); diff --git a/sys/dvb/parsechannels.c b/sys/dvb/parsechannels.c index a813d43b..0bb7d898 100644 --- a/sys/dvb/parsechannels.c +++ b/sys/dvb/parsechannels.c @@ -42,6 +42,9 @@ parse_channels_conf_from_file (const gchar * filename) gchar *satellite[] = { "polarity", "diseqc-source", "symbol-rate" }; + gchar *cable[] = { "inversion", "symbol-rate", "code-rate-hp", + "modulation" + }; int i; GHashTable *res = NULL; @@ -86,6 +89,18 @@ parse_channels_conf_from_file (const gchar * filename) g_hash_table_insert (params, g_strdup ("frequency"), g_strdup (fields[1])); 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) { 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); else 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); } |