mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-16 04:50:42 +08:00
clean up launch example
This commit is contained in:
@@ -15,17 +15,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func runPipeline(mainLoop *glib.MainLoop) error {
|
func runPipeline(mainLoop *glib.MainLoop) error {
|
||||||
gst.Init(&os.Args)
|
|
||||||
fmt.Println(os.Args)
|
|
||||||
if len(os.Args) == 1 {
|
if len(os.Args) == 1 {
|
||||||
return errors.New("Pipeline string cannot be empty")
|
return errors.New("Pipeline string cannot be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a pipeline string from the cli arguments
|
gst.Init(&os.Args)
|
||||||
pipelineString := strings.Join(os.Args[1:], " ")
|
|
||||||
|
|
||||||
/// Let GStreamer create a pipeline from the parsed launch syntax on the cli.
|
// Let GStreamer create a pipeline from the parsed launch syntax on the cli.
|
||||||
pipeline, err := gst.NewPipelineFromString(pipelineString)
|
pipeline, err := gst.NewPipelineFromString(strings.Join(os.Args[1:], " "))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user