cass
1st May 2010, 17:26
Hi
I would like to use my own customized QIODevice to open a video file in QT using Phonon. This should theoretically allow me to play specially encrypted video files. I noticed that MediaSource ( QIODevice * ioDevice ) can take an QIODevice and as a test I tried a basic QFile as a source.
VideoPlayer* video = new VideoPlayer(Phonon::VideoCategory);
main->setWidget(video); // My own class that puts the VideoPlayer on the window at the correct position.
QFile* f = new QFile("data/myvideo.MP4");
if (f->open(QIODevice::ReadOnly))
{
video->play(MediaSource(f));
}
When I debug the code, the file opens successfully, but I only get a "black box" with no video or audio.
When I replace MediaSource(f) with MediaSource("data/myvideo.MP4"), it works but I would like to be able to modify (decrypt) the stream before it get send to the VideoPlayer.
Any ideas?
I would like to use my own customized QIODevice to open a video file in QT using Phonon. This should theoretically allow me to play specially encrypted video files. I noticed that MediaSource ( QIODevice * ioDevice ) can take an QIODevice and as a test I tried a basic QFile as a source.
VideoPlayer* video = new VideoPlayer(Phonon::VideoCategory);
main->setWidget(video); // My own class that puts the VideoPlayer on the window at the correct position.
QFile* f = new QFile("data/myvideo.MP4");
if (f->open(QIODevice::ReadOnly))
{
video->play(MediaSource(f));
}
When I debug the code, the file opens successfully, but I only get a "black box" with no video or audio.
When I replace MediaSource(f) with MediaSource("data/myvideo.MP4"), it works but I would like to be able to modify (decrypt) the stream before it get send to the VideoPlayer.
Any ideas?