-
Notifications
You must be signed in to change notification settings - Fork 259
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
[WIP] init Add support for Config::validate #1718
base: master
Are you sure you want to change the base?
Conversation
Added support for Config::validate in capi
Apologies, as the biggest C API user, and part designer... I had not seen #1659 yet. I disagree with the entire premise of the issue - and I will reproduce this there as a well, but: There's absolutely no reason, as far as I can tell, that Again apologies, this is not you're doing, and we (and I!) appreciate the submission! I can, however, answer some of your questions still!
Again, thanks for the contribution! I think we still need some changes, just not a new API - that is, calling the valiation function from within the setter C API call... |
Ok cool, I guess then we can just close this PR? or do you have some way you want me to take and update it? @dwbuiten |
@Klaven It can probably be reworked to call |
I'll get something pushed out and see if its more on the lines of what you where thinking and maybe you could then give me a few more pointers on what I could do to make it solid! thanks for the input! |
@dwbuiten I updated it with a few calls. Let me know what you think. I'm not sure if I should have extended out the Invalid Config enum like that... but I did so that I could set a useful "last_err" on all the set calls. If this is not wanted, I will change it however you would like! please just let me know if this is in the right direction or not! |
Sorry for the slow response. I don't really have an opinion on extending the config error enum - maybe @tdaede or @lu-zero have opinions. Two notes:
Other than that, it's getting there! |
@dwbuiten I plan on squashing no problem. I understand that. most of the time I leave the commits when changes are asked so the reviewer gets to she what changed after they requested a change. I take this to mean you are ready for a squash and will do that tonight. |
Added support for Config::validate in capi issue: #1659
I have a few questions as I was making this, figured I would make a PR and ask them :)
where should this functions that I made get called :) I made them figured they should be used.
fn rav1e_config_validate(&mut self) -> bool
feels like it should befn rav1e_config_validate(&self) -> Result<(), InvalidConfig>
This would then require whatever callsrav1e_config_validate
to setlast_err
per the issue Add support for Config::validate() in the CAPI #1659 Remove the early validation in the setter and update the documentation accordingly. What setter are you talking about? and what documentation? I looked at the files in
/doc
but was not sure any fit the bill for the capi.I made these
impl
but could have just as easily made them functions. what is your preference?Other then that, how does this look as a start? I have never really done unsafe rust, and need to work on a setup to test out what I have done. but it seems to build at this point :) As I don't know quite where the methods are to be called from i'm not sure what their scope should be.