Add ABI tests and fix related issues

This commit is contained in:
Thibault Saunier 2017-10-04 16:02:53 -03:00
parent e591823df7
commit 288b061843
10 changed files with 134 additions and 37 deletions

28
Tests/test_abi.py Executable file
View file

@ -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)

View file

@ -16,6 +16,7 @@ if __name__ == "__main__":
parser.add_argument("--gapi-codegen") parser.add_argument("--gapi-codegen")
parser.add_argument("--glue-file", default="") parser.add_argument("--glue-file", default="")
parser.add_argument("--glue-includes", default="") parser.add_argument("--glue-includes", default="")
parser.add_argument("--abi-cs-usings", default="")
parser.add_argument("--glue-libname", default="") parser.add_argument("--glue-libname", default="")
parser.add_argument("--assembly-name") parser.add_argument("--assembly-name")
parser.add_argument("--extra-includes", action='append', default=[]) parser.add_argument("--extra-includes", action='append', default=[])
@ -38,7 +39,7 @@ if __name__ == "__main__":
shutil.copyfile(opts.api_raw, api_xml) shutil.copyfile(opts.api_raw, api_xml)
if shutil.which('mono'): if shutil.which('mono'):
launcher = ['mono'] launcher = ['mono', '--debug']
else: else:
launcher = [] launcher = []
@ -56,12 +57,16 @@ if __name__ == "__main__":
'--gluelib-name=' + opts.glue_libname, '--gluelib-name=' + opts.glue_libname,
'--glue-includes=' + opts.glue_includes, '--glue-includes=' + opts.glue_includes,
'--assembly-name=' + opts.assembly_name, '--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: if opts.schema:
cmd += ['--schema=' + 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] cmd += ['-I' + i for i in opts.extra_includes]
subprocess.check_call(launcher + cmd) subprocess.check_call(launcher + cmd)

View file

