add postprocessor to fix missing pkg config and header include

This commit is contained in:
RSWilli
2025-09-16 22:36:07 +02:00
parent 7aef6683b3
commit f7035314d8
3 changed files with 15 additions and 1 deletions

View File

@@ -122,7 +122,7 @@ var Data = genmain.Overlay(
Postprocessors: map[string][]girgen.Postprocessor{
"Gst-1": {ElementFactoryMakeWithProperties},
"GstMpegts-1": {GstUseUnstableAPI},
"GstWebRTC-1": {GstUseUnstableAPI},
"GstWebRTC-1": {GstUseUnstableAPI, FixWebrtcPkgConfig},
},
Filters: []types.FilterMatcher{
// these collide and are not really useful:
@@ -238,6 +238,18 @@ func GstUseUnstableAPI(nsgen *girgen.NamespaceGenerator) error {
return nil
}
func FixWebrtcPkgConfig(nsgen *girgen.NamespaceGenerator) error {
for _, f := range nsgen.Files {
// see: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8433, remove after release
f.Header().AddPackage("gstreamer-sdp-1.0")
// see https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8470 , remove after release
f.Header().IncludeC("gst/webrtc/sctptransport.h")
}
return nil
}
func ElementFactoryMakeWithProperties(nsgen *girgen.NamespaceGenerator) error {
fg := nsgen.MakeFile("elementfactory.go")
fg.Header().NeedsExternGLib()

View File

@@ -22,6 +22,7 @@ import (
// #define GST_USE_UNSTABLE_API // APIs in this package are unstable
// #include <stdlib.h>
// #include <glib-object.h>
// #include <gst/webrtc/sctptransport.h>
// #include <gst/webrtc/webrtc.h>
// extern void callbackDelete(gpointer);
// extern void _gotk4_gstwebrtc1_WebRTCICETransport_ConnectOnSelectedCandidatePairChange(gpointer, guintptr);

View File

@@ -16,6 +16,7 @@ import (
// #define GST_USE_UNSTABLE_API // APIs in this package are unstable
// #include <stdlib.h>
// #include <gst/webrtc/sctptransport.h>
// #include <gst/webrtc/webrtc.h>
import "C"