mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avfilter/vf_v360: add partial size setup for flat
Other part of size is calculated from both available horizontal and vertical FOV and given one size component.
This commit is contained in:
parent
3733a6bc20
commit
f707c84b8b
@ -3790,7 +3790,15 @@ static int config_output(AVFilterLink *outlink)
|
||||
}
|
||||
|
||||
// Override resolution with user values if specified
|
||||
if (s->width > 0 && s->height > 0) {
|
||||
if (s->width > 0 && s->height <= 0 && s->h_fov > 0.f && s->v_fov > 0.f &&
|
||||
s->out == FLAT && s->d_fov == 0.f) {
|
||||
w = s->width;
|
||||
h = w / tanf(s->h_fov * M_PI / 360.f) * tanf(s->v_fov * M_PI / 360.f);
|
||||
} else if (s->width <= 0 && s->height > 0 && s->h_fov > 0.f && s->v_fov > 0.f &&
|
||||
s->out == FLAT && s->d_fov == 0.f) {
|
||||
h = s->height;
|
||||
w = h / tanf(s->v_fov * M_PI / 360.f) * tanf(s->h_fov * M_PI / 360.f);
|
||||
} else if (s->width > 0 && s->height > 0) {
|
||||
w = s->width;
|
||||
h = s->height;
|
||||
} else if (s->width > 0 || s->height > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user