QVideo 4.0.0__tar.gz → 4.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. {qvideo-4.0.0 → qvideo-4.0.1}/PKG-INFO +1 -1
  2. {qvideo-4.0.0 → qvideo-4.0.1}/QCamcorder.py +1 -2
  3. {qvideo-4.0.0 → qvideo-4.0.1}/QVideo.egg-info/PKG-INFO +1 -1
  4. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Genicam/_camera.py +43 -1
  5. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Genicam/_tree.py +24 -28
  6. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/OpenCV/_camera.py +1 -3
  7. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QCamera.py +45 -36
  8. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QCameraTree.py +2 -0
  9. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QVideoSource.py +7 -0
  10. {qvideo-4.0.0 → qvideo-4.0.1}/lib/__init__.py +2 -1
  11. {qvideo-4.0.0 → qvideo-4.0.1}/pyproject.toml +1 -1
  12. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qcamera.py +58 -1
  13. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qgenicamcamera.py +68 -0
  14. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qopencvtree.py +11 -0
  15. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qvideosource.py +32 -0
  16. {qvideo-4.0.0 → qvideo-4.0.1}/LICENSE.md +0 -0
  17. {qvideo-4.0.0 → qvideo-4.0.1}/QVideo.egg-info/SOURCES.txt +0 -0
  18. {qvideo-4.0.0 → qvideo-4.0.1}/QVideo.egg-info/dependency_links.txt +0 -0
  19. {qvideo-4.0.0 → qvideo-4.0.1}/QVideo.egg-info/requires.txt +0 -0
  20. {qvideo-4.0.0 → qvideo-4.0.1}/QVideo.egg-info/top_level.txt +0 -0
  21. {qvideo-4.0.0 → qvideo-4.0.1}/README.md +0 -0
  22. {qvideo-4.0.0 → qvideo-4.0.1}/__init__.py +0 -0
  23. {qvideo-4.0.0 → qvideo-4.0.1}/__main__.py +0 -0
  24. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Basler/__init__.py +0 -0
  25. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Basler/_camera.py +0 -0
  26. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Basler/_tree.py +0 -0
  27. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Flir/QListFlirCameras.py +0 -0
  28. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Flir/__init__.py +0 -0
  29. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Flir/_camera.py +0 -0
  30. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Flir/_tree.py +0 -0
  31. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Genicam/__init__.py +0 -0
  32. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/IDS/__init__.py +0 -0
  33. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/IDS/_camera.py +0 -0
  34. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/IDS/_tree.py +0 -0
  35. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/MV/__init__.py +0 -0
  36. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/MV/_camera.py +0 -0
  37. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/MV/_tree.py +0 -0
  38. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Noise/__init__.py +0 -0
  39. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Noise/_camera.py +0 -0
  40. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Noise/_tree.py +0 -0
  41. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/OpenCV/QListCVCameras.py +0 -0
  42. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/OpenCV/__init__.py +0 -0
  43. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/OpenCV/_devices.py +0 -0
  44. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/OpenCV/_tree.py +0 -0
  45. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Picamera/__init__.py +0 -0
  46. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Picamera/_camera.py +0 -0
  47. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Picamera/_imx500.py +0 -0
  48. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Picamera/_tree.py +0 -0
  49. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Vimbax/__init__.py +0 -0
  50. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Vimbax/_camera.py +0 -0
  51. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/Vimbax/_tree.py +0 -0
  52. {qvideo-4.0.0 → qvideo-4.0.1}/cameras/__init__.py +0 -0
  53. {qvideo-4.0.0 → qvideo-4.0.1}/demos/ROIdemo.py +0 -0
  54. {qvideo-4.0.0 → qvideo-4.0.1}/demos/__init__.py +0 -0
  55. {qvideo-4.0.0 → qvideo-4.0.1}/demos/circulardemo.py +0 -0
  56. {qvideo-4.0.0 → qvideo-4.0.1}/demos/compositedemo.py +0 -0
  57. {qvideo-4.0.0 → qvideo-4.0.1}/demos/demo.py +0 -0
  58. {qvideo-4.0.0 → qvideo-4.0.1}/demos/filterdemo.py +0 -0
  59. {qvideo-4.0.0 → qvideo-4.0.1}/demos/filterrackdemo.py +0 -0
  60. {qvideo-4.0.0 → qvideo-4.0.1}/demos/histogramdemo.py +0 -0
  61. {qvideo-4.0.0 → qvideo-4.0.1}/demos/trackpydemo.py +0 -0
  62. {qvideo-4.0.0 → qvideo-4.0.1}/demos/uniformitydemo.py +0 -0
  63. {qvideo-4.0.0 → qvideo-4.0.1}/demos/yolodemo.py +0 -0
  64. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QCircularBuffer.py +0 -0
  65. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QCircularDVRWidget.py +0 -0
  66. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QDVRWidget.py +0 -0
  67. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QHDF5Reader.py +0 -0
  68. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QHDF5Writer.py +0 -0
  69. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QOpenCVReader.py +0 -0
  70. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/QOpenCVWriter.py +0 -0
  71. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/__init__.py +0 -0
  72. {qvideo-4.0.0 → qvideo-4.0.1}/dvr/icons_rc.py +0 -0
  73. {qvideo-4.0.0 → qvideo-4.0.1}/filters/_MedianBase.py +0 -0
  74. {qvideo-4.0.0 → qvideo-4.0.1}/filters/__init__.py +0 -0
  75. {qvideo-4.0.0 → qvideo-4.0.1}/filters/artistic.py +0 -0
  76. {qvideo-4.0.0 → qvideo-4.0.1}/filters/blob.py +0 -0
  77. {qvideo-4.0.0 → qvideo-4.0.1}/filters/circletransform.py +0 -0
  78. {qvideo-4.0.0 → qvideo-4.0.1}/filters/darkframe.py +0 -0
  79. {qvideo-4.0.0 → qvideo-4.0.1}/filters/dejitter.py +0 -0
  80. {qvideo-4.0.0 → qvideo-4.0.1}/filters/dog.py +0 -0
  81. {qvideo-4.0.0 → qvideo-4.0.1}/filters/edge.py +0 -0
  82. {qvideo-4.0.0 → qvideo-4.0.1}/filters/exposure.py +0 -0
  83. {qvideo-4.0.0 → qvideo-4.0.1}/filters/flatfield.py +0 -0
  84. {qvideo-4.0.0 → qvideo-4.0.1}/filters/foreground.py +0 -0
  85. {qvideo-4.0.0 → qvideo-4.0.1}/filters/gamma.py +0 -0
  86. {qvideo-4.0.0 → qvideo-4.0.1}/filters/invert.py +0 -0
  87. {qvideo-4.0.0 → qvideo-4.0.1}/filters/laplacian.py +0 -0
  88. {qvideo-4.0.0 → qvideo-4.0.1}/filters/median.py +0 -0
  89. {qvideo-4.0.0 → qvideo-4.0.1}/filters/momean.py +0 -0
  90. {qvideo-4.0.0 → qvideo-4.0.1}/filters/momedian.py +0 -0
  91. {qvideo-4.0.0 → qvideo-4.0.1}/filters/normalize.py +0 -0
  92. {qvideo-4.0.0 → qvideo-4.0.1}/filters/rgb.py +0 -0
  93. {qvideo-4.0.0 → qvideo-4.0.1}/filters/roi.py +0 -0
  94. {qvideo-4.0.0 → qvideo-4.0.1}/filters/samplehold.py +0 -0
  95. {qvideo-4.0.0 → qvideo-4.0.1}/filters/smoothing.py +0 -0
  96. {qvideo-4.0.0 → qvideo-4.0.1}/filters/sobel.py +0 -0
  97. {qvideo-4.0.0 → qvideo-4.0.1}/filters/threshold.py +0 -0
  98. {qvideo-4.0.0 → qvideo-4.0.1}/filters/unsharp.py +0 -0
  99. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QFPSMeter.py +0 -0
  100. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QFilterRack.py +0 -0
  101. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QFilterStack.py +0 -0
  102. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QHistogramWidget.py +0 -0
  103. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QListCameras.py +0 -0
  104. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QSnapshot.py +0 -0
  105. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QUniformityWidget.py +0 -0
  106. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QVideoFilter.py +0 -0
  107. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QVideoReader.py +0 -0
  108. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QVideoScreen.py +0 -0
  109. {qvideo-4.0.0 → qvideo-4.0.1}/lib/QVideoWriter.py +0 -0
  110. {qvideo-4.0.0 → qvideo-4.0.1}/lib/_camera.py +0 -0
  111. {qvideo-4.0.0 → qvideo-4.0.1}/lib/_jupyter.py +0 -0
  112. {qvideo-4.0.0 → qvideo-4.0.1}/lib/_qabc.py +0 -0
  113. {qvideo-4.0.0 → qvideo-4.0.1}/lib/chooser.py +0 -0
  114. {qvideo-4.0.0 → qvideo-4.0.1}/lib/clickable.py +0 -0
  115. {qvideo-4.0.0 → qvideo-4.0.1}/lib/errors.py +0 -0
  116. {qvideo-4.0.0 → qvideo-4.0.1}/lib/gentl.py +0 -0
  117. {qvideo-4.0.0 → qvideo-4.0.1}/lib/imageops.py +0 -0
  118. {qvideo-4.0.0 → qvideo-4.0.1}/lib/videotypes.py +0 -0
  119. {qvideo-4.0.0 → qvideo-4.0.1}/overlays/__init__.py +0 -0
  120. {qvideo-4.0.0 → qvideo-4.0.1}/overlays/trackpy.py +0 -0
  121. {qvideo-4.0.0 → qvideo-4.0.1}/overlays/yolo.py +0 -0
  122. {qvideo-4.0.0 → qvideo-4.0.1}/setup.cfg +0 -0
  123. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_artistic.py +0 -0
  124. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_blob.py +0 -0
  125. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_camera.py +0 -0
  126. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_chooser.py +0 -0
  127. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_circletransform.py +0 -0
  128. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_circularbuffer.py +0 -0
  129. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_circulardemo.py +0 -0
  130. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_circulardvrwidget.py +0 -0
  131. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_clickable.py +0 -0
  132. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_compositedemo.py +0 -0
  133. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_darkframe.py +0 -0
  134. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_dejitter.py +0 -0
  135. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_demo.py +0 -0
  136. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_dog.py +0 -0
  137. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_edge.py +0 -0
  138. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_exposure.py +0 -0
  139. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_filter_export.py +0 -0
  140. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_filterdemo.py +0 -0
  141. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_filterrackdemo.py +0 -0
  142. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_filters_gray.py +0 -0
  143. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_flatfield.py +0 -0
  144. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_foreground.py +0 -0
  145. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_gamma.py +0 -0
  146. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_gentl.py +0 -0
  147. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_histogramdemo.py +0 -0
  148. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_histogramwidget.py +0 -0
  149. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_icons_rc.py +0 -0
  150. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_imageops.py +0 -0
  151. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_invert.py +0 -0
  152. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_jupyter.py +0 -0
  153. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_laplacian.py +0 -0
  154. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_median.py +0 -0
  155. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_momean.py +0 -0
  156. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_momedian.py +0 -0
  157. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_normalize.py +0 -0
  158. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_overlays_package.py +0 -0
  159. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qabc.py +0 -0
  160. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qbaslercamera.py +0 -0
  161. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qcamcorder.py +0 -0
  162. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qcameratree.py +0 -0
  163. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qdvrwidget.py +0 -0
  164. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qfilterrack.py +0 -0
  165. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qfilterstack.py +0 -0
  166. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qflircamera.py +0 -0
  167. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qfpsmeter.py +0 -0
  168. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qgenicamtree.py +0 -0
  169. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qhdf5reader.py +0 -0
  170. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qhdf5writer.py +0 -0
  171. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qidscamera.py +0 -0
  172. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qimxcamera.py +0 -0
  173. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qlistcameras.py +0 -0
  174. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qlistcvcameras.py +0 -0
  175. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qlistflircameras.py +0 -0
  176. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qmvcamera.py +0 -0
  177. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qnoisecamera.py +0 -0
  178. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qnoisetree.py +0 -0
  179. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qopencvcamera.py +0 -0
  180. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qopencvdevices.py +0 -0
  181. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qopencvreader.py +0 -0
  182. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qopencvwriter.py +0 -0
  183. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qpicamera.py +0 -0
  184. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qpicameratree.py +0 -0
  185. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qsnapshot.py +0 -0
  186. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qt_binding.py +0 -0
  187. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qvideoreader.py +0 -0
  188. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qvideoscreen.py +0 -0
  189. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qvideowriter.py +0 -0
  190. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_qvimbaxcamera.py +0 -0
  191. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_resolutions.py +0 -0
  192. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_rgb.py +0 -0
  193. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_roi.py +0 -0
  194. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_roidemo.py +0 -0
  195. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_samplehold.py +0 -0
  196. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_smoothing.py +0 -0
  197. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_sobel.py +0 -0
  198. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_threshold.py +0 -0
  199. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_trackpy_overlay.py +0 -0
  200. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_trackpydemo.py +0 -0
  201. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_uniformitydemo.py +0 -0
  202. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_uniformitywidget.py +0 -0
  203. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_unsharp.py +0 -0
  204. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_vendor_trees.py +0 -0
  205. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_videofilter.py +0 -0
  206. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_videotypes.py +0 -0
  207. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_yolo_overlay.py +0 -0
  208. {qvideo-4.0.0 → qvideo-4.0.1}/tests/test_yolodemo.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.0.0
