codecs again

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I kinda put that issue aside, but now it is back. And still I have no 
good solution:

I have one single endpoint, with multiple media_endpoints, all shall 
"run" with different settings of the same codec

looking at the pjmedia-codecs, all factories are kind of designed for 
single usage, one endpoint-one media_endpoint-one codec

I actually want some kind of codec-factory factory, which creates a 
factory instance with exactly one codec set of parameters for a single 
media endpoint

e.g.:

a L16CodecFactoryFactory, with something like

PJ_DEF(pj_status_t) pjmedia_codec_l16_factory_init(pjmedia_endpt *endpt, unsigned sampleRate, unsigned channels)

which registers a l16_codec_factory in the codemgr of the endpt, which in turn provides exactly the codec L16/sampleRate/channels

with the proper pjmedia_codec_factory_op function set

l16_test_alloc,
l16_default_attr,
l16_enum_codecs,
l16_alloc_codec,
l16_dealloc_codec,
pjmedia_codec_l16_deinit

and latter function is the problem: while all other functions expect a pjmedia_codec_factory pointer as parameter, which
can be used to distinguish different codec factories, the deinit (or better: factory->destroy()) is parameterless, so
if a media_endpt is destroyed and calls the destroy() function of the codec factories registered, my CodecFactoryFactory cannot determine, WHICH of its
previously created factories it is that should be destroyed.

In theory I could leave the destroy() op empty, but there is no save way to decide, when I can savely clear a factory
(if I delete it too early, before the media endpoint is destroyed, its destroy call would in turn reference an invalid codec_factory structure

Any ideas? (well, I could modify the pjsip source so that the pjmedia_codec_factory_op (destroy) callback would require
pjmedia_codec_factory *factory parameter as the others...but I would prefer a "non-invasive" way

Thx and regards

Harry




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux