454 lines
17 KiB
HTML
454 lines
17 KiB
HTML
|
|
<!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 — 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> »</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=<<u>Shaka Packager Architecture</u>>
|
|
labelloc=t
|
|
|
|
subgraph cluster_media {
|
|
label=<<u>Media Processing Pipeline</u>>
|
|
|
|
Demuxer, ChunkingHandler, EncryptionHandler, Replicator,
|
|
TrickplayHandler, Muxer [shape=rectangle]
|
|
|
|
Demuxer -> ChunkingHandler [style=bold headlabel="many" taillabel="1"]
|
|
ChunkingHandler -> EncryptionHandler -> Replicator -> TrickplayHandler
|
|
-> Muxer [style=bold]
|
|
ChunkingHandler -> Replicator -> Muxer [style=bold]
|
|
|
|
subgraph cluster_demuxer {
|
|
style=rounded
|
|
label=<<u> </u>>
|
|
|
|
Demuxer2 [label="Demuxer" shape=rectangle]
|
|
Demuxer2 -> MediaParser
|
|
[dir=back arrowtail=diamond headlabel="1" taillabel="1"]
|
|
MediaParser -> Mp4MediaParser, WebMMediaParser, Mp2tMediaParser,
|
|
WvmMediaParser [dir=back arrowtail=onormal]
|
|
}
|
|
|
|
subgraph cluster_muxer {
|
|
style=rounded
|
|
label=<<u> </u>>
|
|
|
|
Muxer2 [label="Muxer" shape=rectangle]
|
|
Muxer2 -> Mp4Muxer, WebMMuxer, Mp2tMuxer [dir=back arrowtail=onormal]
|
|
}
|
|
|
|
# Hack to place cluster_muxer subgraph below cluster_demuxer subgraph.
|
|
WebMMediaParser, Mp2tMediaParser -> Muxer2
|
|
[style=invisible arrowhead=none]
|
|
}
|
|
|
|
MuxerListener, MpdNotifyMuxerListener, HlsNotifyMuxerListener,
|
|
MpdNotifier, HlsNotifier [shape=rectangle style=rounded]
|
|
|
|
Muxer -> MuxerListener
|
|
MuxerListener -> MpdNotifyMuxerListener, HlsNotifyMuxerListener
|
|
[dir=back arrowtail=onormal]
|
|
|
|
subgraph cluster_manifest {
|
|
label=<<u>Manifest Generation</u>>
|
|
|
|
HlsNotifyMuxerListener -> HlsNotifier [headlabel="1" taillabel="many"]
|
|
MpdNotifyMuxerListener -> MpdNotifier [headlabel="1" taillabel="many"]
|
|
|
|
MasterPlaylist, MediaPlaylist, MpdBuilder, AdaptationSet,
|
|
Representation [shape=trapezium]
|
|
|
|
HlsNotifier -> MasterPlaylist
|
|
MasterPlaylist -> MediaPlaylist
|
|
[dir=back arrowtail=diamond headlabel="many" taillabel="1"]
|
|
MpdNotifier -> MpdBuilder
|
|
MpdBuilder -> AdaptationSet -> Representation
|
|
[dir=back arrowtail=diamond headlabel="many" taillabel="1"]
|
|
|
|
{rank=same; MasterPlaylist, MpdBuilder}
|
|
{rank=same; MediaPlaylist, Representation}
|
|
}
|
|
|
|
subgraph cluster_legend {
|
|
style=rounded
|
|
label=<<u>Legend</u>>
|
|
|
|
node [shape=plaintext]
|
|
|
|
blank1 [label="" height=0]
|
|
blank2 [label="" height=0]
|
|
blank3 [label="" height=0]
|
|
|
|
"Composition" -> blank1 [dir=back arrowtail=diamond]
|
|
"Inheritance" -> blank2 [dir=back arrowtail=onormal]
|
|
"MediaHandler data flow" -> blank3 [style=bold]
|
|
|
|
"Bridge Class" [shape=rectangle style=rounded]
|
|
"Manifest Class" [shape=trapezium]
|
|
MediaHandler [shape=rectangle]
|
|
}
|
|
|
|
# Hack to place legend subgraph in the bottom.
|
|
MediaPlaylist -> 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="{... | SegmentInfo | MediaSample ... | SegmentInfo | MediaSample ... | StreamInfo}"
|
|
shape=record
|
|
style=rounded
|
|
];
|
|
|
|
MediaHandler [shape=rectangle]
|
|
MediaHandler2 [shape=rectangle, label=MediaHandler]
|
|
MediaHandler -> StreamData -> MediaHandler2
|
|
}" />
|
|
<p class="plantuml">
|
|
<img src="_images/plantuml-d388f7ab1eb3f4d70c57feb299c189351a097db9.png" alt="MediaHandler -> MediaHandler2 : StreamInfo
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : ...
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : SegmentInfo
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : ...
|
|
MediaHandler -> MediaHandler2 : MediaSample
|
|
MediaHandler -> MediaHandler2 : SegmentInfo
|
|
MediaHandler -> 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="{MediaSample ... | StreamInfo}", shape=record, style=rounded
|
|
]
|
|
StreamData2 [
|
|
label="{MediaSample ... | StreamInfo}", shape=record, style=rounded
|
|
]
|
|
|
|
Demuxer [shape=rectangle]
|
|
Demuxer -> StreamData
|
|
Demuxer -> StreamData2
|
|
}" />
|
|
<p class="plantuml">
|
|
<img src="_images/plantuml-cc4af54b1729e5f327a3d00f038006dfe901ee55.png" alt="Demuxer -> : StreamInfo
|
|
Demuxer -> : MediaSample
|
|
Demuxer -> : MediaSample
|
|
Demuxer -> : ..." />
|
|
</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="{MediaSample ... | StreamInfo}", shape=record, style=rounded
|
|
]
|
|
StreamDataOut [
|
|
label="{SegmentInfo | MediaSample ... | StreamInfo}"
|
|
shape=record
|
|
style=rounded
|
|
]
|
|
|
|
ChunkingHandler [shape=rectangle]
|
|
StreamDataIn -> ChunkingHandler -> StreamDataOut
|
|
}" />
|
|
<p class="plantuml">
|
|
<img src="_images/plantuml-5e2d47ce65c3aa9490c00263dd49c9ce72abe2c8.png" alt="-> ChunkingHandler : StreamInfo
|
|
ChunkingHandler -> : StreamInfo
|
|
-> ChunkingHandler : MediaSample
|
|
ChunkingHandler -> : MediaSample
|
|
-> ChunkingHandler : ...
|
|
ChunkingHandler -> : ...
|
|
-> ChunkingHandler : MediaSample
|
|
ChunkingHandler -> : MediaSample
|
|
ChunkingHandler -> : SegmentInfo
|
|
-> ChunkingHandler : ...
|
|
ChunkingHandler -> : ..." />
|
|
</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 -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MuxerListener : Cache EncryptionInfo
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaStart
|
|
MuxerListener -> MuxerListener : Cache MediaInfo
|
|
|
|
alt segment is not encrypted
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment N-1
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
end
|
|
|
|
alt segment is encrypted
|
|
Muxer -> MuxerListener : OnEncryptionStart
|
|
Muxer -> MuxerListener : OnNewSegment N
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
alt encryption key changes
|
|
Muxer -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MpdNotifier : NotifyEncryptionUpdate
|
|
Muxer -> MuxerListener : OnNewSegment N+k
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
end
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaEnd
|
|
|
|
MuxerListener -> MpdNotifier : NotifyNewContainer
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment ...
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment N
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment N+1
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment ...
|
|
MuxerListener -> 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 -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MuxerListener : Cache EncryptionInfo
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaStart
|
|
MuxerListener -> MpdNotifier : NotifyNewContainer
|
|
|
|
alt segment is not encrypted
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment ...
|
|
Muxer -> MuxerListener : OnNewSegment N-1
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment N-1
|
|
end
|
|
|
|
alt segment is encrypted
|
|
Muxer -> MuxerListener : OnEncryptionStart
|
|
Muxer -> MuxerListener : OnNewSegment N
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment N
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment ...
|
|
alt encryption key changes
|
|
Muxer -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MpdNotifier : NotifyEncryptionUpdate
|
|
Muxer -> MuxerListener : OnNewSegment N+k
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment N+k
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MpdNotifier : NotifyNewSegment ...
|
|
end
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaEnd
|
|
MuxerListener -> 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 -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MuxerListener : Cache EncryptionInfo
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaStart
|
|
MuxerListener -> MuxerListener : Cache MediaInfo
|
|
|
|
alt segment is not encrypted
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment N-1
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
end
|
|
|
|
alt segment is encrypted
|
|
Muxer -> MuxerListener : OnEncryptionStart
|
|
Muxer -> MuxerListener : OnNewSegment N
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
alt encryption key changes
|
|
Muxer -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> HlsNotifier : Cache EncryptionInfo
|
|
Muxer -> MuxerListener : OnNewSegment N+k
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> MuxerListener : Cache SegmentInfo
|
|
end
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaEnd
|
|
|
|
MuxerListener -> HlsNotifier : NotifyNewStream
|
|
alt stream is encrypted
|
|
MuxerListener -> HlsNotifier : NotifyEncryptionUpdate
|
|
end
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment ...
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment N
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment N+1
|
|
MuxerListener -> 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 -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> MuxerListener : Cache EncryptionInfo
|
|
end
|
|
|
|
Muxer -> MuxerListener : OnMediaStart
|
|
MuxerListener -> HlsNotifier : NotifyNewStream
|
|
|
|
alt segment is not encrypted
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment ...
|
|
Muxer -> MuxerListener : OnNewSegment N-1
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment N-1
|
|
end
|
|
|
|
alt segment is encrypted
|
|
Muxer -> MuxerListener : OnEncryptionStart
|
|
MuxerListener -> HlsNotifier : NotifyEncryptionUpdate
|
|
Muxer -> MuxerListener : OnNewSegment N
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment N
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment ...
|
|
alt encryption key changes
|
|
Muxer -> MuxerListener : OnEncryptionInfoReady
|
|
MuxerListener -> HlsNotifier : NotifyEncryptionUpdate
|
|
Muxer -> MuxerListener : OnNewSegment N+k
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment N+k
|
|
Muxer -> MuxerListener : OnNewSegment ...
|
|
MuxerListener -> HlsNotifier : NotifyNewSegment ...
|
|
end
|
|
end
|
|
|
|
Muxer -> 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> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer" role="contentinfo">
|
|
© Copyright 2017, Google.
|
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
|
|
</div>
|
|
</body>
|
|
</html> |