3
+ Version: 4.0.1
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -5,7 +5,7 @@ and DVR.
5
5
 
6
6
  Run directly to launch a full camcorder application with camera selection::
7
7
 
8
- python -m QVideo.QCamcorder [-b|-c|-f|-i|-m|-p|-r|-v] [cameraID]
8
+ python -m QVideo.QCamcorder [-b|-c|-f|-i|-m|-p|-v] [cameraID]
9
9
 
10
10
  Camera flags (mutually exclusive):
11
11
 
@@ -17,7 +17,6 @@ Camera flags (mutually exclusive):
17
17
  -i [cameraID] IDS Imaging camera (requires IDS peak SDK)
18
18
  -m [cameraID] MATRIX VISION mvGenTLProducer (universal GenICam, not FLIR)
19
19
  -p [cameraID] Raspberry Pi camera module (requires picamera2)
20
- -r [cameraID] OpenCV camera with resolution drop-down selector
21
20
  -v [cameraID] Allied Vision VimbaX camera
22
21
  -h Show help and exit
23
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QVideo
3
- Version: 4.0.0
3
+ Version: 4.0.1
4
4
  Summary: PyQt-based framework for integrating video cameras into research applications
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GPL-3.0-or-later
@@ -477,9 +477,51 @@ class QGenicamCamera(QCamera):
477
477
  node = self.node(feature)
