[Live-devel] an architecture question of livemedia server

Jeremy Noring jnoring at logitech.com
Wed Oct 21 17:10:29 PDT 2009


On Wed, Oct 21, 2009 at 10:10 AM, Tao Wu <lanlantao at gmail.com> wrote:

> Hi,
>
> I have an architecture question of livemedia. Livemedia is a single thread
> program, it uses "event" to serve multiple video streams.
> If in one video stream, I called some blocking functions, will it hurt
> other video streams?
> For example, assume the server wants to server two video streams, A and B.
> Both stream A and B's sources are from the hardware encoder, not a file on
> hard drive.
> So if stream A VideoStreamer::ContinueReadProcessing reads data from the
> video sources, it may not get the data immediately when using blocking
> function calls to the hardware encoder. In the worst case, it can stop for
> ever because of hardware failure.
> If that happens, can stream B still function properly when stream A
> blocked?
>

Short answer: no, you cannot block Live555 in any way and expect good
results.

Long answer: instead of blocking, consider having your code simply check and
see if any data is available.  If no data is available, use Live555's event
mechanism to schedule another check for data in however long is
appropriate.  For example, I have a hardware h264 encoder.  On my Live555
thread, I merely check and see if there's any available data.  If there is,
I process it.  If there isn't, I use Live555's scheduling to drop back in
another 20 milliseconds (or whatever is appropriate).

It's polling, yes, but it works just fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20091021/54d7ac77/attachment-0001.html>


More information about the live-devel mailing list