Merge pull request #8112 from PkLab:Fix_7898

CoInitialize/CoUninitialize in VFW classes (#8112)
pull/8123/head
PkLab 8 years ago committed by Alexander Alekhin
parent 607ff2e189
commit ece3fac7ef
  1. 24
      modules/videoio/src/cap_vfw.cpp

@ -312,8 +312,16 @@ CvCapture* cvCreateFileCapture_VFW (const char* filename)
class CvCaptureCAM_VFW : public CvCapture class CvCaptureCAM_VFW : public CvCapture
{ {
public: public:
CvCaptureCAM_VFW() { init(); } CvCaptureCAM_VFW()
virtual ~CvCaptureCAM_VFW() { close(); } {
CoInitialize(NULL);
init();
}
virtual ~CvCaptureCAM_VFW()
{
close();
CoUninitialize();
}
virtual bool open( int index ); virtual bool open( int index );
virtual void close(); virtual void close();
@ -673,8 +681,16 @@ CvCapture* cvCreateCameraCapture_VFW( int index )
class CvVideoWriter_VFW : public CvVideoWriter class CvVideoWriter_VFW : public CvVideoWriter
{ {
public: public:
CvVideoWriter_VFW() { init(); } CvVideoWriter_VFW()
virtual ~CvVideoWriter_VFW() { close(); } {
CoInitialize(NULL);
init();
}
virtual ~CvVideoWriter_VFW()
{
close();
CoUninitialize();
}
virtual bool open( const char* filename, int fourcc, virtual bool open( const char* filename, int fourcc,
double fps, CvSize frameSize, bool isColor ); double fps, CvSize frameSize, bool isColor );

Loading…
Cancel
Save