From 053cd9ba3ebf891fb2455506364a2e0c015e5f1c Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Thu, 27 Jul 2023 23:30:28 +0200 Subject: [PATCH] update mediacommon (#332) --- README.md | 8 ++++---- go.mod | 2 +- go.sum | 4 ++-- pkg/formats/rtph264/decoder.go | 4 ++-- pkg/formats/rtph264/decoder_test.go | 2 +- pkg/formats/rtph265/decoder.go | 4 ++-- pkg/formats/rtph265/decoder_test.go | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ba0f9253..9534a540 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Features: * [API Documentation](#api-documentation) * [RTP Payload Formats](#rtp-payload-formats) * [Standards](#standards) -* [Links](#links) +* [Related projects](#related-projects) ## Examples @@ -152,11 +152,11 @@ In RTSP, media streams are routed between server and clients by using RTP packet * [Codec standards](https://github.com/bluenviron/mediacommon#standards) * [Golang project layout](https://github.com/golang-standards/project-layout) -## Links - -Related projects +## Related projects * [MediaMTX](https://github.com/bluenviron/mediamtx) +* [gohlslib](https://github.com/bluenviron/gohlslib) +* [mediacommon](https://github.com/bluenviron/mediacommon) * [pion/sdp (SDP library used internally)](https://github.com/pion/sdp) * [pion/rtp (RTP library used internally)](https://github.com/pion/rtp) * [pion/rtcp (RTCP library used internally)](https://github.com/pion/rtcp) diff --git a/go.mod b/go.mod index c61298d0..5a09444a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/asticode/go-astits v1.11.0 - github.com/bluenviron/mediacommon v0.6.0 + github.com/bluenviron/mediacommon v0.7.0 github.com/google/uuid v1.3.0 github.com/pion/rtcp v1.2.10 github.com/pion/rtp v1.8.0 diff --git a/go.sum b/go.sum index a1573880..cdea884d 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/asticode/go-astikit v0.30.0 h1:DkBkRQRIxYcknlaU7W7ksNfn4gMFsB0tqMJflx github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0= github.com/asticode/go-astits v1.11.0 h1:GTHUXht0ZXAJXsVbsLIcyfHr1Bchi4QQwMARw2ZWAng= github.com/asticode/go-astits v1.11.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega3LPWz3ND/iI= -github.com/bluenviron/mediacommon v0.6.0 h1:suWFWHL9WL+sfBQPmleCd5jCY0iEtuKgvPRUaBGoq+g= -github.com/bluenviron/mediacommon v0.6.0/go.mod h1:wuLJdxcITiSPgY1MvQqrX+qPlKmNfeV9wNvXth5M98I= +github.com/bluenviron/mediacommon v0.7.0 h1:dJWLLL9oDbAqfK8KuNfnDUQwNbeMAtGeRjZc9Vo95js= +github.com/bluenviron/mediacommon v0.7.0/go.mod h1:wuLJdxcITiSPgY1MvQqrX+qPlKmNfeV9wNvXth5M98I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/pkg/formats/rtph264/decoder.go b/pkg/formats/rtph264/decoder.go index 42ca1b8a..645a94ba 100644 --- a/pkg/formats/rtph264/decoder.go +++ b/pkg/formats/rtph264/decoder.go @@ -178,11 +178,11 @@ func (d *Decoder) DecodeUntilMarker(pkt *rtp.Packet) ([][]byte, time.Duration, e } l := len(nalus) - if (d.frameBufferLen + l) > h264.MaxNALUsPerGroup { + if (d.frameBufferLen + l) > h264.MaxNALUsPerAccessUnit { d.frameBuffer = nil d.frameBufferLen = 0 return nil, 0, fmt.Errorf("NALU count exceeds maximum allowed (%d)", - h264.MaxNALUsPerGroup) + h264.MaxNALUsPerAccessUnit) } d.frameBuffer = append(d.frameBuffer, nalus...) diff --git a/pkg/formats/rtph264/decoder_test.go b/pkg/formats/rtph264/decoder_test.go index b52c600c..810db4ab 100644 --- a/pkg/formats/rtph264/decoder_test.go +++ b/pkg/formats/rtph264/decoder_test.go @@ -190,7 +190,7 @@ func TestDecoderErrorLimit(t *testing.T) { d.Init() var err error - for i := 0; i <= h264.MaxNALUsPerGroup; i++ { + for i := 0; i <= h264.MaxNALUsPerAccessUnit; i++ { _, _, err = d.DecodeUntilMarker(&rtp.Packet{ Header: rtp.Header{ Version: 2, diff --git a/pkg/formats/rtph265/decoder.go b/pkg/formats/rtph265/decoder.go index 7f4ad5f7..9e492030 100644 --- a/pkg/formats/rtph265/decoder.go +++ b/pkg/formats/rtph265/decoder.go @@ -170,11 +170,11 @@ func (d *Decoder) DecodeUntilMarker(pkt *rtp.Packet) ([][]byte, time.Duration, e } l := len(nalus) - if (d.frameBufferLen + l) > h265.MaxNALUsPerGroup { + if (d.frameBufferLen + l) > h265.MaxNALUsPerAccessUnit { d.frameBuffer = nil d.frameBufferLen = 0 return nil, 0, fmt.Errorf("NALU count exceeds maximum allowed (%d)", - h265.MaxNALUsPerGroup) + h265.MaxNALUsPerAccessUnit) } d.frameBuffer = append(d.frameBuffer, nalus...) diff --git a/pkg/formats/rtph265/decoder_test.go b/pkg/formats/rtph265/decoder_test.go index 8b0deec4..8bc9e53a 100644 --- a/pkg/formats/rtph265/decoder_test.go +++ b/pkg/formats/rtph265/decoder_test.go @@ -42,7 +42,7 @@ func TestDecoderErrorLimit(t *testing.T) { d.Init() var err error - for i := 0; i <= h265.MaxNALUsPerGroup; i++ { + for i := 0; i <= h265.MaxNALUsPerAccessUnit; i++ { _, _, err = d.DecodeUntilMarker(&rtp.Packet{ Header: rtp.Header{ Version: 2,