Skip to content

Conversation

@bcasinclair
Copy link
Contributor

This lib needs quite a few more parameters to better model all the features of the ISO 23009-1:2014 spec and also DASH-IF guidelines.

This is a first pass in adding the CommonAttributesAndElements that exist across AdaptationSets and Representations.

Andrew Sinclair and others added 2 commits October 25, 2017 14:45
@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.0% when pulling 990116d on add-attributes into 57e15b1 on master.

mpd/mpd.go Outdated
SegmentProfiles *string `xml:"segmentProfiles,attr"`
Codecs *string `xml:"codecs,attr"`
MaximumSAPPeriod *string `xml:"MaximumSAPPeriod,attr"`
StartWithSAP *string `xml:"startWithSAP,attr"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was an int64 before are we planning to change the type.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 80.325% when pulling 8c94adf on add-attributes into 57e15b1 on master.

@mbowBC
Copy link
Contributor

mbowBC commented Nov 17, 2017

@bcasinclair Hi Andrew I've added the IDs to AdaptationSets and moved in your CommonAttributesAndElements and removed the ones in the AS, this moved the order of XML a bit. I've fixed up the tests also.
Please eye over and let me know if there's more to do and if to meet compliance with DASH-IF guidelines whats next that needs doing. (more tests etc?)

@bcasinclair
Copy link
Contributor Author

bcasinclair commented Nov 21, 2017

@mbowBC makes sense to me. I think what is there is a good start. There is a lot more that could be added

"testing"
"time"

"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import spacing needs fixing

found, err := tc.In.WriteToString()
require.NoError(t, err)
expected := testfixtures.LoadFixture("fixtures/" + tc.Out)
fmt.Println(expected)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can get rid of these now

}

type Representation struct {
ID *string `xml:"id,attr"` // Audio + Video
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more normal to have CommonAttributesAndElements as the first line in the struct - this can go back to where it was

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normal I'd agree but in this case, the inner CommonAttributesAndElements would get picked up first by XMLMarshal and it's ordering by struct order. (no guarantee this will always be the case but..) XML doesn't care about the order of attr , but it's more human readable to have the ID at the front IMO.

mpd/mpd.go Outdated
MimeType *string `xml:"mimeType,attr"`
SegmentProfiles *string `xml:"segmentProfiles,attr"`
Codecs *string `xml:"codecs,attr"`
MaximumSAPPeriod *string `xml:"MaximumSAPPeriod,attr"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the XML attr for this capitalised (but the others aren't)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? can you come point this out I'm being blind.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xml:"MaximumSAPPeriod,attr instead of xml:"maximumSAPPeriod,attr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good spot, I couldn't see that 👓 👍

// startWithSAP - Starts With SAP (i.e. 1).
// lang - Language (i.e. en).
func (period *Period) AddNewAdaptationSetAudio(mimeType string, segmentAlignment bool, startWithSAP int64, lang string) (*AdaptationSet, error) {
func (period *Period) AddNewAdaptationSetAudio(id string, mimeType string, segmentAlignment bool, startWithSAP int64, lang string) (*AdaptationSet, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively making id a required field now, what's the reason for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@id is mandatory on dynamic streams (I think)
AdaptationSet@id is an optional parameter
davemevans/dash.js@7043922
and was found from http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd
search for
<xs:attribute name="id" type="xs:unsignedInt"/>

mbowBC
mbowBC previously requested changes Dec 5, 2017
mpd/mpd.go Outdated
MimeType *string `xml:"mimeType,attr"`
SegmentProfiles *string `xml:"segmentProfiles,attr"`
Codecs *string `xml:"codecs,attr"`
MaximumSAPPeriod *string `xml:"MaximumSAPPeriod,attr"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?? can you come point this out I'm being blind.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 80.325% when pulling 19f608c on add-attributes into 57e15b1 on master.

@mbowBC mbowBC merged commit 90d0544 into master Dec 5, 2017
@stuarthicks stuarthicks deleted the add-attributes branch March 19, 2018 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants