sys/dvb/: Add ATSC tunning and channels.conf parsing support.
authorMichael Krufky <mkrufky@linuxtv.org>
Mon, 18 Aug 2008 11:13:07 +0000 (11:13 +0000)
committerZaheer Abbas Merali <zaheerabbas@merali.org>
Mon, 18 Aug 2008 11:13:07 +0000 (11:13 +0000)
Original commit message from CVS:
patch by: Michael Krufky
* sys/dvb/gstdvbsrc.c:
* sys/dvb/parsechannels.c:
Add ATSC tunning and channels.conf parsing support.
Fixes #537455

ChangeLog
sys/dvb/gstdvbsrc.c
sys/dvb/parsechannels.c

index b30cfa31e0e6071effaf1e31b462093367e6993f..f8c7728a87d2febdd55313e8724475d7d6ebb0b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-08-18  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
+
+       patch by: Michael Krufky
+
+       * sys/dvb/gstdvbsrc.c:
+       * sys/dvb/parsechannels.c:
+       Add ATSC tunning and channels.conf parsing support.
+       Fixes #537455
+
 2008-08-13  Michael Smith <msmith@songbirdnest.com>
 
        * sys/dshowdecwrapper/gstdshowaudiodec.c:
index 1e0369ba45ff2fb68e235632b22b093809d9a6cb..ce562ea4742cadde2bd4a7eb15209544190c9697 100644 (file)
@@ -141,6 +141,8 @@ gst_dvbsrc_modulation_get_type (void)
     {QAM_128, "QAM 128", "QAM 128"},
     {QAM_256, "QAM 256", "QAM 256"},
     {QAM_AUTO, "AUTO", "AUTO"},
+    {VSB_8, "8VSB", "8VSB"},
+    {VSB_16, "16VSB", "16VSB"},
     {0, NULL, NULL},
   };
 
@@ -745,6 +747,11 @@ gst_dvbsrc_open_frontend (GstDvbSrc * object)
           G_TYPE_BOOLEAN, fe_info.caps % FE_CAN_HIERARCHY_AUTO, "auto-fec",
           G_TYPE_BOOLEAN, fe_info.caps & FE_CAN_FEC_AUTO, NULL);
       break;
+    case FE_ATSC:
+      adapter_desc = "ATSC";
+      adapter_structure = gst_structure_new ("dvb-adapter",
+          "type", G_TYPE_STRING, adapter_desc, NULL);
+      break;
     default:
       g_error ("Unknown frontend type: %d", object->adapter_type);
       adapter_structure = gst_structure_new ("dvb-adapter",
@@ -1276,6 +1283,11 @@ gst_dvbsrc_tune (GstDvbSrc * object)
         feparams.u.qam.modulation = object->modulation;
         feparams.u.qam.symbol_rate = sym_rate;
         break;
+      case FE_ATSC:
+        GST_INFO_OBJECT (object, "Tuning ATSC to %d", freq);
+        feparams.frequency = freq;
+        feparams.u.vsb.modulation = object->modulation;
+        break;
       default:
         g_error ("Unknown frontend type: %d", object->adapter_type);
 
index 0bb7d8983bfe266dbd882d38d143e26518b1d6bf..ed07e5374797c2411e3b7b21bd2cc4ff99d77edb 100644 (file)
@@ -101,6 +101,15 @@ 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 == 6) {
+          /* atsc (vsb/qam) */
+          g_hash_table_insert (params, g_strdup ("type"), g_strdup ("atsc"));
+          g_hash_table_insert (params, g_strdup ("modulation"),
+              g_strdup (fields[2]));
+
+          g_hash_table_insert (params, g_strdup ("frequency"),
+              g_strdup (fields[1]));
+          parsed = TRUE;
         }
         if (parsed) {
           g_hash_table_insert (params, g_strdup ("sid"),
@@ -352,6 +361,22 @@ set_properties_for_channel (GObject * dvbbasebin, const gchar * channel_name)
           g_object_set (dvbbasebin, "inversion", 1, NULL);
         else
           g_object_set (dvbbasebin, "inversion", 2, NULL);
+      } else if (strcmp (type, "atsc") == 0) {
+        gchar *val;
+
+        ret = TRUE;
+
+        val = g_hash_table_lookup (params, "modulation");
+        if (strcmp (val, "QAM_64") == 0)
+          g_object_set (dvbbasebin, "modulation", 3, NULL);
+        else if (strcmp (val, "QAM_256") == 0)
+          g_object_set (dvbbasebin, "modulation", 5, NULL);
+        else if (strcmp (val, "8VSB") == 0)
+          g_object_set (dvbbasebin, "modulation", 7, NULL);
+        else if (strcmp (val, "16VSB") == 0)
+          g_object_set (dvbbasebin, "modulation", 8, NULL);
+        else
+          ret = FALSE;
       }
     }
     destroy_channels_hash (channels);