Diffusion K3b 3f6bf50c23d7

It is about time I at least backup all of this.... and since it seems to work...

Authored by Sebastian Trueg <sebastian@trueg.de> on Mar 21 2009, 10:36 PM.

Description

It is about time I at least backup all of this.... and since it seems to work... finally...

Anyway, this is the beginning (and also the biggest chunk) of porting K3b to QIODevice.
No more pipes throughout libk3b. This has several advantages:

  • I could get rid of K3Process
  • In theory K3b could become platform independant
  • The code is more readable (handling all those socket pairs is no fun!)

However, this was a very very hard thing to accomplish (and at least the mixed project
does not work yet). Sadly QProcess (and thus KProcess) is way too high level for K3b.
I tried to make it work for days, tried to port K3b's threaded design to an async one
as Qt prefers. No use. Since QProcess is buffered and the buffer keeps growing endlessly
we end up with a 4gb buffer when writing a dvd since cdrecord needs to perform some
device initialization and perpare the medium. So that was not an option. (Which in the end
is good since the threaded design is much better anyway. We don't want any GUI updates
disturbing the burning process)
I then realized that I had to fork QProcess. Which I did. So now K3b contains a fork of
QProcess which supports unbuffered IO. Obviously I only implemented it for unix. If anyone
could handle the win and mac ports I would be glad. I already filed a bug report with Qt.
They will be looking into it for Qt 4.6.

[Some technical details: basically in unbuffered/raw mode QProcess simply bypasses the buffers
and readData and writeData directly call the native read and write methods. In addition the unix
implementation does NOT configure the pipes to be non-blocking and the socket notifiers are
disabled. The latter is very important as K3b uses the one QProcess from different threads and
that is something QSocketNotifier does not like a bit.]

Apart from the porting to QIODevice for all communication (which was a lot of work) I did some
cleanup and improvements here and there.

iso image writing, data project, and audio project seem to work fine. I did not debug media copy
yet and am sure that the mixed project does not work. But the hardest part is done so that
should be rather simple to fix.

IMHO this is an important step for the KDE4 port and one I was afraid of (and it turned out that
I was right to be ;)

svn path=/trunk/extragear/multimedia/k3b/; revision=942529

Details

Committed
Sebastian Trueg <sebastian@trueg.de>Mar 21 2009, 10:36 PM
Parents
R467:0cf86a0bacb7: Proof-reading.
Branches
Unknown
Tags
Unknown