I think the problem you are running into is that a lot of the types of inputs/outputs are converted to a native file descriptor in the IContainer
JNI code, but the thing you are passing cannot be converted. It may not be possible to create your own IURLProtocolHandler
in this way, because it would, after a trip through XuggleIO.map()
, just end up calling IContainer again and then into the IContainer JNI code which will probably try to get a native file descriptor and call avio_open()
.
However, there may be a couple of things that you can open in IContainer
which are not files/have no file descriptors, and which would be handled correctly. The things you can open can be seen in the IContainer code, namely java.io.DataOutput
and java.io.DataOutputStream
(and the corresponding inputs). I recommend making your DataInput/DataOutput implementation which wraps around BytesReadable/BytesWriteable, and opening it in IContainer.
If that doesn't work, then write your inputs to a temp file and read the outputs from a temp file :)