mpv icon indicating copy to clipboard operation
mpv copied to clipboard

vo_gpu{,_next}: convert scale options to type choice

Open guidocella opened this issue 1 year ago • 10 comments

This allows Tab completing them in the console and zsh, and using cycle scale.

jinc is also added to --tscale=help's output, while before it was missing because validate_scaler_opt() skipped filter windows with the same name as a filter kernel, but the jinc kernel was skipped with --tscale because it is polar.

guidocella avatar May 24 '24 13:05 guidocella

Since we require libplacebo anyway, maybe it is good time to unify filter definitions, instead of adding another layer of paint on top of it.

libplacebo exports things like pl_scale_filters and all filters as structures. Sure, this would be breaking changes for some inconsistencies between vo_gpu, but the long-term plan is to replace it anyway, so we might do it bit by bit.

kasper93 avatar May 24 '24 15:05 kasper93

Since we require libplacebo anyway, maybe it is good time to unify filter definitions, instead of adding another layer of paint on top of it.

libplacebo exports things like pl_scale_filters and all filters as structures. Sure, this would be breaking changes for some inconsistencies between vo_gpu, but the long-term plan is to replace it anyway, so we might do it bit by bit.

Doesn't vo gpu still needs its filter functions and parameters in video/out/filter_kernels.c?

guidocella avatar May 24 '24 15:05 guidocella

Doesn't vo gpu still needs its filter functions and parameters in video/out/filter_kernels.c?

You can get all that from pl_filter_config

kasper93 avatar May 24 '24 16:05 kasper93

Since we require libplacebo anyway, maybe it is good time to unify filter definitions, instead of adding another layer of paint on top of it.

Can this be done in a separate PR instead? There is no need to expand the scope of this. It's mostly semantic changes and some code simplification.

na-na-hi avatar May 24 '24 16:05 na-na-hi

Can this be done in a separate PR instead? There is no need to expand the scope of this. It's mostly semantic changes and some code simplification.

What is the scope of this PR though? All I see is another enum with filters and mapping tables. All this is far from simplification. Simplification would be to remove all this code from mpv. Like I said it is painting over something that should just be replaced.

kasper93 avatar May 24 '24 17:05 kasper93

What is the scope of this PR though?

See commit message.

All I see is another enum with filters and mapping tables. All this is far from simplification.

Removing several special NULL handling and the validate functions and replace them with static mapping tables decreases code complexity. It's more uniform and less error prone.

Simplification would be to remove all this code from mpv. Like I said it is painting over something that should just be replaced.

If @guidocella doesn't want to do this in this PR and you don't want to merge this PR at the current state, then please open another PR which removes the code, instead of stalling valid UX improvements. Once that is resolved we can go back to this one.

na-na-hi avatar May 24 '24 19:05 na-na-hi

This PR is just meant to provide Tab completion. I'm not sure it would be worth it to update all of vo gpu's code to use pl_filter_config when the plan is to remove it later.

guidocella avatar May 24 '24 19:05 guidocella

If @guidocella doesn't want to do this in this PR and you don't want to merge this PR at the current state, then please open another PR which removes the code, instead of stalling valid UX improvements.

I'm sorry, but who are you to tell me what should I do? Also, I'm the last person who is stalling anything here.

kasper93 avatar May 24 '24 19:05 kasper93

So is this PR ready to merge or not? If not, someone needs to do something about it. Maybe I was wrong to assume that no one other than you is interested to do that, but if you aren't and no one else is, then this PR has no future and it's better to be closed.

na-na-hi avatar May 24 '24 21:05 na-na-hi