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)
47 # include <Quickdraw.h>
52 # include <X11/Xlib.h>
53 # include <X11/Intrinsic.h>
54 # include <X11/StringDefs.h>
61 VlcPlugin( NPP, uint16 );
64 NPError init(int argc, char* const argn[], char* const argv[]);
65 libvlc_instance_t* getVLC()
66 { return libvlc_instance; };
68 { return p_browser; };
69 char* getAbsoluteURL(const char *url);
72 void setWindow(const NPWindow &window)
73 { npwindow = window; };
75 NPClass* getScriptClass()
76 { return p_scriptClass; };
78 void setLog(libvlc_log_t *log)
79 { libvlc_log = log; };
80 libvlc_log_t* getLog()
81 { return libvlc_log; };
83 WNDPROC getWindowProc()
84 { return pf_wndproc; };
85 void setWindowProc(WNDPROC wndproc)
86 { pf_wndproc = wndproc; };
90 int setSize(unsigned width, unsigned height);
91 Window getVideoWindow()
93 void setVideoWindow(Window window)
94 { npvideo = window; };
95 Window getControlWindow()
96 { return npcontrol; };
97 void setControlWindow(Window window)
98 { npcontrol = window; };
101 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
103 /* plugin properties */
110 int i_control_height;
114 libvlc_instance_t *libvlc_instance;
115 libvlc_log_t *libvlc_log;
116 NPClass *p_scriptClass;
118 /* browser reference */
122 /* display settings */
128 unsigned int i_width, i_height;
129 Window npvideo, npcontrol;
134 /*******************************************************************************
136 ******************************************************************************/
137 #define PLUGIN_NAME "VLC Multimedia Plug-in"
138 #define PLUGIN_DESCRIPTION \
139 "Version %s, copyright 1996-2007 The VideoLAN Team" \
140 "<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
142 #define PLUGIN_MIMETYPES \
143 /* MPEG-1 and MPEG-2 */ \
144 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
145 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
146 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
147 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
148 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
149 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
151 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
152 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
153 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
154 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
156 "video/x-msvideo:avi:AVI video;" \
158 "video/quicktime:mov,qt:QuickTime video;" \
160 "application/x-ogg:ogg:Ogg stream;" \
161 "application/ogg:ogg:Ogg stream;" \
163 "application/x-vlc-plugin:vlc:VLC plug-in;" \
164 /* Windows Media */ \
165 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
166 "video/x-ms-asf:asf,asx:Windows Media Video;" \
167 "application/x-mplayer2::Windows Media;" \
168 "video/x-ms-wmv:wmv:Windows Media;" \
169 "video/x-ms-wvx:wvx:Windows Media Video;" \
171 "application/x-google-vlc-plugin::Google VLC plug-in;" \
173 "audio/wav:wav:WAV audio;" \
174 "audio/x-wav:wav:WAV audio;" \
176 "audio/3gpp:3gp,3gpp:3GPP audio;" \
177 "video/3gpp:3gp,3gpp:3GPP video;" \
179 "audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
180 "video/3gpp2:3g2,3gpp2:3GPP2 video;" \
182 "video/divx:divx:DivX video;"