From: Stef B. <st...@gm...> - 2011-07-16 20:21:19
|
Hi, I'm working on a FUSE fs basefs. My aim to test various decoders like the one you are using in Aifffffs. See: git clone git://gitorious.org/basefs/basefs.git basefs and http://linux.bononline.nl/wiki/index.php/Basefs,_a_FUSE_fs_to_test_various_decoders_(Gstreamer,_FLAC) I've taken the files aiff.c, aiff.h, id3.c and id3.h from your fs, and written functions open_virtual, read_virtual, release_virtual and size_virtual, which call the function AiffNew, AiffRead, AiffDestroy and AiffSize. The only change I did was the removal of the lock. I'm using a "locked" integer, which indicates the decoder is locked. When a (virual) file is open, the decoder is initialized, and the lock integer is set from 0 to 1. This prevents other "open" calls to create another decoders context on the same file, causing problems. Now when a read arrives, it finds this lock integer, and it must be 1. If it is 0, it is not open. When it's 2, another read is busy, and it's waiting using a condition variable. When it's 1, it's setting the value to2, and the read is able to get access to the decoder, and get bytes read. When ready, it's setting the lock value back again to 1. Note this is not ready yet, it's not taking into account the serialization. Now it gives no valid output on the decoded virtual file. Do you maybe know howto add some more logging? Stef |