From e9ec22b95a8a8d64831ed470e6f9f2a373f95de8 Mon Sep 17 00:00:00 2001 From: RSWilli Date: Tue, 16 Sep 2025 22:36:09 +0200 Subject: [PATCH] fix examples with new casing of EOS and others --- examples/appsink/main.go | 4 ++-- examples/appsrc/main.go | 4 ++-- examples/custom_events/main.go | 2 +- examples/events/main.go | 2 +- examples/gif-encoder/main.go | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/appsink/main.go b/examples/appsink/main.go index a6c618c..02f72d4 100644 --- a/examples/appsink/main.go +++ b/examples/appsink/main.go @@ -37,7 +37,7 @@ func createPipeline() (gst.Pipeline, error) { // Pull the sample that triggered this callback sample := sink.PullSample() if sample == nil { - return gst.FlowEos + return gst.FlowEOS } // Retrieve the buffer from the sample @@ -101,7 +101,7 @@ func runPipeline(pipeline gst.Pipeline) error { signal.Notify(c, os.Interrupt) go func() { <-c - pipeline.SendEvent(gst.NewEventEos()) + pipeline.SendEvent(gst.NewEventEOS()) }() // Loop over messsages from the pipeline diff --git a/examples/appsrc/main.go b/examples/appsrc/main.go index 5cca394..33b7bec 100644 --- a/examples/appsrc/main.go +++ b/examples/appsrc/main.go @@ -37,7 +37,7 @@ func createPipeline() (gst.Pipeline, error) { // by creating a video info with the given format and creating caps from it for the appsrc element. videoInfo := gstvideo.NewVideoInfo() - ok := videoInfo.SetFormat(gstvideo.VideoFormatRGBA, width, height) + ok := videoInfo.SetFormat(gstvideo.VideoFormatRgba, width, height) if !ok { return nil, fmt.Errorf("failed to set video format") @@ -56,7 +56,7 @@ func createPipeline() (gst.Pipeline, error) { var i int // Get all 256 colors in the RGB8P palette. - palette := gstvideo.VideoFormatGetPalette(gstvideo.VideoFormatRGB8P) + palette := gstvideo.VideoFormatGetPalette(gstvideo.VideoFormatRgb8p) // Since our appsrc element operates in pull mode (it asks us to provide data), // we add a handler for the need-data callback and provide new data from there. diff --git a/examples/custom_events/main.go b/examples/custom_events/main.go index 15e851f..579ea4d 100644 --- a/examples/custom_events/main.go +++ b/examples/custom_events/main.go @@ -71,7 +71,7 @@ func createPipeline() (gst.Pipeline, error) { // however displayed this way for demonstration purposes. sink.CallAsync(func(el gst.Element) { fmt.Println("Send EOS is true, sending eos") - if !pipeline.SendEvent(gst.NewEventEos()) { + if !pipeline.SendEvent(gst.NewEventEOS()) { fmt.Println("WARNING: Failed to send EOS to pipeline") } fmt.Println("Sent EOS") diff --git a/examples/events/main.go b/examples/events/main.go index 1ebc34a..8cbbfa7 100644 --- a/examples/events/main.go +++ b/examples/events/main.go @@ -64,7 +64,7 @@ func main() { // Once all sinks are done handling the EOS event (and all buffers that were before the // EOS event in the pipeline already), the pipeline would post an EOS message on the bus, // essentially telling the application that the pipeline is completely drained. - pipeline.SendEvent(gst.NewEventEos()) + pipeline.SendEvent(gst.NewEventEOS()) return } }() diff --git a/examples/gif-encoder/main.go b/examples/gif-encoder/main.go index 50dfb75..90fea23 100644 --- a/examples/gif-encoder/main.go +++ b/examples/gif-encoder/main.go @@ -90,7 +90,7 @@ func encodeGif() error { pipeline.Add(appSink) jpegenc.Link(appSink) appSink.SyncStateWithParent() - appSink.SetWaitOnEos(false) + appSink.SetWaitOnEOS(false) // We can query the decodebin for the duration of the video it received. We can then // use this value to calculate the total number of frames we expect to produce. @@ -111,7 +111,7 @@ func encodeGif() error { // will be a new jpeg image from the pipeline. var frameNum int - appSink.ConnectEos(func(self gstapp.AppSink) { + appSink.ConnectEOS(func(self gstapp.AppSink) { fmt.Println("\nWriting the results of the gif to", outFile) file, err := os.Create(outFile) if err != nil { @@ -136,7 +136,7 @@ func encodeGif() error { // signal the main loop to quit. // This needs to be done from a goroutine to not block the app sink // callback. - return gst.FlowEos + return gst.FlowEOS } // Pull the sample from the sink @@ -164,7 +164,7 @@ func encodeGif() error { } // Create a new paletted image with the same bounds as the pulled one - frame := image.NewPaletted(img.Bounds(), gstvideo.VideoFormatGetPalette(gstvideo.VideoFormatRGB8P)) + frame := image.NewPaletted(img.Bounds(), gstvideo.VideoFormatGetPalette(gstvideo.VideoFormatRgb8p)) // Iterate the bounds of the image and set the pixels in their correct place. for x := 1; x <= img.Bounds().Dx(); x++ {