00001 #ifndef __FBVIDEOGRABBER_H__
00002 #define __FBVIDEOGRABBER_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/fbaudiofmt.h>
00053 #include <fbsdk/fbimage.h>
00054
00055 #ifdef FBSDKUseNamespace
00056 namespace FBSDKNamespace {
00057 #endif
00058
00059 __FB_FORWARD( FBVideoGrabber );
00060 FB_DEFINE_COMPONENT( FBSDK_DLL, VideoGrabber );
00061
00063 enum FBVideoRenderViewingMode {
00064 FBViewingModeStandard,
00065 FBViewingModeModelsOnly,
00066 FBViewingModeXRay,
00067 FBViewingModeCurrent,
00068 FBViewingModeCount
00069 };
00071 enum FBVideoRenderFieldMode {
00072 FBFieldModeNoField,
00073 FBFieldModeField0,
00074 FBFieldModeField1,
00075 FBFieldModeHalfField0,
00076 FBFieldModeHalfField1,
00077 FBFieldModeCount
00078 };
00080 enum FBVideoRenderDepth {
00081 FBVideoRender24Bits,
00082 FBVideoRender32Bits,
00083 FBVideoRenderDepthCount
00084 };
00085
00089 struct FBVideoGrabOptions
00090 {
00091 FBTimeSpan mTimeSpan;
00092 FBTime mTimeSteps;
00093 FBCameraResolutionMode mCameraResolution;
00094 FBVideoRenderDepth mBitsPerPixel;
00095 FBVideoRenderFieldMode mFieldMode;
00096 FBVideoRenderViewingMode mViewingMode;
00097 FBString mOutputFileName;
00098 bool mShowSafeArea;
00099 bool mShowTimeCode;
00100 bool mShowCameraLabel;
00101 bool mAntiAliasing;
00102 bool mRenderAudio;
00103 FBAudioFmt mAudioRenderFormat;
00104 int mStillImageCompression;
00105 };
00107 typedef FBVideoGrabOptions* HFBVideoGrabOptions;
00108
00112 struct FBVideoGrabStats
00113 {
00114 int mTotalFrameCount;
00115 int mRemainingFrameCount;
00116 FBTime mTotalTimeElapsed;
00117 FBTime mEstimatedTime;
00118 FBTime mEstimatedTimeRemaining;
00119 FBTime mTimePerFrame;
00120 };
00121
00125 class FBSDK_DLL FBVideoGrabber : public FBComponent
00126 {
00127
00128 __FBClassDeclare(FBVideoGrabber, FBComponent);
00129 public:
00130
00134 FBVideoGrabber(HIObject pObject=NULL);
00135
00136
00140 void SetOptions(HFBVideoGrabOptions pOptions);
00141
00145 FBVideoGrabOptions GetOptions();
00146
00150 void ResetOptions();
00151
00152
00159 void SetRefreshViewFunc(void* pThis, void(*pCallbackFuncPtr)(void*));
00160
00167 void SetPostRenderFrameCallback(void* pThis, void(*pCallbackFuncPtr)(void*));
00168
00169
00175 bool BeginGrab();
00176
00180 void Grab();
00181
00185 void EndGrab();
00186
00200 HFBImage RenderSnapshot(int pWidth=-1, int pHeight=-1, bool pCameraLabel=false, bool pTimeCode=false, bool pSafeArea=false, bool pAxis=false, bool pGrid=false, bool pFrontPlate=false, bool pBackPlate=false);
00201
00202
00206 FBVideoGrabStats GetStatistics();
00207
00208
00212 FBString GetLastErrorMsg();
00213 };
00214
00215
00216 #ifdef FBSDKUseNamespace
00217 }
00218 #endif
00219 #endif