Commit 435bab6b authored by Sam Hocevar's avatar Sam Hocevar

* ./mozilla/vlcshell.cpp: ported the Mozilla plugin to Windows.

    For the moment it spawns a separate window and seems to behave nastily
    (read: crashes) when the target has sound, but the javascript interface
    works perfectly, for instance.

    To build it, I installed Mozilla development files in my mingw32 dir
    and hacked mozilla-config so that it uses these files. I also hacked
    jri_md.h and jni_md.h to put "defined(_MSC_VER) || defined(__MINGW32__)"
    where it read "defined(_MSC_VER)". No other changes were necessary.
parent d9624250
......@@ -417,7 +417,7 @@ endif
noinst_LIBRARIES += $(noinst_LIBRARIES_mozilla)
MOSTLYCLEANFILES += mozilla/libvlcplugin$(LIBEXT)
MOSTLYCLEANFILES += $(LIBRARIES_mozilla)
EXTRA_DIST += $(SOURCES_mozilla) mozilla/vlcintf.idl
......@@ -430,7 +430,20 @@ SOURCES_mozilla = \
mozilla/vlcpeer.cpp \
mozilla/vlcpeer.h \
mozilla/classinfo.h \
mozilla/npunix.c
$(SOURCES_mozilla_win32) \
$(SOURCES_mozilla_unix)
# Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
# the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
# under Win32 and npunix.c under Unix.
if HAVE_WIN32
LIBRARIES_mozilla = mozilla/npvlc$(LIBEXT)
SOURCES_mozilla_win32 = mozilla/npwin.cpp
CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
else
LIBRARIES_mozilla = mozilla/libvlcplugin$(LIBEXT)
SOURCES_mozilla_unix = mozilla/npunix.c
endif
if BUILD_MOZILLA
noinst_LIBRARIES_mozilla = mozilla/libvlcplugin.a
......@@ -438,20 +451,22 @@ noinst_LIBRARIES_mozilla = mozilla/libvlcplugin.a
mozilla_libvlcplugin_a_SOURCES = $(SOURCES_mozilla) $(BUILT_SOURCES_mozilla) \
$(SOURCES_libgetopt)
mozilla_libvlcplugin_a_CFLAGS = $(CPPFLAGS_pic) $(CFLAGS_pic) \
$(CPPFLAGS_mozilla) $(CFLAGS_mozilla)
$(CPPFLAGS_mozilla) $(CFLAGS_mozilla) \
$(CPPFLAGS_mozilla_EXTRA)
mozilla_libvlcplugin_a_CXXFLAGS = $(CPPFLAGS_pic) $(CXXFLAGS_pic) \
$(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla)
mozilla_libvlcplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic)
$(CPPFLAGS_mozilla) $(CXXFLAGS_mozilla) \
$(CPPFLAGS_mozilla_EXTRA)
mozilla_libvlcplugin_a_DEPENDENCIES = lib/libvlc_pic.a $(L_builtin_pic) $(DATA_npvlc_rc)
BUILT_SOURCES_mozilla = mozilla/vlcintf.h
$(SOURCES_mozilla): mozilla/vlcintf.h
mozilla_libvlcplugin_DATA = mozilla/libvlcplugin$(LIBEXT)
mozilla_libvlcplugindir = $(libdir)/mozilla/plugins
mozilla/libvlcplugin$(LIBEXT): mozilla/libvlcplugin.a $(L_builtin_pic)
$(CC) -o $@ $(mozilla_libvlcplugin_a_OBJECTS) lib/libvlc_pic.a \
$(L_builtin_pic) -shared $(LDFLAGS) $(LDFLAGS_vlc) \
$(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
mozilla_plugin_DATA = $(LIBRARIES_mozilla)
mozilla_plugindir = $(libdir)/mozilla/plugins
$(LIBRARIES_mozilla): mozilla/libvlcplugin.a $(L_builtin_pic)
$(CXXLINK) -o $@ $(mozilla_libvlcplugin_a_OBJECTS) $(DATA_npvlc_rc) \
lib/libvlc_pic.a $(L_builtin_pic) -shared $(LDFLAGS) \
$(LDFLAGS_vlc) $(LDFLAGS_mozilla) $(LDFLAGS_builtin_pic)
mozilla_vlcintf_xpt_DATA = mozilla/vlcintf.xpt
mozilla_vlcintf_xptdir = $(libdir)/mozilla/components
......@@ -462,6 +477,14 @@ mozilla/vlcintf.xpt: Makefile mozilla/vlcintf.idl
mozilla/vlcintf.h: Makefile mozilla/vlcintf.idl
$(XPIDL) -I/usr/share/idl/mozilla -m header \
-o mozilla/vlcintf mozilla/vlcintf.idl
if HAVE_WIN32
DATA_npvlc_rc = $(noinst_mozilla_npvlc_rc_DATA)
noinst_mozilla_npvlc_rc_DATA = mozilla/npvlc_rc.$(OBJEXT)
noinst_mozilla_npvlc_rcdir = $(libdir)
mozilla/npvlc_rc.$(OBJEXT): mozilla/npvlc_rc.rc
$(WINDRES) -i $< -o $@
endif
endif
###############################################################################
......
......@@ -2,7 +2,7 @@
* test2.cpp : Empty C++ module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: test2.cpp,v 1.1 2002/10/04 13:13:54 sam Exp $
* $Id: test2.cpp,v 1.2 2002/10/22 21:10:27 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -33,8 +33,8 @@
*****************************************************************************/
vlc_module_begin();
/* Minimal C++ usage */
string description = "C++ module that does nothing";
set_description( _( description.c_str() ) );
std::string description = "C++ module that does nothing";
set_description( (char*)_( description.c_str() ) );
vlc_module_end();
......@@ -2,7 +2,7 @@
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: directx.c,v 1.3 2002/10/06 19:28:28 gbazin Exp $
* $Id: directx.c,v 1.4 2002/10/22 21:10:28 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -105,6 +105,7 @@ vlc_module_begin();
add_bool( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT );
set_description( _("DirectX video module") );
set_capability( "video output", 100 );
add_shortcut( "directx" );
set_callbacks( OpenVideo, CloseVideo );
vlc_module_end();
......
/////////////////////////////////////////////////////////////////////////////
//
// VideoLAN Client Plugin description.
//
//VS_VERSION_INFO VERSIONINFO
1 VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "ProductName", "VideoLAN Client Plugin\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "OriginalFilename", "npvlc.dll\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "FileDescription", "VideoLAN Client Multimedia Player Plugin<br><br>VideoLAN WWW: <a href=""http://www.videolan.org/"">http://www.videolan.org/</a>\0"
VALUE "InternalName", "npvlc\0"
VALUE "CompanyName", "VideoLAN\0"
VALUE "LegalCopyright", "Copyright VideoLAN \251 1996-2002\0"
VALUE "MIMEType", "audio/mpeg|audio/x-mpeg|video/mpeg|video/x-mpeg|video/mpeg-system|video/x-mpeg-system|video/mpeg4|audio/mpeg4|application/mpeg4-iod|application/mpeg4-muxcodetable|video/x-msvideo|video/quicktime|application/x-vlc-plugin\0"
VALUE "FileExtents", "mp2,mp3,mpga,mpega|mp2,mp3,mpga,mpega|mpg,mpeg,mpe|mpg,mpeg,mpe|mpg,mpeg,vob|mpg,mpeg,vob|mp4,mpg4|mp4,mpg4|mp4,mpg4|mp4,mpg4|avi|mov,qt|\0"
VALUE "FileOpenName", "MPEG audio|MPEG audio|MPEG video|MPEG video|MPEG video|MPEG video|MPEG-4 video|MPEG-4 audio|MPEG-4 video|MPEG-4 video|AVI video|QuickTime video|VLC plugin\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
This diff is collapsed.
......@@ -2,7 +2,7 @@
* vlcplugin.h: a VideoLAN plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcplugin.h,v 1.5 2002/10/11 22:32:56 sam Exp $
* $Id: vlcplugin.h,v 1.6 2002/10/22 21:10:28 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -40,11 +40,15 @@ public:
NPWindow* fWindow;
uint16 fMode;
#ifdef WIN32
#else
/* UNIX data members */
Window window;
Display *display;
uint32 x, y;
uint32 width, height;
#endif
/* vlc data members */
int i_vlc;
......@@ -60,7 +64,7 @@ private:
/*******************************************************************************
* Plugin properties.
******************************************************************************/
#define PLUGIN_NAME "VideoLAN Client Plug-in"
#define PLUGIN_NAME "VideoLAN Client Plugin"
#define PLUGIN_DESCRIPTION \
"VideoLAN Client Multimedia Player Plugin <br>" \
" <br>" \
......
......@@ -2,7 +2,7 @@
* vlcshell.c: a VideoLAN Client plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcshell.cpp,v 1.4 2002/10/11 22:32:56 sam Exp $
* $Id: vlcshell.cpp,v 1.5 2002/10/22 21:10:28 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -168,10 +168,6 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
{
"vlc"
/*, "--plugin-path", "/home/sam/videolan/vlc_MAIN/plugins"*/
, "--vout", "xvideo,x11,dummy"
, "--aout", "dsp"
, "--intf", "dummy"
/*, "--noaudio"*/
};
if( instance == NULL )
......@@ -190,7 +186,11 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
p_plugin->fMode = mode;
p_plugin->fWindow = NULL;
#ifdef WIN32
#else
p_plugin->window = 0;
#endif
p_plugin->i_vlc = VLC_Create();
if( p_plugin->i_vlc < 0 )
......@@ -211,10 +211,20 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
return NPERR_GENERIC_ERROR;
}
value.psz_string = "xvideo,x11,dummy";
VLC_Set( p_plugin->i_vlc, "conf::vout", value );
value.psz_string = "dummy";
VLC_Set( p_plugin->i_vlc, "conf::intf", value );
#ifdef WIN32
value.psz_string = "directx,dummy";
#else
value.psz_string = "xvideo,x11,dummy";
#endif
VLC_Set( p_plugin->i_vlc, "conf::vout", value );
#ifdef WIN32
value.psz_string = "none";//"directx,waveout,dummy";
#else
value.psz_string = "dsp,dummy";
#endif
VLC_Set( p_plugin->i_vlc, "conf::aout", value );
p_plugin->b_stream = 0;
p_plugin->b_autoplay = 0;
......@@ -295,8 +305,12 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
/* Write the window ID for vlc */
value.p_address = (void*)window->window;
VLC_Set( p_plugin->i_vlc, "drawable", value );
//value.p_address = (void*)window->window;
//VLC_Set( p_plugin->i_vlc, "drawable", value );
/* FIXME: this cast sucks */
value.i_int = (int) (long long) (void *) window->window;
VLC_Set( p_plugin->i_vlc, "conf::x11-drawable", value );
VLC_Set( p_plugin->i_vlc, "conf::xvideo-drawable", value );
/*
* PLUGIN DEVELOPERS:
......@@ -306,6 +320,9 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
* size changes, etc.
*/
#ifdef WIN32
#else
Widget netscape_widget;
p_plugin->window = (Window) window->window;
......@@ -318,6 +335,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
netscape_widget = XtWindowToWidget(p_plugin->display, p_plugin->window);
XtAddEventHandler(netscape_widget, ExposureMask, FALSE, (XtEventHandler)Redraw, p_plugin);
Redraw(netscape_widget, (XtPointer)p_plugin, NULL);
#endif
p_plugin->fWindow = window;
......@@ -400,7 +418,7 @@ int32 NPP_WriteReady( NPP instance, NPStream *stream )
int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
int32 len, void *buffer )
{
fprintf(stderr, "NPP_Write %i\n", len);
fprintf(stderr, "NPP_Write %i\n", (int)len);
if( instance != NULL )
{
......
......@@ -4,7 +4,7 @@
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: messages.c,v 1.15 2002/10/14 16:46:56 sam Exp $
* $Id: messages.c,v 1.16 2002/10/22 21:10:28 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -480,6 +480,8 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
p_item->psz_module, psz_object, ppsz_type[i_type],
p_item->psz_msg );
}
fflush( stderr );
}
/*****************************************************************************
......
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