fbvideo.h

Go to the documentation of this file.
00001 #ifndef __FBVIDEO_H__
fbvideo.h
00002 #define __FBVIDEO_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
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 // FBVideo
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     //--- Video (generic) properties.
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     //--- Video (clip) properties
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 // FBVideoMemory
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 // FBVideoIn
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 // FBVideoOut
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 // FBVideoSwitcher
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 // FBPropertyListVideoClip
00369 class FBSDK_DLL FBPropertyListVideoClip : public FBPropertyListComponent
00370 {
00371 public:
00372     FBPropertyListVideoClip();
00377     FBVideoClip* operator[](int pIndex);
00378 };
00379 
00381 // FBPropertyListVideoIn
00384 class FBSDK_DLL FBPropertyListVideoIn : public FBPropertyListComponent
00385 {
00386 public:
00387     FBPropertyListVideoIn();
00392     FBVideoIn* operator[](int pIndex);
00393 };
00394 
00396 // FBPropertyListVideoOut
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

Please send us your comments about this page.