478
478
  if node is None:
479
479
  return False
480
- mode = node.node.get_access_mode()
480
+ with self._mutex:
481
+ mode = node.node.get_access_mode()
481
482
  return (mode == EAccessMode.RW) or (feature in self._protected)
482
483
 
484
+ def state(self, name: str) -> dict[str, object]:
485
+ '''Return a snapshot of the named node, read under the device lock.
486
+
487
+ Read the device through this method, not through :meth:`node`,
488
+ wherever acquisition may be running (for example a GUI that polls
489
+ the hardware): it never overlaps a frame read.
490
+
491
+ Parameters
492
+ ----------
493
+ name : str
494
+ GenICam node name. It must exist (see :meth:`has_node`).
495
+
496
+ Returns
497
+ -------
498
+ dict
499
+ ``access`` (:class:`EAccessMode`) and ``kind`` (``'int'``,
500
+ ``'float'``, ``'enum'`` or ``'other'``) always; ``min``,
501
+ ``max`` and ``inc`` for numbers (``inc`` is ``None`` when the
502
+ node has no increment); ``entries`` (symbolic names) for an
503
+ enumeration; and ``value`` when the node is readable.
504
+ '''
505
+ node = self.node(name)
506
+ with self._mutex:
507
+ access = node.node.get_access_mode()
508
+ state = {'access': access, 'kind': 'other'}
509
+ if isinstance(node, IInteger):
510
+ state.update(kind='int', min=node.min, max=node.max,
511
+ inc=node.inc)
512
+ elif isinstance(node, IFloat):
513
+ state.update(kind='float', min=node.min, max=node.max,
514
+ inc=node.inc if node.has_inc() else None)
515
+ elif isinstance(node, IEnumeration):
516
+ state.update(kind='enum',
517
+ entries=[v.symbolic for v in node.entries])
518
+ if access in (EAccessMode.RO, EAccessMode.RW):
519
+ if isinstance(node, IEnumeration):
520
+ state['value'] = node.to_string()
521
+ elif isinstance(node, IProperty):
522
+ state['value'] = node.value
523
+ return state
524
+
483
525
 
