Add ABI tests and fix related issues
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 4 Oct 2017 19:02:53 +0000 (16:02 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Wed, 11 Oct 2017 16:27:53 +0000 (18:27 +0200)
Tests/test_abi.py [new file with mode: 0755]
generate_code.py
ges/generated/meson.build
ges/gst-editing-services.metadata
ges/meson.build
meson.build
samples/PlaybackTutorial3.cs
sources/generated/meson.build
sources/gstreamer-sharp.metadata
sources/meson.build

diff --git a/Tests/test_abi.py b/Tests/test_abi.py
new file mode 100755 (executable)
index 0000000..838801c
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+import difflib
+import sys
+import shutil
+import subprocess
+
+reference_abi = subprocess.check_output(sys.argv[1]).decode().split("\n")
+launcher = []
+if shutil.which("mono"):
+    launcher = ["mono", "--debug"]
+csharp_abi = subprocess.check_output(launcher + [sys.argv[2]]).decode().split("\n")
+print("Comparing output of %s and %s" % (sys.argv[1], sys.argv[2]))
+
+res = 0
+for line in difflib.unified_diff(reference_abi, csharp_abi):
+    res = 1
+    print(line)
+
+if res:
+    files = [(sys.argv[1] + ".res", reference_abi),
+             (sys.argv[2] + 'res', csharp_abi)]
+
+    for f, vals in files:
+        with open(f, "w") as _f:
+            print("Outputing results in " + f)
+            _f.write("\n".join(vals))
+sys.exit(res)
index 8a3bc10ea4bf804bfeaad85114dcd0d264f62186..fa8b9da65acfbd3d3619dfc8acf4616337643c75 100644 (file)
@@ -16,6 +16,7 @@ if __name__ == "__main__":
     parser.add_argument("--gapi-codegen")
     parser.add_argument("--glue-file", default="")
     parser.add_argument("--glue-includes", default="")
+    parser.add_argument("--abi-cs-usings", default="")
     parser.add_argument("--glue-libname", default="")
     parser.add_argument("--assembly-name")
     parser.add_argument("--extra-includes", action='append', default=[])
@@ -38,7 +39,7 @@ if __name__ == "__main__":
     shutil.copyfile(opts.api_raw, api_xml)
 
     if shutil.which('mono'):
-        launcher = ['mono']
+        launcher = ['mono', '--debug']
     else:
         launcher = []
 
@@ -56,12 +57,16 @@ if __name__ == "__main__":
         '--gluelib-name=' + opts.glue_libname,
         '--glue-includes=' + opts.glue_includes,
         '--assembly-name=' + opts.assembly_name,
-        '--all-opaque',
+        '--abi-c-filename=' + os.path.join(opts.out, opts.assembly_name + "-abi.c"),
+        '--abi-cs-filename=' + os.path.join(opts.out, opts.assembly_name + "-abi.cs"),
     ]
 
     if opts.schema:
         cmd += ['--schema=' + opts.schema]
 
+    if opts.abi_cs_usings:
+        cmd += ['--abi-cs-usings=' + opts.abi_cs_usings]
+
     cmd += ['-I' + i for i in opts.extra_includes]
 
     subprocess.check_call(launcher + cmd)
index a05d4ff34eae61ba83a8ff41ad140769f26fe20e..0e336438ed60a14333ce486b8a52c573efdbb904 100644 (file)
@@ -118,7 +118,7 @@ source_gen = custom_target(pkg + '_codegen',
         generate_api,
         '--api-raw', '@INPUT@',
         '--gapi-fixup', gapi_fixup,
-        '--metadata', metadata_fname,
+        '--metadata', metadata,
         '--gapi-codegen', gapi_codegen,
         '--extra-includes=' + glib_api_includes,
         '--extra-includes=' + gio_api_includes,
@@ -126,9 +126,24 @@ source_gen = custom_target(pkg + '_codegen',
         '--out', meson.current_build_dir(),
         '--files', ';'.join(generated_sources),
         '--assembly-name', pkg,
+        '--glue-includes', 'ges/ges.h',
+        '--abi-cs-usings', 'Gst,Gst.Video,Gst.Sdp,Gst.Tags,Gst.Rtsp,Gst.PbUtils,Gst.Net,Gst.FFT,Gst.Controller,Gst.Base,Gst.Audio,Gst.App,GES',
     ],
     depend_files: [raw_api_fname],
     depends: codegen_dependencies + [gst_source_gen])
 
