sora-sdk 2025.4.0.dev2__tar.gz → 2025.4.0.dev5__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.

Potentially problematic release.


This version of sora-sdk might be problematic. Click here for more details.

Files changed (48) hide show
  1. {sora_sdk-2025.4.0.dev2/src/sora_sdk.egg-info → sora_sdk-2025.4.0.dev5}/PKG-INFO +1 -1
  2. sora_sdk-2025.4.0.dev5/VERSION +1 -0
  3. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/pyproject.toml +7 -6
  4. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/run.py +117 -32
  5. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk/__init__.py +5 -1
  6. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk/sora_sdk_ext.cpython-311-darwin.so +0 -0
  7. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5/src/sora_sdk.egg-info}/PKG-INFO +1 -1
  8. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_amd_amf.py +2 -4
  9. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_apple_video_toolbox.py +3 -11
  10. sora_sdk-2025.4.0.dev5/tests/test_capability.py +50 -0
  11. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_intel_vpl.py +7 -9
  12. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_nvidia_video_codec_sdk.py +3 -14
  13. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_openh264.py +4 -19
  14. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_openh264_simulcast.py +4 -11
  15. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_version.py +3 -3
  16. sora_sdk-2025.4.0.dev2/VERSION +0 -1
  17. sora_sdk-2025.4.0.dev2/tests/test_capability.py +0 -52
  18. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/LICENSE +0 -0
  19. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/MANIFEST.in +0 -0
  20. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/README.md +0 -0
  21. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/buildbase.py +0 -0
  22. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/pypath.py +0 -0
  23. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/setup.cfg +0 -0
  24. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/setup.py +0 -0
  25. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk/py.typed +0 -0
  26. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk/sora_sdk_ext.pyi +0 -0
  27. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk.egg-info/SOURCES.txt +0 -0
  28. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk.egg-info/dependency_links.txt +0 -0
  29. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/src/sora_sdk.egg-info/top_level.txt +0 -0
  30. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_authz.py +0 -0
  31. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_authz_simulcast.py +0 -0
  32. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_ca_cert.py +0 -0
  33. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_degradation_preference.py +0 -0
  34. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_encoded_transform.py +0 -0
  35. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_key_frame_request.py +0 -0
  36. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_messaging.py +0 -0
  37. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_messaging_header.py +0 -0
  38. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_opus.py +0 -0
  39. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_re_offer_re_answer_sdp.py +0 -0
  40. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_sendonly_recvonly.py +0 -0
  41. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_signaling.py +0 -0
  42. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_signaling_message.py +0 -0
  43. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_signaling_notify.py +0 -0
  44. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_simulcast.py +0 -0
  45. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_sora_disconnect.py +0 -0
  46. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_type_disconnect.py +0 -0
  47. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_type_switched.py +0 -0
  48. {sora_sdk-2025.4.0.dev2 → sora_sdk-2025.4.0.dev5}/tests/test_vad.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sora_sdk
3
- Version: 2025.4.0.dev2
3
+ Version: 2025.4.0.dev5
4
4
  Summary: WebRTC SFU Sora Python SDK
5
5
  Home-page: https://github.com/shiguredo/sora-python-sdk
6
6
  Author-email: "Shiguredo Inc." <contact+pypi@shiguredo.jp>
@@ -0,0 +1 @@
1
+ 2025.4.0.dev5
@@ -27,15 +27,14 @@ build-backend = "setuptools.build_meta"
27
27
  python-preference = "only-managed"
28
28
  dev-dependencies = [
29
29
  "nanobind==2.8.0",
30
- "setuptools==80.9",
31
- "build==1.3.0",
32
- "wheel==0.45.1",
30
+ "setuptools==80.9.0",
31
+ "pytest",
32
+ "pytest-repeat",
33
+ "pytest-xdist",
33
34
  "numpy",
34
35
  "httpx",
35
- "pytest",
36
- "ruff",
37
36
  "pyjwt",
38
- "pytest-repeat",
37
+ "ruff",
39
38
  "ty",
40
39
  ]
