Proposal for KDE media interface

Roger Larsson roger.larsson at skelleftea.mail.telia.com
Wed Aug 6 01:18:50 BST 2003


On Tuesday 05 August 2003 23.06, Morten Hustveit wrote:
> Today I wrote a sample interface for handling media files (audio and video,
> not MIDI) in KDE.  It features raw read and write access, as well as
> playback.  It's intended to have multiple backends, specifically for
> OSS/Free, ALSA and aRts, but more may be added.
>
> Having a full media implementation in kdelibs removes the requirement that
> users must run a sound server.  Also, for users wanting to run a sound
> server, it ensures that they can run the server of their choice -- not
> necessarily the one KDE developers prefers.  When the sound server becomes
> deprecated, it does not require a change in the API to use a new one.
>
> When a user is not running a sound server, the kernel driver decides
> whether or not multiple processes can access the sound device
> simultaneously.

Arts could detect and use this feature too.

* Always mix (like now)
	* If the sound device supports simultaneous open.
		* Open a device for each audio stream with the streams sample rate.
		  Mixing and resampling will then be handled by the sound device!
or
* Reject/Queue the new request
	* If the sound device supports simultaneous open, this option will reduce
	  the number of concurrently used audio paths for KDE.
or
* Stop/Pause the currently playing request (at next audio frame)
	* If the sound device ... reduce ... audio paths for KDE.

>
> I have already implemented a similar system in a game engine, so writing
> the implementation for this one should be mostly copying and pasting.  If I
> get support on this, I will write the mentioned backends, a Control Center
> module, as well as the mandatory libxine, libmad and libvorbis plugins.

If it is very so little work, then do it
 - and we can judge on the final result.

But do not underestimate the amount of work!

You need to be able to support:
* ALL audio formats, arts "supports" future too (from the application
  perspective)
* ALL media formats...
	- I guess that it is possible to add a decoder for WMV and suddenly
	  all applications can use it... (Commercial idea for anyone interested)

** Most audio/media formats will be supported by the dynamic libraries.
   So as long as those gets extended this will be OK.

* Source can be: file, streaming
** Some parts of current arts fails in this regard too...

* Destination can be OSS on several Unixes, ALSA, XTerminals with sound...
** Using an library for this too could make your approach easier.

>
> The interface is documented at
> <http://www.ping.uio.no/~mortehu/kmedia/annotated.html>.  I'll delay
> implementation until you people tell me what's wrong with the interface.

Audio effects?
Some applications, like noatun, can insert audio effects.
How do you plan to support this? This part of the interface can be tough to
support in a BC way...

/RogerL

-- 
Roger Larsson
SkellefteƄ
Sweden



More information about the kde-multimedia mailing list