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, VideoClipImage );
00063 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoSwitcher );
00064
00069 #define FBVideoDeclare( ClassName, Parent ) \
00070 FBClassDeclare( ClassName,Parent ); \
00071 public: \
00072 ClassName(const char* pName):Parent(pName) { FBClassInit; } \
00073 private:
00074
00078 #define FBVideoImplementation( ThisComponent ) \
00079 FBClassImplementation( ThisComponent )
00080
00082
00084 __FB_FORWARD( FBVideo );
00085 __FB_FORWARD( FBVideoClip );
00086
00088 enum FBVideoProxyMode {
00089 kFBVideoProxyNone,
00090 kFBVideoProxyOnPlay,
00091 kFBVideoProxyAlways
00092 };
00093
00095 enum FBVideoStorageMode {
00096 kFBVideoStorageDisk,
00097 kFBVideoStorageMemory,
00098 kFBVideoStorageDiskAsync
00099 };
00100
00102 enum FBVideoInterlaceMode {
00103 kFBVideoInterlaceNone,
00104 kFBVideoInterlaceHalfFrameEven,
00105 kFBVideoInterlaceHalfFrameOdd,
00106 kFBVideoInterlaceFullFrameEven,
00107 kFBVideoInterlaceFullFrameOdd
00108 };
00109
00111 enum FBVideoFormat {
00112 kFBVideoFormat_Any,
00113 kFBVideoFormat_Other,
00114 kFBVideoFormat_RGBA_32,
00115 kFBVideoFormat_RGB_24,
00116 kFBVideoFormat_BGRA_32,
00117 kFBVideoFormat_BGR_24,
00118 kFBVideoFormat_BGR_16,
00119 kFBVideoFormat_ABGR_32,
00120 kFBVideoFormat_ARGB_32,
00121 kFBVideoFormat_422
00122 };
00123
00125 enum FBVideoResolution
00126 {
00127 kFBVideo_RES_FULL = 0,
00128 kFBVideo_RES_1,
00129 kFBVideo_RES_2,
00130 kFBVideo_RES_4,
00131 kFBVideo_RES_8,
00132 kFBVideo_RES_16,
00133 kFBVideo_RES_32,
00134 kFBVideo_RES_64,
00135 kFBVideo_RES_128,
00136 kFBVideo_RES_256,
00137 kFBVideo_RES_512,
00138 kFBVideo_RES_1K,
00139 kFBVideo_RES_2K,
00140 kFBVideo_RES_4K,
00141 kFBVideo_RES_8K,
00142 kFBVideo_RES_16K
00143 };
00144
00145 FB_DEFINE_ENUM( FBSDK_DLL, TimeMode );
00146 FB_DEFINE_ENUM( FBSDK_DLL, VideoProxyMode );
00147 FB_DEFINE_ENUM( FBSDK_DLL, VideoStorageMode );
00148 FB_DEFINE_ENUM( FBSDK_DLL, VideoInterlaceMode );
00149 FB_DEFINE_ENUM( FBSDK_DLL, VideoFormat );
00150 FB_DEFINE_ENUM( FBSDK_DLL, VideoResolution );
00151
00167 class FBSDK_DLL FBVideo : public FBBox {
00168 __FBClassDeclare( FBVideo,FBBox );
00169 public:
00177 FBVideo(const char* pName, HIObject pObject=NULL);
00178
00179 FBPropertyBool KeepOnGPU;
00180 };
00181
00182 class FBSDK_DLL FBVideoClip : public FBVideo {
00183 __FBClassDeclare( FBVideoClip,FBVideo );
00184 public:
00192 FBVideoClip(const char* pName, HIObject pObject=NULL);
00193
00194 virtual void FBDelete();
00195
00199 bool IsValid();
00200
00201
00202 FBPropertyString Filename;
00203 FBPropertyString RelativePath;
00204 FBPropertyVideoProxyMode ProxyMode;
00205 FBPropertyVideoStorageMode StorageMode;
00206 FBPropertyInt Width;
00207 FBPropertyInt Height;
00208 FBPropertyInt PowerOfTwoWidth;
00209 FBPropertyInt PowerOfTwoHeight;
00210 FBPropertyVideoInterlaceMode InterlaceMode;
00211 FBPropertyVideoFormat Format;
00212
00213
00214 FBPropertyTime TimeOffset;
00215 FBPropertyInt StartFrame;
00216 FBPropertyInt StopFrame;
00217 FBPropertyDouble FrameRate;
00218 FBPropertyDouble PlaySpeed;
00219 FBPropertyBool FreeRunning;
00220 FBPropertyBool Loop;
00221
00222 FBPropertyTime FrameTime;
00223 FBPropertyInt CurrentFrame;
00224 FBPropertyInt LastFrame;
00225 FBPropertyTime LastFrameTime;
00226 FBPropertyTime CurrentFrameTime;
00227
00235 virtual void DrawImage(int pX = 0, int pY = 0, int pW = -1, int pH = -1, int pFrame = -1);
00236
00241 virtual unsigned char* GetImage(int pFrame = -1 );
00242
00245 virtual void ImageIncUpdateID();
00246
00250 virtual unsigned char* GetPowerOfTwoImage();
00251
00255 int GetTextureID();
00256 };
00257
00258 __FB_FORWARD( FBVideoClipImage );
00259
00260 class FBSDK_DLL FBVideoClipImage : public FBVideoClip {
00261 __FBClassDeclare( FBVideoClipImage,FBVideoClip );
00262 public:
00267 FBVideoClipImage(const char* pName, HIObject pObject=NULL);
00268
00275 FBPropertyBool ImageSequence;
00276 FBPropertyBool UseSystemFrameRate;
00277 FBPropertyVideoResolution MaxMipMapResolution;
00278 };
00279
00281
00283 __FB_FORWARD( FBVideoMemory );
00284
00293 class FBSDK_DLL FBVideoMemory : public FBVideo {
00294 __FBClassDeclare( FBVideoMemory,FBVideo );
00295 public:
00300 FBVideoMemory(const char* pName, HIObject pObject=NULL);
00301
00306 virtual void SetObjectImageSize(int pW,int pH);
00307
00308 FBPropertyInt TextureOGLId;
00309 };
00310
00312
00314 __FB_FORWARD( FBVideoIn );
00315
00317 enum FBVideoLiveType {
00318 kFBVideoLiveDefault,
00319 kFBVideoLiveBasic
00320 };
00321
00323 class FBSDK_DLL FBVideoIn : public FBVideo {
00324 __FBClassDeclare( FBVideoIn, FBVideo );
00325 public:
00329 FBVideoIn(HIObject pObject=NULL);
00330
00331 FBPropertyBool Online;
00332 FBPropertyBool Recording;
00333 FBPropertyBool RecordAudio;
00334 FBPropertyString FilePath;
00335
00340 virtual bool LiveSetCompressor(int pCompressorIndex);
00341
00345 virtual int LiveGetCompressor();
00346
00350 virtual int LiveGetCompressorCount();
00351
00355 virtual const char* LiveGetCompressorName(int pCompressorIndex);
00356
00360 virtual void LiveSetResolutionFR(int pIndex);
00361
00365 virtual int LiveGetResolutionFR();
00366
00370 virtual int LiveGetResolutionFRCount();
00371
00376 virtual const char* LiveGetResolutionFRName(int pIndex);
00377
00381 virtual FBVideoLiveType LiveGetType();
00382 };
00383
00385
00387 __FB_FORWARD( FBVideoOut );
00388
00390 class FBSDK_DLL FBVideoOut : public FBVideo {
00391 __FBClassDeclare( FBVideoOut, FBVideo );
00392 public:
00396 FBVideoOut(HIObject pObject=NULL);
00397 FBPropertyBool Online;
00398 };
00399
00400
00402
00404 __FB_FORWARD( FBVideoSwitcher );
00405 __FB_FORWARD( FBEventVideoSwitcher );
00406
00408 enum FBClipEnd {
00409 kFBClipEndEnd,
00410 kFBClipEndLoop
00411 };
00413 enum FBPlayMode {
00414 kFBPlayModeNoPlay,
00415 kFBPlayModePreviewToEnd,
00416 kFBPlayModePlay,
00417 kFBPlayModeLoop,
00418 kFBPlayModePlayToEnd
00419 };
00420
00421 FB_DEFINE_ENUM( FBSDK_DLL, ClipEnd );
00422 FB_DEFINE_ENUM( FBSDK_DLL, PlayMode );
00423
00425 class FBSDK_DLL FBEventVideoSwitcher : public FBEvent
00426 {
00427 public:
00431 FBEventVideoSwitcher( HKEventBase pEvent );
00432
00433 FBPropertyVideoSwitcher VideoSwitcher;
00434 FBPropertykReference Reference;
00435 FBPropertyClipEnd EndType;
00436 };
00437
00439 class FBSDK_DLL FBVideoSwitcher : public FBVideo
00440 {
00441 __FBClassDeclare( FBVideoSwitcher, FBVideo );
00442 public:
00447 FBVideoSwitcher( const char* pName = NULL, HIObject pObject = NULL );
00448
00451 virtual void ResetVideoSwitcher();
00454 virtual void FinishCurrentVideo();
00457 virtual void PrepareNextFrame();
00461 virtual void SwapCurrent( FBVideo* pVideo );
00466 virtual void SetNextClip( FBVideo* pVideo, FBPlayMode pMode );
00467
00470 virtual bool IsSDKSwitcher();
00471
00472 FBPropertyInt CurrentFrame;
00473 FBPropertyPlayMode PlayMode;
00474 FBPropertyTime TimeRemaining;
00475
00476 FBPropertyVideo CurrentVideo;
00477 FBPropertyEvent OnClipEnd;
00478 FBPropertyDevice DeviceOwner;
00479 FBPropertyBool UsingSystemTime;
00480 };
00481
00483
00486 class FBSDK_DLL FBPropertyListVideoClip : public FBPropertyListComponent
00487 {
00488 public:
00489 FBPropertyListVideoClip();
00494 FBVideoClip* operator[](int pIndex);
00495 };
00496
00498
00501 class FBSDK_DLL FBPropertyListVideoIn : public FBPropertyListComponent
00502 {
00503 public:
00504 FBPropertyListVideoIn();
00509 FBVideoIn* operator[](int pIndex);
00510 };
00511
00513
00516 class FBSDK_DLL FBPropertyListVideoOut : public FBPropertyListComponent
00517 {
00518 public:
00519 FBPropertyListVideoOut();
00524 FBVideoOut* operator[](int pIndex);
00525 };
00526
00527 #ifdef FBSDKUseNamespace
00528 }
00529 #endif
00530 #endif