Commit 924bee03 authored by Sebastien Timmermans's avatar Sebastien Timmermans 🎹

Merge branch 'CtypesFrameCapture' into 'dev'

Ctypes frame capture

See merge request robotran/mbsysc!322
parents 28e727dc d3fa8edf
This diff is collapsed.
......@@ -297,4 +297,49 @@ void ScreenCapture::Record(double speed_factor, double end_time){
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* WRAPPING THE C++ INTO A C API */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void* ScreenCapture_create (int width, int height, int shader_flag,
int multi_samp, int fps){
ScreenCapture* SC = NULL;
SC = new ScreenCapture(width=width, height=height, shader_flag=shader_flag,
multi_samp=multi_samp, fps=fps);
return static_cast<void*>(SC);
}
void ScreenCapture_AddMbs(void* SC, char* mbsfile, char* animfile){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
SC_ptr->AddMbs(mbsfile, animfile);
}
void ScreenCapture_AddCapture(void* SC, char* outputname, int f, int vp_id,
int multisample_enable, int bit_rate){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
SC_ptr->AddCapture(outputname, CaptureFormat(f), vp_id,
multisample_enable=multisample_enable,
OpenGLMbs::MpegFrameCaptureOptions(bit_rate));
}
void ScreenCapture_UpdateMbs(void* SC, double time){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
SC_ptr->UpdateMbs(time);
}
void ScreenCapture_Capture(void* SC){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
SC_ptr->Capture();
}
void ScreenCapture_Record(void* SC, double speed_factor, double end_time){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
SC_ptr->Record(speed_factor=speed_factor, end_time=end_time);
}
void ScreenCapture_Finalize(void* SC){
ScreenCapture* SC_ptr = static_cast<ScreenCapture*>(SC);
delete SC_ptr;
}
......@@ -68,4 +68,20 @@ class ScreenCapture{
};
#ifdef __cplusplus
extern "C"
{
#endif
void* ScreenCapture_create(int width, int height, int shader_flag,
int multi_samp, int fps);
void ScreenCapture_AddMbs(void* SC, char* mbsfile, char* animfile);
void ScreenCapture_AddCapture(void* SC, char* outputname, int f, int vp_id, int multisample_enable, int bit_rate);
void ScreenCapture_UpdateMbs(void* SC, double time);
void ScreenCapture_Capture(void* SC);
void ScreenCapture_Record(void* SC, double speed_factor, double end_time);
void ScreenCapture_Finalize(void* SC);
#ifdef __cplusplus
}
#endif
#endif //_SCREEN_CAPTURE_HH_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment