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
00269 FBPropertyBool ImageSequence;
00270 FBPropertyBool UseSystemFrameRate;
00271 FBPropertyVideoResolution MaxMipMapResolution;
00272 };
00273
00275
00277 __FB_FORWARD( FBVideoMemory );
00278
00280 class FBSDK_DLL FBVideoMemory : public FBVideo {
00281 __FBClassDeclare( FBVideoMemory,FBVideo );
00282 public:
00287 FBVideoMemory(const char* pName, HIObject pObject=NULL);
00288
00293 virtual void SetObjectImageSize(int pW,int pH);
00294
00295 FBPropertyInt TextureOGLId;
00296 };
00297
00299
00301 __FB_FORWARD( FBVideoIn );
00302
00304 enum FBVideoLiveType {
00305 kFBVideoLiveDefault,
00306 kFBVideoLiveBasic
00307 };
00308
00310 class FBSDK_DLL FBVideoIn : public FBVideo {
00311 __FBClassDeclare( FBVideoIn, FBVideo );
00312 public:
00316 FBVideoIn(HIObject pObject=NULL);
00317
00318 FBPropertyBool Online;
00319 FBPropertyBool Recording;
00320 FBPropertyBool RecordAudio;
00321 FBPropertyString FilePath;
00322
00327 virtual bool LiveSetCompressor(int pCompressorIndex);
00328
00332 virtual int LiveGetCompressor();
00333
00337 virtual int LiveGetCompressorCount();
00338
00342 virtual const char* LiveGetCompressorName(int pCompressorIndex);
00343
00347 virtual void LiveSetResolutionFR(int pIndex);
00348
00352 virtual int LiveGetResolutionFR();
00353
00357 virtual int LiveGetResolutionFRCount();
00358
00363 virtual const char* LiveGetResolutionFRName(int pIndex);
00364
00368 virtual FBVideoLiveType LiveGetType();
00369 };
00370
00372
00374 __FB_FORWARD( FBVideoOut );
00375
00377 class FBSDK_DLL FBVideoOut : public FBVideo {
00378 __FBClassDeclare( FBVideoOut, FBVideo );
00379 public:
00383 FBVideoOut(HIObject pObject=NULL);
00384 };
00385
00386
00388
00390 __FB_FORWARD( FBVideoSwitcher );
00391 __FB_FORWARD( FBEventVideoSwitcher );
00392
00394 enum FBClipEnd {
00395 kFBClipEndEnd,
00396 kFBClipEndLoop
00397 };
00399 enum FBPlayMode {
00400 kFBPlayModeNoPlay,
00401 kFBPlayModePreviewToEnd,
00402 kFBPlayModePlay,
00403 kFBPlayModeLoop,
00404 kFBPlayModePlayToEnd
00405 };
00406
00407 FB_DEFINE_ENUM( FBSDK_DLL, ClipEnd );
00408 FB_DEFINE_ENUM( FBSDK_DLL, PlayMode );
00409
00411 class FBSDK_DLL FBEventVideoSwitcher : public FBEvent
00412 {
00413 public:
00417 FBEventVideoSwitcher( HKEventBase pEvent );
00418
00419 FBPropertyVideoSwitcher VideoSwitcher;
00420 FBPropertykReference Reference;
00421 FBPropertyClipEnd EndType;
00422 };
00423
00425 class FBSDK_DLL FBVideoSwitcher : public FBVideo
00426 {
00427 __FBClassDeclare( FBVideoSwitcher, FBVideo );
00428 public:
00433 FBVideoSwitcher( const char* pName = NULL, HIObject pObject = NULL );
00434
00437 virtual void ResetVideoSwitcher();
00440 virtual void FinishCurrentVideo();
00443 virtual void PrepareNextFrame();
00447 virtual void SwapCurrent( HFBVideo pVideo );
00452 virtual void SetNextClip( HFBVideo pVideo, FBPlayMode pMode );
00453
00456 virtual bool IsSDKSwitcher();
00457
00458 FBPropertyInt CurrentFrame;
00459 FBPropertyPlayMode PlayMode;
00460 FBPropertyTime TimeRemaining;
00461
00462 FBPropertyVideo CurrentVideo;
00463 FBPropertyEvent OnClipEnd;
00464 FBPropertyDevice DeviceOwner;
00465 FBPropertyBool UsingSystemTime;
00466 };
00467
00469
00472 class FBSDK_DLL FBPropertyListVideoClip : public FBPropertyListComponent
00473 {
00474 public:
00475 FBPropertyListVideoClip();
00480 FBVideoClip* operator[](int pIndex);
00481 };
00482
00484
00487 class FBSDK_DLL FBPropertyListVideoIn : public FBPropertyListComponent
00488 {
00489 public:
00490 FBPropertyListVideoIn();
00495 FBVideoIn* operator[](int pIndex);
00496 };
00497
00499
00502 class FBSDK_DLL FBPropertyListVideoOut : public FBPropertyListComponent
00503 {
00504 public:
00505 FBPropertyListVideoOut();
00510 FBVideoOut* operator[](int pIndex);
00511 };
00512
00513 #ifdef FBSDKUseNamespace
00514 }
00515 #endif
00516 #endif