expose video capture as logging command in b3RobotSimulatorClientAPI (C++) and pybullet (use STATE_LOGGING_VIDEO_MP4)

This commit is contained in:
Erwin Coumans
2017-03-16 09:13:33 -07:00
parent b7b46b12d3
commit 59d16b2c42
16 changed files with 180 additions and 22 deletions

View File

@@ -179,8 +179,10 @@ enum MultiThreadedGUIHelperCommunicationEnums
eGUIUserDebugAddParameter,
eGUIUserDebugRemoveItem,
eGUIUserDebugRemoveAllItems,
eGUIDumpFramesToVideo,
};
#include <stdio.h>
//#include "BulletMultiThreaded/PlatformDefinitions.h"
@@ -489,7 +491,7 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
args->m_cs->unlock();
}
args->m_physicsServerPtr->disconnectSharedMemory(true);
//do nothing
}
@@ -959,6 +961,16 @@ public:
}
const char* m_mp4FileName;
virtual void dumpFramesToVideo(const char* mp4FileName)
{
m_cs->lock();
m_mp4FileName = mp4FileName;
m_cs->setSharedParam(1, eGUIDumpFramesToVideo);
workerThreadWait();
m_mp4FileName = 0;
}
};
@@ -1614,6 +1626,14 @@ void PhysicsServerExample::updateGraphics()
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIDumpFramesToVideo:
{
m_multiThreadedHelper->m_childGuiHelper->dumpFramesToVideo(m_multiThreadedHelper->m_mp4FileName);
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperIdle:
{
break;