Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you provide a hello world please #1

Open
tmaillart opened this issue Mar 21, 2020 · 0 comments
Open

Could you provide a hello world please #1

tmaillart opened this issue Mar 21, 2020 · 0 comments

Comments

@tmaillart
Copy link

Hello,

Thank you for this repo.

I started a simple hello world, but I don't get how you run the main loop.
Here is my faulty code

package main

import "github.com/andre-hub/go-gstreamer"

func main() {
	gst.Init(nil)
	pipeline, _ := gst.PipelineNew("player")
	filesrc, _ := gst.ElementFactoryMake("filesrc", "source-disk")
	decoder, _ := gst.ElementFactoryMake("decodebin", "decoder")
	pulsesink, _ := gst.ElementFactoryMake("pulsesink", "sink-pulse")

	filesrc.Set("location", "./audio.mp3")

	pipeline.Add(filesrc)
	pipeline.Add(decoder)
	pipeline.Add(pulsesink)

	filesrc.Link(decoder)
	decoder.Link(pulsesink)

	pipeline.SetState(gst.STATE_PLAYING)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant