Skip to content

Instantly share code, notes, and snippets.

@svagionitis
Last active December 16, 2015 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svagionitis/5419247 to your computer and use it in GitHub Desktop.
Save svagionitis/5419247 to your computer and use it in GitHub Desktop.
Sequence Diagram For Loading a DVB stream using the http://www.websequencediagrams.com/.
<div class="wsd" wsd_style="vs2010"><pre>
# No errors on tslock or demux and dcr
title Sequence Diagram For Loading a DVB stream (No errors)
participant "Higher Layer (HTML page, JS)" as HigherLayer
participant "HTMLMediaElement" as MediaPlayer
participant "Video pipeline(Tuner, Demod, Demux, Decoder)" as VideoPipeline
note right of MediaPlayer
networkState: NETWORK_EMPTY
readyState: HAVE_NOTHING
end note
HigherLayer->MediaPlayer: load()
note right of MediaPlayer
networkState: NETWORK_NO_SOURCE
end note
note right of MediaPlayer
networkState: NETWORK_LOADING
end note
MediaPlayer->HigherLayer: loadstart
MediaPlayer->VideoPipeline: Lock to the frequency specified in the DVB url.
MediaPlayer-->HigherLayer: progress
note right of VideoPipeline
Tuner tslock to the given frequency. Everything it's ok with no problem.
end note
VideoPipeline->MediaPlayer: Ok tslocked to the frequency with no problem.
MediaPlayer->VideoPipeline: Can you use the demux and decoder to get the DVB stream?
MediaPlayer-->HigherLayer: progress
note right of VideoPipeline
Media Player uses demux and dcr to create the stream.
*ASSUMPTION*: The size of the video is predefined, so we don't care \nif the decoder will decode the data in order to get the size.
Set the duration to infinite. It might return the first couple of frames. No issues here.
PSI tables were retrieved with no problem.
end note
VideoPipeline->MediaPlayer: The size and the duration are returned.
note right of MediaPlayer
readyState: HAVE_METADATA
end note
MediaPlayer->HigherLayer: loadedmetadata
VideoPipeline->MediaPlayer: A couple of frames are returned.
MediaPlayer->VideoPipeline: Now that the stream is decoded and have the metadata, can you send me emough data for playback?
MediaPlayer-->HigherLayer: progress
note right of VideoPipeline
Media Player uses dcr to create enough data for playback.
end note
VideoPipeline->MediaPlayer: Enough data returned for playback.
note right of MediaPlayer
readyState: HAVE_ENOUGH_DATA
end note
MediaPlayer->HigherLayer: loadeddata
MediaPlayer->HigherLayer: canplay
MediaPlayer->HigherLayer: canplaythrough
HigherLayer->MediaPlayer: play()
</pre></div><script type="text/javascript" src="http://www.websequencediagrams.com/service.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment