(把以前写的文档贴上来一些。要是博客支持直接把word文档上传成为博客岂不是很NB?哈哈...)
Parse the stream
For each stream file, a new form FormFileStreamParserwill be created to parse the stream and show the result. FormFileStreamParserwill have a WorkerFileRoutineParsing to do stream parsing. WorkerFileRoutineParsinghas such name because there may be a new class named WorkerDeviceRoutineParsing to support real time parsing while receiving stream from device.
SequenceDiagram-Parse Stream
FormFileStreamParser:
1. The form will have a tree viewcontrol to show the SI/PSI sections, PID list and also the search result.
2. The form will have a text editto show the hex string of the selected TS packet, section or PES packet.
3. The form will have a text editto show the detail of selected item in the tree view control.
4. The form will have a text editto show the some log info and warning messages.
5. The form will start a thread toparse the stream by creating a WorkerFileRoutineParsing instance.
6. The form will have a messagequeue so that WorkerFileRoutineParsing can push the message into the queue.
7. The form will pick up themessage from the queue and process the message. The message will be picked upand processed in a timer event in order to improve the GUI performance.
8. The form will own a DataParserinstance. The filtered data will be forwarded to DataParser to parse.
9. The form will keep track ofuseful info like stream bitrate, TS packet size and PID list.
Parsing Result
Worker class to parse transport stream
WorkerFile is the worker class to parse alocal transport stream.
1. The class will have a thread toread in the bitstream.
2. The class is a base class.Several other classes will inherit from it to finish specific task.
The class will have several virtual methods, so that the inherited class canoverride them to finish the specific task.Child Class of WorkerFile
StreamParserCore
StreamParserCore is the key class to handlestream parsing.
1. It owns a ManagerSection tomanage all the filtered sections.
2. It owns a ManagerService tomanage the service list.
3. It owns a ManagerPid to manageall PID related info.
4. It owns a ManagerMuxBitrate tomanage all detected mux bitrate.
5. Itowns a StreamDemux to act as a demux channel.
Inside StreamParserCore