88
99import pytest
1010
11- from helper import get_codec , get_inbound_rtp , get_outbound_rtp , get_simulcast_outbound_rtp , get_transport
11+ from helper import (
12+ get_codec ,
13+ get_inbound_rtp ,
14+ get_outbound_rtp ,
15+ get_simulcast_outbound_rtp ,
16+ get_transport ,
17+ )
1218from sumomo import Sumomo
1319
14-
1520# NVIDIA Video Codec 環境が有効でない場合はスキップ
1621pytestmark = pytest .mark .skipif (
1722 not os .environ .get ("NVIDIA_VIDEO_CODEC" ),
@@ -61,9 +66,9 @@ def test_sendonly_recvonly(
6166 role = "sendonly" ,
6267 metadata = sora_settings .metadata ,
6368 http_port = next (port_allocator ),
69+ audio = False ,
6470 video = True ,
6571 video_codec_type = video_codec_type ,
66- audio = True ,
6772 initial_wait = 10 ,
6873 ** encoder_params ,
6974 ) as sender :
@@ -74,8 +79,6 @@ def test_sendonly_recvonly(
7479 role = "recvonly" ,
7580 metadata = sora_settings .metadata ,
7681 http_port = next (port_allocator ),
77- video = True ,
78- audio = True ,
7982 ** decoder_params ,
8083 ) as receiver :
8184 time .sleep (3 )
@@ -89,11 +92,6 @@ def test_sendonly_recvonly(
8992 assert sender_video_codec is not None
9093 assert sender_video_codec ["mimeType" ] == expected_mime_type
9194
92- # audio codec を確認
93- sender_audio_codec = get_codec (sender_stats , "audio/opus" )
94- assert sender_audio_codec is not None
95- assert sender_audio_codec ["mimeType" ] == "audio/opus"
96-
9795 # video outbound-rtp を確認
9896 sender_video_outbound = get_outbound_rtp (sender_stats , "video" )
9997 assert sender_video_outbound is not None
@@ -102,12 +100,6 @@ def test_sendonly_recvonly(
102100 assert "encoderImplementation" in sender_video_outbound
103101 assert sender_video_outbound ["encoderImplementation" ] == "NvCodec"
104102
105- # audio outbound-rtp を確認
106- sender_audio_outbound = get_outbound_rtp (sender_stats , "audio" )
107- assert sender_audio_outbound is not None
108- assert sender_audio_outbound ["packetsSent" ] > 0
109- assert sender_audio_outbound ["bytesSent" ] > 0
110-
111103 # 受信側の統計を確認
112104 receiver_stats = receiver .get_stats ()
113105 assert receiver_stats is not None
@@ -117,11 +109,6 @@ def test_sendonly_recvonly(
117109 assert receiver_video_codec is not None
118110 assert receiver_video_codec ["mimeType" ] == expected_mime_type
119111
120- # audio codec を確認
121- receiver_audio_codec = get_codec (receiver_stats , "audio/opus" )
122- assert receiver_audio_codec is not None
123- assert receiver_audio_codec ["mimeType" ] == "audio/opus"
124-
125112 # video inbound-rtp を確認
126113 receiver_video_inbound = get_inbound_rtp (receiver_stats , "video" )
127114 assert receiver_video_inbound is not None
@@ -130,12 +117,6 @@ def test_sendonly_recvonly(
130117 assert "decoderImplementation" in receiver_video_inbound
131118 assert receiver_video_inbound ["decoderImplementation" ] == "NvCodec"
132119
133- # audio inbound-rtp を確認
134- receiver_audio_inbound = get_inbound_rtp (receiver_stats , "audio" )
135- assert receiver_audio_inbound is not None
136- assert receiver_audio_inbound ["packetsReceived" ] > 0
137- assert receiver_audio_inbound ["bytesReceived" ] > 0
138-
139120
140121@pytest .mark .parametrize (
141122 "video_codec_type" ,
@@ -182,9 +163,9 @@ def test_sendrecv(
182163 role = "sendrecv" ,
183164 metadata = sora_settings .metadata ,
184165 http_port = next (port_allocator ),
166+ audio = False ,
185167 video = True ,
186168 video_codec_type = video_codec_type ,
187- audio = True ,
188169 initial_wait = 10 ,
189170 ** codec_params ,
190171 ) as client1 :
@@ -195,9 +176,9 @@ def test_sendrecv(
195176 role = "sendrecv" ,
196177 metadata = sora_settings .metadata ,
197178 http_port = next (port_allocator ),
179+ audio = False ,
198180 video = True ,
199181 video_codec_type = video_codec_type ,
200- audio = True ,
201182 initial_wait = 10 ,
202183 ** codec_params ,
203184 ) as client2 :
@@ -212,11 +193,6 @@ def test_sendrecv(
212193 assert client1_video_codec is not None
213194 assert client1_video_codec ["mimeType" ] == expected_mime_type
214195
215- # audio codec を確認
216- client1_audio_codec = get_codec (client1_stats , "audio/opus" )
217- assert client1_audio_codec is not None
218- assert client1_audio_codec ["mimeType" ] == "audio/opus"
219-
220196 # video outbound-rtp を確認
221197 client1_video_outbound = get_outbound_rtp (client1_stats , "video" )
222198 assert client1_video_outbound is not None
@@ -225,12 +201,6 @@ def test_sendrecv(
225201 assert "encoderImplementation" in client1_video_outbound
226202 assert client1_video_outbound ["encoderImplementation" ] == "NvCodec"
227203
228- # audio outbound-rtp を確認
229- client1_audio_outbound = get_outbound_rtp (client1_stats , "audio" )
230- assert client1_audio_outbound is not None
231- assert client1_audio_outbound ["packetsSent" ] > 0
232- assert client1_audio_outbound ["bytesSent" ] > 0
233-
234204 # video inbound-rtp を確認
235205 client1_video_inbound = get_inbound_rtp (client1_stats , "video" )
236206 assert client1_video_inbound is not None
@@ -239,12 +209,6 @@ def test_sendrecv(
239209 assert "decoderImplementation" in client1_video_inbound
240210 assert client1_video_inbound ["decoderImplementation" ] == "NvCodec"
241211
242- # audio inbound-rtp を確認
243- client1_audio_inbound = get_inbound_rtp (client1_stats , "audio" )
244- assert client1_audio_inbound is not None
245- assert client1_audio_inbound ["packetsReceived" ] > 0
246- assert client1_audio_inbound ["bytesReceived" ] > 0
247-
248212 # クライアント 2 の統計を確認
249213 client2_stats = client2 .get_stats ()
250214 assert client2_stats is not None
@@ -254,11 +218,6 @@ def test_sendrecv(
254218 assert client2_video_codec is not None
255219 assert client2_video_codec ["mimeType" ] == expected_mime_type
256220
257- # audio codec を確認
258- client2_audio_codec = get_codec (client2_stats , "audio/opus" )
259- assert client2_audio_codec is not None
260- assert client2_audio_codec ["mimeType" ] == "audio/opus"
261-
262221 # video outbound-rtp を確認
263222 client2_video_outbound = get_outbound_rtp (client2_stats , "video" )
264223 assert client2_video_outbound is not None
@@ -267,12 +226,6 @@ def test_sendrecv(
267226 assert "encoderImplementation" in client2_video_outbound
268227 assert client2_video_outbound ["encoderImplementation" ] == "NvCodec"
269228
270- # audio outbound-rtp を確認
271- client2_audio_outbound = get_outbound_rtp (client2_stats , "audio" )
272- assert client2_audio_outbound is not None
273- assert client2_audio_outbound ["packetsSent" ] > 0
274- assert client2_audio_outbound ["bytesSent" ] > 0
275-
276229 # video inbound-rtp を確認
277230 client2_video_inbound = get_inbound_rtp (client2_stats , "video" )
278231 assert client2_video_inbound is not None
@@ -313,7 +266,7 @@ def test_simulcast(sora_settings, free_port, video_codec_type):
313266 role = "sendonly" ,
314267 metadata = sora_settings .metadata ,
315268 http_port = free_port ,
316- audio = True ,
269+ audio = False ,
317270 video = True ,
318271 video_codec_type = video_codec_type ,
319272 simulcast = True ,
@@ -342,17 +295,6 @@ def test_simulcast(sora_settings, free_port, video_codec_type):
342295 for expected_type in expected_types :
343296 assert expected_type in stat_types
344297
345- # audio codec を確認
346- audio_codec_stats = [
347- stat
348- for stat in stats
349- if stat .get ("type" ) == "codec" and stat .get ("mimeType" ) == "audio/opus"
350- ]
351- assert len (audio_codec_stats ) == 1
352-
353- audio_codec = audio_codec_stats [0 ]
354- assert audio_codec ["clockRate" ] == 48000
355-
356298 # video codec を確認
357299 expected_mime_type = f"video/{ video_codec_type } "
358300 video_codec_stats = [
@@ -373,10 +315,6 @@ def test_simulcast(sora_settings, free_port, video_codec_type):
373315 ]
374316 assert len (audio_outbound_rtp_stats ) == 1
375317
376- audio_outbound_rtp = audio_outbound_rtp_stats [0 ]
377- assert audio_outbound_rtp ["packetsSent" ] > 0
378- assert audio_outbound_rtp ["bytesSent" ] > 0
379-
380318 # simulcast では video の outbound-rtp が 3 つ存在することを確認
381319 video_outbound_rtp_by_rid = get_simulcast_outbound_rtp (stats , "video" )
382320 assert len (video_outbound_rtp_by_rid ) == 3
0 commit comments