@@ -66,8 +66,8 @@ func TestClient(t *testing.T) {
6666 require .NoError (t , err2 )
6767
6868 switch authState {
69- case 0 :
70- require .Equal (t , & message.CommandAMF0 {
69+ case 0 : //nolint:dupl
70+ require .Equal (t , & message.CommandAMF0 { //nolint:dupl
7171 ChunkStreamID : 3 ,
7272 Name : "connect" ,
7373 CommandID : 1 ,
@@ -76,17 +76,28 @@ func TestClient(t *testing.T) {
7676 {Key : "app" , Value : "stream" },
7777 {Key : "flashVer" , Value : "LNX 9,0,124,2" },
7878 {Key : "tcUrl" , Value : "rtmp://127.0.0.1:9121/stream" },
79+ {Key : "objectEncoding" , Value : float64 (0 )},
7980 {Key : "fpad" , Value : false },
8081 {Key : "capabilities" , Value : float64 (15 )},
81- {Key : "audioCodecs" , Value : float64 (4071 )},
82- {Key : "videoCodecs" , Value : float64 (252 )},
83- {Key : "videoFunction" , Value : float64 (1 )},
82+ {Key : "audioCodecs" , Value : float64 (1413 )},
83+ {Key : "videoCodecs" , Value : float64 (128 )},
84+ {Key : "videoFunction" , Value : float64 (0 )},
85+ {Key : "fourCcList" , Value : amf0.StrictArray {
86+ "av01" ,
87+ "vp09" ,
88+ "hvc1" ,
89+ "avc1" ,
90+ "Opus" ,
91+ "ac-3" ,
92+ "mp4a" ,
93+ ".mp3" ,
94+ }},
8495 },
8596 },
8697 }, msg )
8798
88- case 1 :
89- require .Equal (t , & message.CommandAMF0 {
99+ case 1 : //nolint:dupl
100+ require .Equal (t , & message.CommandAMF0 { //nolint:dupl
90101 ChunkStreamID : 3 ,
91102 Name : "connect" ,
92103 CommandID : 1 ,
@@ -95,11 +106,22 @@ func TestClient(t *testing.T) {
95106 {Key : "app" , Value : "stream?authmod=adobe&user=myuser" },
96107 {Key : "flashVer" , Value : "LNX 9,0,124,2" },
97108 {Key : "tcUrl" , Value : "rtmp://127.0.0.1:9121/stream?authmod=adobe&user=myuser" },
109+ {Key : "objectEncoding" , Value : float64 (0 )},
98110 {Key : "fpad" , Value : false },
99111 {Key : "capabilities" , Value : float64 (15 )},
100- {Key : "audioCodecs" , Value : float64 (4071 )},
101- {Key : "videoCodecs" , Value : float64 (252 )},
102- {Key : "videoFunction" , Value : float64 (1 )},
112+ {Key : "audioCodecs" , Value : float64 (1413 )},
113+ {Key : "videoCodecs" , Value : float64 (128 )},
114+ {Key : "videoFunction" , Value : float64 (0 )},
115+ {Key : "fourCcList" , Value : amf0.StrictArray {
116+ "av01" ,
117+ "vp09" ,
118+ "hvc1" ,
119+ "avc1" ,
120+ "Opus" ,
121+ "ac-3" ,
122+ "mp4a" ,
123+ ".mp3" ,
124+ }},
103125 },
104126 },
105127 }, msg )
@@ -127,11 +149,22 @@ func TestClient(t *testing.T) {
127149 Value : "rtmp://127.0.0.1:9121/stream?authmod=adobe&user=myuser&challenge=" +
128150 clientChallenge + "&response=" + response ,
129151 },
152+ {Key : "objectEncoding" , Value : float64 (0 )},
130153 {Key : "fpad" , Value : false },
131154 {Key : "capabilities" , Value : float64 (15 )},
132- {Key : "audioCodecs" , Value : float64 (4071 )},
133- {Key : "videoCodecs" , Value : float64 (252 )},
134- {Key : "videoFunction" , Value : float64 (1 )},
155+ {Key : "audioCodecs" , Value : float64 (1413 )},
156+ {Key : "videoCodecs" , Value : float64 (128 )},
157+ {Key : "videoFunction" , Value : float64 (0 )},
158+ {Key : "fourCcList" , Value : amf0.StrictArray {
159+ "av01" ,
160+ "vp09" ,
161+ "hvc1" ,
162+ "avc1" ,
163+ "Opus" ,
164+ "ac-3" ,
165+ "mp4a" ,
166+ ".mp3" ,
167+ }},
135168 },
136169 },
137170 }, msg )
@@ -140,7 +173,7 @@ func TestClient(t *testing.T) {
140173 case "read" , "read nginx rtmp" :
141174 msg , err2 = mrw .Read ()
142175 require .NoError (t , err2 )
143- require .Equal (t , & message.CommandAMF0 {
176+ require .Equal (t , & message.CommandAMF0 { //nolint:dupl
144177 ChunkStreamID : 3 ,
145178 Name : "connect" ,
146179 CommandID : 1 ,
@@ -149,11 +182,22 @@ func TestClient(t *testing.T) {
149182 {Key : "app" , Value : "stream" },
150183 {Key : "flashVer" , Value : "LNX 9,0,124,2" },
151184 {Key : "tcUrl" , Value : "rtmp://127.0.0.1:9121/stream" },
185+ {Key : "objectEncoding" , Value : float64 (0 )},
152186 {Key : "fpad" , Value : false },
153187 {Key : "capabilities" , Value : float64 (15 )},
154- {Key : "audioCodecs" , Value : float64 (4071 )},
155- {Key : "videoCodecs" , Value : float64 (252 )},
156- {Key : "videoFunction" , Value : float64 (1 )},
188+ {Key : "audioCodecs" , Value : float64 (1413 )},
189+ {Key : "videoCodecs" , Value : float64 (128 )},
190+ {Key : "videoFunction" , Value : float64 (0 )},
191+ {Key : "fourCcList" , Value : amf0.StrictArray {
192+ "av01" ,
193+ "vp09" ,
194+ "hvc1" ,
195+ "avc1" ,
196+ "Opus" ,
197+ "ac-3" ,
198+ "mp4a" ,
199+ ".mp3" ,
200+ }},
157201 },
158202 },
159203 }, msg )
@@ -170,6 +214,7 @@ func TestClient(t *testing.T) {
170214 {Key : "app" , Value : "stream" },
171215 {Key : "flashVer" , Value : "LNX 9,0,124,2" },
172216 {Key : "tcUrl" , Value : "rtmp://127.0.0.1:9121/stream" },
217+ {Key : "objectEncoding" , Value : float64 (0 )},
173218 },
174219 },
175220 }, msg )
@@ -408,11 +453,11 @@ func TestClient(t *testing.T) {
408453 switch ca {
409454 case "read" , "read nginx rtmp" :
410455 require .Equal (t , uint64 (3421 ), conn .BytesReceived ())
411- require .Equal (t , uint64 (3409 ), conn .BytesSent ())
456+ require .Equal (t , uint64 (0xdb3 ), conn .BytesSent ())
412457
413458 case "publish" :
414459 require .Equal (t , uint64 (3427 ), conn .BytesReceived ())
415- require .Equal (t , uint64 (0xd27 ), conn .BytesSent ())
460+ require .Equal (t , uint64 (0xd40 ), conn .BytesSent ())
416461 }
417462
418463 <- done
0 commit comments