shaka-packager/html/design_back.html

454 lines
17 KiB
HTML
Raw Normal View History

2018-05-23 23:12:00 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Design &#8212; Shaka Packager documentation</title>
<link rel="stylesheet" href="_static/sphinxdoc_new.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/table_styling.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="nav-item nav-item-0"><a href="index.html">Shaka Packager documentation</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Design</a><ul>
<li><a class="reference internal" href="#architecture-diagram">Architecture diagram</a></li>
<li><a class="reference internal" href="#media-handler-data-flow">Media handler data flow</a><ul>
<li><a class="reference internal" href="#demuxer">Demuxer</a></li>
<li><a class="reference internal" href="#chunkinghandler">ChunkingHandler</a></li>
</ul>
</li>
<li><a class="reference internal" href="#manifest-generation-event-flow">Manifest generation event flow</a><ul>
<li><a class="reference internal" href="#dash-on-demand">DASH On Demand</a></li>
<li><a class="reference internal" href="#dash-live">DASH Live</a></li>
<li><a class="reference internal" href="#hls-single-segment">HLS Single-segment</a></li>
<li><a class="reference internal" href="#hls-multi-segment">HLS Multi-segment</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/design_back.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="design">
<h1>Design<a class="headerlink" href="#design" title="Permalink to this headline"></a></h1>
<div class="section" id="architecture-diagram">
<h2>Architecture diagram<a class="headerlink" href="#architecture-diagram" title="Permalink to this headline"></a></h2>
<img src="_images/graphviz-2be9217e6549f69b5c8785fd58c2d89e684a3884.png" alt="digraph shaka_packager {
label=&lt;&lt;u&gt;Shaka Packager Architecture&lt;/u&gt;&gt;
labelloc=t
subgraph cluster_media {
label=&lt;&lt;u&gt;Media Processing Pipeline&lt;/u&gt;&gt;
Demuxer, ChunkingHandler, EncryptionHandler, Replicator,
TrickplayHandler, Muxer [shape=rectangle]
Demuxer -&gt; ChunkingHandler [style=bold headlabel=&quot;many&quot; taillabel=&quot;1&quot;]
ChunkingHandler -&gt; EncryptionHandler -&gt; Replicator -&gt; TrickplayHandler
-&gt; Muxer [style=bold]
ChunkingHandler -&gt; Replicator -&gt; Muxer [style=bold]
subgraph cluster_demuxer {
style=rounded
label=&lt;&lt;u&gt; &lt;/u&gt;&gt;
Demuxer2 [label=&quot;Demuxer&quot; shape=rectangle]
Demuxer2 -&gt; MediaParser
[dir=back arrowtail=diamond headlabel=&quot;1&quot; taillabel=&quot;1&quot;]
MediaParser -&gt; Mp4MediaParser, WebMMediaParser, Mp2tMediaParser,
WvmMediaParser [dir=back arrowtail=onormal]
}
subgraph cluster_muxer {
style=rounded
label=&lt;&lt;u&gt; &lt;/u&gt;&gt;
Muxer2 [label=&quot;Muxer&quot; shape=rectangle]
Muxer2 -&gt; Mp4Muxer, WebMMuxer, Mp2tMuxer [dir=back arrowtail=onormal]
}
# Hack to place cluster_muxer subgraph below cluster_demuxer subgraph.
WebMMediaParser, Mp2tMediaParser -&gt; Muxer2
[style=invisible arrowhead=none]
}
MuxerListener, MpdNotifyMuxerListener, HlsNotifyMuxerListener,
MpdNotifier, HlsNotifier [shape=rectangle style=rounded]
Muxer -&gt; MuxerListener
MuxerListener -&gt; MpdNotifyMuxerListener, HlsNotifyMuxerListener
[dir=back arrowtail=onormal]
subgraph cluster_manifest {
label=&lt;&lt;u&gt;Manifest Generation&lt;/u&gt;&gt;
HlsNotifyMuxerListener -&gt; HlsNotifier [headlabel=&quot;1&quot; taillabel=&quot;many&quot;]
MpdNotifyMuxerListener -&gt; MpdNotifier [headlabel=&quot;1&quot; taillabel=&quot;many&quot;]
MasterPlaylist, MediaPlaylist, MpdBuilder, AdaptationSet,
Representation [shape=trapezium]
HlsNotifier -&gt; MasterPlaylist
MasterPlaylist -&gt; MediaPlaylist
[dir=back arrowtail=diamond headlabel=&quot;many&quot; taillabel=&quot;1&quot;]
MpdNotifier -&gt; MpdBuilder
MpdBuilder -&gt; AdaptationSet -&gt; Representation
[dir=back arrowtail=diamond headlabel=&quot;many&quot; taillabel=&quot;1&quot;]
{rank=same; MasterPlaylist, MpdBuilder}
{rank=same; MediaPlaylist, Representation}
}
subgraph cluster_legend {
style=rounded
label=&lt;&lt;u&gt;Legend&lt;/u&gt;&gt;
node [shape=plaintext]
blank1 [label=&quot;&quot; height=0]
blank2 [label=&quot;&quot; height=0]
blank3 [label=&quot;&quot; height=0]
&quot;Composition&quot; -&gt; blank1 [dir=back arrowtail=diamond]
&quot;Inheritance&quot; -&gt; blank2 [dir=back arrowtail=onormal]
&quot;MediaHandler data flow&quot; -&gt; blank3 [style=bold]
&quot;Bridge Class&quot; [shape=rectangle style=rounded]
&quot;Manifest Class&quot; [shape=trapezium]
MediaHandler [shape=rectangle]
}
# Hack to place legend subgraph in the bottom.
MediaPlaylist -&gt; MediaHandler [style=invisible arrowhead=none]
}" />
</div>
<div class="section" id="media-handler-data-flow">
<h2>Media handler data flow<a class="headerlink" href="#media-handler-data-flow" title="Permalink to this headline"></a></h2>
<img src="_images/graphviz-787838559a989a01982bde69df7d1ba50dba3dae.png" alt="digraph g {
rankdir=LR
StreamData [
label=&quot;{... | SegmentInfo | MediaSample ... | SegmentInfo | MediaSample ... | StreamInfo}&quot;
shape=record
style=rounded
];
MediaHandler [shape=rectangle]
MediaHandler2 [shape=rectangle, label=MediaHandler]
MediaHandler -&gt; StreamData -&gt; MediaHandler2
}" />
<p class="plantuml">
<img src="_images/plantuml-d388f7ab1eb3f4d70c57feb299c189351a097db9.png" alt="MediaHandler -&gt; MediaHandler2 : StreamInfo
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : ...
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : SegmentInfo
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : ...
MediaHandler -&gt; MediaHandler2 : MediaSample
MediaHandler -&gt; MediaHandler2 : SegmentInfo
MediaHandler -&gt; MediaHandler2 : ..." />
</p>
<div class="section" id="demuxer">
<h3>Demuxer<a class="headerlink" href="#demuxer" title="Permalink to this headline"></a></h3>
<img src="_images/graphviz-4dc6b84ec2715ae381a5f9dba28a4a895975205b.png" alt="digraph g {
rankdir=LR
StreamData [
label=&quot;{MediaSample ... | StreamInfo}&quot;, shape=record, style=rounded
]
StreamData2 [
label=&quot;{MediaSample ... | StreamInfo}&quot;, shape=record, style=rounded
]
Demuxer [shape=rectangle]
Demuxer -&gt; StreamData
Demuxer -&gt; StreamData2
}" />
<p class="plantuml">
<img src="_images/plantuml-cc4af54b1729e5f327a3d00f038006dfe901ee55.png" alt="Demuxer -&gt; : StreamInfo
Demuxer -&gt; : MediaSample
Demuxer -&gt; : MediaSample
Demuxer -&gt; : ..." />
</p>
</div>
<div class="section" id="chunkinghandler">
<h3>ChunkingHandler<a class="headerlink" href="#chunkinghandler" title="Permalink to this headline"></a></h3>
<img src="_images/graphviz-d23de706ddfd3a4d8af17ad11f666c345b90f126.png" alt="digraph g {
rankdir=LR
StreamDataIn [
label=&quot;{MediaSample ... | StreamInfo}&quot;, shape=record, style=rounded
]
StreamDataOut [
label=&quot;{SegmentInfo | MediaSample ... | StreamInfo}&quot;
shape=record
style=rounded
]
ChunkingHandler [shape=rectangle]
StreamDataIn -&gt; ChunkingHandler -&gt; StreamDataOut
}" />
<p class="plantuml">
<img src="_images/plantuml-5e2d47ce65c3aa9490c00263dd49c9ce72abe2c8.png" alt="-&gt; ChunkingHandler : StreamInfo
ChunkingHandler -&gt; : StreamInfo
-&gt; ChunkingHandler : MediaSample
ChunkingHandler -&gt; : MediaSample
-&gt; ChunkingHandler : ...
ChunkingHandler -&gt; : ...
-&gt; ChunkingHandler : MediaSample
ChunkingHandler -&gt; : MediaSample
ChunkingHandler -&gt; : SegmentInfo
-&gt; ChunkingHandler : ...
ChunkingHandler -&gt; : ..." />
</p>
</div>
</div>
<div class="section" id="manifest-generation-event-flow">
<h2>Manifest generation event flow<a class="headerlink" href="#manifest-generation-event-flow" title="Permalink to this headline"></a></h2>
<div class="section" id="dash-on-demand">
<h3>DASH On Demand<a class="headerlink" href="#dash-on-demand" title="Permalink to this headline"></a></h3>
<p class="plantuml">
<img src="_images/plantuml-71609151dc28fa4de722df6081e727525bbd8c2a.png" alt="alt stream is encrypted
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MuxerListener : Cache EncryptionInfo
end
Muxer -&gt; MuxerListener : OnMediaStart
MuxerListener -&gt; MuxerListener : Cache MediaInfo
alt segment is not encrypted
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment N-1
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
end
alt segment is encrypted
Muxer -&gt; MuxerListener : OnEncryptionStart
Muxer -&gt; MuxerListener : OnNewSegment N
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
alt encryption key changes
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MpdNotifier : NotifyEncryptionUpdate
Muxer -&gt; MuxerListener : OnNewSegment N+k
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
end
end
Muxer -&gt; MuxerListener : OnMediaEnd
MuxerListener -&gt; MpdNotifier : NotifyNewContainer
MuxerListener -&gt; MpdNotifier : NotifyNewSegment ...
MuxerListener -&gt; MpdNotifier : NotifyNewSegment N
MuxerListener -&gt; MpdNotifier : NotifyNewSegment N+1
MuxerListener -&gt; MpdNotifier : NotifyNewSegment ...
MuxerListener -&gt; MpdNotifier : Flush" />
</p>
</div>
<div class="section" id="dash-live">
<h3>DASH Live<a class="headerlink" href="#dash-live" title="Permalink to this headline"></a></h3>
<p class="plantuml">
<img src="_images/plantuml-edc9d35f3b0f3e20a550695f8a0bdb29a752d238.png" alt="alt stream is encrypted
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MuxerListener : Cache EncryptionInfo
end
Muxer -&gt; MuxerListener : OnMediaStart
MuxerListener -&gt; MpdNotifier : NotifyNewContainer
alt segment is not encrypted
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MpdNotifier : NotifyNewSegment ...
Muxer -&gt; MuxerListener : OnNewSegment N-1
MuxerListener -&gt; MpdNotifier : NotifyNewSegment N-1
end
alt segment is encrypted
Muxer -&gt; MuxerListener : OnEncryptionStart
Muxer -&gt; MuxerListener : OnNewSegment N
MuxerListener -&gt; MpdNotifier : NotifyNewSegment N
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MpdNotifier : NotifyNewSegment ...
alt encryption key changes
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MpdNotifier : NotifyEncryptionUpdate
Muxer -&gt; MuxerListener : OnNewSegment N+k
MuxerListener -&gt; MpdNotifier : NotifyNewSegment N+k
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MpdNotifier : NotifyNewSegment ...
end
end
Muxer -&gt; MuxerListener : OnMediaEnd
MuxerListener -&gt; MpdNotifier : Flush" />
</p>
</div>
<div class="section" id="hls-single-segment">
<h3>HLS Single-segment<a class="headerlink" href="#hls-single-segment" title="Permalink to this headline"></a></h3>
<p class="plantuml">
<img src="_images/plantuml-62cab1b32d19a8bba05a432164fc35f0fd34ba1b.png" alt="alt stream is encrypted
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MuxerListener : Cache EncryptionInfo
end
Muxer -&gt; MuxerListener : OnMediaStart
MuxerListener -&gt; MuxerListener : Cache MediaInfo
alt segment is not encrypted
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment N-1
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
end
alt segment is encrypted
Muxer -&gt; MuxerListener : OnEncryptionStart
Muxer -&gt; MuxerListener : OnNewSegment N
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
alt encryption key changes
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; HlsNotifier : Cache EncryptionInfo
Muxer -&gt; MuxerListener : OnNewSegment N+k
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; MuxerListener : Cache SegmentInfo
end
end
Muxer -&gt; MuxerListener : OnMediaEnd
MuxerListener -&gt; HlsNotifier : NotifyNewStream
alt stream is encrypted
MuxerListener -&gt; HlsNotifier : NotifyEncryptionUpdate
end
MuxerListener -&gt; HlsNotifier : NotifyNewSegment ...
MuxerListener -&gt; HlsNotifier : NotifyNewSegment N
MuxerListener -&gt; HlsNotifier : NotifyNewSegment N+1
MuxerListener -&gt; HlsNotifier : NotifyNewSegment ..." />
</p>
</div>
<div class="section" id="hls-multi-segment">
<h3>HLS Multi-segment<a class="headerlink" href="#hls-multi-segment" title="Permalink to this headline"></a></h3>
<p class="plantuml">
<img src="_images/plantuml-2b4e7ead076336273a38a8dd3c2a8047700aa621.png" alt="alt stream is encrypted
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; MuxerListener : Cache EncryptionInfo
end
Muxer -&gt; MuxerListener : OnMediaStart
MuxerListener -&gt; HlsNotifier : NotifyNewStream
alt segment is not encrypted
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; HlsNotifier : NotifyNewSegment ...
Muxer -&gt; MuxerListener : OnNewSegment N-1
MuxerListener -&gt; HlsNotifier : NotifyNewSegment N-1
end
alt segment is encrypted
Muxer -&gt; MuxerListener : OnEncryptionStart
MuxerListener -&gt; HlsNotifier : NotifyEncryptionUpdate
Muxer -&gt; MuxerListener : OnNewSegment N
MuxerListener -&gt; HlsNotifier : NotifyNewSegment N
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; HlsNotifier : NotifyNewSegment ...
alt encryption key changes
Muxer -&gt; MuxerListener : OnEncryptionInfoReady
MuxerListener -&gt; HlsNotifier : NotifyEncryptionUpdate
Muxer -&gt; MuxerListener : OnNewSegment N+k
MuxerListener -&gt; HlsNotifier : NotifyNewSegment N+k
Muxer -&gt; MuxerListener : OnNewSegment ...
MuxerListener -&gt; HlsNotifier : NotifyNewSegment ...
end
end
Muxer -&gt; MuxerListener : OnMediaEnd" />
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="nav-item nav-item-0"><a href="index.html">Shaka Packager documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2017, Google.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
</div>
</body>
</html>