go-dash icon indicating copy to clipboard operation
go-dash copied to clipboard

AddContentProtection functions don't set AdaptationSet field in created object

Open juliancooper opened this issue 9 years ago • 7 comments

juliancooper avatar Apr 07 '16 22:04 juliancooper

I think I've hit this issue whereby ContentProtection tags get stripped.

https://static.spuul.com/devops/2017-11-08/content-protection-stripped.txt

We are Brightcove customers, so we would appreciate some prioritisation here to get this addressed.

kaihendry avatar Nov 08 '17 06:11 kaihendry

Thanks for the example @kaihendry, I'll take a look today

thomshutt avatar Nov 08 '17 09:11 thomshutt

In retrospect, I noticed https://github.com/zencoder/go-dash/blob/master/mpd/mpd.go#L90 where you omit empty ContentProtection lines. Tbh perhaps these lines have no value, though I don't understand the mpd/dash very well. Esp when it comes to DRM.

kaihendry avatar Nov 08 '17 09:11 kaihendry

Nope, this is definitely a bug - it seems that we always lose the ContentProtection block on read.

I'll try to get a PR in with a fix by the end of the day.

thomshutt avatar Nov 08 '17 12:11 thomshutt

@kaihendry I've got a fix lined up, but there's an underlying Go bug https://github.com/golang/go/issues/9519 with Unmarshalling namespaced XML attributes that's stopping it from working correctly. It's allegedly going to be fixed in the next version of Go, which should be released towards the end of 2017.

thomshutt avatar Nov 09 '17 16:11 thomshutt

There is no workaround? Thought you get quite firm control if you override the unmarshalling functions. :sweat_smile:

kaihendry avatar Nov 10 '17 01:11 kaihendry

Hey folks, have you considered stephen-fox's approach? I found it referencing that same golang/go issue. I'm gonna fork go-dash and give it a shot.

Watered down it pretty much consists of having separate structs for marshal & unmarshal:

type StructForUnmarshal struct {
    XMLName  xml.Name `xml:"Inform"`
    DeviceId DeviceId
}

type StructForMarshall struct {
    XMLName  xml.Name `xml:"cwmp:Inform"`
    DeviceId DeviceId
}```

Cawb07 avatar Nov 14 '18 19:11 Cawb07