Add bindings for the StreamInfo objects of playbin

This commit is contained in:
Sebastian Dröge 2009-05-28 12:29:59 +02:00
parent ed13fe1646
commit 60bce938cb
4 changed files with 137 additions and 6 deletions

View file

@ -13,20 +13,20 @@ using GLib;
namespace Gst {
public static class BindingHelper {
public static Delegate AddProxySignalDelegate (Element element, string signal,
public static Delegate AddProxySignalDelegate (GLib.Object o, string signal,
DynamicSignalHandler baseHandler, Delegate existingHandler, Delegate addHandler) {
if (existingHandler == null) {
element.Connect (signal, baseHandler);
DynamicSignal.Connect (o, signal, baseHandler);
}
return Delegate.Combine (existingHandler, addHandler);
}
public static Delegate RemoveProxySignalDelegate (Element element, string signal,
public static Delegate RemoveProxySignalDelegate (GLib.Object o, string signal,
DynamicSignalHandler baseHandler, Delegate existingHandler, Delegate removeHandler) {
Delegate temp_delegate = Delegate.Remove (existingHandler, removeHandler);
if (temp_delegate == null) {
element.Disconnect (signal, baseHandler);
DynamicSignal.Disconnect (o, signal, baseHandler);
}
return temp_delegate;

View file

@ -140,7 +140,7 @@ generated-stamp: $(API) $(build_customs) $(overrides)
coreplugins/*.cs: $(API) coreplugins/*.metadata coreplugins/inspect/*.raw
$(MAKE) -C coreplugins
baseplugins/*.cs: $(API) baseplugins/*.metadata baseplugins/inspect/*.raw
baseplugins/*.cs: $(API) baseplugins/*.custom baseplugins/*.metadata baseplugins/inspect/*.raw
$(MAKE) -C baseplugins
$(KEYFILE): $(top_srcdir)/gstreamer-sharp.snk

View file

@ -2,7 +2,7 @@ ELEMENTS = decodebin playbin xvimagesink decodebin2 playbin2
NAMESPACE = Gst.BasePlugins
INSPECT_FILES = $(patsubst %,inspect/%.raw,$(ELEMENTS))
CUSTOM_FILES =
CUSTOM_FILES = playbin.custom
METADATA_FILES = decodebin.metadata playbin.metadata decodebin2.metadata playbin2.metadata
CS_FILES = $(patsubst %,%.cs,$(ELEMENTS))
XML_FILES = $(patsubst %,%.xml,$(ELEMENTS))

View file

@ -0,0 +1,131 @@
[GLib.Property ("stream-info-value-array") ]
public StreamInfo[] StreamInfos {
get {
GLib.Value val = GetProperty ("stream-info-value-array");
GLib.ValueArray va = (GLib.ValueArray) val;
StreamInfo[] ret = new StreamInfo[va.Count];
for (int i = 0; i < va.Count; i++)
ret[i] = (StreamInfo) va[i];
va.Dispose ();
val.Dispose ();
return ret;
}
}
public class StreamInfo : GLib.Object {
[GLib.Property ("object") ]
public Gst.Object Object {
get {
GLib.Value val = GetProperty ("object");
Gst.Object ret = (Gst.Object) val;
val.Dispose ();
return ret;
}
}
[GLib.Property ("type") ]
public StreamType Type {
get {
GLib.Value val = GetProperty ("type");
StreamType ret = (StreamType) val;
val.Dispose ();
return ret;
}
}
[GLib.Property ("decoder") ]
public string Decoder {
get {
GLib.Value val = GetProperty ("decoder");
string ret = (string) val;
val.Dispose ();
return ret;
}
}
[GLib.Property ("mute") ]
public bool Mute {
get {
GLib.Value val = GetProperty ("mute");
bool ret = (bool) val;
val.Dispose ();
return ret;
}
set {
GLib.Value val = new GLib.Value (this, "mute");
val.Val = value;
SetProperty ("mute", val);
val.Dispose ();
}
}
[GLib.Property ("caps") ]
public Gst.Caps Caps {
get {
GLib.Value val = GetProperty ("caps");
Gst.Caps ret = (Gst.Caps) val;
val.Dispose ();
return ret;
}
}
[GLib.Property ("language-code") ]
public string LanguageCode {
get {
GLib.Value val = GetProperty ("language-code");
string ret = (string) val;
val.Dispose ();
return ret;
}
}
[GLib.Property ("codec") ]
public string Codec {
get {
GLib.Value val = GetProperty ("codec");
string ret = (string) val;
val.Dispose ();
return ret;
}
}
public delegate void MutedHandler (object o, MutedArgs args);
public class MutedArgs : GLib.SignalArgs {
public bool Mute {
get {
return (bool) Args[0];
}
}
}
private Delegate Muted_delegate;
protected virtual void OnMuted (object o, GLib.SignalArgs args) {
BindingHelper.InvokeProxySignalDelegate (Muted_delegate, typeof (MutedArgs), o, args);
}
public event MutedHandler Muted {
add {
Muted_delegate = BindingHelper.AddProxySignalDelegate (this, "muted", OnMuted, Muted_delegate, value);
}
remove {
Muted_delegate = BindingHelper.RemoveProxySignalDelegate (this, "muted", OnMuted, Muted_delegate, value);
}
}
[GTypeName ("GstStreamType") ]
public enum StreamType {
Unknown = 0,
Audio = 1,
Video = 2,
Text = 3,
Subpicture = 4,
Element = 5
}
}