Changeset 2e29fe8778b750b0e0c7047c72042c23ac5547ca
- Timestamp:
- 02/03/04 14:00:27 (5 years ago)
- git-parent:
- Files:
-
- AUTHORS (modified) (2 diffs)
- modules/gui/macosx/vout.h (modified) (3 diffs)
- modules/gui/macosx/vout.m (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
AUTHORS
r051ce62 r2e29fe8 1 # $Id: AUTHORS,v 1.10 1 2004/01/05 12:37:52 jljExp $1 # $Id: AUTHORS,v 1.102 2004/02/03 13:00:27 titer Exp $ 2 2 # 3 3 # The format of this file was inspired by the Linux kernel CREDITS file. … … 255 255 D: BeOS module fixes and enhancements 256 256 D: Stream output 257 D: Mac OS X OpenGL video output 257 258 S: France 258 259 modules/gui/macosx/vout.h
r90a7231 r2e29fe8 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001-2003 VideoLAN 5 * $Id: vout.h,v 1.2 1 2004/02/02 08:50:41titer Exp $5 * $Id: vout.h,v 1.22 2004/02/03 13:00:27 titer Exp $ 6 6 * 7 7 * Authors: Colin Delacroix <colin@zoy.org> 8 8 * Florian G. Pflug <fgp@phlo.org> 9 9 * Jon Lech Johansen <jon-vl@nanocrew.net> 10 * Eric Petit <titer@m0k.org> 10 11 * 11 12 * This program is free software; you can redistribute it and/or modify … … 61 62 vout_thread_t * p_vout; 62 63 int b_init_done; 63 unsigned long i_ cur_texture;64 unsigned long i_texture; 64 65 float f_x; 65 66 float f_y; … … 68 69 - (id) initWithFrame: (NSRect) frame vout: (vout_thread_t*) p_vout; 69 70 - (void) initTextures; 70 - (void) reloadTexture : (picture_t *) p_pic;71 - (void) reloadTexture; 71 72 72 73 @end modules/gui/macosx/vout.m
r90a7231 r2e29fe8 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001-2003 VideoLAN 5 * $Id: vout.m,v 1.7 6 2004/02/02 08:50:41titer Exp $5 * $Id: vout.m,v 1.77 2004/02/03 13:00:27 titer Exp $ 6 6 * 7 7 * Authors: Colin Delacroix <colin@zoy.org> … … 9 9 * Jon Lech Johansen <jon-vl@nanocrew.net> 10 10 * Derk-Jan Hartman <thedj@users.sourceforge.net> 11 * Eric Petit <titer@m0k.org> 11 12 * 12 13 * This program is free software; you can redistribute it and/or modify … … 292 293 293 294 /* Try to initialize up to QT_MAX_DIRECTBUFFERS direct buffers */ 294 while( I_OUTPUTPICTURES < QT_MAX_DIRECTBUFFERS ) 295 while( I_OUTPUTPICTURES < 296 p_vout->p_sys->i_opengl ? 1 : QT_MAX_DIRECTBUFFERS ) 295 297 { 296 298 p_pic = NULL; … … 479 481 if( [p_vout->p_sys->o_glview lockFocusIfCanDraw] ) 480 482 { 481 [p_vout->p_sys->o_glview reloadTexture: p_pic]; 483 /* Texture gotta be reload before the buffer is filled 484 (thanks to gcc from arstechnica forums) */ 482 485 [p_vout->p_sys->o_glview drawRect: 483 486 [p_vout->p_sys->o_glview bounds]]; 487 [p_vout->p_sys->o_glview reloadTexture]; 484 488 [p_vout->p_sys->o_glview unlockFocus]; 485 489 } … … 1331 1335 - (void) initTextures 1332 1336 { 1333 int i;1334 GLuint pi_textures[QT_MAX_DIRECTBUFFERS];1335 1336 1337 [[self openGLContext] makeCurrentContext]; 1337 1338 1338 1339 /* Create textures */ 1339 glGenTextures( QT_MAX_DIRECTBUFFERS, pi_textures ); 1340 1341 for( i = 0; i < I_OUTPUTPICTURES; i++ ) 1342 { 1343 glEnable( GL_TEXTURE_RECTANGLE_EXT ); 1344 glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE ); 1345 glEnable( GL_APPLE_texture_range ); 1346 1347 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, pi_textures[i] ); 1348 1349 #if 0 1350 FIXME: the lines below are supposed to avoid a memcpy and get 1351 a noticeable performance boost, but they are annoying side 1352 effects at the moment -- titer 1353 1354 /* Use AGP texturing */ 1355 glTextureRangeAPPLE( GL_TEXTURE_RECTANGLE_EXT, 0, NULL ); 1356 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1357 GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_SHARED_APPLE ); 1358 #endif 1359 1360 /* Tell the driver not to make a copy of the texture but to use 1361 our buffer */ 1362 glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE ); 1363 1364 /* Linear interpolation */ 1365 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1366 GL_TEXTURE_MIN_FILTER, GL_LINEAR ); 1367 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1368 GL_TEXTURE_MAG_FILTER, GL_LINEAR ); 1369 1370 /* I have no idea what this exactly does, but it seems to be 1371 necessary for scaling */ 1372 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1373 GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE ); 1374 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1375 GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 1376 glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); 1377 1378 glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, 1379 p_vout->output.i_width, p_vout->output.i_height, 0, 1380 GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 1381 PP_OUTPUTPICTURE[i]->p_data ); 1382 1383 PP_OUTPUTPICTURE[i]->p_sys = malloc( sizeof( GLuint ) ); 1384 *((GLuint*) PP_OUTPUTPICTURE[i]->p_sys) = pi_textures[i]; 1385 } 1340 glGenTextures( 1, &i_texture ); 1341 1342 glEnable( GL_TEXTURE_RECTANGLE_EXT ); 1343 glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE ); 1344 1345 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_texture ); 1346 1347 /* Use VRAM texturing */ 1348 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1349 GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_CACHED_APPLE ); 1350 1351 /* Tell the driver not to make a copy of the texture but to use 1352 our buffer */ 1353 glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE ); 1354 1355 /* Linear interpolation */ 1356 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1357 GL_TEXTURE_MIN_FILTER, GL_LINEAR ); 1358 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1359 GL_TEXTURE_MAG_FILTER, GL_LINEAR ); 1360 1361 /* I have no idea what this exactly does, but it seems to be 1362 necessary for scaling */ 1363 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1364 GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); 1365 glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, 1366 GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 1367 glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); 1368 1369 glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, 1370 p_vout->output.i_width, p_vout->output.i_height, 0, 1371 GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 1372 PP_OUTPUTPICTURE[0]->p_data ); 1386 1373 1387 1374 b_init_done = 1; 1388 1375 } 1389 1376 1390 - (void) reloadTexture: (picture_t *) p_pic 1391 { 1392 i_cur_texture = *((GLuint*) p_pic->p_sys); 1393 1377 - (void) reloadTexture 1378 { 1394 1379 [[self openGLContext] makeCurrentContext]; 1395 1380 1396 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_ cur_texture );1381 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_texture ); 1397 1382 1398 1383 /* glTexSubImage2D is faster than glTexImage2D … … 1402 1387 p_vout->output.i_width, p_vout->output.i_height, 1403 1388 GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 1404 p_pic->p_data );1389 PP_OUTPUTPICTURE[0]->p_data ); 1405 1390 } 1406 1391 … … 1426 1411 1427 1412 /* Draw a quad with our texture on it */ 1428 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_ cur_texture );1413 glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_texture ); 1429 1414 glBegin( GL_QUADS ); 1430 1415 /* Top left */
