forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvlcplugin.h
166 lines (147 loc) · 5.36 KB
/
vlcplugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*****************************************************************************
* vlcplugin.h: a VLC plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002-2006 the VideoLAN team
* $Id$
*
* Authors: Samuel Hocevar <[email protected]>
Damien Fouilleul <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*******************************************************************************
* Instance state information about the plugin.
******************************************************************************/
#ifndef __VLCPLUGIN_H__
#define __VLCPLUGIN_H__
#include <vlc/libvlc.h>
#include <npapi.h>
#include "control/nporuntime.h"
#if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
#define XP_UNIX 1
#elif defined(XP_MACOSX)
#undef XP_UNIX
#endif
#ifdef XP_WIN
/* Windows stuff */
#endif
#ifdef XP_MACOSX
/* Mac OS X stuff */
# include <Quickdraw.h>
#endif
#ifdef XP_UNIX
/* X11 stuff */
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# include <X11/StringDefs.h>
#endif
class VlcPlugin
{
public:
VlcPlugin( NPP, uint16 );
virtual ~VlcPlugin();
NPError init(int argc, char* const argn[], char* const argv[]);
libvlc_instance_t* getVLC()
{ return libvlc_instance; };
NPP getBrowser()
{ return p_browser; };
char* getAbsoluteURL(const char *url);
NPWindow& getWindow()
{ return npwindow; };
void setWindow(const NPWindow &window)
{ npwindow = window; };
NPClass* getScriptClass()
{ return p_scriptClass; };
void setLog(libvlc_log_t *log)
{ libvlc_log = log; };
libvlc_log_t* getLog()
{ return libvlc_log; };
#if XP_WIN
WNDPROC getWindowProc()
{ return pf_wndproc; };
void setWindowProc(WNDPROC wndproc)
{ pf_wndproc = wndproc; };
#endif
#if XP_UNIX
int setSize(unsigned width, unsigned height);
#endif
uint16 i_npmode; /* either NP_EMBED or NP_FULL */
/* plugin properties */
int b_stream;
int b_autoplay;
char * psz_target;
private:
/* VLC reference */
libvlc_instance_t *libvlc_instance;
libvlc_log_t *libvlc_log;
NPClass *p_scriptClass;
/* browser reference */
NPP p_browser;
char* psz_baseURL;
/* display settings */
NPWindow npwindow;
#if XP_WIN
WNDPROC pf_wndproc;
#endif
#if XP_UNIX
unsigned int i_width, i_height;
#endif
};
/*******************************************************************************
* Plugin properties.
******************************************************************************/
#define PLUGIN_NAME "VLC Multimedia Plugin"
#define PLUGIN_DESCRIPTION \
"Version %s, copyright 1996-2007 The VideoLAN Team" \
"<br><a href=\"http://www.videolan.org/\">http://www.videolan.org/</a>"
#define PLUGIN_MIMETYPES \
/* MPEG-1 and MPEG-2 */ \
"audio/mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
"audio/x-mpeg:mp2,mp3,mpga,mpega:MPEG audio;" \
"video/mpeg:mpg,mpeg,mpe:MPEG video;" \
"video/x-mpeg:mpg,mpeg,mpe:MPEG video;" \
"video/mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
"video/x-mpeg-system:mpg,mpeg,mpe,vob:MPEG video;" \
/* MPEG-4 */ \
"video/mpeg4:mp4,mpg4:MPEG-4 video;" \
"audio/mpeg4:mp4,mpg4:MPEG-4 audio;" \
"application/mpeg4-iod:mp4,mpg4:MPEG-4 video;" \
"application/mpeg4-muxcodetable:mp4,mpg4:MPEG-4 video;" \
/* AVI */ \
"video/x-msvideo:avi:AVI video;" \
/* QuickTime */ \
"video/quicktime:mov,qt:QuickTime video;" \
/* OGG */ \
"application/x-ogg:ogg:Ogg stream;" \
"application/ogg:ogg:Ogg stream;" \
/* VLC */ \
"application/x-vlc-plugin:vlc:VLC plugin;" \
/* Windows Media */ \
"video/x-ms-asf-plugin:asf,asx:Windows Media Video;" \
"video/x-ms-asf:asf,asx:Windows Media Video;" \
"application/x-mplayer2::Windows Media;" \
"video/x-ms-wmv:wmv:Windows Media;" \
/* Google VLC */ \
"application/x-google-vlc-plugin::Google VLC plugin;" \
/* WAV audio */ \
"audio/wav:wav:WAV audio;" \
"audio/x-wav:wav:WAV audio;" \
/* 3GPP */ \
"audio/3gpp:3gp,3gpp:3GPP audio;" \
"video/3gpp:3gp,3gpp:3GPP video;" \
/* 3GPP2 */ \
"audio/3gpp2:3g2,3gpp2:3GPP2 audio;" \
"video/3gpp2:3g2,3gpp2:3GPP2 video;" \
#endif