41
40
 
@@ -43,6 +42,8 @@ dev-dependencies = [
43
42
  target-version = "py311"
44
43
  line-length = 100
45
44
 
45
+ [tool.ty.src]
46
+ include = ["src", "tests"]
46
47
 
47
48
  [tool.pytest.ini_options]
48
49
  xfail_strict = true
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ import glob
2
3
  import hashlib
3
4
  import importlib.metadata
4
5
  import multiprocessing
@@ -180,35 +181,48 @@ AVAILABLE_TARGETS = [
180
181
  ]
181
182
 
182
183
 
183
- def main():
184
- parser = argparse.ArgumentParser()
185
- parser.add_argument("--debug", action="store_true")
186
- parser.add_argument("--relwithdebinfo", action="store_true")
187
- parser.add_argument("--local-webrtc-build-dir", type=os.path.abspath)
188
- parser.add_argument("--local-webrtc-build-args", default="", type=shlex.split)
189
- parser.add_argument("--local-sora-cpp-sdk-dir", type=os.path.abspath)
190
- parser.add_argument("--local-sora-cpp-sdk-args", default="", type=shlex.split)
191
- parser.add_argument("target", choices=AVAILABLE_TARGETS)
184
+ def _find_clang_binary(name: str) -> Optional[str]:
185
+ if shutil.which(name) is not None:
186
+ return name
187
+ else:
188
+ for n in range(50, 14, -1):
189
+ if shutil.which(f"{name}-{n}") is not None:
190
+ return f"{name}-{n}"
191
+ return None
192
192
 
193
- args = parser.parse_args()
194
- if args.target == "windows_x86_64":
193
+
194
+ def _get_platform(target: str) -> Platform:
195
+ if target == "windows_x86_64":
195
196
  platform = Platform("windows", get_windows_osver(), "x86_64")
196
- elif args.target == "macos_x86_64":
197
+ elif target == "macos_x86_64":
197
198
  platform = Platform("macos", get_macos_osver(), "x86_64")
198
- elif args.target == "macos_arm64":
199
+ elif target == "macos_arm64":
199
200
  platform = Platform("macos", get_macos_osver(), "arm64")
200
- elif args.target == "ubuntu-22.04_x86_64":
201
+ elif target == "ubuntu-22.04_x86_64":
201
202
  platform = Platform("ubuntu", "22.04", "x86_64")
202
- elif args.target == "ubuntu-24.04_x86_64":
203
+ elif target == "ubuntu-24.04_x86_64":
203
204
  platform = Platform("ubuntu", "24.04", "x86_64")
204
- elif args.target == "ubuntu-22.04_armv8":
205
+ elif target == "ubuntu-22.04_armv8":
205
206
  platform = Platform("ubuntu", "22.04", "armv8")
206
- elif args.target == "ubuntu-24.04_armv8":
207
+ elif target == "ubuntu-24.04_armv8":
207
208
  platform = Platform("ubuntu", "24.04", "armv8")
208
- elif args.target == "ubuntu-22.04_armv8_jetson":
209
+ elif target == "ubuntu-22.04_armv8_jetson":
209
210
  platform = Platform("jetson", None, "armv8", "ubuntu-22.04")
210
211
  else:
211
- raise Exception(f"Unknown target {args.target}")
212
+ raise Exception(f"Unknown target {target}")
213
+ return platform
214
+
215
+
216
+ def _build(
217
+ target: str,
218
+ debug: bool,
219
+ relwithdebinfo: bool,
220
+ local_webrtc_build_dir: Optional[str],
221
+ local_webrtc_build_args: List[str],
222
+ local_sora_cpp_sdk_dir: Optional[str],
223
+ local_sora_cpp_sdk_args: List[str],
224
+ ):
225
+ platform = _get_platform(target)
212
226
 
213
227
  source_dir = os.path.join(BASE_DIR, "_source", platform.target.package_name)
214
228
  build_dir = os.path.join(BASE_DIR, "_build", platform.target.package_name)
@@ -223,27 +237,23 @@ def main():
223
237
  source_dir,
224
238
  build_dir,
225
239
  install_dir,
226
- args.debug,
227
- args.local_webrtc_build_dir,
228
- args.local_webrtc_build_args,
229
- args.local_sora_cpp_sdk_dir,
230
- args.local_sora_cpp_sdk_args,
240
+ debug,
241
+ local_webrtc_build_dir,
242
+ local_webrtc_build_args,
243
+ local_sora_cpp_sdk_dir,
244
+ local_sora_cpp_sdk_args,
231
245
  )
