mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-06 00:17:00 +08:00
cleanup
This commit is contained in:
@@ -93,8 +93,6 @@ func encodeGif(mainLoop *gst.MainLoop) error {
|
|||||||
appSink, _ := app.NewAppSink()
|
appSink, _ := app.NewAppSink()
|
||||||
pipeline.Add(appSink.Element)
|
pipeline.Add(appSink.Element)
|
||||||
jpegenc.Link(appSink.Element)
|
jpegenc.Link(appSink.Element)
|
||||||
appSink.SyncStateWithParent()
|
|
||||||
|
|
||||||
appSink.SetWaitOnEOS(false)
|
appSink.SetWaitOnEOS(false)
|
||||||
|
|
||||||
// We can query the decodebin for the duration of the video it received. We can then
|
// We can query the decodebin for the duration of the video it received. We can then
|
||||||
@@ -130,8 +128,9 @@ func encodeGif(mainLoop *gst.MainLoop) error {
|
|||||||
if err := gif.EncodeAll(file, outGif); err != nil {
|
if err := gif.EncodeAll(file, outGif); err != nil {
|
||||||
fmt.Println("Could not encode images to gif format!", err)
|
fmt.Println("Could not encode images to gif format!", err)
|
||||||
}
|
}
|
||||||
// Signal the pipeline that we've completed EOS
|
// Signal the pipeline that we've completed EOS.
|
||||||
// pipeline.GetPipelineBus().Post(gst.NewEOSMessage(appSink))
|
// (this should not be required, need to investigate)
|
||||||
|
pipeline.GetPipelineBus().Post(gst.NewEOSMessage(appSink))
|
||||||
},
|
},
|
||||||
NewSampleFunc: func(sink *app.Sink) gst.FlowReturn {
|
NewSampleFunc: func(sink *app.Sink) gst.FlowReturn {
|
||||||
// Increment the frame number counter
|
// Increment the frame number counter
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user