I'm deserizaling the MPEG Dash schema using jaxb2.
The generation of the Java classes works great, however, part of the information in the Dash manifest is lost. Namely, data contained inside the ContentProtection
element. Which looks something like this:
<ContentProtection schemeIdUri="urn:uuid:SomeIdHash" value="PlayReady">
<cenc:pssh>Base64EncodedBlob</cenc:pssh>
<mspr:pro>Base64EncodedBlob</mspr:pro>
</ContentProtection>
The default schema throws the inner fields into a DescriptorType
class with @XmlAnyElement
annotation that results in a List of objects that looks like this:
[[cenc:pssh: null], [mspr:pro: null]]
To attempt to fix the issue, I created my own jxb binding for the ContentProtection
like so:
<jxb:bindings node="//xs:complexType[@name='RepresentationBaseType']/xs:sequence/xs:element[@name='ContentProtection']">
<jxb:class ref="com.jmeter.protocol.dash.sampler.ContentProtection"/>
</jxb:bindings>
However, I'm not closer to getting the Base64EncodedBlob
information contained within. I'm not sure how to setup my annotations in the custom class to construct the list correctly. This is what I've tried.
//@XmlAnyElement(lax = true) //[[cenc:pssh: null], [mspr:pro: null]]
// @XmlJavaTypeAdapter(Pssh.class) //DOESNT WORK
// @XmlValue //Empty List???
// @XmlSchemaType(name = "pssh")
// @XmlElementRef(name = "pssh") //Not matching annotations
// @XmlElement(name = "enc:pssh") //Not matching annotations
protected List<Pssh> pssh;
public List<Pssh> getPssh() {
if (pssh == null) {
pssh = new ArrayList<Pssh>();
}
return this.pssh;
}
My Pssh class looks like:
package com.jmeter.protocol.dash.sampler;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType(name = "enc:pssh")
// @XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "cenc:pssh")
public class Pssh {
// @XmlValue
//@XmlElement
private String psshValue;
public String getPsshValue() {
return psshValue;
}
public void setPsshValue(String psshValue) {
this.psshValue = psshValue;
}
}
What can I do to make the List of Pssh
objects get constructed with the base64 blobs instead of null?