Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

brucekim
Copy link

@brucekim brucekim commented Jul 29, 2021

@tinyzimmer
Copy link
Owner

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())
Copy link
Author

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)

@brucekim
Copy link
Author

brucekim commented Nov 5, 2021

@tinyzimmer How do you think about this?

@tinyzimmer
Copy link
Owner

Sorry been stacked with other stuff lately, but I'll play around with it tomorrow and see.

@RSWilli
Copy link

RSWilli commented Aug 24, 2023

@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

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

Successfully merging this pull request may close these issues.

3 participants