Changeset ad407ff30380e98896cefc46882452e28aef10dc
- Timestamp:
- 23/12/07 17:48:15
(1 year ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1198428495 +0000
- git-parent:
[a19eff66700e36ac1d0a16fc04a206d1ee00cb20]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1198428495 +0000
- Message:
modules/video_output/opengllayer.m: Don't free the gl texture in End(), but in the releaseGLContext function. Set the original bounds of the CALayer. Protect the removeFromSuperlayer by a CATransaction.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2f4c4cc |
rad407ff |
|
| 238 | 238 | p_vout->p_sys->b_frame_available = 0; |
|---|
| 239 | 239 | |
|---|
| | 240 | [CATransaction performSelectorOnMainThread:@selector(begin) |
|---|
| | 241 | withObject:nil waitUntilDone:YES]; |
|---|
| | 242 | |
|---|
| 240 | 243 | [p_sys->o_layer performSelectorOnMainThread:@selector(removeFromSuperlayer) |
|---|
| 241 | 244 | withObject:nil waitUntilDone:YES]; |
|---|
| | 245 | [CATransaction performSelectorOnMainThread:@selector(commit) |
|---|
| | 246 | withObject:nil waitUntilDone:YES]; |
|---|
| | 247 | |
|---|
| | 248 | // Should be done automatically |
|---|
| 242 | 249 | [p_sys->o_layer release]; |
|---|
| 243 | 250 | [p_sys->autorealease_pool release]; |
|---|
| 244 | 251 | |
|---|
| 245 | 252 | /* Free the texture buffer*/ |
|---|
| 246 | | glDeleteTextures( 2, p_sys->p_textures ); |
|---|
| 247 | 253 | if( p_sys->pp_buffer[0] ) free( p_sys->pp_buffer[0] ); |
|---|
| 248 | 254 | if( p_sys->pp_buffer[1] ) free( p_sys->pp_buffer[1] ); |
|---|
| … | … | |
| 305 | 311 | |
|---|
| 306 | 312 | p_sys->b_frame_available = 1; |
|---|
| | 313 | [p_sys->o_layer setNeedsDisplay]; |
|---|
| 307 | 314 | } |
|---|
| 308 | 315 | |
|---|
| … | … | |
| 401 | 408 | me.asynchronous = YES; |
|---|
| 402 | 409 | [me setVout: _p_vout]; |
|---|
| | 410 | me.bounds = CGRectMake( 0.0, 0.0, (float)_p_vout->output.i_height, (float)_p_vout->output.i_width ); |
|---|
| | 411 | |
|---|
| 403 | 412 | } |
|---|
| 404 | 413 | return me; |
|---|
| … | … | |
| 493 | 502 | return context; |
|---|
| 494 | 503 | } |
|---|
| | 504 | |
|---|
| | 505 | - (void)releaseCGLContext:(CGLContextObj)glContext |
|---|
| | 506 | { |
|---|
| | 507 | CGLLockContext( glContext ); |
|---|
| | 508 | CGLSetCurrentContext( glContext ); |
|---|
| | 509 | |
|---|
| | 510 | glDeleteTextures( 2, p_vout->p_sys->p_textures ); |
|---|
| | 511 | |
|---|
| | 512 | CGLUnlockContext( glContext ); |
|---|
| | 513 | } |
|---|
| | 514 | |
|---|
| 495 | 515 | @end |
|---|