@ -118,7 +118,7 @@ source_gen = custom_target(pkg + '_codegen',
generate_api, generate_api,
'--api-raw', '@INPUT@', '--api-raw', '@INPUT@',
'--gapi-fixup', gapi_fixup, '--gapi-fixup', gapi_fixup,
'--metadata', metadata_fname, '--metadata', metadata,
'--gapi-codegen', gapi_codegen, '--gapi-codegen', gapi_codegen,
'--extra-includes=' + glib_api_includes, '--extra-includes=' + glib_api_includes,
'--extra-includes=' + gio_api_includes, '--extra-includes=' + gio_api_includes,
@ -126,9 +126,24 @@ source_gen = custom_target(pkg + '_codegen',
'--out', meson.current_build_dir(), '--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources), '--files', ';'.join(generated_sources),
'--assembly-name', pkg, '--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], depend_files: [raw_api_fname],
depends: codegen_dependencies + [gst_source_gen]) 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 += [join_paths(meson.current_build_dir(), pkg + '-api.xml')]
gapis_deps = [source_gen] gapis_deps = [source_gen]

View 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='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='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[@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> </metadata>

View file

@ -1,6 +1,6 @@
pkg = 'gst-editing-services' pkg = 'gst-editing-services'
raw_api_fname = join_paths(meson.current_source_dir(), pkg + '-api.raw') 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') subdir('generated')
@ -9,12 +9,22 @@ ges_sharp = library(pkg + '-sharp', source_gen,
link_with: gst_sharp, link_with: gst_sharp,
dependencies: [glib_sharp_dep, gio_sharp_dep]) dependencies: [glib_sharp_dep, gio_sharp_dep])
ges_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep, gst_sharp_dep, ges_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep, gst_sharp_dep], link_with: ges_sharp)
ges_dep], link_with: ges_sharp)
configure_file( configure_file(
input: pkg + '-sharp.dll.config', input: pkg + '-sharp.dll.config',
output: pkg + '-sharp.dll.config', output: pkg + '-sharp.dll.config',
configuration: configuration_data()) 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

View file

@ -47,6 +47,7 @@ gapi_codegen = gapi_codegen.full_path()
gacutil = find_program('gacutil') gacutil = find_program('gacutil')
generate_api = find_program('generate_code.py') generate_api = find_program('generate_code.py')
nuget = find_program('nuget.py') nuget = find_program('nuget.py')
diff = find_program('Tests/test_abi.py')
# TODO Handle monodoc # TODO Handle monodoc

View 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. // 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) { 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); var source = new Gst.App.AppSrc(((Element)args.Args [0]).Handle);
Console.WriteLine ("Source has been created. Configuring."); Console.WriteLine ("Source has been created. Configuring.");
AppSource = source; AppSource = source;

View file

@ -688,7 +688,6 @@ generated_sources = [
'Gst.Net_PtpClock.cs', 'Gst.Net_PtpClock.cs',
'Gst.Net_Gst.NetSharp.PtpStatisticsCallbackNative.cs', 'Gst.Net_Gst.NetSharp.PtpStatisticsCallbackNative.cs',
'Gst.Net_NetControlMessageMeta.cs', 'Gst.Net_NetControlMessageMeta.cs',
'Gst.Net_NtpClock.cs',
'Gst.Net_NetAddressMeta.cs', 'Gst.Net_NetAddressMeta.cs',
'Gst.Net_NetTimePacket.cs', 'Gst.Net_NetTimePacket.cs',
'Gst.Net_Constants.cs', 'Gst.Net_Constants.cs',
@ -719,17 +718,31 @@ gst_source_gen = custom_target('gst_codegen',
generate_api, generate_api,
'--api-raw', '@INPUT@', '--api-raw', '@INPUT@',
'--gapi-fixup', gapi_fixup, '--gapi-fixup', gapi_fixup,
'--metadata', metadata_fname, '--metadata', metadata,
'--gapi-codegen', gapi_codegen, '--gapi-codegen', gapi_codegen,
'--extra-includes=' + glib_api_includes, '--extra-includes=' + glib_api_includes,
'--extra-includes=' + gio_api_includes, '--extra-includes=' + gio_api_includes,
'--out', meson.current_build_dir(), '--out', meson.current_build_dir(),
'--files', ';'.join(generated_sources), '--files', ';'.join(generated_sources),
'--assembly-name', meson.project_name(), '--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], depend_files: [raw_api_fname],
depends: codegen_dependencies) 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') gst_api_includes = join_paths(meson.current_build_dir(), 'gstreamer-sharp-api.xml')
gapis = [gst_api_includes] gapis = [gst_api_includes]
gapis_deps = [gst_source_gen] gapis_deps = [gst_source_gen]

View 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='GstRTSPMessage']" name="opaque">true</attr>
<attr path="/api/namespace/struct[@cname='GstTypeFind']" 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> <attr path="/api/namespace/boxed[@cname='GstIterator']" name="opaque">true</attr>
<!-- acknowledge that we GstIterator implements the IEnumerator interface --> <!-- acknowledge that we GstIterator implements the IEnumerator interface -->
<add-node path="/api/namespace/boxed[@cname='GstIterator']"> <add-node path="/api/namespace/boxed[@cname='GstIterator']">
@ -87,11 +76,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
</add-node> </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']/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='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 --> <!-- 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_get_property']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GstChildProxy']/method[@cname='gst_child_proxy_set_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 --> <!-- 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_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> <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> </parameters>
</method> </method>
</add-node> </add-node>
<!-- Some glue problems --> <!-- Some glue problems -->
<attr path="/api/namespace/object[@cname='GstObject']/field[@cname='object']" name="hidden">true</attr> <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='func']" name="hidden">true</attr>
<attr path="/api/namespace/struct[@cname='GstClockEntry']/field[@cname='destroy_data']" 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> <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 --> <!-- 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> <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='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/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='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"/> <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="//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> <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/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="/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="//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 --> <!-- Name clashes -->
<attr path="//method[@cname='gst_buffer_foreach_meta']" name="hidden">true</attr> <!-- FIXME This should probably be usable --> <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="//struct[@cname='GstVideoGLTextureUploadMeta']" name="noequals">true</attr>
<attr path="//object[@cname='GstPad']//union" name="hidden">true</attr> <attr path="//object[@cname='GstPad']//union" name="hidden">true</attr>
<attr path="//struct[@cname='GstControlPoint']" 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" name="hidden">true</attr>
<attr path="//boxed[@cname='GstVideoCodecFrame']/union/field[@cname='padding']" name="type">gpointer</attr> <attr path="//boxed[@cname='GstVideoCodecFrame']/union/field[@cname='padding']" name="type">gpointer</attr>
<attr path="//*[@type='const GList*']" name="type">GList*</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='SECOND']" name="ctype">gint64</attr>
<attr path="//constant[@name='MSECOND']" 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="//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="//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> <attr path="//object/field[@cname='parent']" name="hidden">true</attr>
<!-- buffer fixes --> <!-- 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='dest']" name="type">guint8*</attr>
<attr path="//callback[@cname='GstAudioFormatUnpack']/parameters/parameter[@name='length']" name="name">n_length</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='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 --> <!-- No way to correctly generate these without the element type -->
<attr path="//boxed[@cname='GstMpegtsDescriptor']//method[parameters/parameter[@type='GArray***']]" name="hidden">true</attr> <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 --> <!-- Fixed in 1.4.1 -->
<attr path="//callback[@cname='GstPadEventFunction']/parameters/parameter[@name='event']" name="owned">true</attr> <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='GstPadChainListFunction']/parameters/parameter[@name='list']" name="owned">true</attr>
<attr path="//callback[@cname='GstPadChainFunction']/parameters/parameter[@name='buffer']" name="owned">true</attr> <attr path="//callback[@cname='GstPadChainFunction']/parameters/parameter[@name='buffer']" name="owned">true</attr>
<!-- Mark reserved fields as padding --> <!-- Mark reserved fields as padding -->
<attr path="/api/namespace/struct/field[contains(@cname, 'gst_reserved')]" name="is-padding">true</attr> <attr path="//*[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="//*[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="//*[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="//*[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="//*[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>
</metadata> </metadata>

View file

@ -1,8 +1,7 @@
raw_api_fname = join_paths(meson.current_source_dir(), meson.project_name() + '-api.raw') 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' 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'
gluefile = join_paths(meson.current_build_dir(), 'generate.c')
sources = [ sources = [
'custom/Adapter.cs', '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], gst_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep],
link_with: gst_sharp) 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( configure_file(
input: '../out/gstreamer-sharp.dll.config', input: '../out/gstreamer-sharp.dll.config',
output: 'gstreamer-sharp.dll.config', output: 'gstreamer-sharp.dll.config',