patch proposal

Thierry Bastian thierry.bastian at trolltech.com
Tue Jul 3 16:03:49 CEST 2007


Hello,

 

Here is an aggregation of what I’ve come up with the API review in the past
days (more to come soon about MediaSource/Object/Controller).

 

The change:

-there were some places where integers were used instead of object (like for
the AudioOutputDevice and the Effects). This now uses objects. This is to me
the biggest point in this patch: having a truly object-oriented approach
everywhere.

-property names were defined as QByteArray. This is changed to QString
because QByteArray will be painful. And anyway the QHash<QByteArray,
QVariant> is changed into QVariantMap.

-for the object description, the backend is now responsible for creating
ObjectDescriptionData instead if returning both indexes and properties
separately. This needs changes in the backend as well so don’t expect it to
compile out-of-the-box.

 

Things to reduce size (all experimental):

-make qDebug a noop in release mode. Now in release we do #define pDebug if
(false) qDebug (this saved 5% - ie 8KB - on my windows machine)

- ObjectDescription is no more a template. I defined subclasses for it. We
used this template just for having string typing. The subclasses have the
same meaning. The static fromIndex was removed thanks to using
ObjectDescription everywhere instead of integers. Replacing the templates by
simple class/sub-classes made the library size shrink on my machine by again
7%. I haven’t touch the ObjectDescriptionModel, so remove it from your
project file if you intend to be able to compile ;).

 

To make sure it compiles, I suggest you remove ObjectDescriptionModel,
AudioPlayer, VideoPlayer, SeekSlider and VolumeSlider. I have patches for
those classes as well but the patch I send here is already very huge.

I had to filter out things in the patch so I hope it works without too much
trouble.

 

Håvard it would be great if you could give us information about how this
patch affects the size of phonon on embedded. You could do that in 2 steps:

1.       Removing ObjectDescriptionModel, AudioPlayer, VideoPlayer,
SeekSlider and VolumeSlider

2.       Applying the patch

 

 

For the Windows size:

All in all I’m pretty happy with the on-going work and think we’re not so
far from having a good API ;).  Cyril is more working on the backend
currently and hopes to have something “visible” soon.

 

Regards,

Thierry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/phonon-backends/attachments/20070703/9ff9b304/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 52668 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/phonon-backends/attachments/20070703/9ff9b304/attachment-0001.obj 


More information about the Phonon-backends mailing list