NativeMethods_videoio.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. using System.Diagnostics.Contracts;
  2. using System.Runtime.InteropServices;
  3. #pragma warning disable 1591
  4. #pragma warning disable CA1401 // P/Invokes should not be visible
  5. #pragma warning disable CA2101 // Specify marshaling for P/Invoke string arguments
  6. #pragma warning disable IDE1006 // Naming style
  7. namespace OpenCvSharp.Internal;
  8. static partial class NativeMethods
  9. {
  10. // VideoCapture
  11. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  12. public static extern ExceptionStatus videoio_VideoCapture_new1(out IntPtr returnValue);
  13. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  14. public static extern ExceptionStatus videoio_VideoCapture_new2(
  15. [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference, out IntPtr returnValue);
  16. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  17. public static extern ExceptionStatus videoio_VideoCapture_new3(int device, int apiPreference, out IntPtr returnValue);
  18. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  19. public static extern ExceptionStatus videoio_VideoCapture_new4(
  20. [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference, [In] int[] @params, int paramsLength, out IntPtr returnValue);
  21. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  22. public static extern ExceptionStatus videoio_VideoCapture_new5(int device, int apiPreference, [In] int[] @params, int paramsLength, out IntPtr returnValue);
  23. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  24. public static extern ExceptionStatus videoio_VideoCapture_delete(IntPtr obj);
  25. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  26. public static extern ExceptionStatus videoio_VideoCapture_open1(
  27. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference, out int returnValue);
  28. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  29. public static extern ExceptionStatus videoio_VideoCapture_open2(IntPtr obj, int device, int apiPreference, out int returnValue);
  30. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  31. public static extern ExceptionStatus videoio_VideoCapture_isOpened(IntPtr obj, out int returnValue);
  32. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  33. public static extern ExceptionStatus videoio_VideoCapture_release(IntPtr obj);
  34. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  35. public static extern ExceptionStatus videoio_VideoCapture_grab(IntPtr obj, out int returnValue);
  36. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  37. public static extern ExceptionStatus videoio_VideoCapture_retrieve_OutputArray(IntPtr obj, IntPtr image, int flag, out int returnValue);
  38. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  39. public static extern ExceptionStatus videoio_VideoCapture_retrieve_Mat(IntPtr obj, IntPtr image, int flag, out int returnValue);
  40. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  41. public static extern ExceptionStatus videoio_VideoCapture_operatorRightShift_Mat(IntPtr obj, IntPtr image);
  42. //[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  43. //public static extern ExceptionStatus videoio_VideoCapture_operatorRightShift_UMat(IntPtr obj, IntPtr image);
  44. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  45. public static extern ExceptionStatus videoio_VideoCapture_read_OutputArray(IntPtr obj, IntPtr image, out int returnValue);
  46. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  47. public static extern ExceptionStatus videoio_VideoCapture_read_Mat(IntPtr obj, IntPtr image, out int returnValue);
  48. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  49. public static extern ExceptionStatus videoio_VideoCapture_set(IntPtr obj, int propId, double value, out int returnValue);
  50. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  51. public static extern ExceptionStatus videoio_VideoCapture_get(IntPtr obj, int propId, out double returnValue);
  52. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  53. public static extern ExceptionStatus videoio_VideoCapture_getBackendName(IntPtr obj, IntPtr returnValue);
  54. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  55. public static extern ExceptionStatus videoio_VideoCapture_setExceptionMode(IntPtr obj, int enable);
  56. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  57. public static extern ExceptionStatus videoio_VideoCapture_getExceptionMode(IntPtr obj, out int returnValue);
  58. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  59. public static extern ExceptionStatus videoio_VideoCapture_waitAny(
  60. IntPtr[] streams, nuint streamsSize,
  61. IntPtr readyIndex, long timeoutNs, out int returnValue);
  62. // VideoWriter
  63. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  64. public static extern ExceptionStatus videoio_VideoWriter_new1(out IntPtr returnValue);
  65. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  66. public static extern ExceptionStatus videoio_VideoWriter_new2(
  67. [MarshalAs(UnmanagedType.LPStr)] string filename, int fourcc, double fps,
  68. Size frameSize, int isColor, out IntPtr returnValue);
  69. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  70. public static extern ExceptionStatus videoio_VideoWriter_new3(
  71. [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference, int fourcc, double fps,
  72. Size frameSize, int isColor, out IntPtr returnValue);
  73. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  74. public static extern ExceptionStatus videoio_VideoWriter_new4(
  75. [MarshalAs(UnmanagedType.LPStr)] string filename, int fourcc, double fps,
  76. Size frameSize, [In] int[] @params, int paramsLength, out IntPtr returnValue);
  77. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  78. public static extern ExceptionStatus videoio_VideoWriter_new5(
  79. [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference, int fourcc, double fps,
  80. Size frameSize, [In] int[] @params, int paramsLength, out IntPtr returnValue);
  81. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  82. public static extern ExceptionStatus videoio_VideoWriter_delete(IntPtr obj);
  83. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  84. public static extern ExceptionStatus videoio_VideoWriter_open1(
  85. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename,
  86. int fourcc, double fps, Size frameSize, int isColor, out int returnValue);
  87. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  88. public static extern ExceptionStatus videoio_VideoWriter_open2(
  89. IntPtr obj, [MarshalAs(UnmanagedType.LPStr)] string filename, int apiPreference,
  90. int fourcc, double fps, Size frameSize, int isColor, out int returnValue);
  91. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  92. public static extern ExceptionStatus videoio_VideoWriter_isOpened(IntPtr obj, out int returnValue);
  93. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  94. public static extern ExceptionStatus videoio_VideoWriter_release(IntPtr obj);
  95. //[Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  96. //public static extern ExceptionStatus videoio_VideoWriter_OperatorLeftShift(IntPtr obj, IntPtr image);
  97. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  98. public static extern ExceptionStatus videoio_VideoWriter_write(IntPtr obj, IntPtr image);
  99. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  100. public static extern ExceptionStatus videoio_VideoWriter_set(IntPtr obj, int propId, double value, out int returnValue);
  101. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  102. public static extern ExceptionStatus videoio_VideoWriter_get(IntPtr obj, int propId, out double returnValue);
  103. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  104. public static extern ExceptionStatus videoio_VideoWriter_fourcc(sbyte c1, sbyte c2, sbyte c3, sbyte c4, out int returnValue);
  105. [Pure, DllImport(DllExtern, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
  106. public static extern ExceptionStatus videoio_VideoWriter_getBackendName(IntPtr obj, IntPtr returnValue);
  107. }