[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: Video streaming
From:       Martin Vogt <mvogt () rhrk ! uni-kl ! de>
Date:       2001-01-11 15:44:52
[Download RAW message or body]


Hello,


how to implement streaming?
---------------------------

If we keep mpeglib as de/encoding library I think we need a change
in arts stream handling.(maybe I'm wrong, I don't know much
about arts)

artsd needs to react on "signals" by a threaded "CodecObject".

A CodecObject is a seperate thread which de/encodes streams.
A CodecObject reads byte streams and writes byte streams.
A CodecObject tells if it needs more input or if it has output.

The artsd thread must react on the state of the CodecObject.
(has data / wants data)

From the examples in the arts documentation (about 
async/sync streams) it seems to me that we cannot implement
this behaviour with the current stream types.(mostly because
we need to keep the two threads (artsd/codecObject) seperate)

Currently artsd executes the calculateBlock method.
It blocks in the method and waits for mpeglib until 
the decoding thread in mpeglib produce PCM data.

If artsd would "react" on a signal "has data" it executes
the calculateBlock method _only_ if there is really any data.

Example 1: Consider this.
=======================

- you use artsd to play a local wav file in realtime to /dev/dsp 
- you create a local file inputSource in artsd, an MP3 Decoder
  and connect it to a FileWriter. We have a very slow cpu 
  which cannot decode mp3 in realtime.

Currently artsd would block on the mp3 decoding process
and you cannot hear the local wav file in realtime.
If artsd would react on a signal it would only 
write the decoded mp3 (PCM data) to the disk, if data is really
available.
If you think: well, nice example but CPUs are today fast enough
              to decode mp3 in realtime, then replace wav with mp3 and
              mp3 with a mpeg2divx encoder and you understand
              what I mean.

==> we have synchron (wav) and asynchron behaviour (mp3).

Example 2:
==========

- Same a example 1 but you want to mix the wav/mp3 file together
  into one file.

We need a filter graph wide synchron behaviour, means: before we proceed
with the next wav sample, we need a mp3 sample.

==> artsd must know how to "react right" on signals.
    (A Petri-Net model comes to mind)


Example 3:
==========
- multiple decoding of mp3 an encoding to ogg/vorbis.

==> multiple async filter graphs.


Martin

_______________________________________________
Kde-multimedia mailing list
Kde-multimedia@master.kde.org
http://master.kde.org/mailman/listinfo/kde-multimedia

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic