ponkan-python 0.2.0__tar.gz → 0.2.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.
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/PKG-INFO +2 -2
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/docs/api.md +1 -1
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/pyproject.toml +1 -1
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/streaming/engine.py +14 -8
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_streaming_engine_fake_async.py +16 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/.gitignore +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/LICENSE +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/NOTICE.md +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/README.md +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/docs/publishing.md +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/artifacts.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/capture.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/devices/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/devices/discovery.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/devices/n3dsxl_ftd3.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/errors.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/hardware_gate.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/image/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/image/frame.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/layouts.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/profiles.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/protocol/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/protocol/layout_3ds.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/protocol/n3dsxl.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/protocol/sizes.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/py.typed +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/streaming/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/streaming/buffers.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/streaming/policies.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/streaming/stats.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/tools/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/tools/capture_raw.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/tools/list_devices.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/tools/raw_to_png.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/tools/stream_n3dsxl.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/__init__.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/d3xx_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/d3xx_native.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/d3xx_native_streaming.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/d3xx_streaming.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/ftd3_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/ftd3_pipe.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/libusb_async.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/src/ponkan/transport/libusb_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/conftest.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/README.md +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_connect.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_d3xx_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_d3xx_native_streaming.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_ftd3_pipe.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_high_level_capture_read_api.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_open_close.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_raw_capture.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_streaming.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/manual/test_n3dsxl_decoder_visual.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/performance/README.md +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/performance/test_n3dsxl_d3xx_native_streaming_smoke.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/performance/test_n3dsxl_streaming_smoke.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_capture_device_discovery.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_capture_layout_metadata.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_capture_profiles.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_codex_pre_tool_use_policy.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_d3xx_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_d3xx_native_api.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_d3xx_native_streaming_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_d3xx_streaming_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_ftd3_backend_selector.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_ftd3_pipe_payloads.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_hardware_gate.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_high_level_capture_read_api.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_layout_3ds_decoder.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_libusb_backend.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_artifacts.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_connect_sequence.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_device_filter.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_list_devices_cli.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_session.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_n3dsxl_sizes.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_package.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_raw_capture_metadata.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_stream_n3dsxl_cli.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_streaming_buffers.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_streaming_performance_stats.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_streaming_policies.py +0 -0
- {ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_structured_capture_errors.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: ponkan-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A Python capture library focused on new 3DS XL capture board frame acquisition.
|
|
5
5
|
Project-URL: Documentation, https://github.com/niart120/ponkan-python/blob/master/docs/api.md
|
|
6
6
|
Project-URL: Homepage, https://github.com/niart120/ponkan-python
|
|
@@ -244,7 +244,7 @@ if frame is not None:
|
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
`CaptureReader.stats()` returns a `StreamStats` snapshot from the underlying
|
|
247
|
-
streaming engine. `CaptureReader.close()` is idempotent and
|
|
247
|
+
streaming engine. `CaptureReader.close()` is idempotent and releases the backend even before the first read.
|
|
248
248
|
|
|
249
249
|
Backend selection note: starting with the current unreleased changes,
|
|
250
250
|
`backend="auto"` shares the discovery resolver and uses `"d3xx-native"` on
|
|
@@ -63,6 +63,7 @@ class StreamingEngine:
|
|
|
63
63
|
self._stats = StreamStats()
|
|
64
64
|
self._completion_queue: queue.Queue[RawFrameResult] = queue.Queue(maxsize=raw_slots)
|
|
65
65
|
self._running = False
|
|
66
|
+
self._released = False
|
|
66
67
|
self._next_sequence = 0
|
|
67
68
|
self._timing = StreamTimingCollector() if collect_timing else None
|
|
68
69
|
|
|
@@ -72,6 +73,9 @@ class StreamingEngine:
|
|
|
72
73
|
The method is idempotent while already running. Each slot is checked out
|
|
73
74
|
and submitted once.
|
|
74
75
|
"""
|
|
76
|
+
if self._released:
|
|
77
|
+
message = "streaming backend has already been released"
|
|
78
|
+
raise RuntimeError(message)
|
|
75
79
|
if self._running:
|
|
76
80
|
return
|
|
77
81
|
self._running = True
|
|
@@ -86,16 +90,18 @@ class StreamingEngine:
|
|
|
86
90
|
shutdown drains using the backend's own semantics.
|
|
87
91
|
"""
|
|
88
92
|
_ = timeout
|
|
89
|
-
if
|
|
93
|
+
if self._released:
|
|
90
94
|
return
|
|
91
|
-
self._running
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
if self._running or self.buffer_pool.in_use_count():
|
|
96
|
+
self._running = False
|
|
97
|
+
self._stats.cancelled += self.buffer_pool.in_use_count()
|
|
98
|
+
self.backend.cancel_all()
|
|
99
|
+
self.backend.drain()
|
|
100
|
+
for slot in self.buffer_pool.slots:
|
|
101
|
+
if slot.in_use:
|
|
102
|
+
self.buffer_pool.release(slot.index)
|
|
98
103
|
self.backend.release()
|
|
104
|
+
self._released = True
|
|
99
105
|
|
|
100
106
|
def process_completed(self, *, limit: int | None = None) -> int:
|
|
101
107
|
"""Decode completed raw results outside the callback.
|
|
@@ -4,6 +4,7 @@ import time
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import pytest
|
|
6
6
|
|
|
7
|
+
from ponkan.capture import CaptureReader
|
|
7
8
|
from ponkan.image.frame import CaptureFrame
|
|
8
9
|
from ponkan.protocol.sizes import BOTTOM_WIDTH_3DS, HEIGHT_3DS, TOP_WIDTH_3DS, video_size
|
|
9
10
|
from ponkan.streaming.buffers import RawFrameSlot
|
|
@@ -288,3 +289,18 @@ def test_stop_uses_cancel_drain_release_order() -> None:
|
|
|
288
289
|
assert backend.calls[-3:] == ["cancel_all", "drain", "release"]
|
|
289
290
|
assert engine.buffer_pool.in_use_count() == 0
|
|
290
291
|
assert engine.stats().cancelled == 2
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def test_reader_closed_before_first_read_releases_owned_backend_once() -> None:
|
|
295
|
+
backend = _FakeAsyncBackend()
|
|
296
|
+
engine = StreamingEngine(backend)
|
|
297
|
+
reader = CaptureReader(engine)
|
|
298
|
+
|
|
299
|
+
reader.close()
|
|
300
|
+
assert backend.calls == ["release"]
|
|
301
|
+
engine.stop()
|
|
302
|
+
|
|
303
|
+
assert backend.calls.count("release") == 1
|
|
304
|
+
with pytest.raises(RuntimeError, match="released"):
|
|
305
|
+
engine.start()
|
|
306
|
+
assert not backend.submitted
|
|
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
|
|
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
|
|
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
|
|
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
|
{ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/e2e/test_n3dsxl_high_level_capture_read_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/performance/test_n3dsxl_streaming_smoke.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ponkan_python-0.2.0 → ponkan_python-0.2.1}/tests/unit/test_d3xx_native_streaming_backend.py
RENAMED
|
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
|
|
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
|