+c_abi = custom_target(pkg + '_c_abi',
+        input: raw_api_fname,
+        output: pkg + '-abi.c',
+        command: [generate_api, '--fakeglue'],
+        depends: [source_gen])
+
+cs_abi = custom_target(pkg + '_cs_abi',
+        input: raw_api_fname,
+        output: pkg + '-abi.cs',
+        command: [generate_api, '--fakeglue'],
+        depends: [source_gen])
+
+
 gapis += [join_paths(meson.current_build_dir(), pkg + '-api.xml')]
 gapis_deps = [source_gen]
index a594d196b1b74b895ac9727fc2c56918ece5b434..1c45cab11aa06964637308e6ae7ba2089877917f 100644 (file)
@@ -32,4 +32,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="/api/namespace/object[@name='TimelineElement']/field[@cname='parent_instance']" name="access">private</attr>
        <attr path="/api/namespace/object[@name='Layer']/field[@cname='parent']" name="access">private</attr>
        <attr path="/api/namespace/object[@name='Formatter']/field[@cname='parent']" name="access">private</attr>
+       <attr path="/api/namespace/object/class_struct[@cname='GESBaseXmlFormatterClass']/field[@cname='content_parser']" name="type">GMarkupParser</attr>
+
+       <attr path="/api/namespace/object/class_struct[@cname='GESEffectAssetClass']" name="private">true</attr>
+       <add-node path="/api/namespace/object/class_struct[@cname='GESVideoSourceClass']">
+      <union name="ABI" cname="ABI">
+        <struct name="abi" cname="abi" opaque="false" hidden="false">
+          <field cname="disable_scale_in_compositor" access="public" writeable="true" readable="true" name="DisableScaleInCompositor" type="gint64"/>
+        </struct>
+        <field cname="_gst_reserved" access="private" writeable="false" readable="false" name="_gstGstReserved" type="gpointer" array="true" array_len="4"/>
+      </union>
+       </add-node>
 </metadata>
index 3429b7bce6e5db400a9a765aaa2546b5e1d67452..2193df0161b7df86e8d5d853660c5c3b04b929f0 100644 (file)
@@ -1,6 +1,6 @@
 pkg = 'gst-editing-services'
 raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw')
-metadata_fname = join_paths(meson.current_source_dir(), pkg + '.metadata')
+metadata  = files(pkg + '.metadata')
 
 subdir('generated')
 
@@ -9,12 +9,22 @@ ges_sharp = library(pkg + '-sharp', source_gen,
         link_with: gst_sharp,
         dependencies: [glib_sharp_dep, gio_sharp_dep])
 
-ges_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep, gst_sharp_dep,
-    ges_dep], link_with: ges_sharp)
+ges_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep, gst_sharp_dep], link_with: ges_sharp)
 
 configure_file(
     input: pkg + '-sharp.dll.config',
     output: pkg + '-sharp.dll.config',
     configuration: configuration_data())
 
+if add_languages('c', required: false)
+    c_abi_exe = executable(pkg + '_c_abi', c_abi,
+            c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'],
+            dependencies: [gst_deps, ges_dep])
+
+    cs_abi_exe = executable(pkg + '_cs_abi', cs_abi,
+            cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'],
+            dependencies: [ges_sharp_dep])
+
+    test(pkg + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()])
+endif
 
