libdatachannel-py 2025.1.0.dev10__tar.gz → 2025.1.0.dev12__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 (43) hide show
  1. {libdatachannel_py-2025.1.0.dev10/src/libdatachannel_py.egg-info → libdatachannel_py-2025.1.0.dev12}/PKG-INFO +2 -1
  2. libdatachannel_py-2025.1.0.dev12/VERSION +1 -0
  3. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/pyproject.toml +3 -0
  4. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/setup.py +1 -1
  5. libdatachannel_py-2025.1.0.dev12/src/libdatachannel/codec/__init__.py +1 -0
  6. libdatachannel_py-2025.1.0.dev12/src/libdatachannel/codec/__init__.pyi +376 -0
  7. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel/libdatachannel_ext.cpython-313-darwin.so +0 -0
  8. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel/libdatachannel_ext.pyi +15 -15
  9. libdatachannel_py-2025.1.0.dev12/src/libdatachannel/libyuv/__init__.py +1 -0
  10. libdatachannel_py-2025.1.0.dev12/src/libdatachannel/libyuv/__init__.pyi +187 -0
  11. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12/src/libdatachannel_py.egg-info}/PKG-INFO +2 -1
  12. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel_py.egg-info/SOURCES.txt +5 -0
  13. libdatachannel_py-2025.1.0.dev12/src/libdatachannel_py.egg-info/requires.txt +1 -0
  14. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_libyuv.py +5 -5
  15. libdatachannel_py-2025.1.0.dev10/VERSION +0 -1
  16. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/LICENSE +0 -0
  17. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/MANIFEST.in +0 -0
  18. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/README.md +0 -0
  19. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/buildbase.py +0 -0
  20. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/pypath.py +0 -0
  21. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/run.py +0 -0
  22. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/setup.cfg +0 -0
  23. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel/__init__.py +0 -0
  24. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel/py.typed +0 -0
  25. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel_py.egg-info/dependency_links.txt +0 -0
  26. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/src/libdatachannel_py.egg-info/top_level.txt +0 -0
  27. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_audio_codec.py +0 -0
  28. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_candidate.py +0 -0
  29. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_configuration.py +0 -0
  30. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_description.py +0 -0
  31. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_frameinfo.py +0 -0
  32. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_h265nalunit.py +0 -0
  33. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_mediahandler.py +0 -0
  34. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_message.py +0 -0
  35. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_nalunit.py +0 -0
  36. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_packetizationconfig.py +0 -0
  37. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_peerconnection.py +0 -0
  38. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_prop_audio_codec.py +0 -0
  39. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_reliability.py +0 -0
  40. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_rtppacketizer.py +0 -0
  41. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_video_codec.py +0 -0
  42. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_websocket.py +0 -0
  43. {libdatachannel_py-2025.1.0.dev10 → libdatachannel_py-2025.1.0.dev12}/tests/test_websocketserver.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libdatachannel-py
3
- Version: 2025.1.0.dev10
3
+ Version: 2025.1.0.dev12
4
4
  Summary: libdatachannel-py is a Python binding for libdatachannel.
5
5
  Home-page: https://github.com/shiguredo/libdatachannel-py
6
6
  License-Expression: Apache-2.0
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.13
11
11
  Requires-Python: >=3.13
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Requires-Dist: mypy>=1.16.0
14
15
  Dynamic: home-page
15
16
  Dynamic: license-file
16
17
 
@@ -0,0 +1 @@
1
+ 2025.1.0.dev12
@@ -12,6 +12,9 @@ classifiers = [
12
12
  "Programming Language :: Python :: 3.13",
13
13
  ]
14
14
  requires-python = ">=3.13"
15
+ dependencies = [
16
+ "mypy>=1.16.0",
17
+ ]
15
18
 
16
19
  [project.urls]
17
20
  Source = "https://github.com/shiguredo/libdatachannel-py"
