connect( myStopAction, SIGNAL( activated() ), this, SLOT( OnStopRecording() ) );
myRecorder=VVTK_Recorder::New();
+ myRecorder->CheckExistAVIMaker();
+ if (myRecorder->ErrorStatus()){
+ myRecordingToolBar->setEnabled(false);
+ }
}
void
myName=new char [512];\r
myName[0]=0;\r
myNbWrittenFrames=0;\r
+ //\r
+ myNameAVIMaker=new char[32];\r
+ strcpy (myNameAVIMaker, "jpeg2yuv");\r
}\r
//===============================================\r
// function: ~\r
myFilter->Delete();\r
delete myWriterMgr;\r
delete myName;\r
+ delete myNameAVIMaker;\r
+}\r
+//===============================================\r
+// function: CheckExistAVIMaker\r
+// purpose :\r
+//=============================================== \r
+void VVTK_Recorder::CheckExistAVIMaker()\r
+{\r
+ int iErr, iES;\r
+ //\r
+ myErrorStatus=0;\r
+ iErr=system(myNameAVIMaker);\r
+ iErr=WEXITSTATUS(iErr);\r
+ if (iErr==127){\r
+ myErrorStatus=iErr;\r
+ }\r
}\r
//===============================================\r
// function: DoPlay\r
void VVTK_Recorder::AddSkippedFrames()\r
{\r
myErrorStatus=0;\r
- //\r
- \r
+ //...\r
}\r
//===============================================\r
// function: MakeFileAVI\r
//"jpeg2yuv -f 10 -I p -n 16 -v 0 -j abcx_1%06d.jpeg | yuv2lav -o z.avi" \r
//\r
iNbFPS=(int)myNbFPS;\r
- sprintf(aCmd, "jpeg2yuv -I p -v 0 -f %d -n %d -j %s%s | yuv2lav -o %s.avi",\r
- iNbFPS, myNbWrittenFrames, myName, fmt, myName);\r
+ sprintf(aCmd, "%s -I p -v 0 -f %d -n %d -j %s%s | yuv2lav -o %s.avi",\r
+ myNameAVIMaker, iNbFPS, myNbWrittenFrames, myName, fmt, myName);\r
//\r
myErrorStatus=system(aCmd);\r
}\r
void* theClientData, \r
void* theCallData);\r
\r
+ void CheckExistAVIMaker();\r
//\r
protected :\r
VVTK_Recorder();\r
vtkWindowToImageFilter *myFilter;\r
VVTK_ImageWriterMgr *myWriterMgr;\r
\r
+ char *myNameAVIMaker;\r
+\r
private:\r
VVTK_Recorder(const VVTK_Recorder&); //Not implemented\r
void operator=(const VVTK_Recorder&); //Not implemented\r