Phonon used in Qt Project - Custom QIODevice to support encrypted files

Harald Sitter sitter at kde.org
Tue Nov 27 08:53:54 GMT 2012


Aloha,

On Tue, Nov 27, 2012 at 9:44 AM, Jan Kohlhaas <kohlhaas at lyth.de> wrote:

> I want to integrate Audio and Video support in my Qt-application using the
> Phonon framework. I'm handling protected data (mp3, avi etc.). Therefore
> I'm writing those files encrypted to the filesystem.
>
> To avoid loading a whole video in the buffer I subclassed QIODevice and
> provided a custom IODevice which decrypts the encrypted content
> 'on-the-fly' when Phonon asks for more bytes. (function readData)
> I'm initializing the MediaSource using this custom IODevice.
>
> Encryption/Decryption works fine, no problems. Now I tried to play
> different video types (Audio: mp3 is working) with my Phonon-Player.
> AVI: working
> WMV: not working
>
> Now under "doc.qt.digia.com/main-**snapshot/phonon-mediasource.**
> html#MediaSource-6<http://doc.qt.digia.com/main-snapshot/phonon-mediasource.html#MediaSource-6>"
> I noticed the following sentence:
>
> "Warning: On Windows, we only support QIODevices containing the avi, mp3,
> or mpg formats. Use the constructor that takes a file name to open files
> (the Qt backend does not use a QFile internally)."
>
> Is there any way to avoid this restrictions and to extend this
> functionality? Unfortunalety I definitely have to use encrypted files. And
> perhaps can tell me somebody what's the reason behind this? Using usual
> (not encrypted) files without the custom IODevice there is no problem
> playing video files containing other formats like WMV or (with the right
> codecs) MP4.
>

We do not maintain Qt's Phonon, if you want support for it Digia/Qt-Project
is the better place to ask. What I recommend however is building the
regular Phonon along with the Phonon VLC backend. Not only has it numerous
bug fixes compared to the Qt copy but also vastly greater and more reliable
codec support (through VLC).

HS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20121127/7e6b6e8e/attachment.htm>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list