Skip to content

Commit 54fbd20

Browse files
Bump github.com/bluenviron/mediacommon/v2 from 2.6.0 to 2.7.0 (#990)
* Bump github.com/bluenviron/mediacommon/v2 from 2.6.0 to 2.7.0 Bumps [github.com/bluenviron/mediacommon/v2](https://github.com/bluenviron/mediacommon) from 2.6.0 to 2.7.0. - [Commits](bluenviron/mediacommon@v2.6.0...v2.7.0) --- updated-dependencies: - dependency-name: github.com/bluenviron/mediacommon/v2 dependency-version: 2.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * additional changes * additional changes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: aler9 <[email protected]>
1 parent 93d1306 commit 54fbd20

File tree

8 files changed

+82
-45
lines changed

8 files changed

+82
-45
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/bluenviron/gortsplib/v5
33
go 1.24.0
44

55
require (
6-
github.com/bluenviron/mediacommon/v2 v2.6.0
6+
github.com/bluenviron/mediacommon/v2 v2.7.0
77
github.com/google/uuid v1.6.0
88
github.com/gorilla/websocket v1.5.3
99
github.com/pion/rtcp v1.2.16

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ github.com/asticode/go-astikit v0.30.0 h1:DkBkRQRIxYcknlaU7W7ksNfn4gMFsB0tqMJflx
22
github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
33
github.com/asticode/go-astits v1.14.0 h1:zkgnZzipx2XX5mWycqsSBeEyDH58+i4HtyF4j2ROb00=
44
github.com/asticode/go-astits v1.14.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega3LPWz3ND/iI=
5-
github.com/bluenviron/mediacommon/v2 v2.6.0 h1:wZAPXwv7V78Cx2x7cToYIHOLToHl6APcvHbdQT+gOkg=
6-
github.com/bluenviron/mediacommon/v2 v2.6.0/go.mod h1:5V15TiOfeaNVmZPVuOqAwqQSWyvMV86/dijDKu5q9Zs=
5+
github.com/bluenviron/mediacommon/v2 v2.7.0 h1:XPj8UQu8iZuytwaeiQvqyDrBmo7VdV2+/ND5zPdgbCY=
6+
github.com/bluenviron/mediacommon/v2 v2.7.0/go.mod h1:5V15TiOfeaNVmZPVuOqAwqQSWyvMV86/dijDKu5q9Zs=
77
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
88
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
99
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

pkg/format/format_test.go

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ var casesFormat = []struct {
275275
PayloadTyp: 96,
276276
ProfileLevelID: 1,
277277
Config: &mpeg4audio.AudioSpecificConfig{
278-
Type: mpeg4audio.ObjectTypeAACLC,
279-
SampleRate: 48000,
280-
ChannelCount: 2,
278+
Type: mpeg4audio.ObjectTypeAACLC,
279+
SampleRate: 48000,
280+
ChannelConfig: 2,
281+
ChannelCount: 2,
281282
},
282283
SizeLength: 13,
283284
IndexLength: 3,
@@ -307,9 +308,10 @@ var casesFormat = []struct {
307308
PayloadTyp: 96,
308309
ProfileLevelID: 1,
309310
Config: &mpeg4audio.AudioSpecificConfig{
310-
Type: mpeg4audio.ObjectTypeAACLC,
311-
SampleRate: 48000,
312-
ChannelCount: 2,
311+
Type: mpeg4audio.ObjectTypeAACLC,
312+
SampleRate: 48000,
313+
ChannelConfig: 2,
314+
ChannelCount: 2,
313315
},
314316
SizeLength: 13,
315317
IndexLength: 3,
@@ -339,9 +341,10 @@ var casesFormat = []struct {
339341
PayloadTyp: 96,
340342
ProfileLevelID: 14,
341343
Config: &mpeg4audio.AudioSpecificConfig{
342-
Type: mpeg4audio.ObjectTypeAACLC,
343-
SampleRate: 48000,
344-
ChannelCount: 2,
344+
Type: mpeg4audio.ObjectTypeAACLC,
345+
SampleRate: 48000,
346+
ChannelConfig: 2,
347+
ChannelCount: 2,
345348
},
346349
SizeLength: 13,
347350
},
@@ -371,6 +374,7 @@ var casesFormat = []struct {
371374
ExtensionType: 29,
372375
ExtensionSampleRate: 48000,
373376
SampleRate: 24000,
377+
ChannelConfig: 1,
374378
ChannelCount: 1,
375379
},
376380
SizeLength: 13,
@@ -402,9 +406,10 @@ var casesFormat = []struct {
402406
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
403407
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
404408
AudioSpecificConfig: &mpeg4audio.AudioSpecificConfig{
405-
Type: 2,
406-
SampleRate: 24000,
407-
ChannelCount: 2,
409+
Type: 2,
410+
SampleRate: 24000,
411+
ChannelConfig: 2,
412+
ChannelCount: 2,
408413
},
409414
LatmBufferFullness: 255,
410415
}},
@@ -438,9 +443,10 @@ var casesFormat = []struct {
438443
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
439444
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
440445
AudioSpecificConfig: &mpeg4audio.AudioSpecificConfig{
441-
Type: 2,
442-
SampleRate: 24000,
443-
ChannelCount: 1,
446+
Type: 2,
447+
SampleRate: 24000,
448+
ChannelConfig: 1,
449+
ChannelCount: 1,
444450
},
445451
LatmBufferFullness: 255,
446452
}},
@@ -479,6 +485,7 @@ var casesFormat = []struct {
479485
ExtensionType: 5,
480486
ExtensionSampleRate: 48000,
481487
SampleRate: 24000,
488+
ChannelConfig: 2,
482489
ChannelCount: 2,
483490
},
484491
LatmBufferFullness: 255,
@@ -518,6 +525,7 @@ var casesFormat = []struct {
518525
ExtensionType: 29,
519526
ExtensionSampleRate: 48000,
520527
SampleRate: 24000,
528+
ChannelConfig: 1,
521529
ChannelCount: 1,
522530
},
523531
LatmBufferFullness: 255,
@@ -551,9 +559,10 @@ var casesFormat = []struct {
551559
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
552560
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
553561
AudioSpecificConfig: &mpeg4audio.AudioSpecificConfig{
554-
Type: 2,
555-
SampleRate: 48000,
556-
ChannelCount: 1,
562+
Type: 2,
563+
SampleRate: 48000,
564+
ChannelConfig: 1,
565+
ChannelCount: 1,
557566
},
558567
LatmBufferFullness: 255,
559568
}},
@@ -1212,9 +1221,10 @@ var casesFormat = []struct {
12121221
&MPEG4Audio{
12131222
PayloadTyp: 100,
12141223
Config: &mpeg4audio.AudioSpecificConfig{
1215-
Type: 2,
1216-
SampleRate: 48000,
1217-
ChannelCount: 2,
1224+
Type: 2,
1225+
SampleRate: 48000,
1226+
ChannelConfig: 2,
1227+
ChannelCount: 2,
12181228
},
12191229
SizeLength: 13,
12201230
IndexLength: 3,

pkg/format/mpeg4_audio.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,20 @@ func (f *MPEG4Audio) RTPMap() string {
116116
sampleRate = f.Config.ExtensionSampleRate
117117
}
118118

119-
channelCount := f.Config.ChannelCount
120-
if f.Config.ExtensionType == mpeg4audio.ObjectTypePS {
119+
var channelCount int
120+
121+
switch {
122+
case f.Config.ExtensionType == mpeg4audio.ObjectTypePS:
121123
channelCount = 2
124+
125+
case f.Config.ChannelConfig == 7:
126+
channelCount = 8
127+
128+
case f.Config.ChannelConfig >= 1 && f.Config.ChannelConfig <= 6:
129+
channelCount = int(f.Config.ChannelConfig)
130+
131+
default:
132+
channelCount = 1
122133
}
123134

124135
return "mpeg4-generic/" + strconv.FormatInt(int64(sampleRate), 10) +

pkg/format/mpeg4_audio_latm.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func allLayersHaveSameTypeRateChannelsExtType(c *mpeg4audio.StreamMuxConfig) bool {
1515
typ := c.Programs[0].Layers[0].AudioSpecificConfig.Type
1616
rate := c.Programs[0].Layers[0].AudioSpecificConfig.SampleRate
17-
channels := c.Programs[0].Layers[0].AudioSpecificConfig.ChannelCount
17+
channelConfig := c.Programs[0].Layers[0].AudioSpecificConfig.ChannelConfig
1818
extensionType := c.Programs[0].Layers[0].AudioSpecificConfig.ExtensionType
1919

2020
for i, p := range c.Programs {
@@ -25,7 +25,7 @@ func allLayersHaveSameTypeRateChannelsExtType(c *mpeg4audio.StreamMuxConfig) boo
2525

2626
if l.AudioSpecificConfig.Type != typ ||
2727
l.AudioSpecificConfig.SampleRate != rate ||
28-
l.AudioSpecificConfig.ChannelCount != channels ||
28+
l.AudioSpecificConfig.ChannelConfig != channelConfig ||
2929
l.AudioSpecificConfig.ExtensionType != extensionType {
3030
return false
3131
}
@@ -145,9 +145,20 @@ func (f *MPEG4AudioLATM) RTPMap() string {
145145
sampleRate = aoc.ExtensionSampleRate
146146
}
147147

148-
channelCount := aoc.ChannelCount
149-
if aoc.ExtensionType == mpeg4audio.ObjectTypePS {
148+
var channelCount int
149+
150+
switch {
151+
case aoc.ExtensionType == mpeg4audio.ObjectTypePS:
150152
channelCount = 2
153+
154+
case aoc.ChannelConfig == 7:
155+
channelCount = 8
156+
157+
case aoc.ChannelConfig >= 1 && aoc.ChannelConfig <= 6:
158+
channelCount = int(aoc.ChannelConfig)
159+
160+
default:
161+
channelCount = 1
151162
}
152163

153164
return "MP4A-LATM/" + strconv.FormatInt(int64(sampleRate), 10) +

pkg/format/mpeg4_audio_latm_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ func TestMPEG4AudioLATMAttributes(t *testing.T) {
1616
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
1717
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
1818
AudioSpecificConfig: &mpeg4audio.AudioSpecificConfig{
19-
Type: 2,
20-
SampleRate: 44100,
21-
ChannelCount: 2,
19+
Type: 2,
20+
SampleRate: 44100,
21+
ChannelConfig: 2,
22+
ChannelCount: 2,
2223
},
2324
LatmBufferFullness: 255,
2425
}},
@@ -38,9 +39,10 @@ func TestMPEG4AudioLATMDecEncoder(t *testing.T) {
3839
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
3940
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
4041
AudioSpecificConfig: &mpeg4audio.AudioSpecificConfig{
41-
Type: 2,
42-
SampleRate: 48000,
43-
ChannelCount: 2,
42+
Type: 2,
43+
SampleRate: 48000,
44+
ChannelConfig: 2,
45+
ChannelCount: 2,
4446
},
4547
LatmBufferFullness: 255,
4648
}},

pkg/format/mpeg4_audio_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ func TestMPEG4AudioAttributes(t *testing.T) {
1313
format := &MPEG4Audio{
1414
PayloadTyp: 96,
1515
Config: &mpeg4audio.AudioSpecificConfig{
16-
Type: mpeg4audio.ObjectTypeAACLC,
17-
SampleRate: 48000,
18-
ChannelCount: 2,
16+
Type: mpeg4audio.ObjectTypeAACLC,
17+
SampleRate: 48000,
18+
ChannelConfig: 2,
19+
ChannelCount: 2,
1920
},
2021
SizeLength: 13,
2122
IndexLength: 3,
@@ -30,9 +31,10 @@ func TestMPEG4AudioDecEncoder(t *testing.T) {
3031
format := &MPEG4Audio{
3132
PayloadTyp: 96,
3233
Config: &mpeg4audio.AudioSpecificConfig{
33-
Type: mpeg4audio.ObjectTypeAACLC,
34-
SampleRate: 48000,
35-
ChannelCount: 2,
34+
Type: mpeg4audio.ObjectTypeAACLC,
35+
SampleRate: 48000,
36+
ChannelConfig: 2,
37+
ChannelCount: 2,
3638
},
3739
SizeLength: 13,
3840
IndexLength: 3,

server_play_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,9 +2845,10 @@ func TestServerPlayMulticastParams(t *testing.T) {
28452845
Formats: []format.Format{&format.MPEG4Audio{
28462846
PayloadTyp: 97,
28472847
Config: &mpeg4audio.AudioSpecificConfig{
2848-
Type: mpeg4audio.ObjectTypeAACLC,
2849-
SampleRate: 48000,
2850-
ChannelCount: 2,
2848+
Type: mpeg4audio.ObjectTypeAACLC,
2849+
SampleRate: 48000,
2850+
ChannelConfig: 2,
2851+
ChannelCount: 2,
28512852
},
28522853
SizeLength: 13,
28532854
IndexLength: 3,

0 commit comments

Comments
 (0)