summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Sundermann <stephansundermann@gmail.com>2014-10-23 22:53:37 (GMT)
committerStephan Sundermann <stephansundermann@gmail.com>2014-10-23 22:53:37 (GMT)
commit5b386f21fb9258d0a80fe6eefbb6cd097dad3a41 (patch)
treeb2b0de154266f0ecc52885d2f04dce9d8c3b68f2
parent63ee9a97f051ef12ed528767cb7d8831efa2d42c (diff)
Application: Fix Init(args) and InitCheck(args)HEADmaster
Fixes #739069
-rw-r--r--sources/custom/Application.cs41
-rw-r--r--sources/gstreamer-sharp.metadata7
2 files changed, 44 insertions, 4 deletions
diff --git a/sources/custom/Application.cs b/sources/custom/Application.cs
index ea71cc4..dd8682a 100644
--- a/sources/custom/Application.cs
+++ b/sources/custom/Application.cs
@@ -32,8 +32,47 @@ namespace Gst {
}
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_init(ref int argc, ref IntPtr[] argv);
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_init(IntPtr argc, IntPtr argv);
+
+
public static void Init() {
- gst_init (0, null);
+ gst_init (IntPtr.Zero, IntPtr.Zero);
+ }
+
+ public static void Init(ref string[] argv) {
+ int cnt_argv = argv == null ? 0 : argv.Length;
+ IntPtr[] native_argv = new IntPtr [cnt_argv];
+ for (int i = 0; i < cnt_argv; i++)
+ native_argv [i] = GLib.Marshaller.StringToPtrGStrdup(argv[i]);
+ gst_init(ref cnt_argv, ref native_argv);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern bool gst_init_check(ref int argc, ref IntPtr[] argv, out IntPtr error);
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern bool gst_init_check(IntPtr argc, IntPtr argv, out IntPtr error);
+
+ public static bool InitCheck() {
+ IntPtr error = IntPtr.Zero;
+ bool ret = gst_init_check (IntPtr.Zero, IntPtr.Zero, out error);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+ public static bool InitCheck(ref string[] argv) {
+ int cnt_argv = argv == null ? 0 : argv.Length;
+ IntPtr[] native_argv = new IntPtr [cnt_argv];
+ for (int i = 0; i < cnt_argv; i++)
+ native_argv [i] = GLib.Marshaller.StringToPtrGStrdup(argv[i]);
+ IntPtr error = IntPtr.Zero;
+ bool ret = gst_init_check(ref cnt_argv, ref native_argv, out error);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
}
}
}
diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata
index 1163607..17aa8e9 100644
--- a/sources/gstreamer-sharp.metadata
+++ b/sources/gstreamer-sharp.metadata
@@ -70,9 +70,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
<!-- Maybe some problems with the name -->
<remove-node path="/api/namespace/interface[@cname='GstURIHandler']/class_struct/method[@vm='get_type']" name="vm"/>
<remove-node path="/api/namespace/interface[@cname='GstURIHandler']/virtual_method[@cname='get_type']" name="hidden"/>
- <!-- gapi cannot handle count parameters properly -->
- <attr path="/api/namespace/object[@cname='GstGlobal']/method[@cname='gst_init']/parameters/parameter[@name='argc']" name="name">n_argc</attr>
- <attr path="/api/namespace/object[@cname='GstGlobal']/method[@cname='gst_init_check']/parameters/parameter[@name='argc']" name="name">n_argc</attr>
+
<!-- calling oldobj.Handle should fix this -->
<remove-attr path="/api/namespace/object[@cname='GstObject']/method[@cname='gst_object_replace']/parameters/parameter[@name='oldobj']" name="pass_as"/>
<!-- Some glue problems -->
@@ -123,6 +121,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
<attr path="/api/namespace/boxed[@cname='GstMessage']/method[@cname='gst_message_parse_error']" name="hidden">true</attr>
<attr path="/api/namespace/boxed[@cname='GstMessage']/method[@cname='gst_message_get_stream_status_object']" name="hidden">true</attr>
<attr path="/api/namespace/boxed[@cname='GstMessage']/method[@cname='gst_message_set_stream_status_object']" name="hidden">true</attr>
+ <attr path="/api/namespace/object[@cname='GstGlobal']/method[@cname='gst_init']" name="hidden">true</attr>
+ <attr path="/api/namespace/object[@cname='GstGlobal']/method[@cname='gst_init_check']" name="hidden">true</attr>
+
<!-- GstVideo -->
<attr path="/api/namespace/boxed[@cname='GstVideoCodecState']/field[@cname='padding']" name="type">gpointer</attr>