VlcMacHowto: vlc-macosx.patch

File vlc-macosx.patch, 5.6 KB (added by jdmol, 5 years ago)

Patch for VLC to compile python bindings on Mac OS/X

  • Makefile

    old new  
    628628#noinst_DATA = vlc-bundle 
    629629 
    630630# Create the MacOS X app 
    631 vlc_app_DATA = VLC.app 
    632631vlc_appdir = $(bindir) 
    633632#DATA_win32_rc = $(noinst_share_vlc_win32_rc_DATA) 
    634633#noinst_share_vlc_win32_rc_DATA = share/vlc_win32_rc.$(OBJEXT) 
  • po/Makefile

    old new  
    2626 
    2727INSTALL = /usr/bin/install -c 
    2828INSTALL_DATA = ${INSTALL} -m 644 
    29 MKINSTALLDIRS = @MKINSTALLDIRS@ 
     29MKINSTALLDIRS = autotools/mkinstalldirs 
    3030mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` 
    3131 
    3232GMSGFMT = /Users/jandavidmol/svn/vlc-trunk/./extras/contrib/bin/msgfmt 
  • vlc-config

    old new  
    2020objcflags="" 
    2121ldflags="" 
    2222 
    23 cflags_tuning="-march=pentium-m -mtune=prescott" 
     23cflags_tuning="" 
    2424cflags_optim=" -O3 -ffast-math -funroll-loops" 
    2525cflags_optim_nodebug=" -fomit-frame-pointer" 
    2626cflags_nooptim=" -O2" 
     
    822822      ;; 
    823823    external) 
    824824      echo_external=yes 
    825       ldflags="${ldflags} -lvlc -lvlc-control" 
     825      ldflags="${ldflags} -lvlc" 
    826826      ;;       
    827827    *) 
    828828      module="$1" 
  • modules/gui/macosx/voutgl.m

     
    4343#include <OpenGL/gl.h> 
    4444 
    4545#include <AGL/agl.h> 
     46#include <Carbon/Carbon.h> 
    4647 
    4748/***************************************************************************** 
    4849 * VLCGLView interface 
     
    6869    vlc_bool_t          b_embedded; 
    6970    AGLContext          agl_ctx; 
    7071    AGLDrawable         agl_drawable; 
     72    ControlRef          theControl; 
    7173    int                 i_offx, i_offy; 
    7274    int                 i_width, i_height; 
    7375    WindowRef           theWindow; 
    7476    WindowGroupRef      winGroup; 
    7577    vlc_bool_t          b_clipped_out; 
     78    vlc_bool_t          b_viewport_set; 
    7679    Rect                clipBounds, viewBounds;              
    7780}; 
    7881 
     
    470473    Rect clipBounds; 
    471474     
    472475    var_Get( p_vout->p_libvlc, "drawable", &val ); 
    473     p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int; 
     476    p_vout->p_sys->theControl = val.i_int; 
     477    p_vout->p_sys->agl_drawable = (AGLDrawable)GetWindowPort(GetControlOwner(val.i_int)); 
    474478    aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable); 
    475479 
    476480    var_Get( p_vout->p_libvlc, "drawable-view-top", &val ); 
     
    492496 
    493497    p_vout->p_sys->b_clipped_out = (clipBounds.top == clipBounds.bottom) 
    494498                                 || (clipBounds.left == clipBounds.right); 
    495     if( ! p_vout->p_sys->b_clipped_out ) 
     499    p_vout->p_sys->b_viewport_set = viewBounds.top || viewBounds.bottom 
     500                                 || viewBounds.left || viewBounds.right; 
     501    if( !p_vout->p_sys->b_clipped_out  && p_vout->p_sys->b_viewport_set ) 
    496502    { 
    497503        aglLock(p_vout); 
    498504        aglSetViewport(p_vout, viewBounds, clipBounds); 
     
    590596            Rect clipBounds; 
    591597 
    592598            var_Get( p_vout->p_libvlc, "drawable", &val ); 
    593             p_vout->p_sys->agl_drawable = (AGLDrawable)val.i_int; 
     599            p_vout->p_sys->theControl = val.i_int; 
     600            p_vout->p_sys->agl_drawable = (AGLDrawable)GetWindowPort(GetControlOwner(val.i_int)); 
    594601            aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable); 
    595602 
    596603            var_Get( p_vout->p_libvlc, "drawable-view-top", &val ); 
     
    714721 
    715722                p_vout->p_sys->b_clipped_out = (clipBounds.top == clipBounds.bottom) 
    716723                                             || (clipBounds.left == clipBounds.right); 
    717                 if( ! p_vout->p_sys->b_clipped_out ) 
     724                p_vout->p_sys->b_viewport_set = viewBounds.top || viewBounds.bottom 
     725                                             || viewBounds.left || viewBounds.right; 
     726                if( !p_vout->p_sys->b_clipped_out ) 
    718727                { 
    719728                    /* ignore consecutive viewport update with identical parameters */ 
    720729                    if( memcmp(&clipBounds, &(p_vout->p_sys->clipBounds), sizeof(clipBounds) ) 
     
    769778 
    770779static void aglSwap( vout_thread_t * p_vout ) 
    771780{ 
    772     if( ! p_vout->p_sys->b_clipped_out ) 
     781    if( !p_vout->p_sys->b_clipped_out || !p_vout->p_sys->b_viewport_set ) 
    773782    { 
    774783        p_vout->p_sys->b_got_frame = VLC_TRUE; 
    775784        aglSwapBuffers(p_vout->p_sys->agl_ctx); 
     785 
     786        if( !p_vout->p_sys->b_viewport_set ) { 
     787            WindowRef win; 
     788            Rect rect,clipBounds,viewBounds; 
     789 
     790            /* invalidate window data to force redraw */ 
     791            win = GetWindowFromPort( p_vout->p_sys->agl_drawable ); 
     792            //GetWindowPortBounds( win, &rect ); 
     793            GetControlBounds( p_vout->p_sys->theControl, &rect ); 
     794            InvalWindowRect( win, &rect ); 
     795 
     796            /* check for resizing -- ugly hack to do this in aglSwap, i.e. every frame */ 
     797            clipBounds = viewBounds = rect; 
     798 
     799            /* ignore consecutive viewport update with identical parameters */ 
     800            if( memcmp(&clipBounds, &(p_vout->p_sys->clipBounds), sizeof(clipBounds) ) 
     801             && memcmp(&viewBounds, &(p_vout->p_sys->viewBounds), sizeof(viewBounds)) ) 
     802            { 
     803                /* set first to avoid infinite recursion */ 
     804                p_vout->p_sys->clipBounds = clipBounds; 
     805                p_vout->p_sys->viewBounds = viewBounds; 
     806 
     807                aglSetViewport(p_vout, viewBounds, clipBounds); 
     808                aglReshape( p_vout ); 
     809            } 
     810        } 
    776811    } 
    777812    else 
    778813    {