Search code examples
c#directshowdirectshow.net

DirectShow throws error on my Source Filter (UNSUPPORTED_STREAM) that i use to decrypted the buffer stream


I compiled and registered the DLL that is included in the DirectShow samples ( Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\filters\async) I modified it to decrypt the buffer as I receive it (Because the file I received is encrypted. I can run the example on GraphStudioNext but whenever I try to construct the graph on C# with DirectShowLib it keeps giving me errors.

IBaseFilter xAsync = CreateFilter("C553F2C0-1529-11D0-B4D1-00805F6CBBEA");
hr = graphBuilder.AddFilter(xAsync, "xAsync");

hr = this.graphBuilder.RenderFile(filename, null);

it returns the -2147220891 (VFW_E_UNSUPPORTED_STREAM) (Cannot play back the file: the format is not supported.) Is there a way to get around this?

EDIT: This issue does not happen if I remove my decryption code.


Solution

  • Found out the issue. I had to build the graph from scratch and not reply on RenderFile. I had to manually connect my Custom File Source reader. The reason why it returns -2147220891 (VFW_E_UNSUPPORTED_STREAM) is because I encrypted the entire file included in the header information that the system relies on to determine the rest of the filters to connect to.

    My Graph ended up with FileSourceCustom -> GDCL Demultiplexer -> FFDShowDecoder -> VMR9