[vls-devel] Re: CVS Commit: vls (tooney)
Jean-Paul Saman
jpsaman at wxs.nl
Mon Jun 9 16:29:03 CEST 2003
Tristan,
> . Yet, there are many compilation pb in raw2tsConverter, since all the
> stop/pause have been moved to the TrickPlay class. Jean-Paul, have you
> had a look ? Maybe you know how to solve that in 5 minutes. Otherwise,
> I need to go deeper in the trickplay code.
>
You'll have to remove the DoWork() function and carve it up into two
other functions called GetNextTsPacket() and GetPrevTsPacket(). All
locking semantics and actions that used to go into DoWork() is moved to
C_TrickPlay::DoWork().
In the case of encoding boards there is no chance of getting a
GetPrevTsPacket(), so the function has to always return MPEG_BEGINOFSTREAM.
PROBLEM
=======
With the raw2ts code there are a lot of problems from a design
standpoint. That is why it is not easy to change this to the TrickPlay
design of the server. It is however not a problem from the TrickPlay
architectural change, it is the problem of the current design of the
raw2ts module. Here comes the explanation:
Well this is its current design;
capture <--| Video Capture thread |-->C_Fifo <-+
card |-| raw2ts converter
(webcam,etc) <--| Audio Capture thread |-->C_Fifo <-+
This looks good in theory, but in practise the audio and video threads
are launched inside the converter. Mixing up the responsibilities of
three kind of modules in one file (input, reader and converter), which
is bad! The C_Fifo buffers are used to decouple the reading and
converter thread, which is good. The result is that the raw2ts module
implementation is differently designed then all other modules of vls and
does not fit the architecture. Therefor it has to change.
SOLUTION
========
The Audio and video thread should be launched by an input instead. The
Audio and Video Capture threads should be a "reader", because that is
what their function is.
The converter is then responsible for creating Ts packets from the audio
and video Fifo's. Just like it is done now. To make this work the
DoWork() function must be renamed to GetNextTsPacket().
The C_Fifo{Video and Audio} contain a dated ES stream. The raw2ts
converter creates PES packets and finally TS packets. The function
EStoTS() should be rewritten to meet the constraints from
GetNextTsPacket() and GetPrevTsPacket() (see ts2ts.cpp or ps2ts.cpp).
Basically that means it needs to keep state of the ES it is converting
into PES and TS.
To make the design a bit clearer another figure comes here:
capture <-| raw "video" reader |->C_Fifo<-+
card |-|raw2ts|<-|Normal
(webcam,etc) <-| raw "audio" reader |->C_Fifo<-+ Trickplay
s
^ ^ (launch threads)
| |
| rawinput |
The changes that are outlined above makes the current raw2ts module fit
in the design of vls. Ones that is done the normal trickplay module can
be just by default.
Grtz,
Jean-Paul Saman.
--
This is the vls-devel mailing-list, see http://www.videolan.org/streaming/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the vls-devel
mailing list