[Opalvoip-devel] ptlib sound plugin
Brought to you by:
csoutheren,
rjongbloed
From: mattes <mk...@my...> - 2009-09-02 20:29:21
|
To extract the sound from an opal session (sip/h323) I created a new PTlib plugin shm_pwplugin.so. I use simpleopal for testing. simpleopal --sound-out shm h323:192.168.15.133 Once the connection is established, sound is streamed via SHM. A semaphore informs the consumer about new sound buffers. >From testing with the alsa plugin I know there are roughly 50-60 write cycles per second (640 bytes buffer). When using the shm plugin, i'll get tenthousands of write cycles. far too many, so something is wrong. The variable 'lastWriteCount' seems to be important for the interface. I tried a couple of different settings to no avail. PBoolean PSoundChannelIPM::Write (const void *buf, PINDEX len) { lastWriteCount = 0; PWaitAndSignal m(device_mutex); if ((!isInitialised && !Setup()) || !len || !os_handle) return PFalse; writeSample2SHM( (void*)buf, len ); lastWriteCount += len; return PTrue; } Does someone know the ptlib plugin API. I am doing obviously something wrong. any pointers are appreciated. mattes |