00001
00034 #ifndef LLMEDIABASE_H
00035 #define LLMEDIABASE_H
00036
00037
00038 #if LL_DARWIN
00039 #define LL_QUICKTIME_ENABLED 1
00040 #define LL_LLMOZLIB_ENABLED 1
00041 #elif LL_WINDOWS
00042 #define LL_QUICKTIME_ENABLED 1
00043 #define LL_LLMOZLIB_ENABLED 1
00044 #elif LL_LINUX
00045 #define LL_QUICKTIME_ENABLED 0
00046 #ifndef LL_LLMOZLIB_ENABLED
00047 #define LL_LLMOZLIB_ENABLED 1
00048 #endif // def LL_LLMOZLIB_ENABLED
00049 #elif LL_SOLARIS
00050 #define LL_QUICKTIME_ENABLED 0
00051 #ifndef LL_LLMOZLIB_ENABLED
00052 #define LL_LLMOZLIB_ENABLED 0
00053 #endif // def LL_LLMOZLIB_ENABLED
00054 #endif
00055
00056 #if LL_LLMOZLIB_ENABLED && !defined ( MOZILLA_INTERNAL_API )
00057
00058
00059
00060 #define MOZILLA_INTERNAL_API 1
00061 #endif
00062
00063 #include <string>
00064
00065 class LLMediaObserver;
00066 class LLMediaImplMakerBase;
00067
00068 class LLMediaBase
00069 {
00070 public:
00071 LLMediaBase() {};
00072 virtual ~LLMediaBase() {};
00073
00075
00076
00077
00078 virtual bool init() = 0;
00079
00080
00081 virtual bool reset() = 0;
00082
00083
00084 virtual bool setMimeType( const std::string mime_type ) = 0;
00085 virtual std::string getMimeType() const = 0;
00086
00087
00088
00089 virtual std::string getMediaURL() const = 0;
00090
00091
00092 virtual std::string getVersion() = 0;
00093
00094
00095 virtual bool set404RedirectUrl( std::string redirect_url ) = 0;
00096 virtual bool clr404RedirectUrl() = 0;
00097
00098
00099 virtual bool setBackgroundColor( unsigned int red, unsigned int green, unsigned int blue ) const = 0;
00100
00101
00102 virtual bool setCaretColor( unsigned int red, unsigned int green, unsigned int blue ) const = 0;
00103
00105
00106
00107
00108 virtual bool updateMedia() = 0;
00109
00110
00111 virtual bool setRequestedMediaSize( int media_width, int media_height ) = 0;
00112
00113
00114 virtual int getMediaWidth() const = 0;
00115
00116
00117 virtual int getMediaHeight() const = 0;
00118
00119
00120 virtual bool setMediaDepth( int media_depth ) = 0;
00121
00122
00123 virtual int getMediaDepth() const = 0;
00124
00125
00126 virtual int getMediaBufferSize() const = 0;
00127
00128
00129 virtual unsigned char* getMediaData() = 0;
00130
00131
00132 virtual int getMediaDataWidth() const = 0;
00133 virtual int getMediaDataHeight() const = 0;
00134
00136
00137
00138
00139 virtual int getTextureFormatInternal() const = 0;
00140
00141
00142 virtual int getTextureFormatPrimary() const = 0;
00143
00144
00145 virtual int getTextureFormatType() const = 0;
00146
00147
00148
00149
00151
00152
00153
00154 virtual bool setVolume( float volume ) = 0;
00155 virtual float getVolume() const = 0;
00156
00157
00159
00160 enum ECommand {
00161 COMMAND_NONE = 0,
00162 COMMAND_STOP = 1,
00163 COMMAND_START = 2,
00164 COMMAND_PAUSE = 4,
00165 COMMAND_BACK = 5,
00166 COMMAND_FORWARD = 6
00167 };
00168 enum EStatus {
00169 STATUS_UNKNOWN = 0,
00170 STATUS_INITIALIZING = 1,
00171 STATUS_NAVIGATING = 2,
00172 STATUS_STARTED = 3,
00173 STATUS_STOPPED = 4,
00174 STATUS_PAUSED = 6,
00175 STATUS_RESETTING = 7
00176 };
00177 virtual bool addCommand( ECommand cmd ) = 0;
00178 virtual bool clearCommand() = 0;
00179 virtual bool updateCommand() = 0;
00180 virtual EStatus getStatus() = 0;
00181 virtual bool seek( double time ) = 0;
00182 virtual bool setLooping( bool enable) = 0;
00183 virtual bool isLooping() = 0;
00184
00186
00187
00188
00189 virtual bool setAutoScaled( bool auto_scaled ) = 0;
00190 virtual bool isAutoScaled() const = 0;
00191
00192
00194
00195 virtual bool mouseDown( int x_pos, int y_pos ) = 0;
00196 virtual bool mouseUp( int x_pos, int y_pos ) = 0;
00197 virtual bool mouseMove( int x_pos, int y_pos ) = 0;
00198 virtual bool keyPress( int key_code ) = 0;
00199 virtual bool scrollByLines( int lines ) = 0;
00200 virtual bool focus( bool focus ) = 0;
00201 virtual bool unicodeInput( unsigned long uni_char ) = 0;
00202 virtual bool mouseLeftDoubleClick( int x_pos, int y_pos ) = 0;
00203
00204
00206
00207 virtual bool navigateTo( const std::string url ) = 0;
00208 virtual bool navigateForward() = 0;
00209 virtual bool navigateBack() = 0;
00210 virtual bool canNavigateForward() = 0;
00211 virtual bool canNavigateBack() = 0;
00212
00214
00215 virtual bool enableCookies( bool enable ) = 0;
00216 virtual bool clearCache() = 0;
00217 virtual bool clearCookies() = 0;
00218
00220
00221 virtual bool enableProxy(bool enable, std::string proxy_host_name, int proxy_port) = 0;
00222
00224
00225 virtual bool addObserver( LLMediaObserver* subject ) = 0;
00226 virtual bool remObserver( LLMediaObserver* subject ) = 0;
00227
00229
00230 virtual void setImplMaker(LLMediaImplMakerBase* impl_maker) = 0;
00231
00233
00234 virtual bool supportsMediaType(std::string scheme, std::string type) = 0;
00235 };
00236
00238
00239 const unsigned long LL_MEDIA_KEY_BACKSPACE = 0x08;
00240 const unsigned long LL_MEDIA_KEY_TAB = 0x09;
00241 const unsigned long LL_MEDIA_KEY_RETURN = 0x0D;
00242 const unsigned long LL_MEDIA_KEY_PAD_RETURN = 0x0E;
00243 const unsigned long LL_MEDIA_KEY_ESCAPE = 0x1B;
00244 const unsigned long LL_MEDIA_KEY_PAGE_UP = 0x21;
00245 const unsigned long LL_MEDIA_KEY_PAGE_DOWN = 0x22;
00246 const unsigned long LL_MEDIA_KEY_END = 0x23;
00247 const unsigned long LL_MEDIA_KEY_HOME = 0x24;
00248 const unsigned long LL_MEDIA_KEY_LEFT = 0x25;
00249 const unsigned long LL_MEDIA_KEY_UP = 0x26;
00250 const unsigned long LL_MEDIA_KEY_RIGHT = 0x27;
00251 const unsigned long LL_MEDIA_KEY_DOWN = 0x28;
00252 const unsigned long LL_MEDIA_KEY_INSERT = 0x2D;
00253 const unsigned long LL_MEDIA_KEY_DELETE = 0x2E;
00254
00256
00257 const int LL_MEDIA_UNSIGNED_BYTE = 0x1401;
00258 const int LL_MEDIA_RGB = 0x1907;
00259 const int LL_MEDIA_RGBA = 0x1908;
00260 const int LL_MEDIA_RGB8 = 0x8051;
00261 const int LL_MEDIA_UNSIGNED_INT_8_8_8_8 = 0x8035;
00262 const int LL_MEDIA_UNSIGNED_INT_8_8_8_8_REV = 0x8367;
00263 const int LL_MEDIA_BGR = 0x80E0;
00264 const int LL_MEDIA_BGRA = 0x80E1;
00265
00266
00267 #endif // LLMEDIABASE_H