@@ -44,7 +44,7 @@ def run_setup(build_platform, target_platform):
44
44
  setup(
45
45
  version=version,
46
46
  url="https://github.com/shiguredo/libdatachannel-py",
47
- packages=["libdatachannel"],
47
+ packages=["libdatachannel", "libdatachannel.codec", "libdatachannel.libyuv"],
48
48
  package_dir={"": "src"},
49
49
  package_data={
50
50
  "libdatachannel": ["libdatachannel_ext.*"],
@@ -0,0 +1 @@
1
+ from ..libdatachannel_ext.codec import * # noqa: F401,F403
@@ -0,0 +1,376 @@
1
+ from collections.abc import Callable
2
+ import datetime
3
+ import enum
4
+ from typing import Annotated
5
+
6
+ from numpy.typing import ArrayLike
7
+
8
+
9
+ class VideoCodecType(enum.Enum):
10
+ H264 = 0
11
+
12
+ H265 = 1
13
+
14
+ VP8 = 2
15
+
16
+ VP9 = 3
17
+
18
+ AV1 = 4
19
+
20
+ class ImageFormat(enum.Enum):
21
+ I420 = 0
22
+
23
+ NV12 = 1
24
+
25
+ BGR888 = 2
26
+
27
+ class VideoFrameBufferI420:
28
+ @staticmethod
29
+ def create(arg0: int, arg1: int, /) -> VideoFrameBufferI420: ...
30
+
31
+ @property
32
+ def y(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')]: ...
33
+
34
+ @y.setter
35
+ def y(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')], /) -> None: ...
36
+
37
+ @property
38
+ def u(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')]: ...
39
+
40
+ @u.setter
41
+ def u(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')], /) -> None: ...
42
+
43
+ @property
44
+ def v(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')]: ...
45
+
46
+ @v.setter
47
+ def v(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')], /) -> None: ...
48
+
49
+ def width(self) -> int: ...
50
+
51
+ def height(self) -> int: ...
52
+
53
+ def stride_y(self) -> int: ...
54
+
55
+ def stride_u(self) -> int: ...
56
+
57
+ def stride_v(self) -> int: ...
58
+
59
+ class VideoFrameBufferNV12:
60
+ @staticmethod
61
+ def create(arg0: int, arg1: int, /) -> VideoFrameBufferNV12: ...
62
+
63
+ @property
64
+ def y(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')]: ...
65
+
66
+ @y.setter
67
+ def y(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')], /) -> None: ...
68
+
69
+ @property
70
+ def uv(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')]: ...
71
+
72
+ @uv.setter
73
+ def uv(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None), order='C')], /) -> None: ...
74
+
75
+ def width(self) -> int: ...
76
+
77
+ def height(self) -> int: ...
78
+
79
+ def stride_y(self) -> int: ...
80
+
81
+ def stride_uv(self) -> int: ...
82
+
83
+ class VideoFrameBufferBGR888:
84
+ @staticmethod
85
+ def create(arg0: int, arg1: int, /) -> VideoFrameBufferBGR888: ...
86
+
87
+ @property
88
+ def bgr(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None, 3), order='C')]: ...
89
+
90
+ @bgr.setter
91
+ def bgr(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None, None, 3), order='C')], /) -> None: ...
92
+
93
+ def width(self) -> int: ...
94
+
95
+ def height(self) -> int: ...
96
+
97
+ def stride(self) -> int: ...
98
+
99
+ class VideoFrame:
100
+ def __init__(self) -> None: ...
101
+
102
+ @property
103
+ def format(self) -> ImageFormat: ...
104
+
105
+ @format.setter
106
+ def format(self, arg: ImageFormat, /) -> None: ...
107
+
108
+ @property
109
+ def i420_buffer(self) -> VideoFrameBufferI420: ...
110
+
111
+ @i420_buffer.setter
112
+ def i420_buffer(self, arg: VideoFrameBufferI420, /) -> None: ...
113
+
114
+ @property
115
+ def nv12_buffer(self) -> VideoFrameBufferNV12: ...
116
+
117
+ @nv12_buffer.setter
118
+ def nv12_buffer(self, arg: VideoFrameBufferNV12, /) -> None: ...
119
+
120
+ @property
121
+ def bgr888_buffer(self) -> VideoFrameBufferBGR888: ...
122
+
123
+ @bgr888_buffer.setter
124
+ def bgr888_buffer(self, arg: VideoFrameBufferBGR888, /) -> None: ...
125
+
126
+ @property
127
+ def timestamp(self) -> datetime.timedelta: ...
128
+
129
+ @timestamp.setter
130
+ def timestamp(self, arg: datetime.timedelta | float, /) -> None: ...
131
+
132
+ @property
133
+ def rid(self) -> str | None: ...
134
+
135
+ @rid.setter
136
+ def rid(self, arg: str, /) -> None: ...
137
+
138
+ @property
139
+ def base_width(self) -> int: ...
140
+
141
+ @base_width.setter
142
+ def base_width(self, arg: int, /) -> None: ...
143
+
144
+ @property
145
+ def base_height(self) -> int: ...
146
+
147
+ @base_height.setter
148
+ def base_height(self, arg: int, /) -> None: ...
149
+
150
+ @property
151
+ def frame_number(self) -> int: ...
152
+
153
+ @frame_number.setter
154
+ def frame_number(self, arg: int, /) -> None: ...
155
+
156
+ def width(self) -> int: ...
157
+
158
+ def height(self) -> int: ...
159
+
160
+ class EncodedImage:
161
+ def __init__(self) -> None: ...
162
+
163
+ @property
164
+ def data(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None), order='C')]: ...
165
+
166
+ @data.setter
167
+ def data(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None), order='C')], /) -> None: ...
168
+
169
+ @property
170
+ def timestamp(self) -> datetime.timedelta: ...
171
+
172
+ @timestamp.setter
173
+ def timestamp(self, arg: datetime.timedelta | float, /) -> None: ...
174
+
175
+ @property
176
+ def rid(self) -> str | None: ...
177
+
178
+ @rid.setter
179
+ def rid(self, arg: str, /) -> None: ...
180
+
181
+ class VideoEncoder:
182
+ def init(self, arg: VideoEncoder.Settings, /) -> bool: ...
183
+
184
+ def release(self) -> None: ...
185
+
186
+ def encode(self, arg: VideoFrame, /) -> None: ...
187
+
188
+ def force_intra_next_frame(self) -> None: ...
189
+
190
+ def set_on_encode(self, arg: Callable[[EncodedImage], None], /) -> None: ...
191
+
192
+ class Settings:
193
+ def __init__(self) -> None: ...
194
+
195
+ @property
196
+ def codec_type(self) -> VideoCodecType: ...
197
+
198
+ @codec_type.setter
199
+ def codec_type(self, arg: VideoCodecType, /) -> None: ...
200
+
201
+ @property
202
+ def width(self) -> int: ...
203
+
204
+ @width.setter
205
+ def width(self, arg: int, /) -> None: ...
206
+
207
+ @property
208
+ def height(self) -> int: ...
209
+
210
+ @height.setter
211
+ def height(self, arg: int, /) -> None: ...
212
+
213
+ @property
214
+ def bitrate(self) -> int: ...
215
+
216
+ @bitrate.setter
217
+ def bitrate(self, arg: int, /) -> None: ...
218
+
219
+ @property
220
+ def fps(self) -> int: ...
221
+
222
+ @fps.setter
223
+ def fps(self, arg: int, /) -> None: ...
224
+
225
+ def create_openh264_video_encoder(openh264: str) -> VideoEncoder: ...
226
+
227
+ def create_videotoolbox_video_encoder() -> VideoEncoder: ...
228
+
229
+ def create_aom_video_encoder() -> VideoEncoder: ...
230
+
231
+ class VideoDecoder:
232
+ def init(self, arg: VideoDecoder.Settings, /) -> bool: ...
233
+
234
+ def release(self) -> None: ...
235
+
236
+ def decode(self, arg: EncodedImage, /) -> None: ...
237
+
238
+ def set_on_decode(self, arg: Callable[[VideoFrame], None], /) -> None: ...
239
+
240
+ class Settings:
241
+ def __init__(self) -> None: ...
242
+
243
+ @property
244
+ def codec_type(self) -> VideoCodecType: ...
245
+
246
+ @codec_type.setter
247
+ def codec_type(self, arg: VideoCodecType, /) -> None: ...
248
+
249
+ def create_openh264_video_decoder(openh264: str) -> VideoDecoder: ...
250
+
251
+ def create_aom_video_decoder() -> VideoDecoder: ...
252
+
253
+ class AudioCodecType(enum.Enum):
254
+ OPUS = 0
255
+
256
+ class AudioFrame:
257
+ def __init__(self) -> None: ...
258
+
259
+ @property
260
+ def sample_rate(self) -> int: ...
261
+
262
+ @sample_rate.setter
263
+ def sample_rate(self, arg: int, /) -> None: ...
264
+
265
+ @property
266
+ def pcm(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), order='C')]: ...
267
+
268
+ @pcm.setter
269
+ def pcm(self, arg: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), order='C')], /) -> None: ...
270
+
271
+ @property
272
+ def timestamp(self) -> datetime.timedelta: ...
273
+
274
+ @timestamp.setter
275
+ def timestamp(self, arg: datetime.timedelta | float, /) -> None: ...
276
+
277
+ def channels(self) -> int: ...
278
+
279
+ def samples(self) -> int: ...
280
+
281
+ class EncodedAudio:
282
+ def __init__(self) -> None: ...
283
+
284
+ @property
285
+ def data(self) -> Annotated[ArrayLike, dict(dtype='uint8', shape=(None), order='C')]: ...
286
+
287
+ @data.setter
288
+ def data(self, arg: Annotated[ArrayLike, dict(dtype='uint8', shape=(None), order='C')], /) -> None: ...
289
+
290
+ @property
291
+ def timestamp(self) -> datetime.timedelta: ...
292
+
293
+ @timestamp.setter
294
+ def timestamp(self, arg: datetime.timedelta | float, /) -> None: ...
295
+
296
+ class AudioEncoder:
297
+ def init(self, arg: AudioEncoder.Settings, /) -> bool: ...
298
+
299
+ def release(self) -> None: ...
300
+
301
+ def encode(self, arg: AudioFrame, /) -> None: ...
302
+
303
+ def set_on_encode(self, arg: Callable[[EncodedAudio], None], /) -> None: ...
304
+
305
+ class Settings:
306
+ def __init__(self) -> None: ...
307
+
308
+ @property
309
+ def codec_type(self) -> AudioCodecType: ...
310
+
311
+ @codec_type.setter
312
+ def codec_type(self, arg: AudioCodecType, /) -> None: ...
313
+
314
+ @property
315
+ def sample_rate(self) -> int: ...
316
+
317
+ @sample_rate.setter
318
+ def sample_rate(self, arg: int, /) -> None: ...
319
+
320
+ @property
321
+ def channels(self) -> int: ...
322
+
323
+ @channels.setter
324
+ def channels(self, arg: int, /) -> None: ...
325
+
326
+ @property
327
+ def bitrate(self) -> int: ...
328
+
329
+ @bitrate.setter
330
+ def bitrate(self, arg: int, /) -> None: ...
331
+
332
+ @property
333
+ def frame_duration_ms(self) -> int: ...
334
+
335
+ @frame_duration_ms.setter
336
+ def frame_duration_ms(self, arg: int, /) -> None: ...
337
+
338
+ @property
339
+ def opus_inband_fec(self) -> int: ...
340
+
341
+ @opus_inband_fec.setter
342
+ def opus_inband_fec(self, arg: int, /) -> None: ...
343
+
344
+ def create_opus_audio_encoder() -> AudioEncoder: ...
345
+
346
+ class AudioDecoder:
347
+ def init(self, arg: AudioDecoder.Settings, /) -> bool: ...
348
+
349
+ def release(self) -> None: ...
350
+
351
+ def decode(self, arg: EncodedAudio, /) -> None: ...
352
+
353
+ def set_on_decode(self, arg: Callable[[AudioFrame], None], /) -> None: ...
354
+
355
+ class Settings:
356
+ def __init__(self) -> None: ...
357
+
358
+ @property
359
+ def codec_type(self) -> AudioCodecType: ...
360
+
361
+ @codec_type.setter
362
+ def codec_type(self, arg: AudioCodecType, /) -> None: ...
363
+
364
+ @property
365
+ def sample_rate(self) -> int: ...
366
+
367
+ @sample_rate.setter
368
+ def sample_rate(self, arg: int, /) -> None: ...
369
+
370
+ @property
371
+ def channels(self) -> int: ...
372
+
373
+ @channels.setter
374
+ def channels(self, arg: int, /) -> None: ...
375
+
376
+ def create_opus_audio_decoder() -> AudioDecoder: ...
@@ -434,12 +434,12 @@ class Description:
434
434
  def __init__(self, id: int, uri: str, direction: Description.Direction = Description.Direction.Unknown) -> None: ...
