Author: schwardt
Date: Sun Feb 11 12:47:03 2007
New Revision: 2482

Modified:
   trunk/WIP/record/src/dvbconfigreader.py
   trunk/WIP/record/src/gsttssplitter.c

Log:
- added remove filter (untested!)


Modified: trunk/WIP/record/src/dvbconfigreader.py
==============================================================================
--- trunk/WIP/record/src/dvbconfigreader.py     (original)
+++ trunk/WIP/record/src/dvbconfigreader.py     Sun Feb 11 12:47:03 2007
@@ -151,8 +151,8 @@
 
         self.config['name'] = self.config['name'].replace('|', ':')
         self.config['bouquet'] = self.config['bouquet'].replace('|', ':')
-        self.config['frequency'] = cells[1]
-        
+        self.config['frequency'] = int(cells[1])
+
         # get params
         re_params = re.compile('([ICDMBTGYHV]\d*)',re.IGNORECASE)
         for param in re_params.findall(cells[2].upper()):
@@ -230,7 +230,7 @@
             
  
     def __str__(self):
-        return '%s channel: %s [%s] (vpid=%s  apids=%s)\n' % (self.cfgtype,
+        return '%s channel: %s [%s] (vpid=%s  apids=%s)' % (self.cfgtype,
                                                           
self.config['name'].ljust(25),
                                                           
self.config['bouquet'].ljust(25),
                                                           self.config['vpid'],
@@ -287,9 +287,9 @@
 
 
     def __str__(self):
-        s = '\nMULTIPLEX: name=%s  (f=%s)\n' % (self.name.ljust(14), 
self.frequency)
+        s = '\nMULTIPLEX: name=%s  (f=%s)' % (self.name.__str__().ljust(14), 
self.frequency)
         for chan in self.chanlist:
-            s += str(chan)
+            s += str(chan) + '\n'
         return s
 
 
@@ -381,7 +381,10 @@
     logging.getLogger().setLevel(logging.DEBUG)
     ccr = DVBChannelConfReader('./dvbs.conf')
     print ccr
-    print '---'
+    print '---------------'
+    print 'find channel "n-tv":'
     print ccr.get_channel('n-tv')
+    print '---------------'
+    print 'find channel "n-tv":'
     print ccr.get_channel('n-tv').config
 

Modified: trunk/WIP/record/src/gsttssplitter.c
==============================================================================
--- trunk/WIP/record/src/gsttssplitter.c        (original)
+++ trunk/WIP/record/src/gsttssplitter.c        Sun Feb 11 12:47:03 2007
@@ -1,15 +1,3 @@
-/**
- * SECTION:element-plugin
- *
- * <refsect2>
- * <title>Example launch line</title>
- * <para>
- * <programlisting>
- * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE
- * </programlisting>
- * </para>
- * </refsect2>
- */
 
 #include <assert.h>
 #include <string.h>
@@ -469,7 +457,6 @@
   static int i = 0;
 
   filter = GST_TSSPLITTER (GST_OBJECT_PARENT (pad));
-  //  DEBUGf("chain\n");
 
 /*   DEBUGf("bytes from last iteration=%d\n", 
GST_BUFFER_SIZE(filter->inbuffer)); */
 /*   printHexDump( GST_BUFFER_SIZE(filter->inbuffer), filter->inbuffer->data 
); */
@@ -620,17 +607,42 @@
   DEBUGf("remove_filter(%s)", name);
 
   GstTSSplitterFilter *pidfilter = NULL;
+  int i = 0;
 
+  // find pidfilter to be removed
   pidfilter = gst_tssplitter_find_filter(filter, name);
   DEBUGf("remove_filter(%s)=%p", name, pidfilter);
   if (!pidfilter)
     return;
 
-  // TODO/FIXME
-  // PAD ENTFERNEN
-  // PIDLIST FREIGEBEN
-  // FILTER FREIGEBEN
-  // FILTER GGF. UMSORTIEREN
+  // remove pad
+  gst_element_remove_pad(GST_ELEMENT (filter), pidfilter.pad);
+  gst_object_unref(pidfilter.pad);
+  pidfilter.pad = NULL;
+  
+  // free pidlist + name
+  free(pidfilter.pidlist);
+  pidfilter.pidlist = NULL;
+  free(pidfilter.name);
+  pidfilter.name = NULL;
+  
+  // cleanup pidfilterlist
+  if (filter->filterlist_len > 1) {
+    i = filter->filterlist_len - filter->filterlist_free - 1;
+    
+    if (filter->filterlist[i].name != NULL) {
+      pidfilter.name = filter->filterlist[i].name;
+      pidfilter.pidlist = filter->filterlist[i].pidlist;
+      pidfilter.pad = filter->filterlist[i].pad;
+      
+      filter->filterlist[i].name = NULL;
+      filter->filterlist[i].pidlist = NULL;
+      filter->filterlist[i].pad = NULL;
+    } else {
+      DEBUGf( "deleting last object in list or something weird is going on" );
+    }
+  }    
+  filter->filterlist_free += 1;
 
   return;
 }

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to