232
246
 
233
247
  configuration = "Release"
234
- if args.debug:
248
+ if debug:
235
249
  configuration = "Debug"
236
- if args.relwithdebinfo:
250
+ if relwithdebinfo:
237
251
  configuration = "RelWithDebInfo"
238
252
 
239
253
  webrtc_platform = get_webrtc_platform(platform)
240
- webrtc_info = get_webrtc_info(
241
- webrtc_platform, args.local_webrtc_build_dir, install_dir, args.debug
242
- )
254
+ webrtc_info = get_webrtc_info(webrtc_platform, local_webrtc_build_dir, install_dir, debug)
243
255
 
244
- sora_info = get_sora_info(
245
- webrtc_platform, args.local_sora_cpp_sdk_dir, install_dir, args.debug
246
- )
256
+ sora_info = get_sora_info(webrtc_platform, local_sora_cpp_sdk_dir, install_dir, debug)
247
257
 
248
258
  cmake_args = []
249
259
  cmake_args.append(f"-DCMAKE_BUILD_TYPE={configuration}")
@@ -373,5 +383,80 @@ def main():
373
383
  )
374
384
 
375
385
 
386
+ def _format(
387
+ clang_format_path: Optional[str] = None,
388
+ skip_clang_format: bool = False,
389
+ skip_ruff: bool = False,
390
+ ):
391
+ # C++ ファイルのフォーマット
392
+ if not skip_clang_format:
393
+ if clang_format_path is None:
394
+ clang_format_path = _find_clang_binary("clang-format")
395
+ if clang_format_path is None:
396
+ print("Warning: clang-format not found. Skipping C++ formatting.")
397
+ else:
398
+ patterns = [
399
+ "src/**/*.h",
400
+ "src/**/*.cpp",
401
+ ]
402
+ target_files = []
403
+ for pattern in patterns:
404
+ files = glob.glob(pattern, recursive=True)
405
+ target_files.extend(files)
406
+ if target_files:
407
+ print(f"Formatting {len(target_files)} C++ files...")
408
+ cmd([clang_format_path, "-i"] + target_files)
409
+
410
+ # Python ファイルのフォーマット
411
+ if not skip_ruff:
412
+ print("Running Python formatting with ruff...")
413
+ try:
414
+ cmd(["uv", "run", "ruff", "format"])
415
+ except Exception as e:
416
+ print(f"Formatting failed: {e}")
417
+
418
+
419
+ def main():
420
+ parser = argparse.ArgumentParser()
421
+ sp = parser.add_subparsers(dest="command", required=True)
422
+
423
+ # build サブコマンド
424
+ bp = sp.add_parser("build")
425
+ bp.add_argument("target", choices=AVAILABLE_TARGETS)
426
+ bp.add_argument("--debug", action="store_true")
427
+ bp.add_argument("--relwithdebinfo", action="store_true")
428
+ bp.add_argument("--local-webrtc-build-dir", type=os.path.abspath)
429
+ bp.add_argument("--local-webrtc-build-args", default="", type=shlex.split)
430
+ bp.add_argument("--local-sora-cpp-sdk-dir", type=os.path.abspath)
431
+ bp.add_argument("--local-sora-cpp-sdk-args", default="", type=shlex.split)
432
+
433
+ # format サブコマンド
434
+ fp = sp.add_parser("format")
435
+ fp.add_argument("--clang-format-path", type=str, default=None)
436
+ fp.add_argument(
437
+ "--skip-clang-format", action="store_true", help="Skip C++ formatting with clang-format"
438
+ )
439
+ fp.add_argument("--skip-ruff", action="store_true", help="Skip Python formatting with ruff")
440
+
441
+ args = parser.parse_args()
442
+
443
+ if args.command == "build":
444
+ _build(
445
+ target=args.target,
446
+ debug=args.debug,
447
+ relwithdebinfo=args.relwithdebinfo,
448
+ local_webrtc_build_dir=args.local_webrtc_build_dir,
449
+ local_webrtc_build_args=args.local_webrtc_build_args,
450
+ local_sora_cpp_sdk_dir=args.local_sora_cpp_sdk_dir,
451
+ local_sora_cpp_sdk_args=args.local_sora_cpp_sdk_args,
452
+ )
453
+ elif args.command == "format":
454
+ _format(
455
+ clang_format_path=args.clang_format_path,
456
+ skip_clang_format=args.skip_clang_format,
457
+ skip_ruff=args.skip_ruff,
458
+ )
459
+
460
+
376
461
  if __name__ == "__main__":
