port more examples over to new generated bindings

plugins not yet working, examples mostly untested
This commit is contained in:
RSWilli
2025-09-16 22:36:07 +02:00
parent 9fb9393213
commit 846581a077
37 changed files with 364 additions and 3196 deletions

View File

@@ -5,32 +5,33 @@ import (
"fmt"
"os"
"os/signal"
"time"
"github.com/go-gst/go-gst/examples/plugins/basetransform/internal/customtransform"
"github.com/go-gst/go-gst/gst"
"github.com/go-gst/go-gst/pkg/gst"
)
func run(ctx context.Context) error {
ctx, cancel := signal.NotifyContext(ctx, os.Interrupt)
defer cancel()
gst.Init(nil)
gst.Init()
customtransform.Register()
pipeline, err := gst.NewPipelineFromString("audiotestsrc ! gocustomtransform ! fakesink")
ret, err := gst.ParseLaunch("audiotestsrc ! gocustomtransform ! fakesink")
if err != nil {
return err
}
pipeline := ret.(*gst.Pipeline)
pipeline.SetState(gst.StatePlaying)
<-ctx.Done()
pipeline.BlockSetState(gst.StateNull)
gst.Deinit()
pipeline.BlockSetState(gst.StateNull, gst.ClockTime(time.Second))
return ctx.Err()
}