On Tue, Mar 11, 2014 at 4:07 AM, Tom?? Valenta <vali at kamarad.cz> wrote: > The approach that I have in mind is to create a media port at PJSUA2 > >> level, with API to read/write memory location. The operation will be >> strictly call only from Python and there's no callback. For example, to >> write audio frames in Python: >> >> while port.needFrames(): >> port.write(audio frame) >> > > This is nicely simple approach and I am OK with that, but there are few > points to sort out: > > 1. Locking -- there is a race condition between PJMEDIA and calling (e.g. > Python) thread. > > I don't see it with the simple approach above. Remember that this is strictly polling only by Python application; there's no callback from the stack to Python app. > 2. Buffering -- there should always be enough data on sending end to avoid > gaps that may harm e.g. speech recognition on the other end. And data on > the receiving end also would have to be buffered. > > Yes. > 3. Binary data passing mechanism in SWIG. > > I'm sure there's a facility for that. > All three points were solved by file/pipe approach. > > I would say the buffering and binary problems would still need to be solved with the pipe as well. Cheers Benny > Thanks for comments and ideas, > Vali > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140311/1f83048b/attachment-0001.html>