~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/gui/minimal_macosx/voutgl.m

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * voutgl.m: MacOS X OpenGL provider
 
3
 *****************************************************************************
 
4
 * Copyright (C) 2001-2007 the VideoLAN team
 
5
 * $Id$
 
6
 *
 
7
 * Authors: Colin Delacroix <colin@zoy.org>
 
8
 *          Florian G. Pflug <fgp@phlo.org>
 
9
 *          Jon Lech Johansen <jon-vl@nanocrew.net>
 
10
 *          Derk-Jan Hartman <hartman at videolan dot org>
 
11
 *          Eric Petit <titer@m0k.org>
 
12
 *          Benjamin Pracht <bigben at videolan dot org>
 
13
 *          Damien Fouilleul <damienf at videolan dot org>
 
14
 *
 
15
 * This program is free software; you can redistribute it and/or modify
 
16
 * it under the terms of the GNU General Public License as published by
 
17
 * the Free Software Foundation; either version 2 of the License, or
 
18
 * (at your option) any later version.
 
19
 *
 
20
 * This program is distributed in the hope that it will be useful,
 
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
23
 * GNU General Public License for more details.
 
24
 *
 
25
 * You should have received a copy of the GNU General Public License
 
26
 * along with this program; if not, write to the Free Software
 
27
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 
28
 *****************************************************************************/
 
29
 
 
30
/*****************************************************************************
 
31
 * Preamble
 
32
 *****************************************************************************/
 
33
#include "intf.h"
 
34
#include "voutgl.h"
 
35
 
 
36
int OpenVideoGL  ( vlc_object_t * p_this )
 
37
{
 
38
    vout_thread_t * p_vout = (vout_thread_t *) p_this;
 
39
    vlc_value_t value_drawable;
 
40
 
 
41
    if( !CGDisplayUsesOpenGLAcceleration( kCGDirectMainDisplay ) )
 
42
    {
 
43
        msg_Warn( p_vout, "No OpenGL hardware acceleration found. "
 
44
                          "Video display will be slow" );
 
45
        return( 1 );
 
46
    }
 
47
 
 
48
    msg_Dbg( p_vout, "display is Quartz Extreme accelerated" );
 
49
 
 
50
    p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
 
51
    if( p_vout->p_sys == NULL )
 
52
    {
 
53
        msg_Err( p_vout, "out of memory" );
 
54
        return( 1 );
 
55
    }
 
56
 
 
57
    memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
 
58
 
 
59
    var_Get( p_vout->p_libvlc, "drawable", &value_drawable );
 
60
 
 
61
    if( 0 /* Are we in the mozilla plugin ? XXX: get that from drawable */ )
 
62
    {
 
63
        p_vout->pf_init             = aglInit;
 
64
        p_vout->pf_end              = aglEnd;
 
65
        p_vout->pf_manage           = aglManage;
 
66
        p_vout->pf_control          = aglControl;
 
67
        p_vout->pf_swap             = aglSwap;
 
68
        p_vout->pf_lock             = aglLock;
 
69
        p_vout->pf_unlock           = aglUnlock;
 
70
    }
 
71
    else
 
72
    {
 
73
        /* Let's use the VLCOpenGLVoutView.m class */
 
74
        p_vout->pf_init   = cocoaglvoutviewInit;
 
75
        p_vout->pf_end    = cocoaglvoutviewEnd;
 
76
        p_vout->pf_manage = cocoaglvoutviewManage;
 
77
        p_vout->pf_control= cocoaglvoutviewControl;
 
78
        p_vout->pf_swap   = cocoaglvoutviewSwap;
 
79
        p_vout->pf_lock   = cocoaglvoutviewLock;
 
80
        p_vout->pf_unlock = cocoaglvoutviewUnlock;
 
81
    }
 
82
    p_vout->p_sys->b_got_frame = false;
 
83
 
 
84
    return VLC_SUCCESS;
 
85
}
 
86
 
 
87
void CloseVideoGL ( vlc_object_t * p_this )
 
88
{
 
89
    vout_thread_t * p_vout = (vout_thread_t *) p_this;
 
90
    /* Clean up */
 
91
    free( p_vout->p_sys );
 
92
}