<divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2017 Google Inc. All rights reserved.</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// Use of this source code is governed by a BSD-style</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// license that can be found in the LICENSE file or at</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="comment">// This is only available if key rotation is enabled. Note that we may have</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"> 41</span> <spanclass="comment">// a |key_rotation_encryption_config| even if the segment is not encrypted,</span></div>
<divclass="line"><aname="l00042"></a><spanclass="lineno"> 42</span> <spanclass="comment">// which is the case for clear lead.</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a0fac1fe2d593e78d47244acdfa21759d">SetHandler</a>(<spanclass="keywordtype">size_t</span> output_stream_index,</div>
<divclass="line"><aname="l00090"></a><spanclass="lineno"> 90</span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#aed0da512bbd998ec9d0a5c019ad17acb">Initialize</a>();</div>
<divclass="line"><aname="l00107"></a><spanclass="lineno"> 107</span> <spanclass="keyword">virtual</span> Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a69a31b8ec1b85fd4790c7c2013c69a73">OnFlushRequest</a>(<spanclass="keywordtype">size_t</span> input_stream_index);</div>
<divclass="line"><aname="l00114"></a><spanclass="lineno"> 114</span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#accd62dd4def920571f95f4e1a98ab7ca">Dispatch</a>(std::unique_ptr<StreamData> stream_data);</div>
<divclass="line"><aname="l00117"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ac5c28b9b8e5aa8471186b35f005986a1"> 117</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ac5c28b9b8e5aa8471186b35f005986a1">DispatchPeriodInfo</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00127"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a855263bdfc4c0e24d94277dc4a1b415f"> 127</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a855263bdfc4c0e24d94277dc4a1b415f">DispatchStreamInfo</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00137"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a73dfbc5de4901830cfd25775e2e4fcff"> 137</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a73dfbc5de4901830cfd25775e2e4fcff">DispatchMediaSample</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00147"></a><spanclass="lineno"> 147</span> <spanclass="comment">// DispatchTextSample should only be override for testing.</span></div>
<divclass="line"><aname="l00148"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#aa32bfd69f26d5f81a874d6442584691b"> 148</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#aa32bfd69f26d5f81a874d6442584691b">DispatchTextSample</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00158"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a860716d6beae66729df7bb86b19aa81d"> 158</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a860716d6beae66729df7bb86b19aa81d">DispatchMediaEvent</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00168"></a><spanclass="lineno"><aclass="line"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a505c70d5e911e45ebcabcce09e2658f9"> 168</a></span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a505c70d5e911e45ebcabcce09e2658f9">DispatchSegmentInfo</a>(<spanclass="keywordtype">size_t</span> stream_index,</div>
<divclass="line"><aname="l00178"></a><spanclass="lineno"> 178</span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ad5001bf12073101a949b062943769f5b">FlushDownstream</a>(<spanclass="keywordtype">size_t</span> output_stream_index);</div>
<divclass="line"><aname="l00181"></a><spanclass="lineno"> 181</span>  Status <aclass="code"href="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ab644ca7b0a0dbcbc42936f2dfb979ca5">FlushAllDownstreams</a>();</div>
<divclass="line"><aname="l00198"></a><spanclass="lineno"> 198</span> <spanclass="comment">// The next available output stream index, used by AddHandler.</span></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a71df357be46c02dc0e71b2eabb034c10"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a71df357be46c02dc0e71b2eabb034c10">shaka::media::MediaHandler::ValidateOutputStreamIndex</a></div><divclass="ttdeci">virtual bool ValidateOutputStreamIndex(size_t stream_index) const </div><divclass="ttdoc">Validate if the stream at the specified index actually exists. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d2/de9/media__handler_8cc_source.html#l00048">media_handler.cc:48</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a73dfbc5de4901830cfd25775e2e4fcff"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a73dfbc5de4901830cfd25775e2e4fcff">shaka::media::MediaHandler::DispatchMediaSample</a></div><divclass="ttdeci">Status DispatchMediaSample(size_t stream_index, std::shared_ptr< MediaSample > media_sample)</div><divclass="ttdoc">Dispatch the media sample to downstream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00137">media_handler.h:137</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a0e05325d62bfb66318301c1ed790a46e"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a0e05325d62bfb66318301c1ed790a46e">shaka::media::MediaHandler::InitializeInternal</a></div><divclass="ttdeci">virtual Status InitializeInternal()=0</div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a69a31b8ec1b85fd4790c7c2013c69a73"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a69a31b8ec1b85fd4790c7c2013c69a73">shaka::media::MediaHandler::OnFlushRequest</a></div><divclass="ttdeci">virtual Status OnFlushRequest(size_t input_stream_index)</div><divclass="ttdoc">Event handler for flush request at the specific input stream index. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d2/de9/media__handler_8cc_source.html#l00041">media_handler.cc:41</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a0e169e81344ce4ccfed3194ec5f4a3a1"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a0e169e81344ce4ccfed3194ec5f4a3a1">shaka::media::MediaHandler::IsConnected</a></div><divclass="ttdeci">bool IsConnected()</div><divclass="ttdoc">Validate if the handler is connected to its upstream handler. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00093">media_handler.h:93</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a860716d6beae66729df7bb86b19aa81d"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a860716d6beae66729df7bb86b19aa81d">shaka::media::MediaHandler::DispatchMediaEvent</a></div><divclass="ttdeci">Status DispatchMediaEvent(size_t stream_index, std::shared_ptr< MediaEvent > media_event)</div><divclass="ttdoc">Dispatch the media event to downstream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00158">media_handler.h:158</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a855263bdfc4c0e24d94277dc4a1b415f"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a855263bdfc4c0e24d94277dc4a1b415f">shaka::media::MediaHandler::DispatchStreamInfo</a></div><divclass="ttdeci">Status DispatchStreamInfo(size_t stream_index, std::shared_ptr< StreamInfo > stream_info)</div><divclass="ttdoc">Dispatch the stream info to downstream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00127">media_handler.h:127</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_ac5c28b9b8e5aa8471186b35f005986a1"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ac5c28b9b8e5aa8471186b35f005986a1">shaka::media::MediaHandler::DispatchPeriodInfo</a></div><divclass="ttdeci">Status DispatchPeriodInfo(size_t stream_index, std::shared_ptr< PeriodInfo > period_info)</div><divclass="ttdoc">Dispatch the period info to downstream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00117">media_handler.h:117</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_aa32bfd69f26d5f81a874d6442584691b"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#aa32bfd69f26d5f81a874d6442584691b">shaka::media::MediaHandler::DispatchTextSample</a></div><divclass="ttdeci">Status DispatchTextSample(size_t stream_index, std::shared_ptr< TextSample > text_sample)</div><divclass="ttdoc">Dispatch the text sample to downsream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00148">media_handler.h:148</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_afc48a2450ce50162de18071aef516b6c"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#afc48a2450ce50162de18071aef516b6c">shaka::media::MediaHandler::AddHandler</a></div><divclass="ttdeci">Status AddHandler(std::shared_ptr< MediaHandler > handler)</div><divclass="ttdoc">Connect downstream handler to the next availble output stream index. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00084">media_handler.h:84</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_ad5001bf12073101a949b062943769f5b"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#ad5001bf12073101a949b062943769f5b">shaka::media::MediaHandler::FlushDownstream</a></div><divclass="ttdeci">Status FlushDownstream(size_t output_stream_index)</div><divclass="ttdoc">Flush the downstream connected at the specified output stream index. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d2/de9/media__handler_8cc_source.html#l00063">media_handler.cc:63</a></div></div>
<divclass="ttc"id="classshaka_1_1media_1_1MediaHandler_html_a505c70d5e911e45ebcabcce09e2658f9"><divclass="ttname"><ahref="../../da/dfd/classshaka_1_1media_1_1MediaHandler.html#a505c70d5e911e45ebcabcce09e2658f9">shaka::media::MediaHandler::DispatchSegmentInfo</a></div><divclass="ttdeci">Status DispatchSegmentInfo(size_t stream_index, std::shared_ptr< SegmentInfo > segment_info)</div><divclass="ttdoc">Dispatch the segment info to downstream handlers. </div><divclass="ttdef"><b>Definition:</b><ahref="../../d3/d93/media__handler_8h_source.html#l00168">media_handler.h:168</a></div></div>