chenpi 0.3.1__tar.gz → 0.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chenpi
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Read DS/3DS capture boards (Loopy DS, Optimize Old 3DS) as OpenCV/numpy images on Windows
5
5
  Author: Lizz
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "chenpi"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "Read DS/3DS capture boards (Loopy DS, Optimize Old 3DS) as OpenCV/numpy images on Windows"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "chenpi"
3
- version = "0.3.1"
3
+ version = "0.3.2"
4
4
  description = "Read DS/3DS capture boards (Loopy DS, Optimize Old 3DS) as OpenCV/numpy images on Windows"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -901,7 +901,8 @@ class Optimize3DSCapture:
901
901
  if not signal: # 様子見の 1 本に届いた: 全部の読み込みで出し直す
902
902
  break
903
903
  slots.popleft()
904
- stream += o.buf.raw[:n]
904
+ with memoryview(o.buf) as view: # .raw[:n] だと 128KB を 2 回コピーする
905
+ stream += view[:n]
905
906
  self.dev.start_read(o)
906
907
  slots.append(o)
907
908
  while True:
@@ -919,7 +920,9 @@ class Optimize3DSCapture:
919
920
  continue
920
921
  if len(stream) < size:
921
922
  break
922
- raw = bytes(stream[:size])
923
+ # bytes(stream[:size]) だと 2 回コピーする。del stream[...] の前に view を手放すこと (BufferError になる)
924
+ with memoryview(stream) as view:
925
+ raw = bytes(view[:size])
923
926
  if not is_frame_synced(raw):
924
927
  synced = False
925
928
  del stream[:2]
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