mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 06:08:14 +00:00
Added Element.LinkMany and Element.UnlinkMany
git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@64347 e3ebcda4-bce8-0310-ba0a-eca2169e7518
This commit is contained in:
parent
9b5a54fe8d
commit
610da9b1d9
9 changed files with 103 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-08-25 Khaled Mohammed <khaled.mohammed@gmail.com>
|
||||||
|
* sample/QueueExample.cs: a sample file showcasing
|
||||||
|
use of the queue element
|
||||||
|
* gstreamer-sharp/Element.custom: added static LinkMany and UnlinkMany
|
||||||
|
functions
|
||||||
|
|
||||||
2006-08-20 Khaled Mohammed <khaled.mohammed@gmail.com>
|
2006-08-20 Khaled Mohammed <khaled.mohammed@gmail.com>
|
||||||
* gstreamer-sharp/Buffer.custom: added Ref(), Unref() and Refcount()
|
* gstreamer-sharp/Buffer.custom: added Ref(), Unref() and Refcount()
|
||||||
functionality
|
functionality
|
||||||
|
|
|
@ -69,6 +69,26 @@
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool LinkMany(params Element [] elements)
|
||||||
|
{
|
||||||
|
for(int i=0; i < elements.Length - 1; i++)
|
||||||
|
{
|
||||||
|
if(!elements[i].Link(elements[i+1]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkMany(params Element [] elements)
|
||||||
|
{
|
||||||
|
for(int i=0; i < elements.Length - 1; i++)
|
||||||
|
{
|
||||||
|
elements[i].Unlink(elements[i+1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[DllImport("gstreamer-0.10.dll")]
|
[DllImport("gstreamer-0.10.dll")]
|
||||||
private static extern bool gst_element_query_position(IntPtr raw, ref Format format, out long cur);
|
private static extern bool gst_element_query_position(IntPtr raw, ref Format format, out long cur);
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
<attr path="/api/namespace/object[@name='Pad']/method[@name='AddDataProbe']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Pad']/method[@name='AddDataProbe']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@name='Pad']/method[@name='RemoveDataProbe']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Pad']/method[@name='RemoveDataProbe']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@name='Bin']/method[@name='AddMany']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Bin']/method[@name='AddMany']" name="hidden">1</attr>
|
||||||
|
<attr path="/api/namespace/object[@name='Element']/method[@name='LinkMany']" name="hidden">1</attr>
|
||||||
|
<attr path="/api/namespace/object[@name='Element']/method[@name='UnlinkMany']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@name='Bin']/method[@name='RemoveMany']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Bin']/method[@name='RemoveMany']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@name='Message']/method[@cname='gst_message_new_error']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Message']/method[@cname='gst_message_new_error']" name="hidden">1</attr>
|
||||||
<attr path="/api/namespace/object[@name='Element']/method[@cname='gst_element_add_pad']" name="hidden">1</attr>
|
<attr path="/api/namespace/object[@name='Element']/method[@cname='gst_element_add_pad']" name="hidden">1</attr>
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
PersistentData["AddBufferProbe"] = func_wrapper;
|
PersistentData["AddBufferProbe"] = func_wrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
//IntPtr data = (IntPtr) GCHandle.Alloc(func_wrapper);
|
|
||||||
return gst_pad_add_buffer_probe(this.Handle, func_wrapper.NativeFunc, IntPtr.Zero);
|
return gst_pad_add_buffer_probe(this.Handle, func_wrapper.NativeFunc, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<api>
|
<api
|
||||||
<!--
|
><!--
|
||||||
|
|
||||||
This file was automatically generated.
|
This file was automatically generated.
|
||||||
Please DO NOT MODIFY THIS FILE, modify .metadata files instead.
|
Please DO NOT MODIFY THIS FILE, modify .metadata files instead.
|
||||||
|
|
||||||
-->
|
--><namespace name="Gst" library="gstreamer-0.10.dll">
|
||||||
<namespace name="Gst" library="gstreamer-0.10.dll">
|
|
||||||
<enum name="ActivateMode" cname="GstActivateMode" type="enum">
|
<enum name="ActivateMode" cname="GstActivateMode" type="enum">
|
||||||
<member cname="GST_ACTIVATE_NONE" name="None" />
|
<member cname="GST_ACTIVATE_NONE" name="None" />
|
||||||
<member cname="GST_ACTIVATE_PUSH" name="Push" />
|
<member cname="GST_ACTIVATE_PUSH" name="Push" />
|
||||||
|
@ -5746,6 +5745,4 @@
|
||||||
<parameter type="const-GValue*" name="value2" />
|
<parameter type="const-GValue*" name="value2" />
|
||||||
</parameters>
|
</parameters>
|
||||||
</method>
|
</method>
|
||||||
</class>
|
</class></namespace></api>
|
||||||
</namespace>
|
|
||||||
</api>
|
|
|
@ -19,6 +19,9 @@ helloworld.exe: $(srcdir)/HelloWorld.cs $(assemblies)
|
||||||
typefind.exe: $(srcdir)/TypeFind.cs $(assemblies)
|
typefind.exe: $(srcdir)/TypeFind.cs $(assemblies)
|
||||||
$(CSC) -out:$@ $(GLIBSHARP_LIBS) $(references) $(srcdir)/TypeFind.cs
|
$(CSC) -out:$@ $(GLIBSHARP_LIBS) $(references) $(srcdir)/TypeFind.cs
|
||||||
|
|
||||||
|
queueexample.exe: $(srcdir)/QueueExample.cs $(assemblies)
|
||||||
|
$(CSC) -out:$@ $(GLIBSHARP_LIBS) $(references) $(srcdir)/QueueExample.cs
|
||||||
|
|
||||||
link:
|
link:
|
||||||
ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll gstreamer-sharp.dll
|
ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll gstreamer-sharp.dll
|
||||||
ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll.config gstreamer-sharp.dll.config
|
ln -sf $(top_builddir)/gstreamer-sharp/gstreamer-sharp.dll.config gstreamer-sharp.dll.config
|
||||||
|
|
59
sample/QueueExample.cs
Normal file
59
sample/QueueExample.cs
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
//
|
||||||
|
// Authors:
|
||||||
|
// Khaled Mohammed (khaled.mohammed@gmail.com)
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
using Gst;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public class QueueExample {
|
||||||
|
public static void Main(string [] args)
|
||||||
|
{
|
||||||
|
Application.Init();
|
||||||
|
|
||||||
|
if(args.Length != 1) {
|
||||||
|
Console.Error.WriteLine("usage: mono queueexample.exe <filename>\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Element pipeline = new Pipeline("pipeline");
|
||||||
|
|
||||||
|
Element filesrc = ElementFactory.Make("filesrc", "disk_source");
|
||||||
|
filesrc.SetProperty("location", args[0]);
|
||||||
|
Element decode = ElementFactory.Make("mad", "decode");
|
||||||
|
Element queue = ElementFactory.Make("queue", "queue");
|
||||||
|
|
||||||
|
Element audiosink = ElementFactory.Make("alsasink", "play_audio");
|
||||||
|
|
||||||
|
Bin bin = (Bin) pipeline;
|
||||||
|
bin.AddMany(filesrc, decode, queue, audiosink);
|
||||||
|
|
||||||
|
Element.LinkMany(filesrc, decode, queue, audiosink);
|
||||||
|
|
||||||
|
pipeline.SetState(State.Playing);
|
||||||
|
|
||||||
|
EventLoop(pipeline);
|
||||||
|
|
||||||
|
pipeline.SetState(State.Null);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void EventLoop(Element pipe)
|
||||||
|
{
|
||||||
|
Bus bus = pipe.Bus;
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
Message message = bus.Poll(MessageType.Any, -1);
|
||||||
|
|
||||||
|
switch(message.Type) {
|
||||||
|
case MessageType.Eos: {
|
||||||
|
message.Dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case MessageType.Error: {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,6 +25,9 @@ public static class GstTypefindTest
|
||||||
pipeline.SetState(State.Paused);
|
pipeline.SetState(State.Paused);
|
||||||
pipeline.SetState(State.Null);
|
pipeline.SetState(State.Null);
|
||||||
|
|
||||||
|
source.Dispose();
|
||||||
|
typefind.Dispose();
|
||||||
|
sink.Dispose();
|
||||||
pipeline.Dispose();
|
pipeline.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
<exclude>gstreamer-0.10.3/gst/gstinterface.h</exclude>
|
<exclude>gstreamer-0.10.3/gst/gstinterface.h</exclude>
|
||||||
<exclude>gstreamer-0.10.3/gst/gsturi.h</exclude>
|
<exclude>gstreamer-0.10.3/gst/gsturi.h</exclude>
|
||||||
</namespace>
|
</namespace>
|
||||||
<!--
|
|
||||||
<namespace name="Gst">
|
|
||||||
<file>gst-plugins-base-0.10.3/gst-libs/gst/interfaces/xoverlay.h</file>
|
|
||||||
<dir>gst-plugins-base-0.10.3/gst-libs/gst/video</dir>
|
|
||||||
<exclude>gst-plugins-base-0.10.3/gst-libs/gst/video/video.h</exclude>
|
|
||||||
</namespace>
|
|
||||||
-->
|
|
||||||
</library>
|
</library>
|
||||||
|
<!--
|
||||||
|
<library name="gstcontroller-0.10.dll">
|
||||||
|
<namespace name="Gst">
|
||||||
|
<dir>gstreamer-0.10.3/libs/gst/controller</dir>
|
||||||
|
</namespace>
|
||||||
|
</library>
|
||||||
|
-->
|
||||||
</api>
|
</api>
|
||||||
</gapi-parser-input>
|
</gapi-parser-input>
|
||||||
|
|
Loading…
Reference in a new issue