Results 1 to 4 of 4

Thread: Phonon - Custom QIODevice to support encrypted files

  1. #1
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Phonon - Custom QIODevice to support encrypted files

    Hello,

    I want to integrate Audio and Video support in my 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)

    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" 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.

    Greetings

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Phonon - Custom QIODevice to support encrypted files

    The native backend is most likely implemented using some Windows framework for multimedia data and maybe that wants to operate on files.

    You could try using a different Phonon backend, e.g. the VLC or GStreamer backend, it should be possible to build those for Windows as well.

    If you need more detailed help, I suggest to subscribe to this mailing list https://mail.kde.org/mailman/listinfo/kde-multimedia
    This is where the Phonon developers "hang out"

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    hunsrus (27th November 2012)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Phonon - Custom QIODevice to support encrypted files

    Quote Originally Posted by hunsrus View Post
    Hello,

    I want to integrate Audio and Video support in my 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)

    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" 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.

    Greetings
    If all elses fail you can try implementing a pipe that you will feed with the decrypted data and then read the data from it using regular Phonon API. Note that you need to find a way to make sure nothing but your application can read from the pipe.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    hunsrus (27th November 2012)

  6. #4
    Join Date
    Jun 2008
    Posts
    26
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Phonon - Custom QIODevice to support encrypted files

    Thanks for your replies!
    I posted to the mailing list.
    Furthermore I'll try to change the backend although I don't think this is the problem.
    Wysotas approach is very interesting, if everything else fails I'll give it try.
    Nevertheless thanks for your help, great forum!

Similar Threads

  1. How to install Qt ARM version with phonon support?
    By JimShee in forum Installation and Deployment
    Replies: 1
    Last Post: 15th July 2012, 11:32
  2. QImageReader with custom QIODevice implementation
    By psih128 in forum Qt Programming
    Replies: 0
    Last Post: 10th August 2011, 03:39
  3. Phonon: subclassing QIODevice
    By iDm.MuFFin123 in forum Qt Programming
    Replies: 0
    Last Post: 23rd May 2010, 13:29
  4. Install Qt 4.5 with phonon support
    By webquinty in forum Installation and Deployment
    Replies: 9
    Last Post: 11th December 2009, 21:48
  5. How to compile Qt-4.4 with Phonon support?
    By troorl_ua in forum Installation and Deployment
    Replies: 4
    Last Post: 10th January 2008, 12:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.