Mercurial > mplayer.hg
comparison libvo/vo_gl.c @ 29524:b1a437cdc60d
Add infrastructure and test code to enable aspect scaling and panscan in windowed mode.
author | reimar |
---|---|
date | Thu, 27 Aug 2009 18:36:51 +0000 |
parents | f17b515cb326 |
children | eb2567b65311 |
comparison
equal
deleted
inserted
replaced
29523:00f8d4ca123f | 29524:b1a437cdc60d |
---|---|
161 glViewport( 0, 0, x, y ); | 161 glViewport( 0, 0, x, y ); |
162 | 162 |
163 glMatrixMode(GL_PROJECTION); | 163 glMatrixMode(GL_PROJECTION); |
164 glLoadIdentity(); | 164 glLoadIdentity(); |
165 ass_border_x = ass_border_y = 0; | 165 ass_border_x = ass_border_y = 0; |
166 if (vo_fs && use_aspect) { | 166 if (aspect_scaling() && use_aspect) { |
167 int new_w, new_h; | 167 int new_w, new_h; |
168 GLdouble scale_x, scale_y; | 168 GLdouble scale_x, scale_y; |
169 aspect(&new_w, &new_h, A_ZOOM); | 169 aspect(&new_w, &new_h, A_WINZOOM); |
170 panscan_calc(); | 170 panscan_calc_windowed(); |
171 new_w += vo_panscan_x; | 171 new_w += vo_panscan_x; |
172 new_h += vo_panscan_y; | 172 new_h += vo_panscan_y; |
173 scale_x = (GLdouble)new_w / (GLdouble)x; | 173 scale_x = (GLdouble)new_w / (GLdouble)x; |
174 scale_y = (GLdouble)new_h / (GLdouble)y; | 174 scale_y = (GLdouble)new_h / (GLdouble)y; |
175 glScaled(scale_x, scale_y, 1); | 175 glScaled(scale_x, scale_y, 1); |
720 | 720 |
721 static void flip_page(void) { | 721 static void flip_page(void) { |
722 if (vo_doublebuffering) { | 722 if (vo_doublebuffering) { |
723 if (use_glFinish) glFinish(); | 723 if (use_glFinish) glFinish(); |
724 swapGlBuffers(); | 724 swapGlBuffers(); |
725 if (vo_fs && use_aspect) | 725 if (aspect_scaling() && use_aspect) |
726 glClear(GL_COLOR_BUFFER_BIT); | 726 glClear(GL_COLOR_BUFFER_BIT); |
727 } else { | 727 } else { |
728 do_render(); | 728 do_render(); |
729 do_render_osd(3); | 729 do_render_osd(3); |
730 if (use_glFinish) glFinish(); | 730 if (use_glFinish) glFinish(); |
1146 { | 1146 { |
1147 mp_eosd_res_t *r = data; | 1147 mp_eosd_res_t *r = data; |
1148 r->w = vo_dwidth; r->h = vo_dheight; | 1148 r->w = vo_dwidth; r->h = vo_dheight; |
1149 r->mt = r->mb = r->ml = r->mr = 0; | 1149 r->mt = r->mb = r->ml = r->mr = 0; |
1150 if (scaled_osd) {r->w = image_width; r->h = image_height;} | 1150 if (scaled_osd) {r->w = image_width; r->h = image_height;} |
1151 else if (vo_fs) { | 1151 else if (aspect_scaling()) { |
1152 r->ml = r->mr = ass_border_x; | 1152 r->ml = r->mr = ass_border_x; |
1153 r->mt = r->mb = ass_border_y; | 1153 r->mt = r->mb = ass_border_y; |
1154 } | 1154 } |
1155 } | 1155 } |
1156 return VO_TRUE; | 1156 return VO_TRUE; |