<html><head></head><body><div class="gmail_quote">Le 12 juillet 2017 00:23:30 GMT+08:00, "victorien.lecouviour.tuffet@gmail.com" <git@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">vlc | branch: master | victorien.lecouviour.tuffet@gmail.com <victorien.lecouviour.tuffet@gmail.com> | Fri Jul 7 17:19:30 2017 +0200| [4546bd4d5dac831e99f11b4daace222ce5267473] | committer: Jean-Baptiste Kempf<br /><br />vout: opengl: resize fmt to the max size the HW can handle<br /><br />This fixes the issue #18215 for Linux, MacOS and Windows when using OpenGL<br />vout, as well as the issue #18214.<br /><br />Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org><br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4546bd4d5dac831e99f11b4daace222ce5267473">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4546bd4d5dac831e99f11b4daace222ce5267473</a><br /></blockquote>---<br /><br /> modules/video_output/opengl/vout_helper.c | 38 +++++++++++++++++++++++++++++++<br /> 1 file changed, 38 insertions(+)<br /><br />diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c<br />index 82650b7a85..075b1c2ee8 100644<br />--- a/modules/video_output/opengl/vout_helper.c<br />+++ b/modules/video_output/opengl/vout_helper.c<br />@@ -602,6 +602,35 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm,<br /> return VLC_SUCCESS;<br /> }<br /> <br />+static void<br />+ResizeFormatToGLMaxTexSize(video_format_t *fmt, unsigned int max_tex_size)<br />+{<br />+ if (fmt->i_width > fmt->i_height)<br />+ {<br />+ unsigned int const vis_w = fmt->i_visible_width;<br />+ unsigned int const vis_h = fmt->i_visible_height;<br />+ unsigned int const nw_w = max_tex_size;<br />+ unsigned int const nw_vis_w = nw_w * vis_w / fmt->i_width;<br />+<br />+ fmt->i_height = nw_w * fmt->i_height / fmt->i_width;<br />+ fmt->i_width = nw_w;<br />+ fmt->i_visible_height = nw_vis_w * vis_h / vis_w;<br />+ fmt->i_visible_width = nw_vis_w;<br />+ }<br />+ else<br />+ {<br />+ unsigned int const vis_w = fmt->i_visible_width;<br />+ unsigned int const vis_h = fmt->i_visible_height;<br />+ unsigned int const nw_h = max_tex_size;<br />+ unsigned int const nw_vis_h = nw_h * vis_h / fmt->i_height;<br />+<br />+ fmt->i_width = nw_h * fmt->i_width / fmt->i_height;<br />+ fmt->i_height = nw_h;<br />+ fmt->i_visible_width = nw_vis_h * vis_w / vis_h;<br />+ fmt->i_visible_height = nw_vis_h;<br />+ }<br />+}<br />+<br /> vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,<br /> const vlc_fourcc_t **subpicture_chromas,<br /> vlc_gl_t *gl,<br />@@ -700,6 +729,15 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,<br /> #endif<br /> #undef GET_PROC_ADDR<br /> <br />+ /* Resize the format if it is greater than the maximum texture size<br />+ * supported by the hardware */<br />+ GLint max_tex_size;<br />+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_tex_size);<br />+<br />+ if ((GLint)fmt->i_width > max_tex_size ||<br />+ (GLint)fmt->i_height > max_tex_size)<br />+ ResizeFormatToGLMaxTexSize(fmt, max_tex_size);<br />+<br /> #if defined(USE_OPENGL_ES2)<br /> /* OpenGL ES 2 includes support for non-power of 2 textures by specification<br /> * so checks for extensions are bound to fail. Check for OpenGL ES version instead. */<br /><br /><hr /><br />vlc-commits mailing list<br />vlc-commits@videolan.org<br /><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br /></pre></blockquote></div><br clear="all">The physical dimensions don't seem to make sense here.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>