1Design info for NetStream based media playing
2
3===============================================================================
4 Data flow diagram for Gnash implementation of NetStream playback using FFMPEG
5===============================================================================
6
7Notation: process, [dataStore], <externalEvent>
8
9  [input] --> (2) parser --> [parsedBuffer]
10                                   |
11      +----------------------------+
12      |
13      V
14 (2) decoder <-+-> [videoQueue] --> (1) videoFrameUpdater --> [renderableFrame]
15      ^        |                              ^                     |
16      |        |                              |                     |
17      +------- | -----------------------------+                     |
18               |                              |                     V
19               |          (1) <seek>  ---> [PlayHead]       (1) renderer
20               |                              ^                     |
21               |                              |                     V
22               |                              |                 [videoOut]
23               |                              |
24               +-> [audioQueue] ---> (3) soundPlayer -> [audioOut]
25
26 Processes
27===========
28
29
30                parser : FLVParser
31               decoder : av_streamer
32     videoFrameUpdater : refreshVideoFrame
33              renderer : render_handler
34           soundPlayer : sound_streamer
35                  seek : NetStream::seek
36
37
38
39 Datastores and protection
40===========================
41
42           [input] : Accessible through LoadThread, providing thread-safe interfaces
43    [parsedBuffer] : Accessible through FLVParser, providing thread-safe interfaces
44      [videoQueue] : Accessible through multithread_queue, providing thread-safe interfaces
45      [audioQueue] : Accessible through multithread_queue, providing thread-safe interfaces
46 [renderableFrame] : Direct access, disciplined by image_mutex
47        [audioOut] : Audio output channel
48        [videoOut] : Video output channel
49        [PlayHead] : m_current_timestamp, m_go and m_pause. protection UNCLEAR !! refactoring planned
50
51
52 Threads
53=========
54
55  thread1 (main)              : videoFrameUpdater, renderer, seek
56  thread2 (load/parse/decode) : parser, decoder
57  thread3 (playsound)         : soundPlayer
58
59===============================================================================
60 Data flow diagram for Gnash implementation of NetStream playback using GST
61===============================================================================
62
63
64                         +-->  (2) [ParsedVideoBuffer]---+
65                         |                               |
66(2) [input] --> parser --+                               +---> (2) GST pipeline --> [renderableFrame] --> (1) renderer -> [videoOut]
67                         |                               |               |
68                         +-->  (2) [ParsedAudioBuffer]---+               |
69                                                                         +---> (2) soundPlayer --> [audioOut]
70
71
72 Processes
73===========
74
75
76 thread 2 : FLVParser, decoder, audio output
77 thread 1 : fetch videoframe
78
79