[guardian-dev] getting a native FD from my iocipher disk

Mark Murphy mmurphy at commonsware.com
Thu Jul 18 06:42:14 EDT 2013


On Wed, Jul 17, 2013 at 8:18 PM, Hans-Christoph Steiner
<hans at guardianproject.info> wrote:
> To make that MediaRecorder class work with IOCipher, there would need to be an
> IOCipher version of that class, with all the java.io imports replaced by
> info.guardianproject.iocipher imports, and the native code replaced with code
> that can write to IOCipher, either Java or native.

I suspect that this will be impractical, as most of the actual work
should be done by the OS in StageFright (or the older OpenCORE) in a
separate process.

If you are willing to limit yourself to raw audio formats, you could
have MediaRecorder record to one end of a ParcelFileDescriptor pipe,
with you using the other end to write to IOCipher, at least in
principle (haven't tried the IOCipher part). Here is a sample that
demonstrates the rest:

https://github.com/commonsguy/cw-omnibus/tree/master/Media/AudioRecordStream

However, streams on pipes aren't rewindable, and so traditional audio
and video codecs, where the file's header needs to be updated when
recording is complete, will not work with this technique.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Här kan du ställa och svara på frågor om applikationsutveckling på
Android: http://www.andglobe.com


More information about the Guardian-dev mailing list