mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-03 15:06:34 +00:00
863 lines
28 KiB
Text
863 lines
28 KiB
Text
public Message (GLib.Value val) : base (val) { }
|
|
|
|
[DllImport ("gstreamersharpglue-0.10.dll") ]
|
|
extern static uint gstsharp_gst_message_get_timestamp_offset ();
|
|
|
|
static uint timestamp_offset = gstsharp_gst_message_get_timestamp_offset ();
|
|
public ulong Timestamp {
|
|
get {
|
|
unsafe {
|
|
ulong* raw_ptr = (ulong*) ( ( (byte*) Handle) + timestamp_offset);
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
set {
|
|
if (!IsWritable)
|
|
throw new ApplicationException ();
|
|
|
|
unsafe {
|
|
ulong* raw_ptr = (ulong*) ( ( (byte*) Handle) + timestamp_offset);
|
|
*raw_ptr = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport ("gstreamersharpglue-0.10.dll") ]
|
|
extern static uint gstsharp_gst_message_get_src_offset ();
|
|
|
|
[DllImport ("libgobject-2.0-0.dll") ]
|
|
extern static IntPtr g_object_ref (IntPtr handle);
|
|
|
|
[DllImport ("libgobject-2.0-0.dll") ]
|
|
extern static void g_object_unref (IntPtr handle);
|
|
|
|
static uint src_offset = gstsharp_gst_message_get_src_offset ();
|
|
public Gst.Object Src {
|
|
get {
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + src_offset);
|
|
return GLib.Object.GetObject ( (*raw_ptr)) as Gst.Object;
|
|
}
|
|
}
|
|
set {
|
|
if (!IsWritable)
|
|
throw new ApplicationException ();
|
|
|
|
if (Src != null)
|
|
g_object_unref (Src.Handle);
|
|
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + src_offset);
|
|
*raw_ptr = value == null ? IntPtr.Zero : g_object_ref (value.Handle);
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern uint gst_message_get_seqnum (IntPtr raw);
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_set_seqnum (IntPtr raw, uint seqnum);
|
|
|
|
public uint Seqnum {
|
|
get {
|
|
uint raw_ret = gst_message_get_seqnum (Handle);
|
|
uint ret = raw_ret;
|
|
return ret;
|
|
}
|
|
set {
|
|
if (!IsWritable)
|
|
throw new ApplicationException ();
|
|
|
|
gst_message_set_seqnum (Handle, value);
|
|
}
|
|
}
|
|
|
|
|
|
private Gst.Structure cached_structure = null;
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_get_structure (IntPtr raw);
|
|
|
|
public Gst.Structure Structure {
|
|
get {
|
|
if (cached_structure != null)
|
|
return cached_structure;
|
|
|
|
IntPtr raw_ret = gst_message_get_structure (Handle);
|
|
Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
|
|
if (ret != null)
|
|
ret.FreeNative = false;
|
|
cached_structure = ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
~Message () {
|
|
if (cached_structure != null)
|
|
cached_structure.CreateNativeCopy ();
|
|
cached_structure = null;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_eos (IntPtr src);
|
|
|
|
public static Message NewEos (Gst.Object src) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_eos (src.Handle), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_error_get_message (uint domain, int code);
|
|
|
|
static string GetMessage (uint domain, int code) {
|
|
IntPtr raw_ret = gst_error_get_message (domain, code);
|
|
if (raw_ret == IntPtr.Zero)
|
|
return null;
|
|
|
|
return GLib.Marshaller.PtrToStringGFree (raw_ret);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern uint gst_core_error_quark ();
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern uint gst_library_error_quark ();
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern uint gst_stream_error_quark ();
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern uint gst_resource_error_quark ();
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_error (IntPtr src, ref Gst.GError error, IntPtr debug);
|
|
|
|
public static Message NewError (Gst.Object src, Gst.CoreError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_core_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.CoreError error, string message) {
|
|
return NewError (src, error, message, null);
|
|
}
|
|
public static Message NewError (Gst.Object src, Gst.CoreError error) {
|
|
return NewError (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.StreamError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_stream_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.StreamError error, string message) {
|
|
return NewError (src, error, message, null);
|
|
}
|
|
public static Message NewError (Gst.Object src, Gst.StreamError error) {
|
|
return NewError (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.LibraryError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_library_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
public static Message NewError (Gst.Object src, Gst.LibraryError error, string message) {
|
|
return NewError (src, error, message, null);
|
|
}
|
|
public static Message NewError (Gst.Object src, Gst.LibraryError error) {
|
|
return NewError (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.ResourceError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_resource_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewError (Gst.Object src, Gst.ResourceError error, string message) {
|
|
return NewError (src, error, message, null);
|
|
}
|
|
public static Message NewError (Gst.Object src, Gst.ResourceError error) {
|
|
return NewError (src, error, null, null);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_error (IntPtr msg, out IntPtr err, out IntPtr debug);
|
|
|
|
public void ParseError (out Enum error, out string message, out string debug) {
|
|
if (Type != MessageType.Error)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr err;
|
|
IntPtr dbg;
|
|
|
|
gst_message_parse_error (Handle, out err, out dbg);
|
|
|
|
if (dbg != IntPtr.Zero)
|
|
debug = GLib.Marshaller.Utf8PtrToString (dbg);
|
|
else
|
|
debug = null;
|
|
|
|
if (err == IntPtr.Zero)
|
|
throw new Exception ();
|
|
|
|
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
|
|
|
|
message = gerror.Message;
|
|
|
|
if (gerror.Domain == gst_core_error_quark ())
|
|
error = (Gst.CoreError) gerror.Code;
|
|
else if (gerror.Domain == gst_library_error_quark ())
|
|
error = (Gst.LibraryError) gerror.Code;
|
|
else if (gerror.Domain == gst_resource_error_quark ())
|
|
error = (Gst.ResourceError) gerror.Code;
|
|
else if (gerror.Domain == gst_stream_error_quark ())
|
|
error = (Gst.StreamError) gerror.Code;
|
|
else
|
|
error = null;
|
|
}
|
|
|
|
public void ParseError (out Enum error, out string message) {
|
|
string tmp;
|
|
|
|
ParseError (out error, out message, out tmp);
|
|
}
|
|
|
|
public void ParseError (out Enum error) {
|
|
string tmp, tmp2;
|
|
|
|
ParseError (out error, out tmp, out tmp2);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_warning (IntPtr src, ref Gst.GError error, IntPtr debug);
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.CoreError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_core_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.CoreError error, string message) {
|
|
return NewWarning (src, error, message, null);
|
|
}
|
|
public static Message NewWarning (Gst.Object src, Gst.CoreError error) {
|
|
return NewWarning (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.StreamError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_stream_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.StreamError error, string message) {
|
|
return NewWarning (src, error, message, null);
|
|
}
|
|
public static Message NewWarning (Gst.Object src, Gst.StreamError error) {
|
|
return NewWarning (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.LibraryError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_library_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.LibraryError error, string message) {
|
|
return NewWarning (src, error, message, null);
|
|
}
|
|
public static Message NewWarning (Gst.Object src, Gst.LibraryError error) {
|
|
return NewWarning (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.ResourceError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_resource_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewWarning (Gst.Object src, Gst.ResourceError error, string message) {
|
|
return NewWarning (src, error, message, null);
|
|
}
|
|
public static Message NewWarning (Gst.Object src, Gst.ResourceError error) {
|
|
return NewWarning (src, error, null, null);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_warning (IntPtr msg, out IntPtr err, out IntPtr debug);
|
|
|
|
public void ParseWarning (out Enum error, out string message, out string debug) {
|
|
if (Type != MessageType.Warning)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr err;
|
|
IntPtr dbg;
|
|
|
|
gst_message_parse_warning (Handle, out err, out dbg);
|
|
|
|
if (dbg != IntPtr.Zero)
|
|
debug = GLib.Marshaller.Utf8PtrToString (dbg);
|
|
else
|
|
debug = null;
|
|
|
|
if (err == IntPtr.Zero)
|
|
throw new Exception ();
|
|
|
|
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
|
|
|
|
message = gerror.Message;
|
|
|
|
if (gerror.Domain == gst_core_error_quark ())
|
|
error = (Gst.CoreError) gerror.Code;
|
|
else if (gerror.Domain == gst_library_error_quark ())
|
|
error = (Gst.LibraryError) gerror.Code;
|
|
else if (gerror.Domain == gst_resource_error_quark ())
|
|
error = (Gst.ResourceError) gerror.Code;
|
|
else if (gerror.Domain == gst_stream_error_quark ())
|
|
error = (Gst.StreamError) gerror.Code;
|
|
else
|
|
error = null;
|
|
}
|
|
|
|
public void ParseWarning (out Enum error, out string message) {
|
|
string tmp;
|
|
|
|
ParseWarning (out error, out message, out tmp);
|
|
}
|
|
|
|
public void ParseWarning (out Enum error) {
|
|
string tmp, tmp2;
|
|
|
|
ParseWarning (out error, out tmp, out tmp2);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_info (IntPtr src, ref Gst.GError error, IntPtr debug);
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.CoreError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_core_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.CoreError error, string message) {
|
|
return NewInfo (src, error, message, null);
|
|
}
|
|
public static Message NewInfo (Gst.Object src, Gst.CoreError error) {
|
|
return NewInfo (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.StreamError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_stream_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.StreamError error, string message) {
|
|
return NewInfo (src, error, message, null);
|
|
}
|
|
public static Message NewInfo (Gst.Object src, Gst.StreamError error) {
|
|
return NewInfo (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.LibraryError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_library_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.LibraryError error, string message) {
|
|
return NewInfo (src, error, message, null);
|
|
}
|
|
public static Message NewInfo (Gst.Object src, Gst.LibraryError error) {
|
|
return NewInfo (src, error, null, null);
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.ResourceError error, string message, string debug) {
|
|
Gst.GError err = new Gst.GError ();
|
|
err.Code = (int) error;
|
|
err.Domain = gst_resource_error_quark ();
|
|
err.Message = (message != null) ? message : GetMessage (err.Domain, err.Code);
|
|
|
|
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
|
|
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
|
|
|
|
GLib.Marshaller.Free (raw_ptr);
|
|
err.Unset ();
|
|
return msg;
|
|
}
|
|
|
|
public static Message NewInfo (Gst.Object src, Gst.ResourceError error, string message) {
|
|
return NewInfo (src, error, message, null);
|
|
}
|
|
public static Message NewInfo (Gst.Object src, Gst.ResourceError error) {
|
|
return NewInfo (src, error, null, null);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_info (IntPtr msg, out IntPtr err, out IntPtr debug);
|
|
|
|
public void ParseInfo (out Enum error, out string message, out string debug) {
|
|
if (Type != MessageType.Info)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr err;
|
|
IntPtr dbg;
|
|
|
|
gst_message_parse_info (Handle, out err, out dbg);
|
|
|
|
if (dbg != IntPtr.Zero)
|
|
debug = GLib.Marshaller.Utf8PtrToString (dbg);
|
|
else
|
|
debug = null;
|
|
|
|
if (err == IntPtr.Zero)
|
|
throw new Exception ();
|
|
|
|
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
|
|
|
|
message = gerror.Message;
|
|
|
|
if (gerror.Domain == gst_core_error_quark ())
|
|
error = (Gst.CoreError) gerror.Code;
|
|
else if (gerror.Domain == gst_library_error_quark ())
|
|
error = (Gst.LibraryError) gerror.Code;
|
|
else if (gerror.Domain == gst_resource_error_quark ())
|
|
error = (Gst.ResourceError) gerror.Code;
|
|
else if (gerror.Domain == gst_stream_error_quark ())
|
|
error = (Gst.StreamError) gerror.Code;
|
|
else
|
|
error = null;
|
|
}
|
|
|
|
public void ParseInfo (out Enum error, out string message) {
|
|
string tmp;
|
|
|
|
ParseInfo (out error, out message, out tmp);
|
|
}
|
|
|
|
public void ParseInfo (out Enum error) {
|
|
string tmp, tmp2;
|
|
|
|
ParseInfo (out error, out tmp, out tmp2);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_tag (IntPtr src, IntPtr tags);
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_tag_list_copy (IntPtr handle);
|
|
|
|
public static Message NewTag (Gst.Object src, TagList tags) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_tag (src.Handle, gst_tag_list_copy (tags.Handle)), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_tag (IntPtr msg, out IntPtr tags);
|
|
|
|
public void ParseTag (out TagList tags) {
|
|
if (Type != MessageType.Tag)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr raw_ptr;
|
|
|
|
gst_message_parse_tag (Handle, out raw_ptr);
|
|
if (raw_ptr == IntPtr.Zero)
|
|
tags = null;
|
|
else
|
|
tags = (TagList) GLib.Opaque.GetOpaque (raw_ptr, typeof (TagList), true);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_buffering (IntPtr src, int percent);
|
|
|
|
public static Message NewBuffering (Gst.Object src, int percent) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_buffering (src.Handle, percent), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_buffering (IntPtr msg, out int percent);
|
|
|
|
public void ParseBuffering (out int percent) {
|
|
if (Type != MessageType.Buffering)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_buffering (Handle, out percent);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_set_buffering_stats (IntPtr msg, Gst.BufferingMode mode, int avg_in, int avg_out, long buffering_left);
|
|
|
|
public void SetBufferingStats (Gst.BufferingMode mode, int avg_in, int avg_out, long buffering_left) {
|
|
if (Type != MessageType.Buffering)
|
|
throw new ArgumentException ();
|
|
if (!IsWritable)
|
|
throw new ApplicationException ();
|
|
|
|
gst_message_set_buffering_stats (Handle, mode, avg_in, avg_out, buffering_left);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_buffering_stats (IntPtr msg, out Gst.BufferingMode mode, out int avg_in, out int avg_out, out long buffering_left);
|
|
|
|
public void ParseBufferingStats (out Gst.BufferingMode mode, out int avg_in, out int avg_out, out long buffering_left) {
|
|
if (Type != MessageType.Buffering)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_buffering_stats (Handle, out mode, out avg_in, out avg_out, out buffering_left);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_state_changed (IntPtr src, State oldstate, State newstate, State pendingstate);
|
|
|
|
public static Message NewStateChanged (Gst.Object src, State oldstate, State newstate, State pendingstate) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_changed (src.Handle, oldstate, newstate, pendingstate), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_state_changed (IntPtr msg, out State oldstate, out State newstate, out State pendingstate);
|
|
|
|
public void ParseStateChanged (out State oldstate, out State newstate, out State pendingstate) {
|
|
if (Type != MessageType.StateChanged)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_state_changed (Handle, out oldstate, out newstate, out pendingstate);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_state_dirty (IntPtr src);
|
|
|
|
public static Message NewStateDirty (Gst.Object src) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_dirty (src.Handle), true);
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_clock_provide (IntPtr src, IntPtr clock, bool ready);
|
|
|
|
public static Message NewClockProvide (Gst.Object src, Gst.Clock clock, bool ready) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_provide (src.Handle, clock.Handle, ready), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_clock_provide (IntPtr msg, out IntPtr clock, out bool ready);
|
|
|
|
public void ParseClockProvide (out Gst.Clock clock, out bool ready) {
|
|
if (Type != MessageType.ClockProvide)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr raw;
|
|
|
|
gst_message_parse_clock_provide (Handle, out raw, out ready);
|
|
|
|
clock = GLib.Object.GetObject (raw, false) as Gst.Clock;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_clock_lost (IntPtr src, IntPtr clock);
|
|
|
|
public static Message NewClockLost (Gst.Object src, Gst.Clock clock) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_lost (src.Handle, clock.Handle), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_clock_lost (IntPtr msg, out IntPtr clock);
|
|
|
|
public void ParseClockLost (out Gst.Clock clock) {
|
|
if (Type != MessageType.ClockLost)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr raw;
|
|
|
|
gst_message_parse_clock_lost (Handle, out raw);
|
|
|
|
clock = GLib.Object.GetObject (raw, true) as Gst.Clock;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_new_clock (IntPtr src, IntPtr clock);
|
|
|
|
public static Message NewNewClock (Gst.Object src, Gst.Clock clock) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_new_clock (src.Handle, clock.Handle), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_new_clock (IntPtr msg, out IntPtr clock);
|
|
|
|
public void ParseNewClock (out Gst.Clock clock) {
|
|
if (Type != MessageType.NewClock)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr raw;
|
|
|
|
gst_message_parse_new_clock (Handle, out raw);
|
|
|
|
clock = GLib.Object.GetObject (raw, true) as Gst.Clock;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_application (IntPtr src, IntPtr structure);
|
|
|
|
public static Message NewApplication (Gst.Object src, Gst.Structure structure) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_application (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
|
|
msg.cached_structure = structure;
|
|
structure.FreeNative = false;
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_element (IntPtr src, IntPtr structure);
|
|
|
|
public static Message NewElement (Gst.Object src, Gst.Structure structure) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_element (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
|
|
msg.cached_structure = structure;
|
|
structure.FreeNative = false;
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_custom (Gst.MessageType type, IntPtr src, IntPtr structure);
|
|
|
|
public static Message NewCustom (Gst.MessageType type, Gst.Object src, Gst.Structure structure) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_custom (type, src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
|
|
msg.cached_structure = structure;
|
|
structure.FreeNative = false;
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_segment_start (IntPtr src, Gst.Format format, long position);
|
|
|
|
public static Message NewSegmentStart (Gst.Object src, Gst.Format format, long position) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_start (src.Handle, format, position), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_segment_start (IntPtr msg, out Gst.Format format, out long position);
|
|
|
|
public void ParseSegmentStart (out Gst.Format format, out long position) {
|
|
if (Type != MessageType.SegmentStart)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_segment_start (Handle, out format, out position);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_segment_done (IntPtr src, Gst.Format format, long position);
|
|
|
|
public static Message NewSegmentDone (Gst.Object src, Gst.Format format, long position) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_done (src.Handle, format, position), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_segment_done (IntPtr msg, out Gst.Format format, out long position);
|
|
|
|
public void ParseSegmentDone (out Gst.Format format, out long position) {
|
|
if (Type != MessageType.SegmentDone)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_segment_done (Handle, out format, out position);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_duration (IntPtr src, Gst.Format format, long duration);
|
|
|
|
public static Message NewDuration (Gst.Object src, Gst.Format format, long duration) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_duration (src.Handle, format, duration), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_duration (IntPtr msg, out Gst.Format format, out long duration);
|
|
|
|
public void ParseDuration (out Gst.Format format, out long duration) {
|
|
if (Type != MessageType.Duration)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_duration (Handle, out format, out duration);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_latency (IntPtr src);
|
|
|
|
public static Message NewLatency (Gst.Object src) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_latency (src.Handle), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_async_start (IntPtr src, bool new_base_time);
|
|
|
|
public static Message NewAsyncStart (Gst.Object src, bool new_base_time) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_start (src.Handle, new_base_time), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_async_start (IntPtr msg, out bool new_base_time);
|
|
|
|
public void ParseAsyncStart (out bool new_base_time) {
|
|
if (Type != MessageType.AsyncStart)
|
|
throw new ArgumentException ();
|
|
|
|
gst_message_parse_async_start (Handle, out new_base_time);
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_async_done (IntPtr src);
|
|
|
|
public static Message NewAsyncDone (Gst.Object src) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_done (src.Handle), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern IntPtr gst_message_new_structure_change (IntPtr src, StructureChangeType type, IntPtr owner, bool busy);
|
|
|
|
public static Message NewStructureChange (Gst.Object src, StructureChangeType type, Gst.Element owner, bool busy) {
|
|
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_structure_change (src.Handle, type, owner.Handle, busy), true);
|
|
|
|
return msg;
|
|
}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern void gst_message_parse_structure_change (IntPtr msg, out StructureChangeType type, out IntPtr owner, out bool busy);
|
|
|
|
public void ParseStructureChange (out StructureChangeType type, out Gst.Element owner, out bool busy) {
|
|
if (Type != MessageType.StructureChange)
|
|
throw new ArgumentException ();
|
|
|
|
IntPtr raw_ptr;
|
|
|
|
gst_message_parse_structure_change (Handle, out type, out raw_ptr, out busy);
|
|
owner = GLib.Object.GetObject (raw_ptr, false) as Gst.Element;
|
|
}
|
|
|
|
static Message () {
|
|
GLib.GType.Register (Message.GType, typeof (Message));
|
|
}
|