435
435
 
436
436
  @overload
437
- def __init__(self, description: "std::__1::basic_string_view<char, std::__1::char_traits<char>>") -> None: ...
437
+ def __init__(self, description: str) -> None: ...
438
438
 
439
- def set_description(self, arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> None: ...
439
+ def set_description(self, arg: str, /) -> None: ...
440
440
 
441
441
  @staticmethod
442
- def parse_id(arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> int: ...
442
+ def parse_id(arg: str, /) -> int: ...
443
443
 
444
444
  @property
445
445
  def id(self) -> int: ...
@@ -516,7 +516,7 @@ class Description:
516
516
 
517
517
  def max_message_size(self) -> int | None: ...
518
518
 
519
- def parse_sdp_line(self, arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> None: ...
519
+ def parse_sdp_line(self, arg: str, /) -> None: ...
520
520
 
521
521
  class Media(Description.Entry):
522
522
  @overload
@@ -547,7 +547,7 @@ class Description:
547
547
 
548
548
  def set_bitrate(self, arg: int, /) -> None: ...
549
549
 
550
- def parse_sdp_line(self, arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> None: ...
550
+ def parse_sdp_line(self, arg: str, /) -> None: ...
551
551
 
552
552
  def has_payload_type(self, arg: int, /) -> bool: ...
553
553
 
@@ -572,12 +572,12 @@ class Description:
572
572
  def __init__(self, payload_type: int) -> None: ...
573
573
 
574
574
  @overload
575
- def __init__(self, description: "std::__1::basic_string_view<char, std::__1::char_traits<char>>") -> None: ...
575
+ def __init__(self, description: str) -> None: ...
576
576
 
577
- def set_description(self, arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> None: ...
577
+ def set_description(self, arg: str, /) -> None: ...
578
578
 
579
579
  @staticmethod
580
- def parse_payload_type(arg: "std::__1::basic_string_view<char, std::__1::char_traits<char>>", /) -> int: ...
580
+ def parse_payload_type(arg: str, /) -> int: ...
581
581
 
582
582
  def add_feedback(self, arg: str, /) -> None: ...
583
583
 
@@ -681,7 +681,7 @@ class Description:
681
681
 
682
682
  def has_audio_or_video(self) -> bool: ...
683
683
 
684
- def has_mid(self, mid: "std::__1::basic_string_view<char, std::__1::char_traits<char>>") -> bool: ...
684
+ def has_mid(self, mid: str) -> bool: ...
685
685
 
686
686
  @overload
687
687
  def add_media(self, media: Description.Media) -> int: ...
@@ -780,9 +780,9 @@ class Candidate:
780
780
 
781
781
  def port(self) -> int | None: ...
782
782
 
783
- def __eq__(self, arg: Candidate, /) -> bool: ...
783
+ def __eq__(self, arg: object, /) -> bool: ...
784
784
 
785
- def __ne__(self, arg: Candidate, /) -> bool: ...
785
+ def __ne__(self, arg: object, /) -> bool: ...
786
786
 
787
787
  def __str__(self) -> str: ...
788
788
 
@@ -1350,7 +1350,7 @@ class Channel:
1350
1350
  def send(self, data: bytes | str) -> bool: ...
1351
1351
 
1352
1352
  @overload
1353
- def send(self, data: "std::byte", size: int) -> bool: ...
1353
+ def send(self, data: bytes, size: int) -> bool: ...
1354
1354
 
1355
1355
  def is_open(self) -> bool: ...
1356
1356
 
@@ -1399,7 +1399,7 @@ class DataChannel(Channel):
1399
1399
  def send(self, data: bytes | str) -> bool: ...
1400
1400
 
1401
1401
  @overload
1402
- def send(self, data: "std::byte", size: int) -> bool: ...
1402
+ def send(self, data: bytes, size: int) -> bool: ...
1403
1403
 
1404
1404
  def stream(self) -> int | None: ...
1405
1405
 
@@ -1424,7 +1424,7 @@ class Track(Channel):
1424
1424
  def send(self, data: bytes | str) -> bool: ...
1425
1425
 
1426
1426
  @overload
1427
- def send(self, data: "std::byte", size: int) -> bool: ...
1427
+ def send(self, data: bytes, size: int) -> bool: ...
1428
1428
 
1429
1429
  def mid(self) -> str: ...
1430
1430
 
@@ -1643,7 +1643,7 @@ class WebSocket(Channel):
1643
1643
  def send(self, data: bytes | str) -> bool: ...
1644
1644
 
1645
1645
  @overload
1646
- def send(self, data: "std::byte", size: int) -> bool: ...
1646
+ def send(self, data: bytes, size: int) -> bool: ...
1647
1647
 
1648
1648
  def ready_state(self) -> WebSocket.State: ...
1649
1649
 
@@ -0,0 +1 @@
1
+ from ..libdatachannel_ext.libyuv import * # noqa: F401,F403
@@ -0,0 +1,187 @@
1
+ import enum
2
+
3
+ from numpy.typing import ArrayLike
4
+
5
+
6
+ class FilterMode(enum.Enum):
7
+ kNone = 0
8
+
9
+ kLinear = 1
10
+
11
+ kBilinear = 2
12
+
13
+ kBox = 3
14
+
15
+ class FourCC(enum.Enum):
16
+ kI420 = 808596553
17
+
18
+ kI422 = 842150985
19
+
20
+ kI444 = 875836489
21
+
22
+ kI400 = 808465481
23
+
24
+ kNV21 = 825382478
25
+
26
+ kNV12 = 842094158
27
+
28
+ kYUY2 = 844715353
29
+
30
+ kUYVY = 1498831189
31
+
32
+ kI010 = 808529993
33
+
34
+ kI210 = 808530505
35
+
36
+ kM420 = 808596557
37
+
38
+ kARGB = 1111970369
39
+
40
+ kBGRA = 1095911234
41
+
42
+ kABGR = 1380401729
43
+
44
+ kAR30 = 808669761
45
+
46
+ kAB30 = 808665665
47
+
48
+ kAR64 = 875975233
49
+
50
+ kAB64 = 875971137
51
+
52
+ k24BG = 1195521074
53
+
54
+ kRAW = 544694642
55
+
56
+ kRGBA = 1094862674
57
+
58
+ kRGBP = 1346520914
59
+
60
+ kRGBO = 1329743698
61
+
62
+ kR444 = 875836498
63
+
64
+ kMJPG = 1196444237
65
+
66
+ kYV12 = 842094169
67
+
68
+ kYV16 = 909203033
69
+
70
+ kYV24 = 875714137
71
+
72
+ kYU12 = 842093913
73
+
74
+ kJ420 = 808596554
75
+
76
+ kJ422 = 842150986
77
+
78
+ kJ444 = 875836490
79
+
80
+ kJ400 = 808465482
81
+
82
+ kF420 = 808596550
83
+
84
+ kF422 = 842150982
85
+
86
+ kF444 = 875836486
87
+
88
+ kH420 = 808596552
89
+
90
+ kH422 = 842150984
91
+
92
+ kH444 = 875836488
93
+
94
+ kU420 = 808596565
95
+
96
+ kU422 = 842150997
97
+
98
+ kU444 = 875836501
99
+
100
+ kF010 = 808529990
101
+
102
+ kH010 = 808529992
103
+
104
+ kU010 = 808530005
105
+
106
+ kF210 = 808530502
107
+
108
+ kH210 = 808530504
109
+
110
+ kU210 = 808530517
111
+
112
+ kP010 = 808530000
113
+
114
+ kP210 = 808530512
115
+
116
+ kIYUV = 1448433993
117
+
118
+ kYU16 = 909202777
119
+
120
+ kYU24 = 875713881
121
+
122
+ kYUYV = 1448695129
123
+
124
+ kYUVS = 1937143161
125
+
126
+ kHDYC = 1129923656
127
+
128
+ k2VUY = 2037741106
129
+
130
+ kJPEG = 1195724874
131
+
132
+ kDMB1 = 828534116
133
+
134
+ kBA81 = 825770306
135
+
136
+ kRGB3 = 859981650
137
+
138
+ kBGR3 = 861030210
139
+
140
+ kCM32 = 536870912
141
+
142
+ kCM24 = 402653184
143
+
144
+ kL555 = 892679500
145
+
146
+ kL565 = 892745036
147
+
148
+ k5551 = 825570613
149
+
150
+ kI411 = 825308233
151
+
152
+ kQ420 = 808596561
153
+
154
+ kRGGB = 1111967570
155
+
156
+ kBGGR = 1380403010
157
+
158
+ kGRBG = 1195528775
159
+
160
+ kGBRG = 1196573255
161
+
162
+ kH264 = 875967048
163
+
164
+ kANY = -1
165
+
166
+ class RotationMode(enum.Enum):
167
+ kRotate0 = 0
168
+
169
+ kRotate90 = 90
170
+
171
+ kRotate180 = 180
172
+
173
+ kRotate270 = 270
174
+
175
+ def nv12_scale(src_y: ArrayLike, src_uv: ArrayLike, src_stride_y: int, src_stride_uv: int, src_width: int, src_height: int, dst_y: ArrayLike, dst_uv: ArrayLike, dst_stride_y: int, dst_stride_uv: int, dst_width: int, dst_height: int, filtering: FilterMode) -> int: ...
176
+
177
+ def i420_scale(src_y: ArrayLike, src_u: ArrayLike, src_v: ArrayLike, src_stride_y: int, src_stride_u: int, src_stride_v: int, src_width: int, src_height: int, dst_y: ArrayLike, dst_u: ArrayLike, dst_v: ArrayLike, dst_stride_y: int, dst_stride_u: int, dst_stride_v: int, dst_width: int, dst_height: int, filtering: FilterMode) -> int: ...
178
+
179
+ def convert_to_i420(sample: ArrayLike, sample_size: int, dst_y: ArrayLike, dst_stride_y: int, dst_u: ArrayLike, dst_stride_u: int, dst_v: ArrayLike, dst_stride_v: int, crop_x: int, crop_y: int, src_width: int, src_height: int, crop_width: int, crop_height: int, rotation: RotationMode, fourcc: FourCC) -> int: ...
180
+
181
+ def nv12_to_i420(src_y: ArrayLike, src_uv: ArrayLike, src_stride_y: int, src_stride_uv: int, dst_y: ArrayLike, dst_u: ArrayLike, dst_v: ArrayLike, dst_stride_y: int, dst_stride_u: int, dst_stride_v: int, width: int, height: int) -> int: ...
182
+
183
+ def i420_to_nv12(src_y: ArrayLike, src_u: ArrayLike, src_v: ArrayLike, src_stride_y: int, src_stride_u: int, src_stride_v: int, dst_y: ArrayLike, dst_uv: ArrayLike, dst_stride_y: int, dst_stride_uv: int, width: int, height: int) -> int: ...
184
+
185
+ def rgb24_to_i420(src_rgb24: ArrayLike, src_stride_rgb24: int, dst_y: ArrayLike, dst_u: ArrayLike, dst_v: ArrayLike, dst_stride_y: int, dst_stride_u: int, dst_stride_v: int, width: int, height: int) -> int: ...
186
+
187
+ def i420_to_rgb24(src_y: ArrayLike, src_u: ArrayLike, src_v: ArrayLike, src_stride_y: int, src_stride_u: int, src_stride_v: int, dst_rgb24: ArrayLike, dst_stride_rgb24: int, width: int, height: int) -> int: ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libdatachannel-py
3
- Version: 2025.1.0.dev10
3
+ Version: 2025.1.0.dev12
4
4
  Summary: libdatachannel-py is a Python binding for libdatachannel.
5
5
  Home-page: https://github.com/shiguredo/libdatachannel-py
6
6
  License-Expression: Apache-2.0
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3.13
11
11
  Requires-Python: >=3.13
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Requires-Dist: mypy>=1.16.0
14
15
  Dynamic: home-page
15
16
  Dynamic: license-file
16
17
 
@@ -11,9 +11,14 @@ src/libdatachannel/__init__.py
11
11
  src/libdatachannel/libdatachannel_ext.cpython-313-darwin.so
12
12
  src/libdatachannel/libdatachannel_ext.pyi
13
13
  src/libdatachannel/py.typed
14
+ src/libdatachannel/codec/__init__.py
15
+ src/libdatachannel/codec/__init__.pyi
16
+ src/libdatachannel/libyuv/__init__.py
17
+ src/libdatachannel/libyuv/__init__.pyi
14
18
  src/libdatachannel_py.egg-info/PKG-INFO
15
19
  src/libdatachannel_py.egg-info/SOURCES.txt
16
20
  src/libdatachannel_py.egg-info/dependency_links.txt
21
+ src/libdatachannel_py.egg-info/requires.txt
17
22
  src/libdatachannel_py.egg-info/top_level.txt
18
23
  tests/test_audio_codec.py
19
24
  tests/test_candidate.py
@@ -18,7 +18,7 @@ from libdatachannel.libyuv import (
18
18
  def test_libyuv_nv12_scale():
19
19
  src_width, src_height = 640, 480
20
20
  src = VideoFrameBufferNV12.create(src_width, src_height)
21
- # type: ignore しないと型エラーになる
21
+ # ignore しないと型エラーになる
22
22
  # 参考: https://github.com/wjakob/nanobind/pull/442
23
23
  src.y[:, :] = 42 # type: ignore
24
24
 
@@ -37,7 +37,7 @@ def test_libyuv_nv12_scale():
37
37
  dst.stride_uv(),
38
38
  dst.width(),
39
39
  dst.height(),
40
- FilterMode.NONE,
40
+ FilterMode.kNone,
41
41
  )
42
42
 
43
43
  assert r == 0
@@ -68,7 +68,7 @@ def test_libyuv_i420_scale():
68
68
  dst.stride_v(),
69
69
  dst.width(),
70
70
  dst.height(),
71
- FilterMode.NONE,
71
+ FilterMode.kNone,
72
72
  )
73
73
  assert r == 0
74
74
  assert np.all(dst.y == 42)
@@ -93,8 +93,8 @@ def test_libyuv_convert_to_i420():
93
93
  480,
94
94
  640,
95
95
  480,
96
- RotationMode.Rotate0,
97
- FourCC.NV12,
96
+ RotationMode.kRotate0,
97
+ FourCC.kNV12,
98
98
  )
99
99
  assert r == 0
100
100
  assert np.all(dst.y == 42)
@@ -1 +0,0 @@
1
- 2025.1.0.dev10