484
526
  class QGenicamSource(QVideoSource):
485
527
 
@@ -243,34 +243,31 @@ class QGenicamTree(QCameraTree):
243
243
  name = p.opts.get('name')
244
244
  if not self.camera.has_node(name):
245
245
  continue
246
- node = self.camera.node(name)
247
- if isinstance(node, IInteger):
248
- p.setOpts(limits=(node.min, node.max), step=node.inc)
249
- elif isinstance(node, IFloat):
246
+ state = self.camera.state(name)
247
+ kind, inc = state['kind'], state.get('inc')
248
+ if kind == 'int':
249
+ p.setOpts(limits=(state['min'], state['max']), step=inc)
250
+ elif kind == 'float':
250
251
  scale = self._scaleFactors.get(name, 1.0)
251
- opts = {'limits': (node.min * scale, node.max * scale)}
252
+ opts = {'limits': (state['min'] * scale,
253
+ state['max'] * scale)}
252
254
  if name in self._decParams:
253
255
  value = p.value()
254
256
  if value > 0:
255
257
  step = 10 ** (math.floor(math.log10(value)) - 1)
256
- if node.has_inc():
257
- step = max(step, node.inc * scale)
258
+ if inc is not None:
259
+ step = max(step, inc * scale)
258
260
  opts['step'] = step
259
- elif node.has_inc():
260
- opts['step'] = node.inc * scale
261
+ elif inc is not None:
262
+ opts['step'] = inc * scale
261
263
  p.setOpts(**opts)
262
- elif isinstance(node, IEnumeration):
263
- p.setOpts(limits=[v.symbolic for v in node.entries])
264
-
265
- def _nodeValue(self, name: str, node: IValue) -> object:
266
- '''Read the current value of a node, applying any scale factor.'''
267
- if isinstance(node, IEnumeration):
268
- value = node.to_string()
269
- elif isinstance(node, (IBoolean, IInteger, IFloat, IString)):
270
- value = node.value
271
- else:
272
- return None
273
- if name in self._scaleFactors:
264
+ elif kind == 'enum':
265
+ p.setOpts(limits=state['entries'])
266
+
267
+ def _scaledValue(self, name: str, state: dict) -> object:
268
+ '''Return the value in a node snapshot, applying any scale factor.'''
269
+ value = state.get('value')
270
+ if value is not None and name in self._scaleFactors:
274
271
  value *= self._scaleFactors[name]
275
272
  return value
276
273
 
@@ -289,10 +286,10 @@ class QGenicamTree(QCameraTree):
289
286
  name = p.opts.get('name')
