2009-04-18 14:24:12 +00:00
public Message (GLib.Value val) : base (val) { }
2006-05-20 22:35:40 +00:00
2009-04-07 09:27:20 +00:00
[DllImport ("gstreamersharpglue-0.10") ]
2009-04-18 14:24:12 +00:00
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 ();
2006-05-19 19:24:35 +00:00
2009-04-18 14:24:12 +00:00
unsafe {
ulong* raw_ptr = (ulong*) ( ( (byte*) Handle) + timestamp_offset);
*raw_ptr = value;
}
}
2009-04-07 09:27:20 +00:00
}
2006-08-11 20:53:33 +00:00
2009-04-07 09:27:20 +00:00
[DllImport ("gstreamersharpglue-0.10") ]
2009-04-18 14:24:12 +00:00
extern static uint gstsharp_gst_message_get_src_offset ();
2009-05-01 07:03:49 +00:00
[DllImport ("libgobject-2.0.dll") ]
2009-04-23 12:39:50 +00:00
extern static IntPtr g_object_ref (IntPtr handle);
2009-05-01 07:03:49 +00:00
[DllImport ("libgobject-2.0.dll") ]
2009-04-23 12:39:50 +00:00
extern static void g_object_unref (IntPtr handle);
2009-04-18 14:24:12 +00:00
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 ();
2009-04-23 12:39:50 +00:00
if (Src != null)
g_object_unref (Src.Handle);
2009-04-18 14:24:12 +00:00
unsafe {
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + src_offset);
2009-04-23 12:39:50 +00:00
*raw_ptr = value == null ? IntPtr.Zero : g_object_ref (value.Handle);
2009-04-18 14:24:12 +00:00
}
}
}
[DllImport ("gstreamer-0.10.dll") ]
static extern uint gst_message_get_seqnum (IntPtr raw);
[DllImport ("gstreamer-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);
}
}
2009-04-19 16:29:19 +00:00
2009-04-22 09:54:49 +00:00
private Gst.Structure cached_structure = null;
2009-04-19 16:29:19 +00:00
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_get_structure (IntPtr raw);
public Gst.Structure Structure {
get {
2009-04-22 09:54:49 +00:00
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);
2009-05-22 13:59:15 +00:00
if (ret != null)
ret.FreeNative = false;
2009-04-22 09:54:49 +00:00
cached_structure = ret;
2009-04-19 16:29:19 +00:00
return ret;
}
}
2009-04-22 09:54:49 +00:00
~Message () {
2009-04-22 09:55:52 +00:00
if (cached_structure != null)
cached_structure.CreateNativeCopy ();
2009-04-22 09:54:49 +00:00
cached_structure = null;
}
2009-04-18 14:24:12 +00:00
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_eos (IntPtr src);
public static Message NewEos (Gst.Object src) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_eos (src.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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 ("gstreamer-0.10.dll") ]
static extern uint gst_core_error_quark ();
[DllImport ("gstreamer-0.10.dll") ]
static extern uint gst_library_error_quark ();
[DllImport ("gstreamer-0.10.dll") ]
static extern uint gst_stream_error_quark ();
[DllImport ("gstreamer-0.10.dll") ]
static extern uint gst_resource_error_quark ();
[DllImport ("gstreamer-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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_error (IntPtr msg, out IntPtr err, out IntPtr debug);
2009-04-22 06:07:55 +00:00
public void ParseError (out Enum error, out string message, out string debug) {
2009-04-18 14:24:12 +00:00
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)
2009-04-22 06:07:55 +00:00
throw new Exception ();
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
message = gerror.Message;
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
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;
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseError (out Enum error, out string message) {
2009-04-18 14:24:12 +00:00
string tmp;
2009-04-22 06:07:55 +00:00
ParseError (out error, out message, out tmp);
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseError (out Enum error) {
2009-04-18 14:24:12 +00:00
string tmp, tmp2;
2009-04-22 06:07:55 +00:00
ParseError (out error, out tmp, out tmp2);
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_warning (IntPtr msg, out IntPtr err, out IntPtr debug);
2009-04-22 06:07:55 +00:00
public void ParseWarning (out Enum error, out string message, out string debug) {
2009-04-18 14:24:12 +00:00
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)
2009-04-22 06:07:55 +00:00
throw new Exception ();
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
message = gerror.Message;
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
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;
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseWarning (out Enum error, out string message) {
2009-04-18 14:24:12 +00:00
string tmp;
2009-04-22 06:07:55 +00:00
ParseWarning (out error, out message, out tmp);
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseWarning (out Enum error) {
2009-04-18 14:24:12 +00:00
string tmp, tmp2;
2009-04-22 06:07:55 +00:00
ParseWarning (out error, out tmp, out tmp2);
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
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);
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
2009-04-18 14:24:12 +00:00
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
return msg;
}
2009-04-22 06:07:55 +00:00
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);
}
2009-04-18 14:24:12 +00:00
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_info (IntPtr msg, out IntPtr err, out IntPtr debug);
2009-04-22 06:07:55 +00:00
public void ParseInfo (out Enum error, out string message, out string debug) {
2009-04-18 14:24:12 +00:00
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)
2009-04-22 06:07:55 +00:00
throw new Exception ();
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
GError gerror = (Gst.GError) Marshal.PtrToStructure (err, typeof (Gst.GError));
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
message = gerror.Message;
2009-04-18 14:24:12 +00:00
2009-04-22 06:07:55 +00:00
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;
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseInfo (out Enum error, out string message) {
2009-04-18 14:24:12 +00:00
string tmp;
2009-04-22 06:07:55 +00:00
ParseInfo (out error, out message, out tmp);
2009-04-18 14:24:12 +00:00
}
2009-04-22 06:07:55 +00:00
public void ParseInfo (out Enum error) {
2009-04-18 14:24:12 +00:00
string tmp, tmp2;
2009-04-22 06:07:55 +00:00
ParseInfo (out error, out tmp, out tmp2);
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_tag (IntPtr src, IntPtr tags);
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_tag_list_copy (IntPtr handle);
public static Message NewTag (Gst.Object src, TagList tags) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_tag (src.Handle, gst_tag_list_copy (tags.Handle)), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_tag (IntPtr msg, out IntPtr tags);
2009-04-22 06:07:55 +00:00
public void ParseTag (out TagList tags) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.Tag)
throw new ArgumentException ();
IntPtr raw_ptr;
gst_message_parse_tag (Handle, out raw_ptr);
if (raw_ptr == IntPtr.Zero)
2009-04-22 06:07:55 +00:00
tags = null;
else
tags = (TagList) GLib.Opaque.GetOpaque (raw_ptr, typeof (TagList), true);
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_buffering (IntPtr src, int percent);
public static Message NewBuffering (Gst.Object src, int percent) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_buffering (src.Handle, percent), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_buffering (IntPtr msg, out int percent);
2009-04-22 06:07:55 +00:00
public void ParseBuffering (out int percent) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.Buffering)
throw new ArgumentException ();
gst_message_parse_buffering (Handle, out percent);
}
[DllImport ("gstreamer-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 ("gstreamer-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 ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_changed (src.Handle, oldstate, newstate, pendingstate), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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 ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_state_dirty (IntPtr src);
public static Message NewStateDirty (Gst.Object src) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_dirty (src.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_provide (src.Handle, clock.Handle, ready), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_clock_provide (IntPtr msg, out IntPtr clock, out bool ready);
2009-04-22 06:07:55 +00:00
public void ParseClockProvide (out Gst.Clock clock, out bool ready) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.ClockProvide)
throw new ArgumentException ();
IntPtr raw;
gst_message_parse_clock_provide (Handle, out raw, out ready);
2009-04-22 06:07:55 +00:00
clock = GLib.Object.GetObject (raw, false) as Gst.Clock;
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_lost (src.Handle, clock.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_clock_lost (IntPtr msg, out IntPtr clock);
2009-04-22 06:07:55 +00:00
public void ParseClockLost (out Gst.Clock clock) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.ClockLost)
throw new ArgumentException ();
IntPtr raw;
gst_message_parse_clock_lost (Handle, out raw);
2009-04-22 06:07:55 +00:00
clock = GLib.Object.GetObject (raw, true) as Gst.Clock;
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_new_clock (src.Handle, clock.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_new_clock (IntPtr msg, out IntPtr clock);
2009-04-22 06:07:55 +00:00
public void ParseNewClock (out Gst.Clock clock) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.NewClock)
throw new ArgumentException ();
IntPtr raw;
gst_message_parse_new_clock (Handle, out raw);
2009-04-22 06:07:55 +00:00
clock = GLib.Object.GetObject (raw, true) as Gst.Clock;
2009-04-18 14:24:12 +00:00
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_application (IntPtr src, IntPtr structure);
public static Message NewApplication (Gst.Object src, Gst.Structure structure) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_application (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
2009-04-22 10:46:28 +00:00
msg.cached_structure = structure;
structure.FreeNative = false;
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_element (IntPtr src, IntPtr structure);
public static Message NewElement (Gst.Object src, Gst.Structure structure) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_element (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
2009-04-22 10:46:28 +00:00
msg.cached_structure = structure;
structure.FreeNative = false;
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_custom (type, src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
2009-04-22 10:46:28 +00:00
msg.cached_structure = structure;
structure.FreeNative = false;
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_start (src.Handle, format, position), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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 ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_done (src.Handle, format, position), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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 ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_duration (src.Handle, format, duration), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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 ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_latency (IntPtr src);
public static Message NewLatency (Gst.Object src) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_latency (src.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_start (src.Handle, new_base_time), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern void gst_message_parse_async_start (IntPtr msg, out bool new_base_time);
2009-04-22 06:07:55 +00:00
public void ParseAsyncStart (out bool new_base_time) {
2009-04-18 14:24:12 +00:00
if (Type != MessageType.AsyncStart)
throw new ArgumentException ();
gst_message_parse_async_start (Handle, out new_base_time);
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_message_new_async_done (IntPtr src);
public static Message NewAsyncDone (Gst.Object src) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_done (src.Handle), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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) {
2009-05-20 15:29:36 +00:00
Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_structure_change (src.Handle, type, owner.Handle, busy), true);
2009-04-18 14:24:12 +00:00
return msg;
}
[DllImport ("gstreamer-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;
}
2009-04-07 09:27:20 +00:00
2009-04-18 14:24:12 +00:00
static Message () {
GLib.GType.Register (Message.GType, typeof (Message));
2009-04-07 09:27:20 +00:00
}