examples compiling again

This commit is contained in:
RSWilli
2025-09-16 22:36:07 +02:00
parent ca3249e47b
commit e1b00764a8
55 changed files with 7642 additions and 1654 deletions

View File

@@ -1,51 +1,46 @@
package customtransform
import (
"github.com/diamondburned/gotk4/pkg/core/glib"
"github.com/go-gst/go-gst/pkg/gst"
"github.com/go-gst/go-gst/pkg/gstbase"
)
// Register needs to be called after gst.Init() to make the gocustombin available in the standard
// gst element registry. After this call the element can be used like any other gstreamer element
func Register() bool {
registered := glib.RegisterSubclassWithConstructor[*customBaseTransform](
func() *customBaseTransform {
return &customBaseTransform{}
},
glib.WithOverrides[*customBaseTransform, gstbase.BaseTransformOverrides](func(b *customBaseTransform) gstbase.BaseTransformOverrides {
return gstbase.BaseTransformOverrides{}
}),
glib.WithClassInit[*gstbase.BaseTransformClass](func(class *gstbase.BaseTransformClass) {
class.ParentClass().SetStaticMetadata(
"custom base transform",
"Transform/demo",
"custom base transform",
"Wilhelm Bartel <bartel.wilhelm@gmail.com>",
)
panic("Register is not implemented yet")
// registered := glib.RegisterSubclassWithConstructor[*customBaseTransform](
// func() *customBaseTransform {
// return &customBaseTransform{}
// },
// glib.WithOverrides[*customBaseTransform, gstbase.BaseTransformOverrides](func(b *customBaseTransform) gstbase.BaseTransformOverrides {
// return gstbase.BaseTransformOverrides{}
// }),
// glib.WithClassInit[*gstbase.BaseTransformClass](func(class *gstbase.BaseTransformClass) {
// class.ParentClass().SetStaticMetadata(
// "custom base transform",
// "Transform/demo",
// "custom base transform",
// "Wilhelm Bartel <bartel.wilhelm@gmail.com>",
// )
class.ParentClass().AddPadTemplate(gst.NewPadTemplate(
"src",
gst.PadSrc,
gst.PadAlways,
gst.CapsFromString("audio/x-raw,channels=2,rate=48000"),
))
class.ParentClass().AddPadTemplate(gst.NewPadTemplate(
"sink",
gst.PadSink,
gst.PadAlways,
gst.CapsFromString("audio/x-raw,channels=2,rate=48000"),
))
}),
)
// class.ParentClass().AddPadTemplate(gst.NewPadTemplate(
// "src",
// gst.PadSrc,
// gst.PadAlways,
// gst.CapsFromString("audio/x-raw,channels=2,rate=48000"),
// ))
// class.ParentClass().AddPadTemplate(gst.NewPadTemplate(
// "sink",
// gst.PadSink,
// gst.PadAlways,
// gst.CapsFromString("audio/x-raw,channels=2,rate=48000"),
// ))
// }),
// )
return gst.ElementRegister(
// no plugin:
nil,
// The name of the element
"gocustomtransform",
// The rank of the element
uint(gst.RankNone),
registered.Type(),
)
// return gst.ElementRegister(
// // no plugin:
// nil,
// // The name of the element
// "gocustomtransform",
// // The rank of the element
// uint(gst.RankNone),
// registered.Type(),
// )
}

View File

@@ -25,7 +25,7 @@ func run(ctx context.Context) error {
return err
}
pipeline := ret.(*gst.Pipeline)
pipeline := ret.(gst.Pipeline)
pipeline.SetState(gst.StatePlaying)