@@ -7,7 +7,7 @@ defmodule Client.Test do
77
88 @ mpegts_url "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8"
99 @ fmp4_url "https://raw.githubusercontent.com/membraneframework-labs/ex_hls/refs/heads/plug-demuxing-engine-into-client/fixture/output.m3u8"
10- describe "if client reads video and audio samples of the HLS" do
10+ describe "if client reads video and audio frames of the HLS" do
1111 test "(MPEGTS) stream" do
1212 client = Client . new ( @ mpegts_url , ExHLS.DemuxingEngine.MPEGTS )
1313
@@ -27,23 +27,23 @@ defmodule Client.Test do
2727 assert % RemoteStream { content_format: AAC , type: :bytestream } in tracks_info
2828 assert % RemoteStream { content_format: H264 , type: :bytestream } in tracks_info
2929
30- { video_sample , client } = client |> Client . read_video_sample ( )
30+ { video_frame , client } = client |> Client . read_video_frame ( )
3131
32- assert % { pts_ms : 10033 , dts_ms : 10000 } = video_sample
33- assert byte_size ( video_sample . payload ) == 1048
32+ assert % { pts : 10033 , dts : 10000 } = video_frame
33+ assert byte_size ( video_frame . payload ) == 1048
3434
3535 assert << 0 , 0 , 0 , 1 , 9 , 240 , 0 , 0 , 0 , 1 , 103 , 100 , 0 , 31 , 172 , 217 , 128 , 80 , 5 , 187 , 1 , 16 ,
3636 0 , 0 , 3 , 0 , 16 , 0 , 0 , 7 , 128 , 241 , 131 , 25 , 160 , 0 , 0 , 0 ,
37- 1 >> <> _rest = video_sample . payload
37+ 1 >> <> _rest = video_frame . payload
3838
39- { audio_sample , _client } = Client . read_audio_sample ( client )
39+ { audio_frame , _client } = Client . read_audio_frame ( client )
4040
41- assert % { pts_ms : 10010 , dts_ms : 10010 } = audio_sample
42- assert byte_size ( audio_sample . payload ) == 6154
41+ assert % { pts : 10010 , dts : 10010 } = audio_frame
42+ assert byte_size ( audio_frame . payload ) == 6154
4343
4444 assert << 255 , 241 , 80 , 128 , 4 , 63 , 252 , 222 , 4 , 0 , 0 , 108 , 105 , 98 , 102 , 97 , 97 , 99 , 32 , 49 ,
4545 46 , 50 , 56 , 0 , 0 , 66 , 64 , 147 , 32 , 4 , 50 , 0 , 71 , 255 , 241 , 80 , 128 , 10 , 255 , 252 ,
46- 33 , 70 , 254 , 208 , 221 , 101 , 200 , 21 , 97 , 0 >> <> _rest = audio_sample . payload
46+ 33 , 70 , 254 , 208 , 221 , 101 , 200 , 21 , 97 , 0 >> <> _rest = audio_frame . payload
4747 end
4848
4949 test "(fMP4) stream" do
@@ -73,27 +73,27 @@ defmodule Client.Test do
7373 } = tracks_info |> Enum . find ( & match? ( % AAC { } , & 1 ) )
7474
7575 assert Client . get_variants ( client ) == % { }
76- { video_sample , client } = Client . read_video_sample ( client )
76+ { video_frame , client } = Client . read_video_frame ( client )
7777
78- assert % { pts_ms : 0 , dts_ms : 0 } = video_sample
79- assert byte_size ( video_sample . payload ) == 775
78+ assert % { pts : 0 , dts : 0 } = video_frame
79+ assert byte_size ( video_frame . payload ) == 775
8080
8181 assert << 0 , 0 , 2 , 171 , 6 , 5 , 255 , 255 , 167 , 220 , 69 , 233 , 189 , 230 , 217 , 72 , 183 , 150 , 44 ,
8282 216 , 32 , 217 , 35 , 238 , 239 , 120 , 50 , 54 , 52 , 32 , 45 , 32 , 99 , 111 , 114 , 101 , 32 , 49 ,
83- 54 , 52 , 32 , 114 , 51 , 49 , 48 , 56 , 32 , 51 , 49 , 101 >> <> _rest = video_sample . payload
83+ 54 , 52 , 32 , 114 , 51 , 49 , 48 , 56 , 32 , 51 , 49 , 101 >> <> _rest = video_frame . payload
8484
85- { first_audio_sample , client } = Client . read_audio_sample ( client )
85+ { first_audio_frame , client } = Client . read_audio_frame ( client )
8686
87- assert % { pts_ms : 0 , dts_ms : 0 } = first_audio_sample
87+ assert % { pts : 0 , dts : 0 } = first_audio_frame
8888
89- assert first_audio_sample . payload ==
89+ assert first_audio_frame . payload ==
9090 << 220 , 0 , 76 , 97 , 118 , 99 , 54 , 49 , 46 , 51 , 46 , 49 , 48 , 48 , 0 , 66 , 32 , 8 , 193 , 24 ,
9191 56 >>
9292
93- { second_audio_sample , _client } = Client . read_audio_sample ( client )
93+ { second_audio_frame , _client } = Client . read_audio_frame ( client )
9494
95- assert % { pts_ms : 23 , dts_ms : 23 } = second_audio_sample
96- assert second_audio_sample . payload == << 33 , 16 , 4 , 96 , 140 , 28 >>
95+ assert % { pts : 23 , dts : 23 } = second_audio_frame
96+ assert second_audio_frame . payload == << 33 , 16 , 4 , 96 , 140 , 28 >>
9797 end
9898 end
9999end
0 commit comments