3 #include "IAttributeFields.h" 4 #include "IMovieCodec.h" 31 IMovieCodec* GetMovieCodec(
bool bCreateIfNotExist =
true);
46 ATTRIBUTE_METHOD1(
CMoviePlatform, video_encode_example_s,
const char*) { cls->video_encode_example(p1);
return S_OK; }
48 ATTRIBUTE_METHOD1(
CMoviePlatform, GetCodec_s,
int*) { *p1 = cls->GetCodec();
return S_OK; }
49 ATTRIBUTE_METHOD1(
CMoviePlatform, SetCodec_s,
int) { cls->SetCodec(p1);
return S_OK; }
51 ATTRIBUTE_METHOD1(
CMoviePlatform, GetMarginLeft_s,
int*) { *p1 = cls->MarginLeft();
return S_OK; }
52 ATTRIBUTE_METHOD1(
CMoviePlatform, SetMarginLeft_s,
int) { cls->MarginLeft(p1);
return S_OK; }
54 ATTRIBUTE_METHOD1(
CMoviePlatform, GetMarginTop_s,
int*) { *p1 = cls->MarginTop();
return S_OK; }
55 ATTRIBUTE_METHOD1(
CMoviePlatform, SetMarginTop_s,
int) { cls->MarginTop(p1);
return S_OK; }
57 ATTRIBUTE_METHOD1(
CMoviePlatform, GetMarginRight_s,
int*) { *p1 = cls->MarginRight();
return S_OK; }
58 ATTRIBUTE_METHOD1(
CMoviePlatform, SetMarginRight_s,
int) { cls->MarginRight(p1);
return S_OK; }
60 ATTRIBUTE_METHOD1(
CMoviePlatform, GetMarginBottom_s,
int*) { *p1 = cls->MarginBottom();
return S_OK; }
61 ATTRIBUTE_METHOD1(
CMoviePlatform, SetMarginBottom_s,
int) { cls->MarginBottom(p1);
return S_OK; }
63 ATTRIBUTE_METHOD1(
CMoviePlatform, HasMoviePlugin_s,
bool*) { *p1 = cls->HasMoviePlugin();
return S_OK; }
65 ATTRIBUTE_METHOD1(
CMoviePlatform, GetRecordingFPS_s,
int*) { *p1 = cls->GetRecordingFPS();
return S_OK; }
66 ATTRIBUTE_METHOD1(
CMoviePlatform, SetRecordingFPS_s,
int) { cls->SetRecordingFPS(p1);
return S_OK; }
68 ATTRIBUTE_METHOD1(
CMoviePlatform, GetVideoBitRate_s,
int*) { *p1 = cls->GetVideoBitRate();
return S_OK; }
69 ATTRIBUTE_METHOD1(
CMoviePlatform, SetVideoBitRate_s,
int) { cls->SetVideoBitRate(p1);
return S_OK; }
71 ATTRIBUTE_METHOD1(
CMoviePlatform, IsCaptureMic_s,
bool*) { *p1 = cls->IsCaptureMic();
return S_OK; }
72 ATTRIBUTE_METHOD1(
CMoviePlatform, SetCaptureMic_s,
bool) { cls->SetCaptureMic(p1);
return S_OK; }
74 ATTRIBUTE_METHOD1(
CMoviePlatform, IsCaptureAudio_s,
bool*) { *p1 = cls->IsCaptureAudio();
return S_OK; }
75 ATTRIBUTE_METHOD1(
CMoviePlatform, SetCaptureAudio_s,
bool) { cls->SetCaptureAudio(p1);
return S_OK; }
77 ATTRIBUTE_METHOD1(
CMoviePlatform, GetStereoCaptureMode_s,
int*) { *p1 = cls->GetStereoCaptureMode();
return S_OK; }
80 ATTRIBUTE_METHOD1(
CMoviePlatform, GetStereoEyeSeparation_s,
float*) { *p1 = cls->GetStereoEyeSeparation();
return S_OK; }
81 ATTRIBUTE_METHOD1(
CMoviePlatform, SetStereoEyeSeparation_s,
float) { cls->SetStereoEyeSeparation(p1);
return S_OK; }
84 void video_encode_example(
const char *filename,
int codec_id = 0);
87 virtual void SetCodec(
int nCodec);
90 virtual int GetCodec();
92 typedef std::function<void(bool, std::vector<BYTE>& base64)> screenshot_callback;
113 void SetVideoBitRate(
int nRate);
114 int GetVideoBitRate();
119 void SetMovieScreenSize(
int nWidth,
int nHeight);
121 void GetMovieScreenSize(
int* nWidth,
int* nHeight);
124 string GetMovieFileName();
127 void BeginCaptureFrame();
128 void EndCaptureFrame();
136 bool BeginCapture(
const string& sFileName);
142 void ResumeCapture();
145 bool IsInCaptureSession();
151 bool SetCaptureTarget();
154 bool UnsetCaptureTarget();
158 void RenderCaptured();
163 void SaveCapturedFrame(
int nMode=0);
167 bool TakeScreenShot(
const string& filename);
176 void TakeScreenShot_Async(
const string& filename,
bool bEncode =
false,
int width = -1,
int height = -1, screenshot_callback callback =
nullptr);
186 bool TakeScreenShot_FromGDI(
const string& filename, std::vector<BYTE>& outBase64Buffers,
bool bEncode =
false,
int width = -1,
int height = -1);
198 int CaptureBitmapBuffer(HWND nHwnd,
int& outFileHeaderSize,
int& outInfoHeaderSize, std::vector<BYTE>& outBuffers,
bool bCaptureMouse =
false,
int nLeft = 0,
int nTop = 0,
int width = 0,
int height = 0);
205 bool TakeScreenShot(
const string& filename,
int width,
int height);
213 bool ResizeImage(
const string& filename,
int width,
int height,
const string& destFilename);
221 bool GetImageInfo(
const string& filename,
int* width,
int* height,
int* nFileSize);
223 HRESULT InvalidateDeviceObjects();
224 HRESULT RestoreDeviceObjects();
228 void EnableCodecSelection(
bool bEnable);
229 bool IsCodecSelectionEnabled();
233 void SetRecordingFPS(
int nFPS);
236 int GetRecordingFPS();
261 void SetStereoEyeSeparation(
float fDist);
266 float GetStereoEyeSeparation();
271 int GetCurrentFrameNumber();
274 void FrameCaptureFFMPEG();
279 bool HasMoviePlugin();
281 void SetCaptureAudio(
bool bEnable);
282 bool IsCaptureAudio();
284 void SetCaptureMic(
bool bEnable);
287 bool IsUseGDI()
const;
288 void SetUseGDI(
bool val);
293 string m_beginningStr;
295 float m_fLastRefreshInterval;
297 std::vector<std::function<void()>> m_functionsToPerform;
298 std::mutex m_performMutex;
300 #ifdef USE_DIRECTX_RENDERER 301 LPDIRECT3DTEXTURE9 m_pCaptureTexture;
302 LPDIRECT3DSURFACE9 m_pCaptureSurface;
303 LPDIRECT3DSURFACE9 m_pBackBufferSurface;
304 LPDIRECT3DSURFACE9 m_pOldDepthStencilSurface, m_pDepthStencilSurface;
305 LPDIRECT3DSURFACE9 m_pOffScreenSurface;
307 HBITMAP m_BitmapHandle;
316 bool m_bRenderBorder;
318 bool m_bUseWaterMark;
325 int MarginLeft()
const {
return m_nMarginLeft; }
326 void MarginLeft(
int val) { m_nMarginLeft = val; }
328 int MarginRight()
const {
return m_nMarginRight; }
329 void MarginRight(
int val) { m_nMarginRight = val; }
331 int MarginTop()
const {
return m_nMarginTop; }
332 void MarginTop(
int val) { m_nMarginTop = val; }
334 int MarginBottom()
const {
return m_nMarginBottom; }
335 void MarginBottom(
int val) { m_nMarginBottom = val; }
341 bool m_bAllowCodecSelection;
349 float m_nStereoEyeSeparation;
for movie capturing
Definition: IMovieCodec.h:17
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
different physics engine has different winding order.
Definition: EventBinding.h:32
recording started but paused
Definition: MoviePlatform.h:15
MOVIE_RECORDING_STATE
Definition: MoviePlatform.h:10
A common interface for all classes implementing IAttributeFields By implementing this class's virtual...
Definition: IAttributeFields.h:59
MOVIE_CAPTURE_MODE
Video capture mode.
Definition: IMovieCodec.h:6
recording
Definition: MoviePlatform.h:13
recording stopped
Definition: MoviePlatform.h:17