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 p_scriptClass; };
77 void setLog(libvlc_log_t *log)
78 { libvlc_log = log; };
79 libvlc_log_t* getLog()
80 { return libvlc_log; };
82 WNDPROC getWindowProc()
83 { return pf_wndproc; };
84 void setWindowProc(WNDPROC wndproc)
85 { pf_wndproc = wndproc; };
89 int setSize(unsigned width, unsigned height);
92 uint16 i_npmode; /* either NP_EMBED or NP_FULL */
94 /* plugin properties */
101 libvlc_instance_t *libvlc_instance;
102 libvlc_log_t *libvlc_log;
103 NPClass *p_scriptClass;
105 /* browser reference */
109 /* display settings */
115 unsigned int i_width, i_height;
119 /*******************************************************************************
121 ******************************************************************************/
122 #define PLUGIN_NAME "VLC Multimedia Plugin"
123 #define PLUGIN_DESCRIPTION \
124 "Version %s, copyright 1996-2007 The VideoLAN Team" \
125 "<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
127 #define PLUGIN_MIMETYPES \
128 /* MPEG-1 and MPEG-2 */ \
129 "audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
130 "audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
131 "video/mpeg:mpg,mpeg,mpe:MPEG video;" \
132 "video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
133 "video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
134 "video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
136 "video/mpeg4:mp4,mpg4:MPEG-4 video;" \
137 "audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
138 "application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
139 "application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
141 "video/x-msvideo:avi:AVI video;" \
143 "video/quicktime:mov,qt:QuickTime video;" \
145 "application/x-ogg:ogg:Ogg stream;" \
146 "application/ogg:ogg:Ogg stream;" \
148 "application/x-vlc-plugin:vlc:VLC plugin;" \
149 /* Windows Media */ \
150 "video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
151 "video/x-ms-asf:asf,asx:Windows Media Video;" \
152 "application/x-mplayer2::Windows Media;" \
153 "video/x-ms-wmv:wmv:Windows Media;" \
155 "application/x-google-vlc-plugin::Google VLC plugin;" \
157 "audio/wav:wav:WAV audio;" \
158 "audio/x-wav:wav:WAV audio;" \
160 "audio/3gpp:3gp,3gpp:3GPP audio;" \
161 "video/3gpp:3gp,3gpp:3GPP video;" \
163 "audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
164 "video/3gpp2:3g2,3gpp2:3GPP2 video;" \