-
Notifications
You must be signed in to change notification settings - Fork 37
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
I get error when try SetPropery "muxer" for the "splitmuxsink" plugin. #30
Comments
Hi, I don’t know |
I'm having a similar issue with setting the package main
import (
"fmt"
"log"
"time"
"github.com/tinyzimmer/go-gst/gst"
)
func main(){
gst.Init(nil)
pipeline, _ := gst.NewPipeline("")
src0, _ := gst.NewElement("videotestsrc")
src1, _ := gst.NewElement("videotestsrc")
inputSelector, _ := gst.NewElement("input-selector")
fakesink, _ := gst.NewElement("fakesink")
pipeline.AddMany(
src0,
src1,
inputSelector,
fakesink,
)
src0.LinkFiltered(inputSelector, gst.NewCapsFromString("video/x-raw, framerate=16/1"))
src1.LinkFiltered(inputSelector, gst.NewCapsFromString("video/x-raw, framerate=16/1"))
inputSelector.Link(fakesink)
pipeline.SetState(gst.StatePlaying)
if inputSelector.GetState() != gst.StatePlaying {
time.Sleep(10*time.Millisecond)
}
// Check the current active pad
prop, _ := inputSelector.GetProperty("active-pad")
fmt.Println("active-pad:", prop.(*gst.Pad).GetName())
// Change the active pad
pad := inputSelector.GetStaticPad("sink_1")
err := inputSelector.SetProperty("active-pad", pad)
if err != nil {
log.Fatalf("Input selector failed to change inputs: %v\n", err)
}
} Output:
Seems like the issues is in go-glib. I've narrowed it down to err := inputSelector.SetProperty("active-pad", pad.GObject()) This, however, opens another can of worms, because in
To fix this I think a simple solution would be to adjust the check in if valType != propType { to if !(valType.IsA(propType) || propType.IsA(valType)) { @tinyzimmer how do you feel about this? |
+1 |
@artofey move this issue to https://github.com/go-gst/go-gst (where future development of the bindings will take place) if you think it is necessary. Alternatively move the linked PR to https://github.com/go-gst/go-glib |
Implement GetStructure on Element messages
Gstreamer's documentation allowed set property "muxer' for elelment "splitmuxsink".
But I got error in this code example:
err: fatal error: checkptr: pointer arithmetic result points to invalid allocation
I have tried other uses as well:
splitMux.Set("muxer", mux.GObject())
splitMux.Set("muxer", *mux)
but I also get errors (but different ones)
Does this library allow me to do what I want? When using the C language, I can do this easily.
The text was updated successfully, but these errors were encountered: