mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 15:56:42 +00:00
Use the copy-on-unref workaround for newly created Application/Element/Custom messages
This commit is contained in:
parent
53ff480060
commit
303724d400
1 changed files with 9 additions and 3 deletions
|
@ -708,7 +708,9 @@ static extern IntPtr gst_message_new_application (IntPtr src, IntPtr structure);
|
|||
static extern IntPtr gst_structure_copy (IntPtr handle);
|
||||
|
||||
public static Message NewApplication (Gst.Object src, Gst.Structure structure) {
|
||||
Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_application (src.Handle, (structure != null) ? gst_structure_copy (structure.Handle) : IntPtr.Zero), typeof (Message), true);
|
||||
Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_application (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
|
||||
msg.cached_structure = structure;
|
||||
structure.FreeNative = false;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
@ -717,7 +719,9 @@ public static Message NewApplication (Gst.Object src, Gst.Structure structure) {
|
|||
static extern IntPtr gst_message_new_element (IntPtr src, IntPtr structure);
|
||||
|
||||
public static Message NewElement (Gst.Object src, Gst.Structure structure) {
|
||||
Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_element (src.Handle, (structure != null) ? gst_structure_copy (structure.Handle) : IntPtr.Zero), typeof (Message), true);
|
||||
Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_element (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
|
||||
msg.cached_structure = structure;
|
||||
structure.FreeNative = false;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
@ -726,7 +730,9 @@ public static Message NewElement (Gst.Object src, Gst.Structure structure) {
|
|||
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) GLib.Opaque.GetOpaque (gst_message_new_custom (type, src.Handle, (structure != null) ? gst_structure_copy (structure.Handle) : IntPtr.Zero), typeof (Message), true);
|
||||
Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_custom (type, src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
|
||||
msg.cached_structure = structure;
|
||||
structure.FreeNative = false;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue