mirror of
https://github.com/go-gst/go-gst.git
synced 2025-09-27 04:15:56 +08:00
add postprocessor to fix missing pkg config and header include
This commit is contained in:
14
generator.go
14
generator.go
@@ -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()
|
||||
|
@@ -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);
|
||||
|
@@ -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"
|
||||
|
||||
|
Reference in New Issue
Block a user