Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add optional attributes? #7

Open
TobbeEdgeware opened this issue Oct 27, 2020 · 0 comments
Open

How to add optional attributes? #7

TobbeEdgeware opened this issue Oct 27, 2020 · 0 comments

Comments

@TobbeEdgeware
Copy link

TobbeEdgeware commented Oct 27, 2020

This looks like a nice library for manipulating DASH MPDs.

I'm considering using this library for a project similar to https://github.com/dash-Industry-Forum/dash-live-source-simulator in Go, but there are very many MPD nodes and attributes missing before I can use it.

I can make some PRs for the elements I'm missing, but would like to know to understand if you have a strong opinion on how to add optional attributes.

For example, I would like to add contentType to AdaptationSet, and I could either do it as

	ContentType             string           `xml:"contentType,attr,omitempty"`

or

ContentType             *string           `xml:"contentType,attr"`

In my view, the first approach should be more efficient since it avoids one level of pointers, and it is also more clear
(at least to me) that this is an optional attribute. However, I get the impression that you use the pointers like *string to signal that something is optional.

What is your recommendation?

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

No branches or pull requests

1 participant