-
Notifications
You must be signed in to change notification settings - Fork 18
SetPropertyValue(): Let enum type of property allow interget type of value #3
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
base: main
Are you sure you want to change the base?
Conversation
Interesting idea. I'm a little tied up at the moment but I'll tinker with it when I get a chance. |
@@ -236,7 +236,7 @@ func (v *Object) SetPropertyValue(name string, value *Value) error { | |||
fallthrough | |||
default: | |||
if valType != propType { | |||
return fmt.Errorf("Invalid type %s for property %s", value.TypeName(), name) | |||
return fmt.Errorf("Invalid type %s for property %s(%s)", value.TypeName(), name, propType.Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying type name of property given into error message would be helpful for debugging I think.
appSrc, err = gst.NewElement("appsrc")
err = appSrc.SetProperty("max-bytes", 1048576)
if err != nil {
logger.Errorf("gst appsrc err on set property max-bytes : %+v", err)
}
property description (appsrc, max-bytes)
max-bytes : The maximum number of bytes to queue internally (0 = unlimited)
flags: readable, writable
Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 200000
As is
Invalid type gint for property max-bytes
To be
Invalid type gint for property max-bytes(guint64)
@tinyzimmer How do you think about this? |
Sorry been stacked with other stuff lately, but I'll play around with it tomorrow and see. |
@brucekim please move this PR to https://github.com/go-gst/go-gst (where future development of the bindings will take place). I myself stumbled upon this issue while setting some enum values |
Related issue