00001 #ifndef __FBVIDEO_H__
00002 #define __FBVIDEO_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045
00048 #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050
00051 #include <fbsdk/fbcomponent.h>
00052 #include <fbsdk/fbcore.h>
00053
00054 #ifdef FBSDKUseNamespace
00055 namespace FBSDKNamespace {
00056 #endif
00057
00058 FB_DEFINE_COMPONENT( FBSDK_DLL, Video );
00059 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoIn );
00060 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoOut );
00061 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoClip );
00062 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoSwitcher );
00063
00068 #define FBVideoDeclare( ClassName, Parent ) \
00069 FBClassDeclare( ClassName,Parent ); \
00070 public: \
00071 ClassName(char * pName):Parent(pName) { FBClassInit; } \
00072 private:
00073
00077 #define FBVideoImplementation( ThisComponent ) \
00078 FBClassImplementation( ThisComponent )
00079
00081
00083 __FB_FORWARD( FBVideo );
00084 __FB_FORWARD( FBVideoClip );
00085
00087 enum FBVideoProxyMode {
00088 kFBVideoProxyNone,
00089 kFBVideoProxyOnPlay,
00090 kFBVideoProxyAlways
00091 };
00092
00094 enum FBVideoStorageMode {
00095 kFBVideoStorageDisk,
00096 kFBVideoStorageMemory,
00097 kFBVideoStorageFreeRunning
00098 };
00099
00101 enum FBVideoInterlaceMode {
00102 kFBVideoInterlaceNone,
00103 kFBVideoInterlaceHalfFrameEven,
00104 kFBVideoInterlaceHalfFrameOdd,
00105 kFBVideoInterlaceFullFrameEven,
00106 kFBVideoInterlaceFullFrameOdd
00107 };
00108
00110 enum FBVideoFormat {
00111 kFBVideoFormat_Any,
00112 kFBVideoFormat_Other,
00113 kFBVideoFormat_RGBA_32,
00114 kFBVideoFormat_RGB_24,
00115 kFBVideoFormat_BGRA_32,
00116 kFBVideoFormat_BGR_24,
00117 kFBVideoFormat_BGR_16,
00118 kFBVideoFormat_ABGR_32,
00119 kFBVideoFormat_ARGB_32,
00120 kFBVideoFormat_422
00121 };
00122
00123
00124 FB_DEFINE_ENUM( FBSDK_DLL, VideoProxyMode );
00125 FB_DEFINE_ENUM( FBSDK_DLL, VideoStorageMode );
00126 FB_DEFINE_ENUM( FBSDK_DLL, VideoInterlaceMode );
00127 FB_DEFINE_ENUM( FBSDK_DLL, VideoFormat );
00128
00144 class FBSDK_DLL FBVideo : public FBBox {
00145 __FBClassDeclare( FBVideo,FBBox );
00146 public:
00154 FBVideo(char *pName, HIObject pObject=NULL);
00155 };
00156
00157 class FBSDK_DLL FBVideoClip : public FBVideo {
00158 __FBClassDeclare( FBVideoClip,FBVideo );
00159 public:
00167 FBVideoClip(char *pName, HIObject pObject=NULL);
00168
00169 virtual void FBDelete();
00170
00174 bool IsValid();
00175
00176
00177 FBPropertyString Filename;
00178 FBPropertyString RelativePath;
00179 FBPropertyVideoProxyMode ProxyMode;
00180 FBPropertyVideoStorageMode StorageMode;
00181 FBPropertyInt Width;
00182 FBPropertyInt Height;
00183 FBPropertyInt PowerOfTwoWidth;
00184 FBPropertyInt PowerOfTwoHeight;
00185 FBPropertyVideoInterlaceMode InterlaceMode;
00186 FBPropertyVideoFormat Format;
00187
00188
00189 FBPropertyTime TimeOffset;
00190 FBPropertyInt StartFrame;
00191 FBPropertyInt StopFrame;
00192 FBPropertyDouble FPS;
00193 FBPropertyDouble PlaySpeed;
00194 FBPropertyBool FreeRunning;
00195 FBPropertyBool Loop;
00196
00197 FBPropertyTime FrameTime;
00198 FBPropertyInt CurrentFrame;
00199 FBPropertyInt LastFrame;
00200 FBPropertyTime LastFrameTime;
00201 FBPropertyTime CurrentFrameTime;
00202
00210 virtual void DrawImage(int pX = 0, int pY = 0, int pW = -1, int pH = -1, int pFrame = -1);
00211
00216 virtual unsigned char* GetImage(int pFrame = -1 );
00217
00221 virtual unsigned char* GetPowerOfTwoImage();
00222
00226 int GetTextureID();
00227 };
00228
00230
00232 __FB_FORWARD( FBVideoMemory );
00233
00235 class FBSDK_DLL FBVideoMemory : public FBVideo {
00236 __FBClassDeclare( FBVideoMemory,FBVideo );
00237 public:
00242 FBVideoMemory(char *pName, HIObject pObject=NULL);
00243
00248 virtual void SetObjectImageSize(int pW,int pH);
00249
00250 FBPropertyInt TextureOGLId;
00251 };
00252
00254
00256 __FB_FORWARD( FBVideoIn );
00257
00259 class FBSDK_DLL FBVideoIn : public FBVideo {
00260 __FBClassDeclare( FBVideoIn, FBVideo );
00261 public:
00265 FBVideoIn(HIObject pObject=NULL);
00266 };
00267
00269
00271 __FB_FORWARD( FBVideoOut );
00272
00274 class FBSDK_DLL FBVideoOut : public FBVideo {
00275 __FBClassDeclare( FBVideoOut, FBVideo );
00276 public:
00280 FBVideoOut(HIObject pObject=NULL);
00281 };
00282
00283
00285
00287 __FB_FORWARD( FBVideoSwitcher );
00288 __FB_FORWARD( FBEventVideoSwitcher );
00289
00291 enum FBClipEnd {
00292 kFBClipEndEnd,
00293 kFBClipEndLoop
00294 };
00296 enum FBPlayMode {
00297 kFBPlayModeNoPlay,
00298 kFBPlayModePreviewToEnd,
00299 kFBPlayModePlay,
00300 kFBPlayModeLoop,
00301 kFBPlayModePlayToEnd
00302 };
00303
00304 FB_DEFINE_ENUM( FBSDK_DLL, ClipEnd );
00305 FB_DEFINE_ENUM( FBSDK_DLL, PlayMode );
00306
00308 class FBSDK_DLL FBEventVideoSwitcher : public FBEvent
00309 {
00310 public:
00314 FBEventVideoSwitcher( HKEventBase pEvent );
00315
00316 FBPropertyVideoSwitcher VideoSwitcher;
00317 FBPropertykReference Reference;
00318 FBPropertyClipEnd EndType;
00319 };
00320
00322 class FBSDK_DLL FBVideoSwitcher : public FBVideo
00323 {
00324 __FBClassDeclare( FBVideoSwitcher, FBVideo );
00325 public:
00330 FBVideoSwitcher( char* pName = NULL, HIObject pObject = NULL );
00331
00334 virtual void ResetVideoSwitcher();
00337 virtual void FinishCurrentVideo();
00340 virtual void PrepareNextFrame();
00344 virtual void SwapCurrent( HFBVideo pVideo );
00349 virtual void SetNextClip( HFBVideo pVideo, FBPlayMode pMode );
00350
00353 virtual bool IsSDKSwitcher();
00354
00355 FBPropertyInt CurrentFrame;
00356 FBPropertyPlayMode PlayMode;
00357 FBPropertyTime TimeRemaining;
00358
00359 FBPropertyVideo CurrentVideo;
00360 FBPropertyEvent OnClipEnd;
00361 FBPropertyDevice DeviceOwner;
00362 FBPropertyBool UsingSystemTime;
00363 };
00364
00366
00369 class FBSDK_DLL FBPropertyListVideoClip : public FBPropertyListComponent
00370 {
00371 public:
00372 FBPropertyListVideoClip();
00377 FBVideoClip* operator[](int pIndex);
00378 };
00379
00381
00384 class FBSDK_DLL FBPropertyListVideoIn : public FBPropertyListComponent
00385 {
00386 public:
00387 FBPropertyListVideoIn();
00392 FBVideoIn* operator[](int pIndex);
00393 };
00394
00396
00399 class FBSDK_DLL FBPropertyListVideoOut : public FBPropertyListComponent
00400 {
00401 public:
00402 FBPropertyListVideoOut();
00407 FBVideoOut* operator[](int pIndex);
00408 };
00409
00410 #ifdef FBSDKUseNamespace
00411 }
00412 #endif
00413 #endif