ffmpeg | branch: master | Paul B Mahol <[email protected]> | Sat Feb 29 20:22:37 
2020 +0100| [f707c84b8b89a937cc388e5ae4b8fcd67e07b75c] | committer: Paul B Mahol

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f707c84b8b89a937cc388e5ae4b8fcd67e07b75c
---

 libavfilter/vf_v360.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 3c73ad32f7..fc799f18c2 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -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) {

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to