Author: khaled
Date: 2006-08-29 20:46:32 -0400 (Tue, 29 Aug 2006)
New Revision: 64526

Modified:
   branches/abock/gstreamer-sharp/ChangeLog
   
branches/abock/gstreamer-sharp/gstreamer-sharp/plugins-base/TypeFindElement.cs
   branches/abock/gstreamer-sharp/sample/MetaData.cs
   branches/abock/gstreamer-sharp/sample/TypeFind.cs
Log:
Fixed sample/TypeFind.cs

Modified: branches/abock/gstreamer-sharp/ChangeLog
===================================================================
--- branches/abock/gstreamer-sharp/ChangeLog    2006-08-29 23:31:15 UTC (rev 
64525)
+++ branches/abock/gstreamer-sharp/ChangeLog    2006-08-30 00:46:32 UTC (rev 
64526)
@@ -1,6 +1,8 @@
 2006-08-29  Khaled Mohammed <[EMAIL PROTECTED]>
        * sample/MetaData.cs: a sample file which extracts tag information
        from media files and displays them to console.
+       * sample/TypeFind.cs: fixed to make it work with the new DynamicSignal
+       class.
 
 2006-08-25  Khaled Mohammed <[EMAIL PROTECTED]>
        * sample/QueueExample.cs: a sample file showcasing 

Modified: 
branches/abock/gstreamer-sharp/gstreamer-sharp/plugins-base/TypeFindElement.cs
===================================================================
--- 
branches/abock/gstreamer-sharp/gstreamer-sharp/plugins-base/TypeFindElement.cs  
    2006-08-29 23:31:15 UTC (rev 64525)
+++ 
branches/abock/gstreamer-sharp/gstreamer-sharp/plugins-base/TypeFindElement.cs  
    2006-08-30 00:46:32 UTC (rev 64526)
@@ -40,21 +40,29 @@
         {
             return ElementFactory.Make("typefind", name) as TypeFindElement;
         }
-     
+    /* 
         protected virtual void OnHaveType(object o, GLib.SignalArgs args)
         {
             BindingHelper.InvokeProxySignalDelegate(have_type_delegate, 
typeof(HaveTypeArgs), o, args);
         }
+       */
+
      
-        public event HaveTypeHandler HaveType {
+        public event GLib.DynamicSignalHandler HaveType {
             add {
+                               /*
                 have_type_delegate = 
BindingHelper.AddProxySignalDelegate(this, "have-type", 
                     OnHaveType, have_type_delegate, value);
+                               */
+                               GLib.DynamicSignal.Connect(this, "have-type", 
value);
             }
             
             remove {
+                               /*
                 have_type_delegate = 
BindingHelper.RemoveProxySignalDelegate(this, "have-type", 
                     OnHaveType, have_type_delegate, value);
+                               */
+                               GLib.DynamicSignal.Disconnect(this, 
"have-type", value);
             }
         }
         

Modified: branches/abock/gstreamer-sharp/sample/MetaData.cs
===================================================================
--- branches/abock/gstreamer-sharp/sample/MetaData.cs   2006-08-29 23:31:15 UTC 
(rev 64525)
+++ branches/abock/gstreamer-sharp/sample/MetaData.cs   2006-08-30 00:46:32 UTC 
(rev 64526)
@@ -46,6 +46,9 @@
 
                        switch(message.Type) {
                                case MessageType.Error:
+                                       string error;
+                                       message.ParseError(out error);
+                                       Console.Error.WriteLine("Error: {0}", 
error);
                                        message.Dispose();
                                        return true;
                                case MessageType.Eos:
@@ -84,10 +87,15 @@
                source = ElementFactory.Make("filesrc", "source");
                decodebin = ElementFactory.Make("decodebin", "decodebin");
 
+               if(pipeline == null) Console.Error.WriteLine("Pipeline count 
not be created");
+               if(source == null) Console.Error.WriteLine("Element filesrc 
could not be created");
+               if(decodebin == null) Console.Error.WriteLine("Element 
decodebin coult not be created");
+
                Bin bin = (Bin) pipeline;
                bin.AddMany(source, decodebin);
-               source.Link(decodebin);
-               decodebin.Dispose();
+               if(!source.Link(decodebin))
+                       Console.Error.WriteLine("filesrc could not be linked 
with decodebin");
+               //decodebin.Dispose();
        }
 
        public static void Main(string [] args) 

Modified: branches/abock/gstreamer-sharp/sample/TypeFind.cs
===================================================================
--- branches/abock/gstreamer-sharp/sample/TypeFind.cs   2006-08-29 23:31:15 UTC 
(rev 64525)
+++ branches/abock/gstreamer-sharp/sample/TypeFind.cs   2006-08-30 00:46:32 UTC 
(rev 64526)
@@ -31,10 +31,11 @@
         pipeline.Dispose();
     }
     
-    private static void OnHaveType(object o, HaveTypeArgs args) 
+    private static void OnHaveType(object o, GLib.SignalArgs args) 
     {
-        args.Caps.Refcount++;
-        Console.WriteLine("MimeType: {0}, {1}", args.Caps, typefind.Caps);     
       
+               Caps caps = args.Args[1] as Caps;
+               caps.Refcount++;
+        Console.WriteLine("MimeType: {0}, {1}", caps , typefind.Caps);         
   
     }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to