1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0025383: Broken vrecord command

Pass HWND of the current 3D view to OpenGl_AVIWriter::StartRecording()
in order to make it work.
This commit is contained in:
san 2014-10-15 18:06:52 +04:00 committed by bugmaster
parent 94dea18e8b
commit 6d17debbe9

View File

@ -15,7 +15,9 @@
#if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE) #if (defined(_WIN32) || defined(__WIN32__)) && defined(HAVE_VIDEOCAPTURE)
#include <windows.h> #include <windows.h>
#include <Aspect_Window.hxx>
#include <OpenGl_AVIWriter.hxx> #include <OpenGl_AVIWriter.hxx>
#include <V3d_View.hxx>
#endif #endif
#include <ViewerTest.hxx> #include <ViewerTest.hxx>
@ -33,6 +35,13 @@ static Standard_Integer avi_record(Draw_Interpretor& /*di*/,
Standard_Integer aResult = 1; Standard_Integer aResult = 1;
#if (defined(_WIN32) || defined(__WIN32__)) #if (defined(_WIN32) || defined(__WIN32__))
#ifdef HAVE_VIDEOCAPTURE #ifdef HAVE_VIDEOCAPTURE
Handle(V3d_View) aView = ViewerTest::CurrentView ();
if (aView.IsNull())
{
std::cout << "Call vinit before!\n";
return 1;
}
static OpenGl_AVIWriter * pAviWriter = 0L; static OpenGl_AVIWriter * pAviWriter = 0L;
if (strncmp(argv[1], "file", 5) == 0) { if (strncmp(argv[1], "file", 5) == 0) {
@ -52,7 +61,7 @@ static Standard_Integer avi_record(Draw_Interpretor& /*di*/,
cout << "AVI Writer instance has not been initialized. Use command " cout << "AVI Writer instance has not been initialized. Use command "
<< argv[0] << " file ..." << endl; << argv[0] << " file ..." << endl;
} else if (strncmp(argv[1], "start", 6) == 0) { } else if (strncmp(argv[1], "start", 6) == 0) {
pAviWriter->StartRecording(); pAviWriter->StartRecording (aView->Window()->NativeHandle());
aResult = 0; aResult = 0;
} else if (strncmp(argv[1], "stop", 5) == 0) { } else if (strncmp(argv[1], "stop", 5) == 0) {
pAviWriter->StopRecording(); pAviWriter->StopRecording();