290
287
  if not self.camera.has_node(name):
291
288
  continue
292
- node = self.camera.node(name)
293
- if node.node.get_access_mode() != EAccessMode.RO:
289
+ state = self.camera.state(name)
290
+ if state['access'] != EAccessMode.RO:
294
291
  continue
295
- value = self._nodeValue(name, node)
292
+ value = self._scaledValue(name, state)
296
293
  if value is None:
297
294
  continue
298
295
  p.blockSignals(True)
@@ -333,11 +330,10 @@ class QGenicamTree(QCameraTree):
333
330
  name = p.opts.get('name')
334
331
  if not self.camera.has_node(name):
335
332
  continue
336
- node = self.camera.node(name)
337
- mode = node.node.get_access_mode()
338
- if mode not in (EAccessMode.RO, EAccessMode.RW):
333
+ state = self.camera.state(name)
334
+ if state['access'] not in (EAccessMode.RO, EAccessMode.RW):
339
335
  continue
340
- value = self._nodeValue(name, node)
336
+ value = self._scaledValue(name, state)
341
337
  if value is None:
342
338
  continue
343
339
  p.setValue(value)
@@ -243,9 +243,7 @@ class QOpenCVCamera(QCamera):
243
243
  Stores the value for the next :meth:`_initialize` and writes it to
244
244
  the device immediately. OpenCV's V4L2 backend handles the required
245
245
  ``VIDIOC_STREAMOFF`` / ``VIDIOC_S_FMT`` / ``VIDIOC_STREAMON`` cycle
246
- internally, so no device close/reopen is needed. The caller must not
247
- be holding :attr:`~QVideo.lib.QCamera.QCamera.mutex` — use
248
- :meth:`~QVideo.lib.QCamera.QCamera.set` which acquires it.
246
+ internally, so no device close/reopen is needed.
249
247
  '''
250
248
  self._configWidth = int(value)
251
249
  self._device.set(self.WIDTH, self._configWidth)
@@ -1,12 +1,14 @@
1
1
  '''Abstract base class for all QVideo camera backends.'''
2
2
  from abc import abstractmethod
3
3
  from collections.abc import Callable
4
+ from functools import wraps
4
5
  from types import TracebackType
5
6
  from qtpy import QtCore
6
7
  from QVideo.lib._qabc import QABCMeta
7
8
  from QVideo.lib.videotypes import Image
8
9
  import numpy as np
9
10
  import logging
11
+ import threading
10
12
 
11
13
 
12
14
  logger = logging.getLogger(__name__)
@@ -68,11 +70,14 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
68
70
 
69
71
  Notes
70
72
  -----
71
- ``QCamera`` holds a single non-recursive :attr:`mutex`. :meth:`set`,
72
- :meth:`get`, :meth:`execute`, and :meth:`saferead` all acquire it,
73
- so subclass :meth:`read` implementations must not call back into
74
- any of those methods or a deadlock will result. Pause and resume
75
- control is the responsibility of the enclosing :class:`QVideoSource`.
73
+ One reentrant lock serializes all access to the device. Every
74
+ registered getter, setter and method, and :meth:`saferead`, runs
75
+ holding it, so no property is read or written while a frame is
76
+ being read, and a multi-step change (stop acquisition, set, restart)
77
+ is never interleaved with anything else. Backends need no locking of
78
+ their own, and may freely call one another's properties. Pause and
79
+ resume control is the responsibility of the enclosing
80
+ :class:`QVideoSource`.
76
81
  '''
77
82
 
78
83
  PropertyValue = bool | int | float | str
@@ -86,7 +91,7 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
86
91
 
87
92
  def __init__(self, *args, **kwargs) -> None:
88
93
  super().__init__(*args, **kwargs)
89
- self._mutex = QtCore.QMutex()
94
+ self._mutex = threading.RLock()
90
95
  self._properties: dict[str, dict[str, object]] = {}
91
96
  self._methods: dict[str, Callable[[], object]] = {}
92
97
  self._isOpen = False
@@ -117,7 +122,7 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
117
122
  def __setattr__(self, name: str, value) -> None:
118
123
  '''Delegate attribute assignment to registered property setters.
119
124
 
120
- Routes ``camera.fps = 30`` through :meth:`set` (mutex-protected,
125
+ Routes ``camera.fps = 30`` through :meth:`set` (serialized with reads,
121
126
  type-coerced) for any name in ``_properties``. All other names —
122
127
  including internal backing attributes and Qt object attributes —
123
128
  fall through to ``super().__setattr__``.
@@ -177,7 +182,9 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
177
182
  if setter is _AUTO:
178
183
  def setter(v): return setattr(self, f'_{name}', ptype(v))
179
184
  self._properties[name] = dict(
180
- getter=getter, setter=setter, ptype=ptype, **meta)
185
+ getter=self._serialized(getter),
186
+ setter=self._serialized(setter),
187
+ ptype=ptype, **meta)
181
188
 
182
189
  def registerMethod(self, name: str, method: Callable[[], object]) -> None:
183
190
  '''Register a named callable method.
