Mercurial > mplayer.hg
comparison libvo/vo_directx.c @ 22459:d870e862d272
Simplify config by using code available in video_out.c
author | reimar |
---|---|
date | Tue, 06 Mar 2007 11:34:06 +0000 |
parents | 780caed72ac7 |
children | 98eaf29b5dee |
comparison
equal
deleted
inserted
replaced
22458:2c1ecca1886c | 22459:d870e862d272 |
---|---|
1269 | 1269 |
1270 static int | 1270 static int |
1271 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t options, char *title, uint32_t format) | 1271 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t options, char *title, uint32_t format) |
1272 { | 1272 { |
1273 RECT rd; | 1273 RECT rd; |
1274 vo_screenwidth = monitor_rect.right - monitor_rect.left; | |
1275 vo_screenheight = monitor_rect.bottom - monitor_rect.top; | |
1276 vo_fs = options & 0x01; | 1274 vo_fs = options & 0x01; |
1277 image_format = format; | 1275 image_format = format; |
1278 image_width = width; | 1276 image_width = width; |
1279 image_height = height; | 1277 image_height = height; |
1280 d_image_width = d_width; | 1278 d_image_width = d_width; |
1281 d_image_height = d_height; | 1279 d_image_height = d_height; |
1282 if(format != primary_image_format)nooverlay = 0; | 1280 if(format != primary_image_format)nooverlay = 0; |
1283 aspect_save_orig(image_width,image_height); | |
1284 aspect_save_prescale(d_image_width,d_image_height); | |
1285 if(vidmode){ | |
1286 vo_screenwidth=vm_width; | |
1287 vo_screenheight=vm_height; | |
1288 } | |
1289 aspect_save_screenres(vo_screenwidth,vo_screenheight); | |
1290 aspect(&d_image_width, &d_image_height, A_NOZOOM); | |
1291 window_aspect= (float)d_image_width / (float)d_image_height; | 1281 window_aspect= (float)d_image_width / (float)d_image_height; |
1292 vo_dx = 0; | |
1293 vo_dy = 0; | |
1294 | 1282 |
1295 #ifdef HAVE_NEW_GUI | 1283 #ifdef HAVE_NEW_GUI |
1296 if(use_gui){ | 1284 if(use_gui){ |
1297 vo_dwidth = d_image_width; | |
1298 vo_dheight = d_image_height; | |
1299 guiGetEvent(guiSetShVideo, 0); | 1285 guiGetEvent(guiSetShVideo, 0); |
1300 } | 1286 } |
1301 #endif | 1287 #endif |
1302 /*release all directx objects*/ | 1288 /*release all directx objects*/ |
1303 if (g_cc != NULL)g_cc->lpVtbl->Release(g_cc); | 1289 if (g_cc != NULL)g_cc->lpVtbl->Release(g_cc); |
1312 if (g_lpddsPrimary != NULL) g_lpddsPrimary->lpVtbl->Release(g_lpddsPrimary); | 1298 if (g_lpddsPrimary != NULL) g_lpddsPrimary->lpVtbl->Release(g_lpddsPrimary); |
1313 g_lpddsPrimary = NULL; | 1299 g_lpddsPrimary = NULL; |
1314 mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>overlay surfaces released\n"); | 1300 mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>overlay surfaces released\n"); |
1315 | 1301 |
1316 if(!vidmode){ | 1302 if(!vidmode){ |
1317 if(vo_geometry){ | 1303 if(!vo_geometry){ |
1318 vo_dx= ( vo_screenwidth - d_image_width ) / 2; vo_dy=( vo_screenheight - d_image_height ) / 2; | |
1319 geometry(&vo_dx, &vo_dy, &d_image_width, &d_image_height, vo_screenwidth, vo_screenheight); | |
1320 } | |
1321 else { | |
1322 GetWindowRect(hWnd,&rd); | 1304 GetWindowRect(hWnd,&rd); |
1323 vo_dx=rd.left; | 1305 vo_dx=rd.left; |
1324 vo_dy=rd.top; | 1306 vo_dy=rd.top; |
1325 } | 1307 } |
1326 vo_dx += monitor_rect.left; /* move position to global window space */ | 1308 vo_dx += monitor_rect.left; /* move position to global window space */ |
1582 va_start(ap, data); | 1564 va_start(ap, data); |
1583 value = va_arg(ap, int*); | 1565 value = va_arg(ap, int*); |
1584 va_end(ap); | 1566 va_end(ap); |
1585 return color_ctrl_get(data, value); | 1567 return color_ctrl_get(data, value); |
1586 } | 1568 } |
1569 case VOCTRL_UPDATE_SCREENINFO: | |
1570 if (vidmode) { | |
1571 vo_screenwidth = vm_width; | |
1572 vo_screenheight = vm_height; | |
1573 } else { | |
1574 vo_screenwidth = monitor_rect.right - monitor_rect.left; | |
1575 vo_screenheight = monitor_rect.bottom - monitor_rect.top; | |
1576 } | |
1577 aspect_save_screenres(vo_screenwidth, vo_screenheight); | |
1578 return VO_TRUE; | |
1587 case VOCTRL_RESET: | 1579 case VOCTRL_RESET: |
1588 last_rect.left = 0xDEADC0DE; // reset window position cache | 1580 last_rect.left = 0xDEADC0DE; // reset window position cache |
1589 // fall-through intended | 1581 // fall-through intended |
1590 }; | 1582 }; |
1591 return VO_NOTIMPL; | 1583 return VO_NOTIMPL; |