gst_init finally works and pops correctly

This commit is contained in:
Avi Zimmerman
2021-01-21 10:01:06 +02:00
parent a4741af5a5
commit 4fd15b6a7a
6 changed files with 50 additions and 28 deletions

View File

@@ -15,8 +15,8 @@ import (
)
func runPipeline(mainLoop *glib.MainLoop) error {
gst.Init(nil)
gst.Init(&os.Args)
fmt.Println(os.Args)
if len(os.Args) == 1 {
return errors.New("Pipeline string cannot be empty")
}
@@ -34,6 +34,7 @@ func runPipeline(mainLoop *glib.MainLoop) error {
pipeline.GetPipelineBus().AddWatch(func(msg *gst.Message) bool {
switch msg.Type() {
case gst.MessageEOS: // When end-of-stream is received stop the main loop
pipeline.BlockSetState(gst.StateNull)
mainLoop.Quit()
case gst.MessageError: // Error messages are always fatal
err := msg.ParseError()