@@ -189,7 +196,18 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
189
196
  method : callable
190
197
  Zero-argument callable to invoke.
191
198
  '''
192
- self._methods[name] = method
199
+ self._methods[name] = self._serialized(method)
200
+
201
+ def _serialized(self, function: Callable | None) -> Callable | None:
202
+ '''Wrap *function* so that it runs holding the device lock.'''
203
+ if function is None:
204
+ return None
205
+
206
+ @wraps(function)
207
+ def locked(*args):
208
+ with self._mutex:
209
+ return function(*args)
210
+ return locked
193
211
 
194
212
  # ------------------------------------------------------------------
195
213
  # Open / close lifecycle
@@ -299,16 +317,15 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
299
317
  value : PropertyValue
300
318
  New value to assign.
301
319
  '''
302
- with QtCore.QMutexLocker(self._mutex):
303
- if key not in self._properties:
304
- logger.error(f'Unknown property: {key}')
305
- return
306
- setter = self._properties[key]['setter']
307
- if setter is None:
308
- logger.warning(f'Property {key!r} is read-only')
309
- else:
310
- logger.debug(f'Setting {key}: {value}')
311
- setter(value)
320
+ if key not in self._properties:
321
+ logger.error(f'Unknown property: {key}')
322
+ return
323
+ setter = self._properties[key]['setter']
324
+ if setter is None:
325
+ logger.warning(f'Property {key!r} is read-only')
326
+ else:
327
+ logger.debug(f'Setting {key}: {value}')
328
+ setter(value)
312
329
 
313
330
  @QtCore.Slot(str)
314
331
  def get(self, key: str) -> PropertyValue | None:
@@ -326,12 +343,10 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
326
343
  PropertyValue or None
327
344
  Current value, or ``None`` if the property is unknown.
328
345
  '''
329
- with QtCore.QMutexLocker(self._mutex):
330
- if key in self._properties:
331
- value = self._properties[key]['getter']()
332
- else:
333
- logger.error(f'Unknown property: {key}')
334
- return None
346
+ if key not in self._properties:
347
+ logger.error(f'Unknown property: {key}')
348
+ return None
349
+ value = self._properties[key]['getter']()
335
350
  self.propertyValue.emit(key, value)
336
351
  return value
337
352
 
@@ -344,11 +359,10 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
344
359
  key : str
345
360
  Method name.
346
361
  '''
347
- with QtCore.QMutexLocker(self._mutex):
348
- if key in self._methods:
349
- self._methods[key]()
350
- else:
351
- logger.error(f'Unknown method: {key}')
362
+ if key in self._methods:
363
+ self._methods[key]()
364
+ else:
365
+ logger.error(f'Unknown method: {key}')
352
366
 
353
367
  # ------------------------------------------------------------------
354
368
  # Frame acquisition
@@ -363,11 +377,6 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
363
377
  tuple[bool, Image or None]
364
378
  ``(True, frame)`` on success, ``(False, None)`` on failure.
365
379
 
366
- Notes
367
- -----
368
- Must not call :meth:`set`, :meth:`get`, :meth:`execute`, or
369
- :meth:`saferead` — those methods acquire the same non-recursive
370
- mutex that :meth:`saferead` holds while invoking ``read()``.
371
380
  '''
372
381
 
373
382
  def saferead(self) -> CameraData:
@@ -381,7 +390,7 @@ class QCamera(QtCore.QObject, metaclass=QABCMeta):
381
390
  tuple[bool, Image or None]
382
391
  Result of :meth:`read`.
383
392
  '''
384
- with QtCore.QMutexLocker(self._mutex):
393
+ with self._mutex:
385
394
  return self.read()
386
395
 
387
396
  # ------------------------------------------------------------------
@@ -76,6 +76,8 @@ class QCameraTree(ParameterTree):
76
76
  'default': value}
77
77
  if spec['setter'] is None:
78
78
  entry['enabled'] = False
79
+ if spec.get('hidden'):
80
+ entry['visible'] = False
79
81
  if spec['ptype'] is str and spec.get('limits'):
80
82
  entry.update(type='list', limits=spec['limits'])
81
83
  entries.append(entry)
@@ -143,6 +143,13 @@ class QVideoSource(QtCore.QThread):
143
143
  self.newFrame.emit(frame, info)
144
144
  logger.debug('streaming finished')
145
145
 
146
+ def __del__(self) -> None:
147
+ # Python state only: the flag is absent if construction failed and
148
+ # False once stopped, when Qt may already have deleted the object.
149
+ if vars(self).get('_running'):
150
+ self.stop()
151
+ self.wait()
152
+
146
153
  @QtCore.Slot()
147
154
  def start(self) -> 'QVideoSource':
148
155
  '''Start the capture thread.
@@ -59,6 +59,7 @@ from .QSnapshot import QSnapshot
59
59
  __all__ = '''Image
