<divclass="textblock"><p><aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> class provides methods to add Representations and <ContentProtection> elements to the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> element. </p>
<p>Definition at line <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html#l00154">154</a> of file <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html">mpd_builder.h</a>.</p>
<tr><tdclass="paramname">adaptation_set_id</td><td>is an ID number for this <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. </td></tr>
<tr><tdclass="paramname">lang</td><td>is the language of this <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. Mainly relevant for audio. </td></tr>
<tr><tdclass="paramname">mpd_options</td><td>is the options for this MPD. </td></tr>
<tr><tdclass="paramname">mpd_type</td><td>is the type of this MPD. </td></tr>
<tr><tdclass="paramname">representation_counter</td><td>is a Counter for assigning ID numbers to <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. It can not be NULL. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00654">654</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Add a ContenProtection element to the adaptation set. <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> does not add <ContentProtection> elements automatically to itself even if <em>media_info.protected_content</em> is populated. This is because some MPDs should have the elements at <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> level and some at <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> level. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">element</td><td>contains the ContentProtection element contents. If <em>element</em> has {value, schemeIdUri} set and has {“value”, “schemeIdUri”} as key for <em>additional_attributes</em>, then the former is used. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00717">717</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<tr><tdclass="paramname">media_info</td><td>is a MediaInfo object used to initialize the returned <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> instance. It may contain only one of VideoInfo, AudioInfo, or TextInfo, i.e. VideoInfo XOR AudioInfo XOR TextInfo. </td></tr>
<dlclass="section return"><dt>Returns</dt><dd>On success, returns a pointer to <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. Otherwise returns NULL. The returned pointer is owned by the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> instance. </dd></dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00673">673</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Set the Role element for this <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. The Role element's is schemeIdUri='urn:mpeg:dash:role:2011'. See ISO/IEC 23009-1:2012 section 5.8.5.5. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">role</td><td>of this <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00729">729</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Forces the (sub)segmentAlignment field to be set to <em>segment_alignment</em>. Use this if you are certain that the (sub)segments are alinged/unaligned for the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">segment_alignment</td><td>is the value used for (sub)segmentAlignment attribute. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00816">816</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Makes a copy of <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> xml element with its child <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> and ContentProtection elements. </p>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00739">739</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00826">826</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Notifies the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> instance that a new (sub)segment was added to the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> with <em>representation_id</em>. This must be called every time a (sub)segment is added to a <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> in this <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a>. If a <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> is constructed using <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html#a9a15647b565f9898a5a0e1d3176ff935">AddRepresentation()</a> this is called automatically whenever <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html#ad40b7da1667aeb77c84958ec4ec0d9eb">Representation::AddNewSegment()</a> is is called. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">representation_id</td><td>is the id of the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> with a new segment. </td></tr>
<tr><tdclass="paramname">start_time</td><td>is the start time of the new segment. </td></tr>
<tr><tdclass="paramname">duration</td><td>is the duration of the new segment. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00837">837</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Notifies the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> instance that the sample duration for the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> was set. The frame duration for a video <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> might not be specified when a <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> is created (by calling <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html#a9a15647b565f9898a5a0e1d3176ff935">AddRepresentation()</a>). This should be used to notify this instance that the frame rate for a Represenatation has been set. This method is called automatically when Represenatation::SetSampleDuration() is called if the Represenatation instance was created using <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html#a9a15647b565f9898a5a0e1d3176ff935">AddRepresentation()</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">representation_id</td><td>is the id of the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. is the duration of a frame in the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. </td></tr>
<tr><tdclass="paramname">timescale</td><td>is the timescale of the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00848">848</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Sets the <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html">AdaptationSet</a> attribute. Passing a negative value to this method will unset the attribute. Note that group=0 is a special group, as mentioned in the DASH MPD specification. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">group_number</td><td>is the value of AdaptatoinSet. </td></tr>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00822">822</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Update the 'cenc:pssh' element for <em>drm_uuid</em> ContentProtection element. If the element does not exist, this will add one. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">drm_uuid</td><td>is the UUID of the DRM for encryption. </td></tr>
<tr><tdclass="paramname">pssh</td><td>is the content of <cenc:pssh> element. Note that DASH IF IOP mentions that this should be base64 encoded string of the whole pssh box. </td></tr>
</table>
</dd>
</dl>
<dlclass="section attention"><dt>Attention</dt><dd>This might get removed once DASH IF IOP specification makes a a clear guideline on how to handle key rotation. Also to get this working with shaka-player, this method <em>DOES NOT</em> update the PSSH element. Instead, it removes the element regardless of the content of <em>pssh</em>. </dd></dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00723">723</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>