Browse Source

Added VideoCapture.Release function.

pull/768/merge
Canming Huang 1 year ago
parent
commit
565fe8cb61
  1. 13
      Emgu.CV.Extern/CMakeLists.txt
  2. 2
      Emgu.CV.Extern/videoio/videoio_c_extra.cpp
  3. 2
      Emgu.CV.Extern/videoio/videoio_c_extra.h
  4. 4
      Emgu.CV/Videoio/VideoCapture.cs

13
Emgu.CV.Extern/CMakeLists.txt

@ -1980,13 +1980,14 @@ ENDIF()
"${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV/Videoio/VideoCapture.g.cs"
"cv::VideoCapture"
"VideoCapture"
"isOpened;ExceptionMode"
"bool;bool"
"val;prop"
"IsOpened;ExceptionMode"
"bool;bool"
"isOpened;ExceptionMode;release"
"bool;bool;void"
"val;prop;act0"
"IsOpened;ExceptionMode;Release"
"bool;bool;void"
"True if the camera is opened;
If True, methods raise exceptions if not successful instead of returning an error code"
If True, methods raise exceptions if not successful instead of returning an error code;
The method is automatically called by subsequent VideoCapture.Open and by VideoCapture destructor."
"Emgu.CV"
"CvInvoke"
"VideoCapture"

2
Emgu.CV.Extern/videoio/videoio_c_extra.cpp

@ -84,7 +84,7 @@ cv::VideoCapture* cveVideoCaptureCreateFromFile(cv::String* fileName, int apiPre
#endif
}
void cveVideoCaptureRelease(cv::VideoCapture** capture)
void cveVideoCaptureRelease2(cv::VideoCapture** capture)
{
#ifdef HAVE_OPENCV_VIDEOIO
delete *capture;

2
Emgu.CV.Extern/videoio/videoio_c_extra.h

@ -69,7 +69,7 @@ CVAPI(void) OpenniGetColorPoints(
CVAPI(cv::VideoCapture*) cveVideoCaptureCreateFromDevice(int device, int apiPreference, std::vector< int >* params);
CVAPI(cv::VideoCapture*) cveVideoCaptureCreateFromFile(cv::String* fileName, int apiPreference, std::vector< int >* params);
CVAPI(void) cveVideoCaptureRelease(cv::VideoCapture** capture);
CVAPI(void) cveVideoCaptureRelease2(cv::VideoCapture** capture);
CVAPI(bool) cveVideoCaptureSet(cv::VideoCapture* capture, int propId, double value);
CVAPI(double) cveVideoCaptureGet(cv::VideoCapture* capture, int propId);
CVAPI(bool) cveVideoCaptureGrab(cv::VideoCapture* capture);

4
Emgu.CV/Videoio/VideoCapture.cs

@ -413,7 +413,7 @@ namespace Emgu.CV
if (_needDispose && _ptr != IntPtr.Zero)
{
Stop();
CvInvoke.cveVideoCaptureRelease(ref _ptr);
CvInvoke.cveVideoCaptureRelease2(ref _ptr);
}
#endif
}
@ -779,7 +779,7 @@ namespace Emgu.CV
internal static extern IntPtr cveVideoCaptureCreateFromFile(IntPtr filename, VideoCapture.API api, IntPtr captureProperties);
[DllImport(ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)]
internal static extern void cveVideoCaptureRelease(ref IntPtr capture);
internal static extern void cveVideoCaptureRelease2(ref IntPtr capture);
[DllImport(ExternLibrary, CallingConvention = CvInvoke.CvCallingConvention)]
[return: MarshalAs(CvInvoke.BoolToIntMarshalType)]

Loading…
Cancel
Save