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>
60 VlcPlugin( NPP, uint16 );
63 NPError init(int argc, char* const argn[], char* const argv[]);
64 libvlc_instance_t* getVLC()
65 { return libvlc_instance; };
67 { return p_browser; };
68 char* getAbsoluteURL(const char *url);
69 const NPWindow* getWindow()
70 { return &npwindow; };
71 void setWindow(const NPWindow *window)
72 { npwindow = *window; };
74 NPClass* getScriptClass()
75 { return scriptClass; };
78 WNDPROC getWindowProc()
79 { return pf_wndproc; };
80 void setWindowProc(WNDPROC wndproc)
81 { pf_wndproc = wndproc; };
85 int setSize(unsigned width, unsigned height);
88 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
90 /* plugin properties */
97 libvlc_instance_t *libvlc_instance;
100 /* browser reference */
104 /* display settings */
110 unsigned int i_width, i_height;
114 /*******************************************************************************
116 ******************************************************************************/
117 #define PLUGIN_NAME "VLC multimedia plugin"
118 #define PLUGIN_DESCRIPTION \
119 "VLC multimedia plugin <br>" \
122 "VideoLAN WWW: <a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
124 #define PLUGIN_MIMETYPES \
125 /* MPEG-1 and MPEG-2 */ \
126 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
127 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
128 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
129 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
130 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
131 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
133 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
134 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
135 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
136 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
138 "video/x-msvideo:avi:AVI video;" \
140 "video/quicktime:mov,qt:QuickTime video;" \
142 "application/x-ogg:ogg:Ogg stream;" \
143 "application/ogg:ogg:Ogg stream;" \
144 /* explicit plugin call */ \
145 "application/x-vlc-plugin::VLC plugin;" \
146 /* windows media */ \
147 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
148 "video/x-ms-asf:asf,asx:Windows Media Video;" \
149 "application/x-mplayer2::Windows Media;" \
150 "video/x-ms-wmv:wmv:Windows Media;" \
151 /* Google VLC mime */ \
152 "application/x-google-vlc-plugin::Google VLC plugin" \
154 "audio/wav::WAV audio" \
155 "audio/x-wav::WAV audio" \