AC_CONFIG_FILES([
Makefile
sources/Makefile
- sources/glue/Makefile
samples/Makefile
sources/AssemblyInfo.cs
gstreamer-sharp-1.0.pc
parser.add_argument("--gapi-fixup")
parser.add_argument("--metadata")
parser.add_argument("--gapi-codegen")
- parser.add_argument("--glue-file")
- parser.add_argument("--glue-includes")
- parser.add_argument("--glue-libname")
+ parser.add_argument("--glue-file", default='')
+ parser.add_argument("--glue-includes", default='')
+ parser.add_argument("--glue-libname", default='')
parser.add_argument("--assembly-name")
parser.add_argument("--extra-includes", action='append', default=[])
parser.add_argument("--out")
'--extra-includes=' + glib_api_includes,
'--extra-includes=' + gio_api_includes,
'--extra-includes=' + gst_api_includes,
- '--glue-file', gluefile,
- '--glue-includes', glueincludes,
'--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources),
'--assembly-name', pkg,
- '--glue-libname', 'libgessharpglue-' + apiversion + '.dll',
],
depend_files: [raw_api_fname],
depends: codegen_dependencies + [gst_source_gen])
metadata_fname = join_paths(meson.current_source_dir(), pkg + '.metadata')
snk = join_paths(meson.current_source_dir(), '../', meson.project_name() + '.snk')
-glueincludes = 'ges/ges.h'
-gluefile = join_paths(meson.current_build_dir(), 'generate.c')
-
-sources = [
- 't.cs'
-]
-
subdir('generated')
-ges_sharp = library(pkg + '-sharp', source_gen, sources,
+ges_sharp = library(pkg + '-sharp', source_gen,
cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-unsafe',
'-keyfile:' + snk],
link_with: gst_sharp,
dependencies: [glib_sharp_dep, gio_sharp_dep])
-gluegen = custom_target(pkg + 'gluegen',
- input: raw_api_fname,
- output: 'generate.c',
- command: [generate_api, '--fakeglue'],
- depends: [source_gen])
-
-library('gessharpglue-1.0.0', gluegen, dependencies: gst_deps + [ges_dep])
-
ges_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep, gst_sharp_dep,
ges_dep], link_with: ges_sharp)
gio_sharp_dep = gtk_sharp.get_variable('gio_sharp_dep')
gio_sharp = gtk_sharp.get_variable('gio_sharp')
-gio_glue = gtk_sharp.get_variable('gio_glue')
gapi_fixup = gtk_sharp.get_variable('gapi_fixup')
gapi_codegen = gtk_sharp.get_variable('gapi_codegen')
meson.add_install_script(nuget, '--package-name', 'GstSharp',
'--assembly', gst_sharp.full_path(),
- '--native', gst_glue.full_path(),
'--assembly', gio_sharp.full_path(),
- '--native', gio_glue.full_path(),
'--assembly', glib_sharp.full_path(),
'--project-url', 'https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html',
'--icon-url', 'https://gstreamer.freedesktop.org/images/header-logo-top.png',
<configuration>
<!-- Linux -->
- <dllmap dll="libgstreamersharpglue-1.0.0.dll" target="libgstreamersharpglue-1.0.0.so" os="linux"/>
<dllmap dll="libgstreamer-1.0-0.dll" target="libgstreamer-1.0.so" os="linux"/>
<dllmap dll="libgstaudio-1.0-0.dll" target="libgstaudio-1.0.so" os="linux"/>
<dllmap dll="libgstbase-1.0-0.dll" target="libgstbase-1.0.so" os="linux"/>
<dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so" os="linux"/>
<dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0.so" os="linux"/>
<!-- Mac OS X -->
- <dllmap dll="libgstreamersharpglue-1.0.0.dll" target="libgstreamersharpglue-1.0.0.so" os="osx"/>
<dllmap dll="libgstreamer-1.0-0.dll" target="libgstreamer-1.0.dylib" os="osx"/>
<dllmap dll="libgstaudio-1.0-0.dll" target="libgstaudio-1.0.dylib" os="osx"/>
<dllmap dll="libgstbase-1.0-0.dll" target="libgstbase-1.0.dylib" os="osx"/>
pipeline.SetState (State.Null);
}
}
-}
\ No newline at end of file
+}
Connect (o, name, false, handler);
}
- static int g_closure_sizeof = gstsharp_g_closure_sizeof ();
-
public static void Connect (GLib.Object o, string name,
bool after, Delegate handler)
{
if (!SignalInfo.IsValidDelegate (handler))
throw new Exception ("Invalid delegate");
- IntPtr closure = g_closure_new_simple (g_closure_sizeof, IntPtr.Zero);
+ // Let's allocate 64bytes for the GClosure, it should be more than necessary.
+ IntPtr closure = g_closure_new_simple (64, IntPtr.Zero);
g_closure_set_meta_marshal (closure, (IntPtr)GCHandle.Alloc (k), marshalHandler);
uint signalId = g_signal_connect_closure (o.Handle, name, closure, after);
SignalHandlers.Add (k, new SignalInfo (signalId, closure, handler));
}
}
- [DllImport ("libgstreamersharpglue-1.0.0.dll", CallingConvention = CallingConvention.Cdecl)]
- static extern int gstsharp_g_closure_sizeof ();
-
public static void Disconnect (GLib.Object o, string name, Delegate handler)
{
ObjectSignalKey k = new ObjectSignalKey (o, name);
public static object Emit (GLib.Object o, string name, params object[] parameters)
{
SignalQuery query;
- IntPtr type = gstsharp_g_type_from_instance (o.Handle);
+ IntPtr type;
+ unsafe {
+ // GType is the first field of GTypeInstance->g_class
+ type = (*(IntPtr*) ((GLib.Object.GTypeInstance*) o.Handle)->g_class);
+ }
GType gtype = new GType (type);
string signal_name, signal_detail;
uint signal_detail_quark = 0;
return ret;
}
- [DllImport ("libgstreamersharpglue-1.0.0.dll", CallingConvention = CallingConvention.Cdecl)]
- static extern IntPtr gstsharp_g_type_from_instance (IntPtr o);
-
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern int g_signal_handler_disconnect (IntPtr o, uint handler_id);
static extern void gst_message_parse_error (IntPtr msg, out IntPtr err, out IntPtr debug);
public void ParseError (out GLib.GException error, out string debug) {
- if (Type != MessageType.Error)
- throw new ArgumentException ();
IntPtr err;
IntPtr dbg;
public GLib.Value StreamStatusObject {
get {
- if(Type != MessageType.StreamStatus)
- throw new ArgumentException ();
IntPtr raw_ret = gst_message_get_stream_status_object(Handle);
GLib.Value ret = (GLib.Value) Marshal.PtrToStructure (raw_ret, typeof (GLib.Value));
return ret;
}
set {
- if(Type != MessageType.StreamStatus)
- throw new ArgumentException ();
IntPtr native_value = GLib.Marshaller.StructureToPtrAlloc (value);
gst_message_set_stream_status_object(Handle, native_value);
value = (GLib.Value) Marshal.PtrToStructure (native_value, typeof (GLib.Value));
public class PropertyNotFoundException : Exception {}
+ [StructLayout (LayoutKind.Sequential)]
+ struct GstObject {
+ IntPtr _lock;
+ public string name;
+ public Object parent;
+ public uint flags;
+ IntPtr controlBindings;
+ public int control_rate;
+ public int last_sync;
+
+ private IntPtr[] _gstGstReserved;
+ }
+
partial class Object
{
private Dictionary <string, bool> PropertyNameCache = new Dictionary<string, bool> ();
'--gapi-codegen', gapi_codegen,
'--extra-includes=' + glib_api_includes,
'--extra-includes=' + gio_api_includes,
- '--glue-file', gluefile,
- '--glue-includes', glueincludes,
'--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources),
'--assembly-name', meson.project_name(),
+++ /dev/null
-lib_LTLIBRARIES = libgstreamersharpglue-1.0.0.la
-
-libgstreamersharpglue_1_0_0_la_SOURCES = gobject.c
-
-nodist_libgstreamersharpglue_1_0_0_la_SOURCES = generated.c
-
-libgstreamersharpglue_1_0_0_la_LDFLAGS = -module -avoid-version -no-undefined
-
-libgstreamersharpglue_1_0_0_la_LIBADD = $(GST_LIBS)
-
-libgstreamersharpglue_1_0_0_la_CPPFLAGS = -DGST_USE_UNSTABLE_API
-
-INCLUDES = $(GST_CFLAGS) -I$(top_srcdir)
-
-libgstreamersharpglue.dll: $(libgstreamersharpglue_1_0_0_la_OBJECTS) libgstreamersharpglue.rc libgstreamersharpglue.def
- ./build-dll libgstreamersharpglue $(VERSION)
-
-CLEANFILES = lib*.a lib*.dll generated.c
-
-MAINTAINERCLEANFILES = Makefile.in
-
-EXTRA_DIST =
+++ /dev/null
-//
-// Authors:
-// Sebastian Dröge <sebastian.droege@collabora.co.uk>
-//
-// Copyright (C) 2009 Sebastian Dröge
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301 USA
-
-#include <glib-object.h>
-
-gint
-gstsharp_g_closure_sizeof (void)
-{
- return sizeof (GClosure);
-}
-
-GType
-gstsharp_g_type_from_instance (GTypeInstance * instance)
-{
- return G_TYPE_FROM_INSTANCE (instance);
-}
<attr path="/api/namespace/boxed[@cname='GstVideoCodecState']/field[@cname='padding']" name="type">gpointer</attr>
<attr path="/api/namespace/object[@cname='GstVideoDecoder']/field[@cname='padding']" name="type">gpointer</attr>
<attr path="/api/namespace/object[@cname='GstVideoDecoder']/class_struct/field[@cname='padding']" name="type">gpointer</attr>
+ <attr path="/api/namespace/object[@cname='GstVideoEncoder']/field[@cname='padding']" name="type">gpointer</attr>
<attr path="/api/namespace/struct[@cname='GstByteReader']" name="opaque">1</attr>
<remove-node path="/api/namespace//struct[@cname='GstByteReader']//method"/>
<attr path="//struct[@name='VideoGLTextureUploadMeta']//field[@cname='user_data_copy' or @cname='user_data_free']" name="hidden">true</attr>
'-keyfile:' + snk],
dependencies: [glib_sharp_dep, gio_sharp_dep])
-gluegen = custom_target('gluegen',
- input: raw_api_fname,
- output: 'generate.c',
- command: [generate_api, '--fakeglue'],
- depends: [gst_source_gen])
+#gluegen = custom_target('gluegen',
+ #input: raw_api_fname,
+ #output: 'generate.c',
+ #command: [generate_api, '--fakeglue'],
+ #depends: [gst_source_gen])
-gst_glue = library('gstreamersharpglue-1.0.0', gluegen, 'glue/gobject.c', dependencies: gst_deps)
+#gst_glue = library('gstreamersharpglue-1.0.0', gluegen, 'glue/gobject.c', dependencies: gst_deps)
gst_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep],
link_with: gst_sharp)