[vala/staging] gstreamer-audio-1.0: Adjustments for Gst.Audio.Sink class extension



commit 96c9e8ff84b149018ac777272fa3b9e2c238c010
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Jun 9 13:56:25 2020 +0200

    gstreamer-audio-1.0: Adjustments for Gst.Audio.Sink class extension

 vapi/Makefile.am                       | 2 +-
 vapi/gstreamer-audio-1.0.vapi          | 7 +++++++
 vapi/metadata/GstAudio-1.0-custom.vala | 8 ++++++++
 vapi/metadata/GstAudio-1.0.metadata    | 5 +++++
 4 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index f70554d49..3def1647b 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -524,7 +524,7 @@ gstreamer-app-1.0:
        $(GENVAPI) --library $(srcdir)/gstreamer-app-1.0 --pkg gstreamer-base-1.0 --metadatadir 
$(METADATADIR) $(GIRDIR)/GstApp-1.0.gir
 
 gstreamer-audio-1.0:
-       $(GENVAPI) --library $(srcdir)/gstreamer-audio-1.0 --pkg gstreamer-base-1.0 --metadatadir 
$(METADATADIR) $(GIRDIR)/GstAudio-1.0.gir
+       $(GENVAPI) --library $(srcdir)/gstreamer-audio-1.0 --pkg gstreamer-base-1.0 --metadatadir 
$(METADATADIR) $(METADATADIR)/GstAudio-1.0-custom.vala $(GIRDIR)/GstAudio-1.0.gir
 
 gstreamer-bad-allocators-1.0:
        $(GENVAPI) --library $(srcdir)/gstreamer-bad-allocators-1.0 --pkg gstreamer-1.0 --metadatadir 
$(METADATADIR) $(GIRDIR)/GstBadAllocators-1.0.gir
diff --git a/vapi/gstreamer-audio-1.0.vapi b/vapi/gstreamer-audio-1.0.vapi
index 689d6f152..db83a23db 100644
--- a/vapi/gstreamer-audio-1.0.vapi
+++ b/vapi/gstreamer-audio-1.0.vapi
@@ -441,8 +441,10 @@ namespace Gst {
                [CCode (cheader_filename = "gst/audio/audio.h", type_id = "gst_audio_sink_get_type ()")]
                [GIR (name = "AudioSink")]
                public class Sink : Gst.Audio.BaseSink {
+                       public class Gst.Audio.SinkClassExtension? extension;
                        [CCode (has_construct_function = false)]
                        protected Sink ();
+                       [CCode (vfunc_name = "extension->clear_all")]
                        [NoWrapper]
                        public virtual void clear_all ();
                        [NoWrapper]
@@ -596,6 +598,11 @@ namespace Gst {
                        public int segtotal;
                        public int seglatency;
                }
+               [CCode (cheader_filename = "gst/audio/audio.h", has_type_id = false)]
+               [GIR (name = "AudioSinkClassExtension")]
+               public struct SinkClassExtension {
+                       public GLib.Callback clear_all;
+               }
                [CCode (cheader_filename = "gst/audio/audio.h", cprefix = 
"GST_AUDIO_BASE_SINK_DISCONT_REASON_", type_id = "gst_audio_base_sink_discont_reason_get_type ()")]
                [GIR (name = "AudioBaseSinkDiscontReason")]
                [Version (since = "1.6")]
diff --git a/vapi/metadata/GstAudio-1.0-custom.vala b/vapi/metadata/GstAudio-1.0-custom.vala
new file mode 100644
index 000000000..26bbcc046
--- /dev/null
+++ b/vapi/metadata/GstAudio-1.0-custom.vala
@@ -0,0 +1,8 @@
+namespace Gst.Audio {
+       public class Sink : Gst.Audio.BaseSink {
+               public class SinkClassExtension? extension;
+               [CCode (vfunc_name = "extension->clear_all")]
+               [NoWrapper]
+               public virtual void clear_all ();
+       }
+}
diff --git a/vapi/metadata/GstAudio-1.0.metadata b/vapi/metadata/GstAudio-1.0.metadata
index df642711f..5d9aaa171 100644
--- a/vapi/metadata/GstAudio-1.0.metadata
+++ b/vapi/metadata/GstAudio-1.0.metadata
@@ -15,3 +15,8 @@ buffer_add_audio_downmix_meta skip=false
 // No way to annotate virtual methods without invokers
 AudioSink.write.data type="uint8[]" array_length_idx=1
 AudioSrc.read.data type="uint8[]" array_length_idx=1
+
+// Keep track of new function pointers
+// https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/716
+AudioSinkClassExtension
+  .clear_all type="GLib.Callback"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]