turbopipe 1.1.0__cp38-cp38-macosx_11_0_arm64.whl → 1.2.1__cp38-cp38-macosx_11_0_arm64.whl
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.
Potentially problematic release.
This version of turbopipe might be problematic. Click here for more details.
- turbopipe/__init__.py +9 -6
- turbopipe/_turbopipe.cpython-38-darwin.so +0 -0
- {turbopipe-1.1.0.dist-info → turbopipe-1.2.1.dist-info}/METADATA +6 -3
- turbopipe-1.2.1.dist-info/RECORD +6 -0
- turbopipe-1.1.0.dist-info/RECORD +0 -6
- {turbopipe-1.1.0.dist-info → turbopipe-1.2.1.dist-info}/License.md +0 -0
- {turbopipe-1.1.0.dist-info → turbopipe-1.2.1.dist-info}/WHEEL +0 -0
turbopipe/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Union
|
|
1
|
+
from typing import Optional, Union
|
|
2
2
|
|
|
3
3
|
from moderngl import Buffer
|
|
4
4
|
|
|
@@ -7,8 +7,8 @@ from turbopipe import _turbopipe
|
|
|
7
7
|
|
|
8
8
|
def pipe(buffer: Union[Buffer, memoryview], fileno: int) -> None:
|
|
9
9
|
"""
|
|
10
|
-
Pipe the content of a moderngl.Buffer or memoryview to a file descriptor,
|
|
11
|
-
|
|
10
|
+
Pipe the content of a moderngl.Buffer or memoryview to a file descriptor, fast, threaded and
|
|
11
|
+
blocking when needed. Call `sync(buffer)` before this, and `sync()` when done for
|
|
12
12
|
|
|
13
13
|
Usage:
|
|
14
14
|
```python
|
|
@@ -29,9 +29,12 @@ def pipe(buffer: Union[Buffer, memoryview], fileno: int) -> None:
|
|
|
29
29
|
_turbopipe.pipe(buffer, fileno)
|
|
30
30
|
del buffer
|
|
31
31
|
|
|
32
|
-
def sync() -> None:
|
|
33
|
-
"""Waits for all
|
|
34
|
-
|
|
32
|
+
def sync(buffer: Optional[Union[Buffer, memoryview]]=None) -> None:
|
|
33
|
+
"""Waits for any pending write operation on a buffer, or 'all buffers' if None, to finish"""
|
|
34
|
+
if isinstance(buffer, Buffer):
|
|
35
|
+
buffer = memoryview(buffer.mglo)
|
|
36
|
+
_turbopipe.sync(buffer)
|
|
37
|
+
del buffer
|
|
35
38
|
|
|
36
39
|
def close() -> None:
|
|
37
40
|
"""Syncs and deletes objects"""
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: turbopipe
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: 🌀 Faster MemoryView inter-process data transfers for subprocesses
|
|
5
5
|
Home-page: https://brokensrc.dev
|
|
6
6
|
Author-Email: Tremeschin <29046864+Tremeschin@users.noreply.github.com>
|
|
@@ -100,7 +100,7 @@ import turbopipe
|
|
|
100
100
|
|
|
101
101
|
# Create ModernGL objects
|
|
102
102
|
ctx = moderngl.create_standalone_context()
|
|
103
|
-
|
|
103
|
+
buffers = [ctx.buffer(reserve=1920*1080*3) for _ in range(2)]
|
|
104
104
|
|
|
105
105
|
# Make sure resolution, pixel format matches!
|
|
106
106
|
ffmpeg = subprocess.Popen(
|
|
@@ -109,7 +109,10 @@ ffmpeg = subprocess.Popen(
|
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
# Rendering loop of yours (eg. 1m footage)
|
|
112
|
-
for
|
|
112
|
+
for frame in range(60 * 60):
|
|
113
|
+
buffer = buffers[frame % len(buffer)]
|
|
114
|
+
turbopipe.sync(buffer)
|
|
115
|
+
fbo.read_into(buffer)
|
|
113
116
|
turbopipe.pipe(buffer, ffmpeg.stdin.fileno())
|
|
114
117
|
|
|
115
118
|
# Finalize writing, encoding
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
turbopipe/_turbopipe.cpython-38-darwin.so,sha256=AU3mK2gdF4sIYvlkShSExE7e9_ai3aJC4ecXvX3SsIk,77024
|
|
2
|
+
turbopipe/__init__.py,sha256=G5UDJHOgRTkf1viJAKRcsP8eud_2Mx5ToMC9qTqOYZ4,1299
|
|
3
|
+
turbopipe-1.2.1.dist-info/License.md,sha256=it5BPGKEP68XuUE54o2wVWR8NeWowkvb5dQO62UPeo8,1075
|
|
4
|
+
turbopipe-1.2.1.dist-info/RECORD,,
|
|
5
|
+
turbopipe-1.2.1.dist-info/WHEEL,sha256=gixTN0HsYR5PX8c0wEAoSTr9rAlXoRH7dBcjFiFpBp8,91
|
|
6
|
+
turbopipe-1.2.1.dist-info/METADATA,sha256=8Bf_FoqBhIWrTcK-17_tvkAlsas4O00p-8vCJXhcDk0,21836
|
turbopipe-1.1.0.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
turbopipe/_turbopipe.cpython-38-darwin.so,sha256=W1NXhLE8tM5F4Y7lbCvhomSp103WXMCWqxsr7g5OVzs,76848
|
|
2
|
-
turbopipe/__init__.py,sha256=vDOOrpFDLHBpftUk1Jr-QoRd1lOLkhg-0kRvHUAyArk,1043
|
|
3
|
-
turbopipe-1.1.0.dist-info/License.md,sha256=it5BPGKEP68XuUE54o2wVWR8NeWowkvb5dQO62UPeo8,1075
|
|
4
|
-
turbopipe-1.1.0.dist-info/RECORD,,
|
|
5
|
-
turbopipe-1.1.0.dist-info/WHEEL,sha256=gixTN0HsYR5PX8c0wEAoSTr9rAlXoRH7dBcjFiFpBp8,91
|
|
6
|
-
turbopipe-1.1.0.dist-info/METADATA,sha256=lKFUmRKCCjpY1gaAG4_WuqTKoaUZFKN0JQeSIkfvlLg,21716
|
|
File without changes
|
|
File without changes
|