PDA

View Full Version : Phonon and filters



THRESHE
29th April 2008, 16:20
Hi everybody

In the application I'm writing I need to link filters in a chain to output video stream. One of the filters is a codec that decrypts an XOR-ed file. I need to link these filters on two systems (Windows and Mac OS X).

So the question is are there any methods to explicitly link these filters with Phonon ?
If there aren't phonon methods to do it are there any DirectShow and QuickTime methods to do so?

wysota
29th April 2008, 16:33
So first you have a xor encrypted file, which should after decryption be subject to regular video decoding?

Phonon::MediaSource takes QIODevice pointer as its argument, so you can create a QIODevice that will do the decryption on the fly. I did it once for RC4 and it's very simple. There is an article on QQ that deals with the subject.

THRESHE
29th April 2008, 17:02
Thanks for your reply Wysota.

But the problem is that if DirectShow links filters one can write a codec that will just link on the top of my codec and dump all decrypted data to a file. My codec is a DRM codec so the aim is to protect data (though personally I think that DRM is stupid it's my job :eek: )

wysota
29th April 2008, 22:13
Where in the stream does the codec reside?

THRESHE
30th April 2008, 14:18
AsyncReader->My filter->Haali Media Splitter ( splits stream to audio and video)->something...->render

wysota
4th May 2008, 21:40
So where does the actual frame decoding go?

THRESHE
5th May 2008, 11:39
What do you mean ?

wysota
5th May 2008, 19:56
Where are the video and audio streams decoded into single images and audio chunks? Before or after your DRM thing?

THRESHE
7th May 2008, 10:56
They are decoded after my DRM filter. My filter is a low level one and it can only read raw data from asyncreader end decode them into same raw data but unencrypted.

wysota
7th May 2008, 17:34
So how does that make my solution from post #2 invalid? If someone has access to decrypted frames before sending them to the video decoder, using a crafted codec will allow one to intercept the video stream anyway...

THRESHE
7th May 2008, 17:42
Yes but if I link filters manually it won't be possible

wysota
7th May 2008, 18:57
I think you didn't understand me... Regardless if you link manually or not (?), you'll have to get a stream of data from somewhere. You might pass a file name or read it using QIODevice. At that point you can decrypt your stream and pass it to the regular phonon flow. If I want to steal the stream, I will, it's just a matter of saving the stream from the codec to an external file, so it really doesn't matter what solution you choose - eventually you'll have to go through some backend that can be altered to steal the stream. I really suggest you implement a QIODevice that does the decryption.

THRESHE
8th May 2008, 12:48
If I want to steal the stream, I will, it's just a matter of saving the stream from the codec to an external file, so it really doesn't matter what solution you choose - eventually you'll have to go through some backend that can be altered to steal the stream.
If I configure these filters and backends manually I will be able to link only trusted ones. I know that it's possible to do that with DirectShow API. You will not be able to steal the stream because it will go through filters that are embedded in my application.

wysota
8th May 2008, 13:22
In that case use DirectShow and not Qt. I don't see how Phonon could help you here...

THRESHE
8th May 2008, 14:01
I hoped it could :(

wysota
9th May 2008, 07:42
In what? If you want to use DirectShow to manually bind the exact codecs, etc. how could Phonon help you if it doesn't allow strict bindings because it has to be crossplatform so the backend is chosen manually? I'm not sure you can do it in DirectShow, because you never know what codecs you have in your system, but if you insist that it is possible, then I won't say otherwise...