377
462
  main()
@@ -4,12 +4,16 @@ from .sora_sdk_ext import * # noqa: F401,F403
4
4
  # 開発環境の場合は VERSION ファイルから取得
5
5
  try:
6
6
  from importlib.metadata import version, PackageNotFoundError
7
+
7
8
  try:
8
9
  __version__ = version("sora_sdk")
9
10
  except PackageNotFoundError:
10
11
  # パッケージがインストールされていない場合(開発環境)
11
12
  import os
12
- _version_file = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "VERSION")
13
+
14
+ _version_file = os.path.join(
15
+ os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "VERSION"
16
+ )
13
17
  if os.path.exists(_version_file):
14
18
  with open(_version_file, "r") as f:
15
19
  __version__ = f.read().strip()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sora_sdk
3
- Version: 2025.4.0.dev2
3
+ Version: 2025.4.0.dev5
4
4
  Summary: WebRTC SFU Sora Python SDK
5
5
  Home-page: https://github.com/shiguredo/sora-python-sdk
6
6
  Author-email: "Shiguredo Inc." <contact+pypi@shiguredo.jp>
@@ -18,8 +18,9 @@ from sora_sdk import (
18
18
  get_video_codec_capability,
19
19
  )
20
20
 
21
+ pytestmark = pytest.mark.skipif(os.environ.get("AMD_AMF") is None, reason="AMD AMF でのみ実行する")
22
+
21
23
 
22
- @pytest.mark.skipif(os.environ.get("AMD_AMF") is None, reason="AMD AMF でのみ実行する")
23
24
  def test_amd_amf_available(settings):
24
25
  capability = get_video_codec_capability()
25
26
 
@@ -57,7 +58,6 @@ def test_amd_amf_available(settings):
57
58
  pytest.fail(f"未実装の codec_type: {c.type}")
58
59
 
59
60
 