index e3cf4789ff5a67f55ef4c1e7717384d8f94a39dc..639401bb51194e604bf1fe3b128903d4f512d459 100644 (file)
@@ -47,6 +47,7 @@ gapi_codegen = gapi_codegen.full_path()
 gacutil = find_program('gacutil')
 generate_api = find_program('generate_code.py')
 nuget = find_program('nuget.py')
+diff = find_program('Tests/test_abi.py')
 
 # TODO Handle monodoc
 
index 47ecef5893e7884e17ee15be916635f2d7f7907b..dc725b063847f65720fe328745ca8bb571bfe6b2 100644 (file)
@@ -93,7 +93,7 @@ namespace GstreamerSharp
 
                // This function is called when playbin has created the appsrc element, so we have a chance to configure it.
                static void SourceSetup (object sender, GLib.SignalArgs args) {
-                       var info = new Gst.Audio.AudioInfo();
+                       var info = new Gst.Audio.AudioInfo ();
                        var source = new Gst.App.AppSrc(((Element)args.Args [0]).Handle);
                        Console.WriteLine ("Source has been created. Configuring.");
                        AppSource = source;
index 2a64c84d6c5f59d015e001af63a696a9c4b73423..200edd1d0558935eeb98a52bfd377ee6319b6caa 100644 (file)
@@ -688,7 +688,6 @@ generated_sources = [
     'Gst.Net_PtpClock.cs',
     'Gst.Net_Gst.NetSharp.PtpStatisticsCallbackNative.cs',
     'Gst.Net_NetControlMessageMeta.cs',
-    'Gst.Net_NtpClock.cs',
     'Gst.Net_NetAddressMeta.cs',
     'Gst.Net_NetTimePacket.cs',
     'Gst.Net_Constants.cs',
@@ -719,17 +718,31 @@ gst_source_gen = custom_target('gst_codegen',
         generate_api,
         '--api-raw', '@INPUT@',
         '--gapi-fixup', gapi_fixup,
-        '--metadata', metadata_fname,
+        '--metadata', metadata,
         '--gapi-codegen', gapi_codegen,
         '--extra-includes=' + glib_api_includes,
         '--extra-includes=' + gio_api_includes,
         '--out', meson.current_build_dir(),
         '--files', ';'.join(generated_sources),
         '--assembly-name', meson.project_name(),
+        '--glue-includes', glueincludes,
+        '--abi-cs-usings', 'Gst,Gst.Video,Gst.Sdp,Gst.Tags,Gst.Rtsp,Gst.PbUtils,Gst.Net,Gst.FFT,Gst.Controller,Gst.Base,Gst.Audio,Gst.App',
     ],
     depend_files: [raw_api_fname],
     depends: codegen_dependencies)
 
+c_abi = custom_target('gst_sharp_c_abi',
+        input: raw_api_fname,
+        output: 'gstreamer-sharp-abi.c',
+        command: [generate_api, '--fakeglue'],
+        depends: [gst_source_gen])
+
+cs_abi = custom_target('gst_sharp_cs_abi',
+        input: raw_api_fname,
+        output: 'gstreamer-sharp-abi.cs',
+        command: [generate_api, '--fakeglue'],
+        depends: [gst_source_gen])
+
 gst_api_includes = join_paths(meson.current_build_dir(), 'gstreamer-sharp-api.xml')
 gapis = [gst_api_includes]
 gapis_deps = [gst_source_gen]
index 8249af956f0662d470fbb57f0203b16cd7796de2..3e447b817e1132adf3c941309995fbd8a6716b2a 100644 (file)
@@ -67,17 +67,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="/api/namespace/struct[@cname='GstRTSPMessage']" name="opaque">true</attr>
 
        <attr path="/api/namespace/struct[@cname='GstTypeFind']" name="opaque">true</attr>
-    <!-- Add callback nodes that are not handled in structures (remove the data which is in the middle) -->
-       <remove-node path="/api/namespace/struct[@cname='GstTypeFind']/field[@cname='data']"/>
-       <remove-node path="/api/namespace/struct[@cname='GstTypeFind']/field[@cname='_gst_reserved']"/>
-       <add-node path="/api/namespace/struct[@cname='GstTypeFind']">
-      <field cname="peek" access="private" writeable="false" readable="false" name="Peek" type="gpointer" hidden="true"/>
-      <field cname="suggest" access="private" writeable="false" readable="false" name="Suggest" type="gpointer" hidden="true"/>
-      <field cname="data" access="public" writeable="true" readable="true" name="Data" type="gpointer" />
-      <field cname="get_length" access="private" writeable="false" readable="false" name="GetLengtk" type="gpointer" hidden="true"/>
-      <field cname="_gst_reserved" access="private" writeable="false" readable="false" name="_gstGstReserved" type="gpointer" array="true" array_len="4" is-padding="true" />
-       </add-node>
-
        <attr path="/api/namespace/boxed[@cname='GstIterator']" name="opaque">true</attr>
        <!-- acknowledge that we GstIterator implements the IEnumerator interface -->
        <add-node path="/api/namespace/boxed[@cname='GstIterator']">
@@ -87,11 +76,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        </add-node>
        <attr path="/api/namespace/boxed[@cname='GstIterator']/method[@cname='gst_iterator_next']" name="hidden">true</attr>
        <attr path="/api/namespace/boxed[@cname='GstIterator']/field[@cname='master_cookie']" name="type">guint32*</attr>
-       <attr path="/api/namespace/boxed[@cname='GstStructure']/field[@cname='name']" name="hidden">true</attr>
        <!-- Fix for GstChildProxy -->
        <attr path="/api/namespace/interface[@cname='GstChildProxy']/method[@cname='gst_child_proxy_get_property']" name="hidden">1</attr>
        <attr path="/api/namespace/interface[@cname='GstChildProxy']/method[@cname='gst_child_proxy_set_property']" name="hidden">1</attr>
-
        <!-- FIXME: array handling -->
        <attr path="/api/namespace/struct[@cname='GstRTCPPacket']/method[@cname='gst_rtcp_packet_sdes_copy_entry']" name="hidden">true</attr>
        <attr path="/api/namespace/struct[@cname='GstRTCPPacket']/method[@cname='gst_rtcp_packet_sdes_get_entry']" name="hidden">true</attr>
@@ -117,16 +104,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
                </parameters>
                </method>
        </add-node>
-
        <!-- Some glue problems -->
        <attr path="/api/namespace/object[@cname='GstObject']/field[@cname='object']" name="hidden">true</attr>
        <attr path="/api/namespace/struct[@cname='GstClockEntry']/field[@cname='func']" name="hidden">true</attr>
        <attr path="/api/namespace/struct[@cname='GstClockEntry']/field[@cname='destroy_data']" name="hidden">true</attr>
        <attr path="/api/namespace/object[@cname='GstTask']/field[@cname='notify']" name="hidden">true</attr>
 
-       <!-- Hide structure callbacks -->
-       <attr path="/api/namespace/struct[@cname='GstDataQueueItem']/field[@cname='destroy']" name="hidden">true</attr>
-
        <!-- hide user data; FIXME: already removed in 1.2 GIR file, remove when we update to this version -->
        <attr path="/api/namespace/object[@cname='GstBus']/method[@cname='gst_bus_sync_signal_handler']/parameters/parameter[@name='data']" name="hidden">1</attr>
 
@@ -190,6 +173,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <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>
+       <attr path="/api/namespace/struct[@cname='GstAudioRingBufferSpec']" name="opaque">true</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>
        <attr path="//interface[@cname='GstVideoOverlay']//parameter[@type='guintptr']" name="type">gpointer</attr>
@@ -203,6 +187,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="/api/namespace/object[@cname='GstAudioClock']/field[@cname='destroy_notify']" name="hidden">1</attr>
        <attr path="/api/namespace/interface[@cname='GstStreamVolume']/property[@cname='volume']" name="hidden">1</attr>
        <attr path="//method[@cname='gst_audio_filter_class_add_pad_templates']" name="name">AddAudioPadTemplate</attr> <!-- FIXME This should probably be usable -->
+       <attr path="/api/namespace//struct[@cname='GstAudioDownmixMeta']" name="parent">GstMeta</attr>
+       <attr path="/api/namespace//struct[@cname='GstAudioDownmixMeta']/field[@cname='from_position']" name="type">GstAudioChannelPosition*</attr>
+       <attr path="/api/namespace//struct[@cname='GstAudioDownmixMeta']/field[@cname='to_position']" name="type">GstAudioChannelPosition*</attr>
 
        <!-- Name clashes -->
        <attr path="//method[@cname='gst_buffer_foreach_meta']" name="hidden">true</attr> <!-- FIXME This should probably be usable -->
@@ -271,7 +258,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="//struct[@cname='GstVideoGLTextureUploadMeta']" name="noequals">true</attr>
        <attr path="//object[@cname='GstPad']//union" name="hidden">true</attr>
        <attr path="//struct[@cname='GstControlPoint']" name="hidden">true</attr>
-       <move-node path="//boxed[@cname='GstVideoCodecFrame']/union/field">//boxed[@cname='GstVideoCodecFrame']</move-node>
        <attr path="//boxed[@cname='GstVideoCodecFrame']/union" name="hidden">true</attr>
        <attr path="//boxed[@cname='GstVideoCodecFrame']/union/field[@cname='padding']" name="type">gpointer</attr>
        <attr path="//*[@type='const GList*']" name="type">GList*</attr>
@@ -281,7 +267,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="//constant[@name='SECOND']" name="ctype">gint64</attr>
        <attr path="//constant[@name='MSECOND']" name="ctype">gint64</attr>
        <attr path="//method[parameters/parameter[contains(@type, 'Class*')]]" name="hidden">true</attr>
-       <attr path="//struct[@cname='GstMapInfo']/field[@name='Data']" name="hidden">true</attr>
+       <attr path="//struct[@cname='GstMapInfo']/field[@name='Data']" name="type">gpointer</attr>
+       <attr path="//struct[@cname='GstMapInfo']/field[@name='Data']" name="array">false</attr>
        <attr path="//method[@cname='gst_tag_list_copy_value']/parameters/parameter[@name='dest']" name="pass_as">ref</attr>
        <attr path="//object/field[@cname='parent']" name="hidden">true</attr>
     <!-- buffer fixes -->
@@ -323,19 +310,35 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
        <attr path="//callback[@cname='GstAudioFormatUnpack']/parameters/parameter[@name='dest']" name="type">guint8*</attr>
        <attr path="//callback[@cname='GstAudioFormatUnpack']/parameters/parameter[@name='length']" name="name">n_length</attr>
        <attr path="/api/namespace/object[@cname='GstObject']/field[@cname='flags']" name="writeable">true</attr>
+       <attr path="/api/namespace/object[@cname='GstAudioRingBuffer']/field[@cname='empty_seg']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstRTSPMessage']/field[@cname='body']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadKeyData']/field[@cname='key_data']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadKeyData']/field[@cname='salt_data']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadKeyData']/field[@cname='kv_data']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadSPParam']/field[@cname='val']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadPKE']/field[@cname='data']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadRAND']/field[@cname='rand']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstMIKEYPayloadT']/field[@cname='ts_value']" name="type">guint8*</attr>
+       <attr path="/api/namespace/struct[@cname='GstVideoResampler']/field[@cname='phase']" name="type">guint32*</attr>
+       <attr path="/api/namespace/struct[@cname='GstVideoResampler']/field[@cname='n_taps']" name="type">guint32*</attr>
+       <attr path="/api/namespace/struct[@cname='GstVideoResampler']/field[@cname='taps']" name="type">gdouble*</attr>
+
        <!-- No way to correctly generate these without the element type -->
        <attr path="//boxed[@cname='GstMpegtsDescriptor']//method[parameters/parameter[@type='GArray***']]" name="hidden">true</attr>
 
+       <!-- Hide because it is basically an alias to NetClock -->
+       <attr path="/api/namespace/object[@cname='GstNtpClock']" name="hidden">true</attr>
+
        <!-- Fixed in 1.4.1 -->
        <attr path="//callback[@cname='GstPadEventFunction']/parameters/parameter[@name='event']" name="owned">true</attr>
        <attr path="//callback[@cname='GstPadChainListFunction']/parameters/parameter[@name='list']" name="owned">true</attr>
        <attr path="//callback[@cname='GstPadChainFunction']/parameters/parameter[@name='buffer']" name="owned">true</attr>
 
        <!-- Mark reserved fields as padding -->
-       <attr path="/api/namespace/struct/field[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
-       <attr path="/api/namespace/struct/field[contains(@cname, 'gst_reserved2')]" name="is-padding">true</attr>
-       <attr path="/api/namespace/boxed/field[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
-       <attr path="/api/namespace/boxed/field[contains(@cname, 'gst_reserved_p')]" name="is-padding">true</attr>
-       <attr path="/api/namespace/boxed/field[contains(@cname, 'gst_reserved_i')]" name="is-padding">true</attr>
-       <attr path="/api/namespace/object/field[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved2')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved_p')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved_i')]" name="is-padding">true</attr>
+       <attr path="//*[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr>
 </metadata>
index 748d9d55e160bda5aa0b3ff8fc9b69843e38fb04..2cea50447a15f404fe391396d4dadfbbc8bd9ee4 100644 (file)
@@ -1,8 +1,7 @@
 raw_api_fname = join_paths(meson.current_source_dir(), meson.project_name() + '-api.raw')
-metadata_fname = join_paths(meson.current_source_dir(), meson.project_name() + '.metadata')
+metadata = files(meson.project_name() + '.metadata')
 
-glueincludes = 'gst/gst.h,gst/app/app.h,gst/audio/audio.h,gst/base/base.h,gst/controller/controller.h,gst/fft/fft.h,gst/net/net.h,gst/pbutils/gstaudiovisualizer.h,gst/pbutils/pbutils.h,gst/rtp/rtp.h,gst/rtsp/rtsp.h,gst/sdp/sdp.h,gst/tag/tag.h,gst/video/video.h'
-gluefile = join_paths(meson.current_build_dir(), 'generate.c')
+glueincludes = 'glib.h,gst/gst.h,gst/video/video.h,gst/audio/audio.h,gst/rtsp/rtsp.h,gst/app/app.h,gst/audio/audio.h,gst/base/base.h,gst/controller/controller.h,gst/fft/fft.h,gst/net/net.h,gst/pbutils/gstaudiovisualizer.h,gst/pbutils/pbutils.h,gst/rtp/rtp.h,gst/rtsp/rtsp.h,gst/sdp/sdp.h,gst/tag/tag.h,gst/video/video.h,gst/video/gstvideoaffinetransformationmeta.h,gst/net/gstnetcontrolmessagemeta.h'
 
 sources = [
     'custom/Adapter.cs',
@@ -42,6 +41,18 @@ gst_sharp = library('gstreamer-sharp', gst_source_gen, sources,
 gst_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep],
         link_with: gst_sharp)
 
+if add_languages('c', required: false)
+    c_abi_exe = executable('gst_sharp_c_abi', c_abi,
+            cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-unsafe'],
+            dependencies: [gst_deps])
+
+    cs_abi_exe = executable('gst_sharp_cs_abi', cs_abi,
+            cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-unsafe'],
+            dependencies: [gst_sharp_dep])
+
+    test('gstreamer_sharp_abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()])
+endif
+
 configure_file(
     input: '../out/gstreamer-sharp.dll.config',
     output: 'gstreamer-sharp.dll.config',