pkg/driver/camera/camera_windows.cpp
// freeCamera closes device and frees all resources allocated by openCamera().
freeCamera closes device and frees all resources allocated by openCamera().
freeCamera closes device and frees all resources allocated by openCamera () .
void freeCamera(camera* cam)
{
  if (cam->mediaControl)
    ((IMediaControl*)cam->mediaControl)->Stop();
  safeRelease((ISampleGrabber**)&cam->grabber);
  safeRelease((IMediaControl**)&cam->mediaControl);
  if (cam->callback)
  {
    ((SampleGrabberCallback*)cam->callback)->Release();
    delete ((SampleGrabberCallback*)cam->callback);
    cam->callback = nullptr;
  }
  if (cam->props)
  {
    delete cam->props;
    cam->props = nullptr;
  }
}
void freeCamera ( camera * cam ) { if ( cam -> mediaControl ) ( ( IMediaControl * ) cam -> mediaControl ) -> Stop ( ) ; safeRelease ( ( ISampleGrabber * * ) & cam -> grabber ) ; safeRelease ( ( IMediaControl * * ) & cam -> mediaControl ) ; if ( cam -> callback ) { ( ( SampleGrabberCallback * ) cam -> callback ) -> Release ( ) ; delete ( ( SampleGrabberCallback * ) cam -> callback ) ; cam -> callback = nullptr ; } if ( cam -> props ) { delete cam -> props ; cam -> props = nullptr ; } }
freeCamera closes device and frees all resources allocated by openCamera().
freeCamera closes device and frees all resources allocated by openCamera () .