60
- @pytest.mark.skipif(os.environ.get("AMD_AMF") is None, reason="AMD AMF でのみ実行する")
61
61
  @pytest.mark.parametrize(
62
62
  "video_codec_type",
63
63
  [
@@ -120,7 +120,6 @@ def test_amd_amf_key_frame_request(settings, video_codec_type):
120
120
  assert outbound_rtp_stats["keyFramesEncoded"] >= outbound_rtp_stats["pliCount"] * 0.7
121
121
 
122
122
 
123
- @pytest.mark.skipif(os.environ.get("AMD_AMF") is None, reason="AMD AMF でのみ実行する")
124
123
  @pytest.mark.parametrize(
125
124
  "video_codec_type",
126
125
  [
@@ -212,7 +211,6 @@ def test_amd_amf_sendonly_recvonly(settings, video_codec_type):
212
211
  assert inbound_rtp_stats["keyFramesDecoded"] > 0
213
212
 
214
213
 
215
- @pytest.mark.skipif(os.environ.get("AMD_AMF") is None, reason="AMD AMF でのみ実行する")
216
214
  @pytest.mark.parametrize(
217
215
  (
218
216
  "video_codec_type",
@@ -5,10 +5,11 @@ import pytest
5
5
  from client import SoraClient, SoraRole
6
6
  from simulcast import default_video_bit_rate, expect_target_bitrate
7
7
 
8
-
9
- @pytest.mark.skipif(
8
+ pytestmark = pytest.mark.skipif(
10
9
  os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
11
10
  )
11
+
12
+
12
13
  @pytest.mark.parametrize(
13
14
  "video_codec_type",
14
15
  ["H264", "H265"],
@@ -46,9 +47,6 @@ def test_apple_video_toolbox_sendonly(settings, video_codec_type):
46
47
  assert outbound_rtp_stats["packetsSent"] > 0
47
48
 
48
49
 
49
- @pytest.mark.skipif(
50
- os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
51
- )
52
50
  @pytest.mark.parametrize(
53
51
  "video_codec_type",
54
52
  ["H264", "H265"],
@@ -100,9 +98,6 @@ def test_apple_video_toolbox_sendonly_recvonly(settings, video_codec_type):
100
98
  assert inbound_rtp_stats["packetsReceived"] > 0
101
99
 
102
100
 
103
- @pytest.mark.skipif(
104
- os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
105
- )
106
101
  @pytest.mark.parametrize(
107
102
  (
108
103
  "video_codec_type",
@@ -233,9 +228,6 @@ def test_apple_video_toolbox_simulcast(
233
228
  )
234
229
 
235
230
 
236
- @pytest.mark.skipif(
237
- os.environ.get("APPLE_VIDEO_TOOLBOX") is None, reason="Apple Video Toolbox でのみ実行する"
238
- )
239
231
  @pytest.mark.parametrize(
240
232
  (
241
233
  "video_codec_type",
@@ -0,0 +1,50 @@
1
+ import time
2
+
3
+ from client import SoraClient, SoraRole
4
+
5
+ from sora_sdk import (
6
+ SoraVideoCodecImplementation,
7
+ SoraVideoCodecPreference,
8
+ SoraVideoCodecType,
9
+ )
10
+
11
+ # def test_preference_invalid(settings):
12
+ # # opneh264 のパスを設定してないのに H264 エンコーダを使おうとしているので Sora 生成時にエラーになる
13
+ # with pytest.raises(RuntimeError):
14
+ # SoraClient(
15
+ # settings,
16
+ # SoraRole.SENDONLY,
17
+ # audio=False,
18
+ # video=True,
19
+ # video_codec_type="H264",
20
+ # video_codec_preference=SoraVideoCodecPreference(
21
+ # codecs=[
22
+ # SoraVideoCodecPreference.Codec(
23
+ # type=SoraVideoCodecType.H264,
24
+ # encoder=SoraVideoCodecImplementation.CISCO_OPENH264,
25
+ # )
26
+ # ]
27
+ # ),
28
+ # )
29
+
30
+
31
+ def test_preference_vp8(settings):
32
+ sendonly = SoraClient(
33
+ settings,
34
+ SoraRole.SENDONLY,
35
+ audio=False,
36
+ video=True,
37
+ video_codec_type="VP8",
38
+ video_codec_preference=SoraVideoCodecPreference(
39
+ codecs=[
40
+ SoraVideoCodecPreference.Codec(
41
+ type=SoraVideoCodecType.VP8, encoder=SoraVideoCodecImplementation.INTERNAL
42
+ )
43
+ ]
44
+ ),
45
+ )
46
+ sendonly.connect(fake_video=True)
47
+
48
+ time.sleep(5)
49
+
50
+ sendonly.disconnect()
@@ -19,8 +19,11 @@ from sora_sdk import (
19
19
  get_video_codec_capability,
20
20
  )
21
21
 
22
+ pytestmark = pytest.mark.skipif(
23
+ os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する"
24
+ )
25
+
22
26
 
23
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
24
27
  def test_intel_vpl_available():
25
28
  capability = get_video_codec_capability()
26
29
 
@@ -61,7 +64,6 @@ def test_intel_vpl_available():
61
64
  pytest.fail(f"未実装の codec_type: {c.type}")
62
65
 
63
66
 
64
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
65
67
  @pytest.mark.parametrize(
66
68
  "video_codec_type",
67
69
  [
@@ -124,7 +126,6 @@ def test_intel_vpl_key_frame_request(settings, video_codec_type):
124
126
  )
125
127
 
126
128
 
127
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
128
129
  @pytest.mark.parametrize(
129
130
  (
130
131
  "video_codec_type",
@@ -281,7 +282,6 @@ def test_intel_vpl_simulcast(
281
282
  assert s["packetsSent"] <= 2
282
283
 
283
284
 
284
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
285
285
  @pytest.mark.parametrize(
286
286
  "video_codec_type",
287
287
  [
@@ -457,7 +457,6 @@ def test_intel_vpl_av1_mini_resolution(
457
457
  ## VPL Decode
458
458
 
459
459
 
460
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
461
460
  @pytest.mark.parametrize(
462
461
  (
463
462
  "video_codec_type",
@@ -554,7 +553,6 @@ def test_intel_vpl_decode(
554
553
  assert inbound_rtp_stats["keyFramesDecoded"] > 0
555
554
 
556
555
 
557
- @pytest.mark.skipif(os.environ.get("INTEL_VPL") is None, reason="Intel VPL でのみ実行する")
558
556
  def test_intel_vpl_av1_rtp_hdr_ext(settings):
559
557
  sendonly = SoraClient(
560
558
  settings,
@@ -604,6 +602,6 @@ def test_intel_vpl_av1_rtp_hdr_ext(settings):
604
602
  sendonly.disconnect()
605
603
 
606
604
  # AV1 の RTP ヘッダー拡張が送られてきていることを確認
607
- assert stats["rtp_hdrext"]["total_received_rtp_hdrext_av1_rtp_sepc"] > 0, (
608
- "Dependency Descriptor RTP Header Extension が Python SDK から送られてきていません"
609
- )
605
+ assert (
606
+ stats["rtp_hdrext"]["total_received_rtp_hdrext_av1_rtp_sepc"] > 0
607
+ ), "Dependency Descriptor RTP Header Extension が Python SDK から送られてきていません"
@@ -17,10 +17,11 @@ from sora_sdk import (
17
17
  SoraVideoCodecType,
18
18
  )
19
19
 
20
-
21
- @pytest.mark.skipif(
20
+ pytestmark = pytest.mark.skipif(
22
21
  os.environ.get("NVIDIA_VIDEO_CODEC_SDK") is None, reason="NVIDIA Video Codec SDK でのみ実行する"
23
22
  )
23
+
24
+
24
25
  def test_nvidia_video_codec_sdk_available():
25
26
  capability = get_video_codec_capability()
26
27
 
@@ -57,9 +58,6 @@ def test_nvidia_video_codec_sdk_available():
57
58
  pytest.fail(f"未実装の codec_type: {c.type}")
58
59
 
59
60
 
60
- @pytest.mark.skipif(
61
- os.environ.get("NVIDIA_VIDEO_CODEC_SDK") is None, reason="NVIDIA Video Codec SDK でのみ実行する"
62
- )
63
61
  @pytest.mark.parametrize(
64
62
  "video_codec_type",
65
63
  [
@@ -121,9 +119,6 @@ def test_intel_vpl_key_frame_request(settings, video_codec_type):
121
119
  )
122
120
 
123
121
 
124
- @pytest.mark.skipif(
125
- os.environ.get("NVIDIA_VIDEO_CODEC_SDK") is None, reason="NVIDIA Video Codec SDK でのみ実行する"
126
- )
127
122
  @pytest.mark.parametrize(
128
123
  (
129
124
  "video_codec_type",
@@ -213,9 +208,6 @@ def test_nvidia_codec_sdk_sendonly_recvonly(settings, video_codec_type, expected
213
208
  assert inbound_rtp_stats["packetsReceived"] > 0
214
209
 
215
210
 
216
- @pytest.mark.skipif(
217
- os.environ.get("NVIDIA_VIDEO_CODEC_SDK") is None, reason="NVIDIA Video Codec SDK でのみ実行する"
218
- )
219
211
  @pytest.mark.parametrize(
220
212
  (
221
213
  "video_codec_type",
@@ -367,9 +359,6 @@ def test_nvidia_video_codec_sdk_simulcast(
367
359
 
368
360
  # VP8 / VP9 は HWA Decoder のみ搭載している
369
361
  # https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new
370
- @pytest.mark.skipif(
371
- os.environ.get("NVIDIA_VIDEO_CODEC_SDK") is None, reason="NVIDIA Video Codec SDK でのみ実行する"
372
- )
373
362
  @pytest.mark.parametrize(
374
363
  ("video_codec_type", "expected_implementation"),
375
364
  [
@@ -14,11 +14,12 @@ from sora_sdk import (
14
14
  get_video_codec_capability,
15
15
  )
16
16
 
17
-
18
- @pytest.mark.skipif(
19
- os.environ.get("OPENH264_VERSION") is None,
17
+ pytestmark = pytest.mark.skipif(
18
+ os.environ.get("OPENH264_PATH") is None,
20
19
  reason="OpenH264 のときだけ実行する",
21
20
  )
21
+
22
+
22
23
  def test_capability(settings):
23
24
  capability = get_video_codec_capability(openh264=settings.openh264_path)
24
25
  has_internal = False
@@ -31,10 +32,6 @@ def test_capability(settings):
31
32
  assert has_internal and has_openh264
32
33
 
33
34
 
34
- @pytest.mark.skipif(
35
- os.environ.get("OPENH264_VERSION") is None,
36
- reason="OpenH264 のときだけ実行する",
37
- )
38
35
  def test_preference(settings):
39
36
  capability = get_video_codec_capability(openh264=settings.openh264_path)
40
37
  preference = create_video_codec_preference_from_implementation(
@@ -43,10 +40,6 @@ def test_preference(settings):
43
40
  assert preference.has_implementation(SoraVideoCodecImplementation.CISCO_OPENH264)
44
41
 
45
42
 
46
- @pytest.mark.skipif(
47
- os.environ.get("OPENH264_VERSION") is None,
48
- reason="OpenH264 のときだけ実行する",
49
- )
50
43
  def test_openh264_get_codec_capability(settings):
51
44
  capability = get_video_codec_capability(openh264=settings.openh264_path)
52
45
 
@@ -87,10 +80,6 @@ def test_openh264_get_codec_capability(settings):
87
80
  )
88
81
 
89
82
 
90
- @pytest.mark.skipif(
91
- os.environ.get("OPENH264_VERSION") is None,
92
- reason="OpenH264 のときだけ実行する",
93
- )
94
83
  def test_openh264_video_codec_preference(settings):
95
84
  Sora(
96
85
  video_codec_preference=SoraVideoCodecPreference(
@@ -122,10 +111,6 @@ def test_openh264_video_codec_preference(settings):
122
111
  )
123
112
 
124
113
 
125
- @pytest.mark.skipif(
126
- os.environ.get("OPENH264_VERSION") is None,
127
- reason="OpenH264 のときだけ実行する",
128
- )
129
114
  def test_openh264_sendonly_recvonly(settings):
130
115
  sendonly = SoraClient(
131
116
  settings,
@@ -11,11 +11,12 @@ from sora_sdk import (
11
11
  SoraVideoCodecType,
12
12
  )
13
13
 
14
-
15
- @pytest.mark.skipif(
16
- os.environ.get("OPENH264_VERSION") is None,
14
+ pytestmark = pytest.mark.skipif(
15
+ os.environ.get("OPENH264_PATH") is None,
17
16
  reason="OpenH264 のときだけ実行する",
18
17
  )
18
+
19
+
19
20
  @pytest.mark.parametrize(
20
21
  (
21
22
  "video_codec_type",
@@ -140,10 +141,6 @@ def test_openh264_simulcast(
140
141
  )
141
142
 
142
143
 
143
- @pytest.mark.skipif(
144
- os.environ.get("OPENH264_VERSION") is None,
145
- reason="OpenH264 のときだけ実行する",
146
- )
147
144
  @pytest.mark.parametrize(
148
145
  (
149
146
  "video_codec_type",
@@ -271,10 +268,6 @@ def test_openh264_authz_simulcast_r2_active_false(
271
268
  )
272
269
 
273
270
 
274
- @pytest.mark.skipif(
275
- os.environ.get("OPENH264_VERSION") is None,
276
- reason="OpenH264 のときだけ実行する",
277
- )
278
271
  @pytest.mark.parametrize(
279
272
  (
280
273
  "video_codec_type",
@@ -7,11 +7,11 @@ def test_version():
7
7
  assert hasattr(sora_sdk, "__version__")
8
8
  assert isinstance(sora_sdk.__version__, str)
9
9
  assert sora_sdk.__version__ != "unknown"
10
-
10
+
11
11
  # VERSION ファイルの内容と一致することを確認
12
12
  version_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), "VERSION")
13
13
  with open(version_file, "r") as f:
14
14
  expected_version = f.read().strip()
15
-
15
+
16
16
  assert sora_sdk.__version__ == expected_version
17
- print(f"sora_sdk.__version__ = {sora_sdk.__version__}")
17
+ print(f"sora_sdk.__version__ = {sora_sdk.__version__}")
@@ -1 +0,0 @@
1
- 2025.4.0.dev2
@@ -1,52 +0,0 @@
1
- import time
2
-
3
- import pytest
4
- from client import SoraClient, SoraRole
5
-
6
- from sora_sdk import (
7
- SoraVideoCodecImplementation,
8
- SoraVideoCodecPreference,
9
- SoraVideoCodecType,
10
- )
11
-
12
-
13
- def test_preference_invalid(settings):
14
- # opneh264 のパスを設定してないのに H264 エンコーダを使おうとしているので Sora 生成時にエラーになる
15
- with pytest.raises(RuntimeError):
16
- SoraClient(
17
- settings,
18
- SoraRole.SENDONLY,
19
- audio=False,
20
- video=True,
21
- video_codec_type="H264",
22
- video_codec_preference=SoraVideoCodecPreference(
23
- codecs=[
24
- SoraVideoCodecPreference.Codec(
25
- type=SoraVideoCodecType.H264,
26
- encoder=SoraVideoCodecImplementation.CISCO_OPENH264,
27
- )
28
- ]
29
- ),
30
- )
31
-
32
-
33
- def test_preference_vp8(settings):
34
- sendonly = SoraClient(
35
- settings,
36
- SoraRole.SENDONLY,
37
- audio=False,
38
- video=True,
39
- video_codec_type="VP8",
40
- video_codec_preference=SoraVideoCodecPreference(
41
- codecs=[
42
- SoraVideoCodecPreference.Codec(
43
- type=SoraVideoCodecType.VP8, encoder=SoraVideoCodecImplementation.INTERNAL
44
- )
45
- ]
46
- ),
47
- )
48
- sendonly.connect(fake_video=True)
49
-
50
- time.sleep(5)
51
-
52
- sendonly.disconnect()