60
60
  FrameInfo
61
61
  clickable Camera choose_camera QListCameras
62
- QCamera QCameraError QDriverError QDeviceError QVideoSource QCameraTree QFilterRack QFilterStack
62
+ QCamera QCameraError QDriverError QDeviceError QVideoSource QCameraTree
63
+ QFilterRack QFilterStack
63
64
  QVideoReader QVideoWriter QVideoScreen
64
65
  QFPSMeter QHistogramWidget QUniformityWidget QSnapshot VideoFilter QVideoFilter'''.split()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "QVideo"
7
- version = "4.0.0"
7
+ version = "4.0.1"
8
8
  description = "PyQt-based framework for integrating video cameras into research applications"
9
9
  readme = "README.md"
10
10
  license = { text = "GPL-3.0-or-later" }
@@ -1,4 +1,6 @@
1
1
  '''Unit tests for QCamera.'''
2
+ import threading
3
+ import time
2
4
  import unittest
3
5
  import numpy as np
4
6
  from unittest.mock import patch
@@ -75,7 +77,7 @@ class TestInit(unittest.TestCase):
75
77
 
76
78
  def test_has_mutex(self):
77
79
  cam = make_camera()
78
- self.assertIsInstance(cam._mutex, QtCore.QMutex)
80
+ self.assertIsInstance(cam._mutex, type(threading.RLock()))
79
81
 
80
82
 
81
83
 
@@ -428,5 +430,60 @@ class TestExecute(unittest.TestCase):
428
430
  cam.execute('nonexistent')
429
431
 
430
432
 
433
+ class TestSerialization(unittest.TestCase):
434
+ '''No device access overlaps a frame read, by any route.'''
435
+
436
+ def setUp(self):
437
+ self.cam = make_camera()
438
+ self.reading = threading.Event()
439
+ self.overlaps = []
440
+
441
+ def slow_read():
442
+ self.reading.set()
443
+ time.sleep(0.15)
444
+ self.reading.clear()
445
+ return True, np.zeros((4, 4), dtype=np.uint8)
446
+
447
+ def checked(value):
448
+ def getter():
449
+ self.overlaps.append(self.reading.is_set())
450
+ return value
451
+ return getter
452
+
453
+ self.cam.read = slow_read
454
+ self.cam.registerProperty('probe', getter=checked(1), ptype=int)
455
+ self.cam.registerMethod('act', checked(None))
456
+
457
+ def during_a_read(self, access):
458
+ thread = threading.Thread(target=self.cam.saferead)
459
+ thread.start()
460
+ self.reading.wait(1)
461
+ access()
462
+ thread.join()
463
+ self.assertEqual(self.overlaps, [False])
464
+
465
+ def test_attribute_access(self):
466
+ self.during_a_read(lambda: self.cam.probe)
467
+
468
+ def test_get(self):
469
+ self.during_a_read(lambda: self.cam.get('probe'))
470
+
471
+ def test_settings(self):
472
+ self.during_a_read(lambda: self.cam.settings)
473
+
474
+ def test_execute(self):
475
+ self.during_a_read(lambda: self.cam.execute('act'))
476
+
477
+ def test_set(self):
478
+ self.cam.registerProperty('probe', getter=lambda: 1, ptype=int,
479
+ setter=lambda v: self.overlaps.append(
480
+ self.reading.is_set()))
481
+ self.during_a_read(lambda: self.cam.set('probe', 2))
482
+
483
+ def test_a_setter_may_read_other_properties(self):
484
+ self.cam.set('width', 320)
485
+ self.assertEqual(self.cam.shape.width(), 320)
486
+
487
+
431
488
  if __name__ == '__main__':
432
489
  unittest.main()
@@ -2,6 +2,7 @@
2
2
  import os
3
3
  import subprocess
4
4
  import sys
5
+ import threading
5
6
  import unittest
6
7
  import numpy as np
7
8
  from unittest.mock import MagicMock, patch
@@ -726,6 +727,73 @@ class TestExecute(unittest.TestCase):
726
727
  # TestIsReadwrite
727
728
  # ---------------------------------------------------------------------------
728
729
 
730
+ class TestState(unittest.TestCase):
731
+ '''A snapshot of a node, read under the device lock.'''
732
+
733
+ def state_of(self, feature):
734
+ cam, _, device = make_camera()
735
+ device.remote_device.node_map.get_node.return_value = feature
736
+ return cam, cam.state(feature.node.name)
737
+
738
+ def test_integer(self):
739
+ feature = _make_feature(_IInteger, name='Width', value=640,
740
+ min=64, max=1920, inc=4)
741
+ _, state = self.state_of(feature)
742
+ self.assertEqual(state, dict(access=_EAccessMode.RW, kind='int',
743
+ min=64, max=1920, inc=4, value=640))
744
+
745
+ def test_float_with_increment(self):
746
+ feature = _make_feature(_IFloat, name='Gamma', value=1.,
747
+ min=.1, max=4., inc=.1)
748
+ feature.has_inc.return_value = True
749
+ _, state = self.state_of(feature)
750
+ self.assertEqual((state['kind'], state['inc']), ('float', .1))
751
+
752
+ def test_float_without_increment(self):
753
+ feature = _make_feature(_IFloat, name='Gamma', value=1.,
754
+ min=.1, max=4.)
755
+ feature.has_inc.return_value = False
756
+ _, state = self.state_of(feature)
757
+ self.assertIsNone(state['inc'])
758
+
759
+ def test_enumeration(self):
760
+ feature = _make_feature(_IEnumeration, name='PixelFormat')
761
+ feature.to_string.return_value = 'Mono8'
762
+ entry = MagicMock()
763
+ entry.symbolic = 'Mono8'
764
+ feature.entries = [entry]
765
+ _, state = self.state_of(feature)
766
+ self.assertEqual(state['kind'], 'enum')
767
+ self.assertEqual(state['entries'], ['Mono8'])
768
+ self.assertEqual(state['value'], 'Mono8')
769
+
770
+ def test_command_has_neither_value_nor_limits(self):
771
+ feature = _make_feature(_ICommand, name='AcquisitionStop')
772
+ _, state = self.state_of(feature)
773
+ self.assertEqual(state, dict(access=_EAccessMode.RW, kind='other'))
774
+
775
+ def test_unreadable_node_reports_no_value(self):
776
+ feature = _make_feature(_IInteger, name='Width', mode='WO',
777
+ min=0, max=1, inc=1)
778
+ feature.value = None
779
+ _, state = self.state_of(feature)
780
+ self.assertNotIn('value', state)
781
+
782
+ def test_state_waits_for_a_read_in_progress(self):
783
+ feature = _make_feature(_IInteger, name='Width', value=1,
784
+ min=0, max=1, inc=1)
785
+ cam, _, device = make_camera()
786
+ device.remote_device.node_map.get_node.return_value = feature
787
+ done = threading.Event()
788
+ thread = threading.Thread(
789
+ target=lambda: (cam.state('Width'), done.set()))
790
+ with cam._mutex:
791
+ thread.start()
792
+ self.assertFalse(done.wait(0.1))
793
+ self.assertTrue(done.wait(1))
794
+ thread.join()
795
+
796
+
729
797
  class TestIsReadwrite(unittest.TestCase):
730
798
 
731
799
  def test_rw_mode_returns_true(self):
@@ -149,6 +149,17 @@ class TestResolutionEnum(unittest.TestCase):
149
149
  if 'fps' in tree._parameters:
150
150
  self.assertFalse(tree._parameters['fps'].opts.get('enabled', True))
151
151
 
152
+ def test_width_height_fps_hidden_when_formats_available(self):
153
+ tree, _ = make_tree()
154
+ for name in ('width', 'height', 'fps'):
155
+ if name in tree._parameters:
156
+ self.assertFalse(tree._parameters[name].opts['visible'])
157
+
158
+ def test_width_height_shown_when_no_formats(self):
159
+ tree, _ = make_tree(formats=[])
160
+ for name in ('width', 'height'):
161
+ self.assertTrue(tree._parameters[name].opts.get('visible', True))
162
+
152
163
  def test_resolution_labels_contain_dimensions(self):
153
164
  tree, _ = make_tree()
154
165
  limits = tree._parameters['resolution'].opts.get('limits', {})
@@ -1,4 +1,6 @@
1
1
  '''Unit tests for QVideoSource.'''
2
+ import subprocess
3
+ import sys
2
4
  import time
3
5
  import unittest
4
6
  import numpy as np
@@ -336,5 +338,35 @@ class TestRun(unittest.TestCase):
336
338
  self.assertTrue(finished)
337
339
 
338
340
 
341
+ class TestDroppingARunningSource(unittest.TestCase):
342
+
343
+ CODE = """
344
+ import os
345
+ os.environ['QT_QPA_PLATFORM'] = 'offscreen'
346
+ import gc
347
+ from qtpy import QtWidgets
348
+ app = QtWidgets.QApplication([])
349
+ from QVideo.cameras.Noise import QNoiseCamera
350
+ from QVideo.lib import QVideoSource
351
+
352
+
353
+ def build():
354
+ source = QVideoSource(QNoiseCamera()).start()
355
+ assert source.isRunning()
356
+
357
+
358
+ build()
359
+ gc.collect()
360
+ print('survived')
361
+ """
362
+
363
+ def test_dropping_a_running_source_is_safe(self):
364
+ result = subprocess.run([sys.executable, '-c', self.CODE],
365
+ capture_output=True, text=True)
366
+ self.assertEqual(result.returncode, 0, result.stderr[-400:])
367
+ self.assertIn('survived', result.stdout)
368
+ self.assertNotIn('Destroyed while thread', result.stderr)
369
+
370
+
339
371
  if __name__ == '__main__':
340
372
  unittest.main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes