From 689728af0792e13d378ead6ad4e602fb7e0417c2 Mon Sep 17 00:00:00 2001 From: Raman Pandey Date: Mon, 27 Jun 2022 13:14:06 +0530 Subject: [PATCH 1/6] Added missing attributes for dash mpd model Added missing attributes such as Role, AudioChannelConfiguration and Id, width, height, Par and SegmentRate in Representation and AdaptionSet. --- mpd.go | 145 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 109 insertions(+), 36 deletions(-) diff --git a/mpd.go b/mpd.go index 8586eda..338da2f 100644 --- a/mpd.go +++ b/mpd.go @@ -121,7 +121,7 @@ func (m *MPD) Encode() ([]byte, error) { // hacks for self-closing tags res := new(bytes.Buffer) - res.WriteString(``) + res.WriteString(``) res.WriteByte('\n') for { s, err := x.ReadString('\n') @@ -163,7 +163,8 @@ type periodMarshal struct { // AdaptationSet represents XSD's AdaptationSetType. type AdaptationSet struct { - MimeType string `xml:"mimeType,attr"` + Role *Role `xml:"Role,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` StartWithSAP *uint64 `xml:"startWithSAP,attr"` BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` @@ -173,10 +174,19 @@ type AdaptationSet struct { ContentProtections []DRMDescriptor `xml:"ContentProtection,omitempty"` Representations []Representation `xml:"Representation,omitempty"` Codecs *string `xml:"codecs,attr"` + ContentType string `xml:"contentType,attr,omitempty"` + ID *string `xml:"id,attr"` + Width *string `xml:"width,attr,omitempty"` + Height *string `xml:"height,attr,omitempty"` + MaxWidth *string `xml:"maxWidth,attr,omitempty"` + MaxHeight *string `xml:"maxHeight,attr,omitempty"` + FrameRate *string `xml:"frameRate,attr,omitempty"` + Par *string `xml:"par,attr,omitempty"` } type adaptationSetMarshal struct { - MimeType string `xml:"mimeType,attr"` + Role *roleMarshal `xml:"Role,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` StartWithSAP *uint64 `xml:"startWithSAP,attr"` BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` @@ -186,35 +196,67 @@ type adaptationSetMarshal struct { ContentProtections []drmDescriptorMarshal `xml:"ContentProtection,omitempty"` Representations []representationMarshal `xml:"Representation,omitempty"` Codecs *string `xml:"codecs,attr"` + ContentType string `xml:"contentType,attr,omitempty"` + ID *string `xml:"id,attr"` + Width *string `xml:"width,attr,omitempty"` + Height *string `xml:"height,attr,omitempty"` + MaxWidth *string `xml:"maxWidth,attr,omitempty"` + MaxHeight *string `xml:"maxHeight,attr,omitempty"` + FrameRate *string `xml:"frameRate,attr,omitempty"` + Par *string `xml:"par,attr,omitempty"` +} + +type Role struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` +} + +type roleMarshal struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` } // Representation represents XSD's RepresentationType. type Representation struct { - ID *string `xml:"id,attr"` - Width *uint64 `xml:"width,attr"` - Height *uint64 `xml:"height,attr"` - SAR *string `xml:"sar,attr"` - FrameRate *string `xml:"frameRate,attr"` - Bandwidth *uint64 `xml:"bandwidth,attr"` - AudioSamplingRate *string `xml:"audioSamplingRate,attr"` - Codecs *string `xml:"codecs,attr"` - BaseURL *string `xml:"BaseURL,omitempty"` - ContentProtections []DRMDescriptor `xml:"ContentProtection,omitempty"` - SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` + ID *string `xml:"id,attr"` + Width *uint64 `xml:"width,attr"` + Height *uint64 `xml:"height,attr"` + SAR *string `xml:"sar,attr"` + FrameRate *string `xml:"frameRate,attr"` + Bandwidth *uint64 `xml:"bandwidth,attr"` + AudioSamplingRate *string `xml:"audioSamplingRate,attr"` + Codecs *string `xml:"codecs,attr"` + BaseURL *string `xml:"BaseURL,omitempty"` + ContentProtections []DRMDescriptor `xml:"ContentProtection,omitempty"` + SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` + AudioChannelConfiguration *AudioChannelConfiguration `xml:"AudioChannelConfiguration,omitempty"` } type representationMarshal struct { - ID *string `xml:"id,attr"` - Width *uint64 `xml:"width,attr"` - Height *uint64 `xml:"height,attr"` - SAR *string `xml:"sar,attr"` - FrameRate *string `xml:"frameRate,attr"` - Bandwidth *uint64 `xml:"bandwidth,attr"` - AudioSamplingRate *string `xml:"audioSamplingRate,attr"` - Codecs *string `xml:"codecs,attr"` - BaseURL *string `xml:"BaseURL,omitempty"` - ContentProtections []drmDescriptorMarshal `xml:"ContentProtection,omitempty"` - SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` + ID *string `xml:"id,attr"` + Width *uint64 `xml:"width,attr"` + Height *uint64 `xml:"height,attr"` + SAR *string `xml:"sar,attr"` + FrameRate *string `xml:"frameRate,attr"` + Bandwidth *uint64 `xml:"bandwidth,attr"` + AudioSamplingRate *string `xml:"audioSamplingRate,attr"` + Codecs *string `xml:"codecs,attr"` + BaseURL *string `xml:"BaseURL,omitempty"` + ContentProtections []drmDescriptorMarshal `xml:"ContentProtection,omitempty"` + SegmentTemplate *SegmentTemplate `xml:"SegmentTemplate,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` + AudioChannelConfiguration *audioChannelConfigurationMarshal `xml:"AudioChannelConfiguration,omitempty"` +} + +type AudioChannelConfiguration struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` +} + +type audioChannelConfigurationMarshal struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` } // Descriptor represents XSD's DescriptorType. @@ -312,6 +354,8 @@ func modifyAdaptationSets(as []*AdaptationSet) []*adaptationSetMarshal { BitstreamSwitching: copyobj.Bool(a.BitstreamSwitching), Codecs: copyobj.String(a.Codecs), Lang: copyobj.String(a.Lang), + ID: copyobj.String(a.ID), + ContentType: a.ContentType, MimeType: a.MimeType, SegmentAlignment: a.SegmentAlignment, StartWithSAP: copyobj.UInt64(a.StartWithSAP), @@ -319,6 +363,13 @@ func modifyAdaptationSets(as []*AdaptationSet) []*adaptationSetMarshal { SubsegmentStartsWithSAP: copyobj.UInt64(a.SubsegmentStartsWithSAP), Representations: modifyRepresentations(a.Representations), ContentProtections: modifyContentProtections(a.ContentProtections), + Role: modifyRole(a.Role), + Width: copyobj.String(a.Width), + Height: copyobj.String(a.Height), + MaxWidth: copyobj.String(a.MaxWidth), + MaxHeight: copyobj.String(a.MaxHeight), + Par: copyobj.String(a.Par), + FrameRate: copyobj.String(a.FrameRate), } asm = append(asm, adaptationSet) } @@ -329,17 +380,19 @@ func modifyRepresentations(rs []Representation) []representationMarshal { rsm := make([]representationMarshal, 0, len(rs)) for _, r := range rs { representation := representationMarshal{ - AudioSamplingRate: copyobj.String(r.AudioSamplingRate), - Bandwidth: copyobj.UInt64(r.Bandwidth), - Codecs: copyobj.String(r.Codecs), - FrameRate: copyobj.String(r.FrameRate), - Height: copyobj.UInt64(r.Height), - ID: copyobj.String(r.ID), - Width: copyobj.UInt64(r.Width), - SegmentTemplate: copySegmentTemplate(r.SegmentTemplate), - SAR: copyobj.String(r.SAR), - ContentProtections: modifyContentProtections(r.ContentProtections), - BaseURL: copyobj.String(r.BaseURL), + AudioSamplingRate: copyobj.String(r.AudioSamplingRate), + Bandwidth: copyobj.UInt64(r.Bandwidth), + Codecs: copyobj.String(r.Codecs), + FrameRate: copyobj.String(r.FrameRate), + Height: copyobj.UInt64(r.Height), + ID: copyobj.String(r.ID), + Width: copyobj.UInt64(r.Width), + SegmentTemplate: copySegmentTemplate(r.SegmentTemplate), + SAR: copyobj.String(r.SAR), + ContentProtections: modifyContentProtections(r.ContentProtections), + BaseURL: copyobj.String(r.BaseURL), + MimeType: r.MimeType, + AudioChannelConfiguration: modifyAudioChannelConfiguration(r.AudioChannelConfiguration), } rsm = append(rsm, representation) } @@ -397,3 +450,23 @@ func modifyPssh(p *Pssh) *psshMarshal { Value: copyobj.String(p.Value), } } + +func modifyRole(r *Role) *roleMarshal { + if r == nil { + return nil + } + return &roleMarshal{ + SchemeIdUri: copyobj.String(r.SchemeIdUri), + Value: copyobj.String(r.Value), + } +} + +func modifyAudioChannelConfiguration(a *AudioChannelConfiguration) *audioChannelConfigurationMarshal { + if a == nil { + return nil + } + return &audioChannelConfigurationMarshal{ + SchemeIdUri: copyobj.String(a.SchemeIdUri), + Value: copyobj.String(a.Value), + } +} From 5754ca374e9d36fdf7c5b46b92900ba078c9dd88 Mon Sep 17 00:00:00 2001 From: Raman Pandey Date: Tue, 5 Jul 2022 17:05:43 +0530 Subject: [PATCH 2/6] fixed cenc attribute issue fixed cenc namespace issue --- mpd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mpd.go b/mpd.go index 338da2f..a0f4b18 100644 --- a/mpd.go +++ b/mpd.go @@ -75,6 +75,7 @@ type MPD struct { PublishTime *string `xml:"publishTime,attr"` Profiles string `xml:"profiles,attr"` XSI *string `xml:"xsi,attr,omitempty"` + Cenc *string `xml:"cenc,attr,omitempty"` SCTE35 *string `xml:"scte35,attr,omitempty"` XSISchemaLocation *string `xml:"schemaLocation,attr"` ID *string `xml:"id,attr"` @@ -86,6 +87,7 @@ type MPD struct { type mpdMarshal struct { XMLName xml.Name `xml:"MPD"` XSI *string `xml:"xmlns:xsi,attr,omitempty"` + Cenc *string `xml:"xmlns:cenc,attr,omitempty"` XMLNS *string `xml:"xmlns,attr"` XSISchemaLocation *string `xml:"xsi:schemaLocation,attr"` ID *string `xml:"id,attr"` @@ -320,6 +322,7 @@ func modifyMPD(mpd *MPD) *mpdMarshal { XSI: copyobj.String(mpd.XSI), SCTE35: copyobj.String(mpd.SCTE35), XSISchemaLocation: copyobj.String(mpd.XSISchemaLocation), + Cenc: copyobj.String(mpd.Cenc), ID: copyobj.String(mpd.ID), BaseURL: copyobj.String(mpd.BaseURL), Period: modifyPeriod(mpd.Period), From ee666df4e5be9d4457ed7fcd3f943ae3f5dc381a Mon Sep 17 00:00:00 2001 From: Raman Pandey Date: Wed, 13 Jul 2022 15:17:23 +0530 Subject: [PATCH 3/6] updated module name --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2da1afe..d510abf 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/mc2soft/mpd +module github.com/RamanPndy/go-dash-mpd go 1.16 From a5f2b89f4758da37df95f3bec9c936071c902ddd Mon Sep 17 00:00:00 2001 From: RamanPndy Date: Wed, 13 Jul 2022 17:48:21 +0530 Subject: [PATCH 4/6] go-dash-mpd: changes for v1.0.1 --- fixture_elemental_delta_live.mpd | 2 +- fixture_elemental_delta_vod.mpd | 2 +- fixture_elemental_delta_vod_multi_drm.mpd | 2 +- fixture_flussonic_live.mpd | 2 +- fixture_vod_with_base_url.mpd | 2 +- go.mod | 2 +- go.sum | 2 ++ 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fixture_elemental_delta_live.mpd b/fixture_elemental_delta_live.mpd index c4c676d..c8ba15e 100644 --- a/fixture_elemental_delta_live.mpd +++ b/fixture_elemental_delta_live.mpd @@ -1,4 +1,4 @@ - + diff --git a/fixture_elemental_delta_vod.mpd b/fixture_elemental_delta_vod.mpd index 44b88fe..2ec0f74 100644 --- a/fixture_elemental_delta_vod.mpd +++ b/fixture_elemental_delta_vod.mpd @@ -1,4 +1,4 @@ - + diff --git a/fixture_elemental_delta_vod_multi_drm.mpd b/fixture_elemental_delta_vod_multi_drm.mpd index 4f33fb4..9e239b9 100644 --- a/fixture_elemental_delta_vod_multi_drm.mpd +++ b/fixture_elemental_delta_vod_multi_drm.mpd @@ -1,4 +1,4 @@ - + diff --git a/fixture_flussonic_live.mpd b/fixture_flussonic_live.mpd index e92cd74..1891c75 100644 --- a/fixture_flussonic_live.mpd +++ b/fixture_flussonic_live.mpd @@ -1,4 +1,4 @@ - + diff --git a/fixture_vod_with_base_url.mpd b/fixture_vod_with_base_url.mpd index 4313339..c6d30d0 100644 --- a/fixture_vod_with_base_url.mpd +++ b/fixture_vod_with_base_url.mpd @@ -1,4 +1,4 @@ - + https://video-1-2/ diff --git a/go.mod b/go.mod index d510abf..0065fbc 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/RamanPndy/go-dash-mpd go 1.16 require ( - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/mc2soft/mpd v1.1.2 github.com/stretchr/testify v1.6.1 gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b ) diff --git a/go.sum b/go.sum index ed17c33..88c8e65 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mc2soft/mpd v1.1.2 h1:sHrckLOBGZh8wmJcL2ND7P3SlbjeloLMB3cstHAT3a4= +github.com/mc2soft/mpd v1.1.2/go.mod h1:hsTGV0w8BqZFiHc9VOgW9wk9ZjnF3wM4NdSoJRJLtE0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 5b244bacc12f3d34a8b83d53500423912a0bd23e Mon Sep 17 00:00:00 2001 From: RamanPndy Date: Tue, 26 Jul 2022 16:04:27 +0530 Subject: [PATCH 5/6] fixed reference issue --- README.md | 4 ++-- go.mod | 2 +- go.sum | 2 -- mpd.go | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 70983ca..3df73ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# mpd [![GoDoc](https://godoc.org/github.com/mc2soft/mpd?status.svg)](https://godoc.org/github.com/mc2soft/mpd) [![Build Status](https://travis-ci.org/mc2soft/mpd.svg)](https://travis-ci.org/mc2soft/mpd) +# mpd [![GoDoc](https://godoc.org/github.com/RamanPndy/go-dash-mpd?status.svg)](https://godoc.org/github.com/RamanPndy/go-dash-mpd) [![Build Status](https://travis-ci.org/mc2soft/mpd.svg)](https://travis-ci.org/mc2soft/mpd) Go library for parsing and generating MPEG-DASH Media Presentation Description (MPD) files. -[Documentation](http://godoc.org/github.com/mc2soft/mpd). +[Documentation](http://godoc.org/github.com/RamanPndy/go-dash-mpd). diff --git a/go.mod b/go.mod index 0065fbc..d510abf 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/RamanPndy/go-dash-mpd go 1.16 require ( - github.com/mc2soft/mpd v1.1.2 + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/stretchr/testify v1.6.1 gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b ) diff --git a/go.sum b/go.sum index 88c8e65..ed17c33 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mc2soft/mpd v1.1.2 h1:sHrckLOBGZh8wmJcL2ND7P3SlbjeloLMB3cstHAT3a4= -github.com/mc2soft/mpd v1.1.2/go.mod h1:hsTGV0w8BqZFiHc9VOgW9wk9ZjnF3wM4NdSoJRJLtE0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/mpd.go b/mpd.go index a0f4b18..7b36dd1 100644 --- a/mpd.go +++ b/mpd.go @@ -9,7 +9,7 @@ import ( "regexp" "strconv" - copyobj "github.com/mc2soft/mpd/utils" + copyobj "github.com/RamanPndy/go-dash-mpd/utils" ) // http://mpeg.chiariglione.org/standards/mpeg-dash From f8eea5683806370544b07007c498d9bd6c5a9d8a Mon Sep 17 00:00:00 2001 From: RamanPndy Date: Wed, 27 Jul 2022 15:01:00 +0530 Subject: [PATCH 6/6] added SupplementalProperty in manifest files --- README.md | 2 +- mpd.go | 99 ++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 62 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 3df73ff..265a414 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mpd [![GoDoc](https://godoc.org/github.com/RamanPndy/go-dash-mpd?status.svg)](https://godoc.org/github.com/RamanPndy/go-dash-mpd) [![Build Status](https://travis-ci.org/mc2soft/mpd.svg)](https://travis-ci.org/mc2soft/mpd) +# go-dash-mpd [![GoDoc](https://godoc.org/github.com/RamanPndy/go-dash-mpd?status.svg)](https://godoc.org/github.com/RamanPndy/go-dash-mpd) Go library for parsing and generating MPEG-DASH Media Presentation Description (MPD) files. diff --git a/mpd.go b/mpd.go index 7b36dd1..6a6fb34 100644 --- a/mpd.go +++ b/mpd.go @@ -165,47 +165,49 @@ type periodMarshal struct { // AdaptationSet represents XSD's AdaptationSetType. type AdaptationSet struct { - Role *Role `xml:"Role,omitempty"` - MimeType string `xml:"mimeType,attr,omitempty"` - SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` - StartWithSAP *uint64 `xml:"startWithSAP,attr"` - BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` - SubsegmentAlignment ConditionalUint `xml:"subsegmentAlignment,attr"` - SubsegmentStartsWithSAP *uint64 `xml:"subsegmentStartsWithSAP,attr"` - Lang *string `xml:"lang,attr"` - ContentProtections []DRMDescriptor `xml:"ContentProtection,omitempty"` - Representations []Representation `xml:"Representation,omitempty"` - Codecs *string `xml:"codecs,attr"` - ContentType string `xml:"contentType,attr,omitempty"` - ID *string `xml:"id,attr"` - Width *string `xml:"width,attr,omitempty"` - Height *string `xml:"height,attr,omitempty"` - MaxWidth *string `xml:"maxWidth,attr,omitempty"` - MaxHeight *string `xml:"maxHeight,attr,omitempty"` - FrameRate *string `xml:"frameRate,attr,omitempty"` - Par *string `xml:"par,attr,omitempty"` + Role *Role `xml:"Role,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` + SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` + StartWithSAP *uint64 `xml:"startWithSAP,attr"` + BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` + SubsegmentAlignment ConditionalUint `xml:"subsegmentAlignment,attr"` + SubsegmentStartsWithSAP *uint64 `xml:"subsegmentStartsWithSAP,attr"` + Lang *string `xml:"lang,attr"` + ContentProtections []DRMDescriptor `xml:"ContentProtection,omitempty"` + Representations []Representation `xml:"Representation,omitempty"` + Codecs *string `xml:"codecs,attr"` + ContentType string `xml:"contentType,attr,omitempty"` + ID *string `xml:"id,attr"` + Width *string `xml:"width,attr,omitempty"` + Height *string `xml:"height,attr,omitempty"` + MaxWidth *string `xml:"maxWidth,attr,omitempty"` + MaxHeight *string `xml:"maxHeight,attr,omitempty"` + FrameRate *string `xml:"frameRate,attr,omitempty"` + Par *string `xml:"par,attr,omitempty"` + SupplementalProperty *SupplementalProperty `xml:"SupplementalProperty,omitempty"` } type adaptationSetMarshal struct { - Role *roleMarshal `xml:"Role,omitempty"` - MimeType string `xml:"mimeType,attr,omitempty"` - SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` - StartWithSAP *uint64 `xml:"startWithSAP,attr"` - BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` - SubsegmentAlignment ConditionalUint `xml:"subsegmentAlignment,attr"` - SubsegmentStartsWithSAP *uint64 `xml:"subsegmentStartsWithSAP,attr"` - Lang *string `xml:"lang,attr"` - ContentProtections []drmDescriptorMarshal `xml:"ContentProtection,omitempty"` - Representations []representationMarshal `xml:"Representation,omitempty"` - Codecs *string `xml:"codecs,attr"` - ContentType string `xml:"contentType,attr,omitempty"` - ID *string `xml:"id,attr"` - Width *string `xml:"width,attr,omitempty"` - Height *string `xml:"height,attr,omitempty"` - MaxWidth *string `xml:"maxWidth,attr,omitempty"` - MaxHeight *string `xml:"maxHeight,attr,omitempty"` - FrameRate *string `xml:"frameRate,attr,omitempty"` - Par *string `xml:"par,attr,omitempty"` + Role *roleMarshal `xml:"Role,omitempty"` + MimeType string `xml:"mimeType,attr,omitempty"` + SegmentAlignment ConditionalUint `xml:"segmentAlignment,attr"` + StartWithSAP *uint64 `xml:"startWithSAP,attr"` + BitstreamSwitching *bool `xml:"bitstreamSwitching,attr"` + SubsegmentAlignment ConditionalUint `xml:"subsegmentAlignment,attr"` + SubsegmentStartsWithSAP *uint64 `xml:"subsegmentStartsWithSAP,attr"` + Lang *string `xml:"lang,attr"` + ContentProtections []drmDescriptorMarshal `xml:"ContentProtection,omitempty"` + Representations []representationMarshal `xml:"Representation,omitempty"` + Codecs *string `xml:"codecs,attr"` + ContentType string `xml:"contentType,attr,omitempty"` + ID *string `xml:"id,attr"` + Width *string `xml:"width,attr,omitempty"` + Height *string `xml:"height,attr,omitempty"` + MaxWidth *string `xml:"maxWidth,attr,omitempty"` + MaxHeight *string `xml:"maxHeight,attr,omitempty"` + FrameRate *string `xml:"frameRate,attr,omitempty"` + Par *string `xml:"par,attr,omitempty"` + SupplementalProperty *supplementalPropertyMarshal `xml:"SupplementalProperty,omitempty"` } type Role struct { @@ -218,6 +220,16 @@ type roleMarshal struct { Value *string `xml:"value,attr,omitempty"` } +type SupplementalProperty struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` +} + +type supplementalPropertyMarshal struct { + SchemeIdUri *string `xml:"schemeIdUri,attr,omitempty"` + Value *string `xml:"value,attr,omitempty"` +} + // Representation represents XSD's RepresentationType. type Representation struct { ID *string `xml:"id,attr"` @@ -373,6 +385,7 @@ func modifyAdaptationSets(as []*AdaptationSet) []*adaptationSetMarshal { MaxHeight: copyobj.String(a.MaxHeight), Par: copyobj.String(a.Par), FrameRate: copyobj.String(a.FrameRate), + SupplementalProperty: modifySupplementalProperty(a.SupplementalProperty), } asm = append(asm, adaptationSet) } @@ -464,6 +477,16 @@ func modifyRole(r *Role) *roleMarshal { } } +func modifySupplementalProperty(s *SupplementalProperty) *supplementalPropertyMarshal { + if s == nil { + return nil + } + return &supplementalPropertyMarshal{ + SchemeIdUri: copyobj.String(s.SchemeIdUri), + Value: copyobj.String(s.Value), + } +} + func modifyAudioChannelConfiguration(a *AudioChannelConfiguration) *audioChannelConfigurationMarshal { if a == nil { return nil