<divclass="textblock"><p><aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> class contains references to a single media stream, as well as optional ContentProtection elements for that stream. </p>
<p>Definition at line <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html#l00431">431</a> of file <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html">mpd_builder.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<tr><tdclass="paramname">media_info</td><td>is a MediaInfo containing information on the media. <em>media_info.bandwidth</em> is required for 'static' profile. If <em>media_info.bandwidth</em> is not present in 'dynamic' profile, this tries to estimate it using the info passed to <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html#ad40b7da1667aeb77c84958ec4ec0d9eb">AddNewSegment()</a>. </td></tr>
<tr><tdclass="paramname">mpd_options</td><td>is options for the entire MPD. </td></tr>
<tr><tdclass="paramname">representation_id</td><td>is the numeric ID for the <Representation>. </td></tr>
<tr><tdclass="paramname">state_change_listener</td><td>is an event handler for state changes to the representation. If null, no event handler registered. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l00986">986</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Add a ContenProtection element to the representation. <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> does not add <ContentProtection> elements automatically to itself even if <em>media_info</em> passed to <aclass="el"href="../../db/de4/classedash__packager_1_1AdaptationSet.html#a9a15647b565f9898a5a0e1d3176ff935">AdaptationSet::AddRepresentation()</a> has <em>media_info.protected_content</em> 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>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l01038">1038</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Add a media (sub)segment to the representation. AdaptationSetsubSegmentAlignment,segmentAlignment} cannot be set if this is not called for all Representations. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">start_time</td><td>is the start time for the (sub)segment, in units of the stream's time scale. </td></tr>
<tr><tdclass="paramname">duration</td><td>is the duration of the segment, in units of the stream's time scale. </td></tr>
<tr><tdclass="paramname">size</td><td>of the segment in bytes. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l01052">1052</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>Copy of <Representation>. </dd></dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l01095">1095</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>ID number for <Representation>. </dd></dl>
<p>Definition at line <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html#l00490">490</a> of file <aclass="el"href="../../d6/da3/mpd__builder_8h_source.html">mpd_builder.h</a>.</p>
<p>Tries to initialize the instance. If this does not succeed, the instance should not be used. </p>
<dlclass="section return"><dt>Returns</dt><dd>true on success, false otherwise. </dd></dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l01000">1000</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
<p>Set the sample duration of this <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a>. Sample duration is not available right away especially for live. This allows setting the sample duration after the <aclass="el"href="../../d7/d15/classedash__packager_1_1Representation.html">Representation</a> has been initialized. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">sample_duration</td><td>is the duration of a sample. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html#l01077">1077</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#l01045">1045</a> of file <aclass="el"href="../../dd/d11/mpd__builder_8cc_source.html">mpd_builder.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>