Commit d86fd156 authored by Simon Latapie's avatar Simon Latapie

* mozilla plugin on MacOSX. Not fully implemented yet.

 * compiled with mozilla 1.4 (won't probably work with <1.4)
 * TODO:
 *     - make XPCOM work (play,pause,stop buttons)
 *     - fullscreen implementation (quite difficult on MacOSX because only
 *       the main thread can create windows)
parent 10afbf83
B/* Localized versions of Info.plist keys */
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Vlc Plugin</string>
<key>CFBundleIdentifier</key>
<string>com.netscape.vlc</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>NSPL</string>
<key>CFBundleSignature</key>
<string>MOSS</string>
<key>CFBundleVersion</key>
<string>0.12</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PBXProjectSourcePath</key>
<string>/Users/garf/cavapasmerder/VlcPlugin.pbproj</string>
</dict>
</plist>
......@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.h,v 1.11 2003/05/01 01:11:17 hartman Exp $
* $Id: vout.h,v 1.12 2003/08/14 12:38:03 garf Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -81,10 +81,15 @@ struct vout_sys_t
#ifdef __QUICKTIME__
CodecType i_codec;
CGrafPtr p_qdport;
CGrafPtr p_qdportold;
ImageSequence i_seq;
MatrixRecordPtr p_matrix;
DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr;
Ptr p_fullscreen_state;
RgnHandle mask;
int portx;
int porty;
int isplugin;
#endif
};
This diff is collapsed.
......@@ -29,8 +29,13 @@ SOURCES_win32 = support/npwin.cpp
CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
else
if HAVE_DARWIN
# We don't define LIBRARIES_mozilla because we'll be using project builder
SOURCES_macosx = support/npmac.cpp
# We don't define LIBRARIES_mozilla because we'll be using project builder, or not...
BUNDLE_mozilla = VLC\ Plugin.plugin
vlc_moz_FLAGS = `$(VLC_CONFIG) --libs vlc builtin pic mozilla`
moz_CFLAGS = `$(MOZILLA_CONFIG) --cflags plugin java nspr/obsolete nspr oji xpcom xpconnect`
moz_plugin_FLAGS = -c -F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) -I/Developer/Headers/FlatCarbon -arch ppc -fno-common -fpascal-strings -O0 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 -g -include mozilla-config.h
else
LIBRARIES_mozilla = libvlcplugin$(LIBEXT)
SOURCES_unix = support/npunix.c
......@@ -52,7 +57,7 @@ libplugin_a_DEPENDENCIES = $(DATA_npvlc_rc)
BUILT_SOURCES_mozilla = vlcintf.h
$(SOURCES_mozilla): vlcintf.h
plugin_DATA = $(LIBRARIES_mozilla)
plugin_DATA = $(LIBRARIES_mozilla) $(BUNDLE_mozilla)
plugindir = $(libdir)/mozilla/plugins
$(LIBRARIES_mozilla): $(libplugin_a_OBJECTS) \
$(libplugin_a_DEPENDENCIES) stamp-pic
......@@ -75,14 +80,29 @@ DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
noinst_npvlc_rcdir = $(libdir)
npvlc_rc.$(OBJEXT): npvlc_rc.rc
$(WINDRES) --include-dir $(srcdir)/mozilla -i $< -o $@
$(WINDRES) --include-dir $(srcdir) -i $< -o $@
endif
if HAVE_DARWIN
VLC\ Plugin.plugin:
rm -rf $(srcdir)/VLC\ Plugin.plugin
mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS
mkdir -p $(srcdir)/VLC\ Plugin.plugin/Contents/Resources
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcplugin.cpp -o $(srcdir)/libplugin_a-vlcplugin.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcshell.cpp -o $(srcdir)/libplugin_a-vlcshell.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/vlcpeer.cpp -o $(srcdir)/libplugin_a-vlcpeer.o
/usr/bin/g++3 $(moz_plugin_FLAGS) $(srcdir)/support/npmac.cpp -o $(srcdir)/libplugin_a-npmac.o
/usr/bin/g++3 $(srcdir)/libplugin_a-vlcplugin.o $(srcdir)/libplugin_a-vlcshell.o $(srcdir)/libplugin_a-vlcpeer.o $(srcdir)/libplugin_a-npmac.o -o $(srcdir)/VLC\ Plugin.plugin/Contents/MacOS/VLC\ Plugin -L/usr/lib -F/System/Library/Frameworks/CoreFoundation.framework -framework CoreFoundation -arch ppc -bundle -read_only_relocs suppress $(top_srcdir)/lib/libvlc_pic.a -dylib $(vlc_moz_FLAGS)
cp $(top_srcdir)/extras/MacOSX/plugin/Info.plist $(srcdir)/VLC\ Plugin.plugin/Contents/Info.plist
cp $(top_srcdir)/extras/MacOSX/plugin/pbdevelopment.plist $(srcdir)/VLC\ Plugin.plugin/Contents/pbdevelopment.plist
cp -r $(top_srcdir)/extras/MacOSX/plugin/English.lproj $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/
Rez /Developer/Headers/FlatCarbon/Types.r $(srcdir)/vlc.r -o $(srcdir)/VLC\ Plugin.plugin/Contents/Resources/Vlc\ Plugin.rsrc
endif
endif
###############################################################################
# Stamp rules
###############################################################################
clean: clean-stamp
clean: clean-stamp clean-bundle
clean-stamp:
rm -f stamp-pic
......@@ -95,6 +115,9 @@ stamp-pic: FORCE
done
@if test ! -f $@; then printf "" > $@; fi
clean-bundle:
rm -rf $(srcdir)/VLC\ Plugin.plugin
###############################################################################
# Force rule
###############################################################################
......
This diff is collapsed.
......@@ -3,7 +3,6 @@
*****************************************************************************/
/* Definitions of system resource types */
#include <Types.r>
/* The first string in the array is a plugin description,
* the second is the plugin name */
......
......@@ -2,7 +2,7 @@
* vlcplugin.h: a VLC plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcplugin.h,v 1.11 2003/07/17 09:25:58 sigmunau Exp $
* $Id: vlcplugin.h,v 1.12 2003/08/14 12:38:03 garf Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -24,6 +24,12 @@
/*******************************************************************************
* Instance state information about the plugin.
******************************************************************************/
/* No, I really don't want to use XP_UNIX stuff on MacOSX */
#ifdef XP_MACOSX
#undef XP_UNIX
#endif
class VlcPlugin
{
public:
......@@ -53,6 +59,12 @@ public:
Display *p_display;
#endif
#ifdef XP_MACOSX
/* MACOS data members */
NPWindow *window;
#endif
/* vlc data members */
int i_vlc;
int b_stream;
......
......@@ -2,7 +2,7 @@
* vlcshell.cpp: a VLC plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcshell.cpp,v 1.15 2003/07/23 01:13:48 gbazin Exp $
* $Id: vlcshell.cpp,v 1.16 2003/08/14 12:38:03 garf Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -45,14 +45,7 @@
/* Windows stuff */
#endif
#ifdef XP_UNIX
/* X11 stuff */
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
#endif
#ifdef XP_MAC
#ifdef XP_MACOSX
/* Mac OS X stuff */
# include <QuickDraw.h>
#endif
......@@ -66,6 +59,18 @@
# define WINDOW_TEXT "(no libvlc)"
#endif
/* No, I really don't want to use XP_UNIX stuff on MacOSX */
#ifdef XP_MACOSX
#undef XP_UNIX
#endif
#ifdef XP_UNIX
/* X11 stuff */
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
#endif
/*****************************************************************************
* Unix-only declarations
******************************************************************************/
......@@ -76,6 +81,15 @@
static void Redraw( Widget w, XtPointer closure, XEvent *event );
#endif
/*****************************************************************************
* MacOS-only declarations
******************************************************************************/
#ifdef XP_MACOSX
# define VOUT_PLUGINS "macosx"
# define AOUT_PLUGINS "macosx"
#endif
/*****************************************************************************
* Windows-only declarations
*****************************************************************************/
......@@ -176,23 +190,28 @@ NPError NPP_GetValue( NPP instance, NPPVariable variable, void *value )
/******************************************************************************
* Mac-only API calls
*****************************************************************************/
#ifdef XP_MAC
#ifdef XP_MACOSX
int16 NPP_HandleEvent( NPP instance, void * event )
{
VlcPlugin *p_plugin = (VlcPlugin*)instance->pdata;
vlc_value_t value;
if( instance == NULL )
{
return false;
}
Boolean eventHandled = false;
EventRecord *pouetEvent = (EventRecord*)event;
#if 0
TPlugin *pPlugin = (TPlugin*)instance->pdata;
if( pPlugin != NULL && event != NULL )
if (pouetEvent->what == 6)
{
eventHandled = pPlugin->HandleEvent( *(EventRecord*)event );
value.i_int = 1;
VLC_Set( p_plugin->i_vlc, "drawableredraw", value );
return true;
}
#endif
Boolean eventHandled = false;
return eventHandled;
}
......@@ -381,6 +400,20 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
NPError NPP_SetWindow( NPP instance, NPWindow* window )
{
#ifdef XP_MACOSX
vlc_value_t value;
vlc_value_t valuex;
vlc_value_t valuey;
vlc_value_t valuew;
vlc_value_t valueh;
vlc_value_t valuet;
vlc_value_t valuel;
vlc_value_t valueb;
vlc_value_t valuer;
vlc_value_t valueportx;
vlc_value_t valueporty;
#endif
if( instance == NULL )
{
return NPERR_INVALID_INSTANCE_ERROR;
......@@ -390,11 +423,42 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
/* Write the window ID for vlc */
#if USE_LIBVLC
vlc_value_t value;
#ifdef XP_MACOSX
value.i_int = ((NP_Port*) (window->window))->port;
VLC_Set( p_plugin->i_vlc, "drawable", value );
valueportx.i_int = ((NP_Port*) (window->window))->portx;
valueporty.i_int = ((NP_Port*) (window->window))->porty;
VLC_Set( p_plugin->i_vlc, "drawableportx", valueportx );
VLC_Set( p_plugin->i_vlc, "drawableporty", valueporty );
valuex.i_int = window->x;
valuey.i_int = window->y;
valuew.i_int = window->width;
valueh.i_int = window->height;
valuet.i_int = window->clipRect.top;
valuel.i_int = window->clipRect.left;
valueb.i_int = window->clipRect.bottom;
valuer.i_int = window->clipRect.right;
VLC_Set( p_plugin->i_vlc, "drawablet", valuet );
VLC_Set( p_plugin->i_vlc, "drawablel", valuel );
VLC_Set( p_plugin->i_vlc, "drawableb", valueb );
VLC_Set( p_plugin->i_vlc, "drawabler", valuer );
VLC_Set( p_plugin->i_vlc, "drawablex", valuex );
VLC_Set( p_plugin->i_vlc, "drawabley", valuey );
VLC_Set( p_plugin->i_vlc, "drawablew", valuew );
VLC_Set( p_plugin->i_vlc, "drawableh", valueh );
p_plugin->window = window;
#else
/* FIXME: this cast sucks */
value.i_int = (int) (ptrdiff_t) (void *) window->window;
VLC_Set( p_plugin->i_vlc, "drawable", value );
#endif
#endif
/*
......
......@@ -17,7 +17,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2002-04-22 09:56+0200\n"
"Last-Translator: Samuel Hocevar <sam@zoy.org>\n"
......@@ -25,6 +24,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105
msgid ""
......
......@@ -6,7 +6,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2001-12-10 13:32+0100\n"
"Last-Translator: Jean-Pierre Kuypers <Kuypers@sri.ucl.ac.be> 2003-07-27\n"
......@@ -14,6 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8-bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105
msgid ""
......
......@@ -6,7 +6,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2003-07-24 15:00+0100\n"
"Last-Translator: Vella Bruno\n"
......@@ -14,6 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105
msgid ""
......
......@@ -4,7 +4,6 @@
msgid ""
msgstr ""
"Project-Id-Version: vlc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2003-08-11 21:05+0200\n"
"PO-Revision-Date: 2003-01-09 02:37+0900\n"
"Last-Translator: Fumio Nakayama <endymion@ca2.so-net.ne.jp>\n"
......@@ -12,6 +11,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=euc-jp\n"
"Content-Transfer-Encoding: 8bit\n"
"Report-Msgid-Bugs-To: \n"
#: include/vlc_interface.h:105
#, fuzzy
......
......@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.94 2003/07/23 01:13:48 gbazin Exp $
* $Id: libvlc.c,v 1.95 2003/08/14 12:38:04 garf Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -564,6 +564,17 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
* FIXME: kludge to use a p_vlc-local variable for the Mozilla plugin
*/
var_Create( p_vlc, "drawable", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableredraw", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablet", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablel", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableb", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawabler", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablex", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawabley", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawablew", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableh", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableportx", VLC_VAR_INTEGER );
var_Create( p_vlc, "drawableporty", VLC_VAR_INTEGER );
/*
* Get input filenames given as commandline arguments
......@@ -893,6 +904,7 @@ int VLC_Stop( int i_object )
* Ask the interfaces to stop and destroy them
*/
msg_Dbg( p_vlc, "removing all interfaces" );
while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
{
intf_StopThread( p_intf );
......@@ -904,6 +916,7 @@ int VLC_Stop( int i_object )
/*
* Free playlists
*/
msg_Dbg( p_vlc, "removing all playlists" );
while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
FIND_CHILD )) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment