[vlc-devel] Mac OS X Framework: Patch for minimal_macosx and lopengl

Enrique Osuna enrique.osuna at gmail.com
Sat Sep 29 16:50:14 CEST 2007


Sorry for the resend.  I just realized how much I hated hotmail.
----

Hi all,

I'm a first time contributor.  I've been working with the Mac OS X
Framework for VLC and found a few bugs.  More specifically, the test
application included in SVN will not run because the video output
plugin (opengl) is calling on an "opengl provider" plugin
(libmacosx_plugin.dylib) that uses legacy APIs to render the video to
a window (or subview).  If I delete libmacosx_plugin.dylib from the
framework's modules folder, the application runs just fine.

I figured that if I could tell libvlc with the initialization
parameters that I wanted to use a specific opengl provider, that this
would fix my problem.  So modified modules/opengl.c and
modules/minimal_macosx/macosx.c to get my desired affect.  I added an
"opengl-provider" parameter in opengl.c.  Then when opengl.c requests
for an "opengl provider", I specified the value of "opengl-provider"
as a shortcut.

In minimal_macosx I included the add_shortcut("provider_cocoa")
declaration to allow me to choose this module as my opengl provider.
I modified the framework's VLCLibrary.m file to load libvlc as
follows:

        char *lib_vlc_params[] = {
            [applicationPath cString],
            "-I", "dummy", "-vvvv", "--opengl-provider", "provider_cocoa", NULL
        };
        instance = libvlc_new(6, lib_vlc_params, &ex);

Now the test application loads with no problems, and actually uses the
libminimal_macosx_plugin.dylib as the opengl provider versus
libmacosx_plugin.dylib.

This patch shouldn't break anything, as it only adds a few lines.

Please see attached for the patch.

Any feedback is welcomed.

- Enrique



More information about the vlc-devel mailing list