1 /*****************************************************************************
2 * vlcplugin.h: a VLC plugin for Mozilla
3 *****************************************************************************
4 * Copyright (C) 2002-2006 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
8 Damien Fouilleul <damienf@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*******************************************************************************
26 * Instance state information about the plugin.
27 ******************************************************************************/
28 #ifndef __VLCPLUGIN_H__
29 #define __VLCPLUGIN_H__
31 #include <vlc/libvlc.h>
33 #include "control/nporuntime.h"
35 #if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
37 #elif defined(XP_MACOSX)
48 # include <Quickdraw.h>
53 # include <X11/Xlib.h>
54 # include <X11/Intrinsic.h>
55 # include <X11/StringDefs.h>
62 VlcPlugin( NPP, uint16 );
65 NPError init(int argc, char* const argn[], char* const argv[]);
66 libvlc_instance_t* getVLC()
67 { return libvlc_instance; };
69 { return p_browser; };
70 char* getAbsoluteURL(const char *url);
71 const NPWindow* getWindow()
72 { return &npwindow; };
73 void setWindow(const NPWindow *window)
74 { npwindow = *window; };
76 NPClass* getScriptClass()
77 { return scriptClass; };
80 WNDPROC getWindowProc()
81 { return pf_wndproc; };
82 void setWindowProc(WNDPROC wndproc)
83 { pf_wndproc = wndproc; };
87 int setSize(unsigned width, unsigned height);
90 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
92 /* plugin properties */
99 libvlc_instance_t *libvlc_instance;
100 NPClass *scriptClass;
102 /* browser reference */
106 /* display settings */
112 unsigned int i_width, i_height;
116 /*******************************************************************************
118 ******************************************************************************/
119 #define PLUGIN_NAME "VLC multimedia plugin"
120 #define PLUGIN_DESCRIPTION \
121 "VLC multimedia plugin <br>" \
124 "VideoLAN WWW: <a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
126 #define PLUGIN_MIMETYPES \
127 /* MPEG-1 and MPEG-2 */ \
128 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
129 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
130 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
131 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
132 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
133 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
135 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
136 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
137 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
138 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
140 "video/x-msvideo:avi:AVI video;" \
142 "video/quicktime:mov,qt:QuickTime video;" \
144 "application/x-ogg:ogg:Ogg stream;" \
145 "application/ogg:ogg:Ogg stream;" \
146 /* explicit plugin call */ \
147 "application/x-vlc-plugin::VLC plugin;" \
148 /* windows media */ \
149 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
150 "video/x-ms-asf:asf,asx:Windows Media Video;" \
151 "application/x-mplayer2::Windows Media;" \
152 "video/x-ms-wmv:wmv:Windows Media;" \
153 /* Google VLC mime */ \
154 "application/x-google-vlc-plugin::Google VLC plugin" \
156 "audio/wav::WAV audio" \
157 "audio/x-wav::WAV audio" \