-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add extradata methods also to cc #59
Conversation
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.
I'd rather create an extra_data.go
file (no test file needed) with
func getExtraData(d *C.uint8_t, size C.size_t) []byte {
// Content of current CodecParameters.ExtraData()
}
func setExtraData(b []byte, d **C.uint8_t, size *C.size_t) error {
// Content of current CodecParameters.SetExtraData()
}
and use these 2 new functions in both CodecContext
and CodecParameters
🤔
they share many similar fields like framerate, pixfmt etc.., then u have extra file just for these two things i dont know whats better. |
I think creating global unexported functions that take pointers to C fields like I suggest would be best: func getExtraData(d *C.uint8_t, size C.size_t) []byte {
// Content of current CodecParameters.ExtraData()
}
func setExtraData(b []byte, d **C.uint8_t, size *C.size_t) error {
// Content of current CodecParameters.SetExtraData()
} No need to create structs or anything else, just helper functions that unify the logic to retrieve and set the extradata. We may use them for other structs in the future. For instance the content of return bytesFromC(func(size *C.size_t) *C.uint8_t {
*size = C.size_t(size)
return d
}) |
@Cacsjep do you feel like implementing the requested changes? If not, that's ok, I'll have some time to implement them in the coming days 👍 |
Oh, I'm sorry, I completely forgot, I don't have time at the moment. It would be cool if you make it, if not I can do it next month or so =) |
No worries, fyi I've merged in |
No description provided.