Changeset ad407ff30380e98896cefc46882452e28aef10dc

Show
Ignore:
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
  • modules/video_output/opengllayer.m

    r2f4c4cc rad407ff  
    238238    p_vout->p_sys->b_frame_available = 0; 
    239239 
     240    [CATransaction performSelectorOnMainThread:@selector(begin) 
     241                    withObject:nil waitUntilDone:YES]; 
     242 
    240243    [p_sys->o_layer performSelectorOnMainThread:@selector(removeFromSuperlayer) 
    241244                    withObject:nil waitUntilDone:YES]; 
     245    [CATransaction performSelectorOnMainThread:@selector(commit) 
     246                    withObject:nil waitUntilDone:YES]; 
     247 
     248    // Should be done automatically 
    242249    [p_sys->o_layer release]; 
    243250    [p_sys->autorealease_pool release]; 
    244251 
    245252    /* Free the texture buffer*/ 
    246     glDeleteTextures( 2, p_sys->p_textures ); 
    247253    if( p_sys->pp_buffer[0] ) free( p_sys->pp_buffer[0] ); 
    248254    if( p_sys->pp_buffer[1] ) free( p_sys->pp_buffer[1] ); 
     
    305311 
    306312    p_sys->b_frame_available = 1; 
     313    [p_sys->o_layer setNeedsDisplay]; 
    307314} 
    308315 
     
    401408        me.asynchronous = YES; 
    402409        [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 
    403412    } 
    404413    return me; 
     
    493502    return context; 
    494503} 
     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 
    495515@end