[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Linphone-developers] Sockets inside a plugin
From: |
Simon Morlat |
Subject: |
RE: [Linphone-developers] Sockets inside a plugin |
Date: |
Fri, 04 Dec 2009 18:57:40 +0100 |
Hi
THere is nothing forbidden in plugins.
The only thing to take care (but it 's true for every mediastreamer2
MSFilter):
Never make blocking calls (read,recv,connect...) within
the .process .preprocess,.postprocess methods of a filter.
Use non-blocking IO or defer the blocking operations into a seperate
thread.
Simon
Le jeudi 03 décembre 2009 à 19:00 +0000, M Walton a écrit :
> Hi Simon,
>
> From the point of view of inside a plugin, is there anything i need to be
> aware with when using the sockets API? Im opening a couple of UDP sockets on
> eth0 for sending/receiving using broadcast addresses.
>
> Thought id check whilst getting the remote debugging working as im not seeing
> any udp traffic coming out of it at the moment.
>
> Regards
>
> Billy
>
>
> -----Original Message-----
> From: Simon Morlat [mailto:address@hidden
> Sent: 03 December 2009 12:53 PM
> To: M Walton
> Cc: address@hidden
> Subject: RE: [Linphone-developers] Linphone customisation
>
> Sounds like it could not find a libmslisgw_init() function in your
> plugin.
> If you used C++, don't forget to prepend this function with extern "C".
>
> Simon
>
> Le jeudi 03 décembre 2009 à 12:43 +0000, M Walton a écrit :
> > Hi Simon,
> >
> > Thanks for the quick response! im getting closer...
> >
> > So now i understand, its /usr/lib/mediastreamer/plugins
> >
> > so i have added a few printf's in and around the ms_load_plugins function,
> > one to print the search path and the other to print the files it finds
> >
> > my file is called libmslisgw.so
> >
> > so if i run linphonec i get my debug strings...
> >
> > It finds my file - but doesnt seem to do anything with it, i thinks it
> > failing on the strstr calls, possibly the PLUGINS_EXT bit?
> >
> > root:/usr/lib/mediastreamer/plugins> linphonec
> > NLS disabled.
> > .
> > .
> > .
> > ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm_hw.c:1429:(_snd_pcm_hw_open)
> > Inval
> > id value for card
> > ALSA lib ../../../alsa-lib-1.0.18/src/pcm/pcm_hw.c:1429:(_snd_pcm_hw_open)
> > Inval
> > id value for card
> > opening directory /usr/lib/mediastreamer/plugins
> > Found .
> > Found ..
> > Found libmslisgw.so
> > opening directory /usr/lib/liblinphone/plugins
> > Ready
> > Warning: video is disabled in linphonec, use -V or -C or -D to enable.
> > linphonec> soundcard list
> > 0: ALSA: default device
> > 1: OSS: /dev/dsp
> > 2: OSS: /dev/dsp1
> > linphonec>
> >
> > -----Original Message-----
> > From: Simon Morlat [mailto:address@hidden
> > Sent: 03 December 2009 11:44 AM
> > To: M Walton
> > Cc: address@hidden
> > Subject: RE: [Linphone-developers] Linphone customisation
> >
> > Le jeudi 03 décembre 2009 à 10:59 +0000, M Walton a écrit :
> > > Hi Simon,
> > >
> > > I have managed to create and build the plugin, however, i have a few
> > > questions that i think are preventing it from working:
> > >
> > > 1) When you say "The plugin must be installed in
> > > $prefix/lib/mediastreamer/plugins/" - what do you mean by $prefix? i have
> > > installed it into /lib/mediastreamer/plugins - but it doesnt seem to get
> > > detected.
> > >
> > > Do you mean $linphonec-dir$/libs/mediastreamer/plugins?
> > >
> > > Also, is the directory /libs/mediastreamer not /libs/mediastreamer2?
> >
> > by $prefix I meant the installation prefix (usually /usr or /usr/local),
> > when you do 'make install' in linphone.
> > thus the plugin should be in
> > /usr/local/lib/mediastreamer/plugins/
> > if you configured linphone with --prefix=/usr it will be in
> > /usr/lib/mediastreamer/plugins/
> >
> > >
> > > 2) Do i need to register the soundcard AND the two filters? or just the
> > > soundcard which will in turn register the associated filters?
> > >
> > > void liblisgw_init(void){
> > > ms_snd_card_manager_register_desc(ms_snd_card_manager_get(),
> > > &lismore_card_desc);
> > > ms_filter_register(&lismore_write_desc);
> > > ms_filter_register(&lismore_read_desc);
> > > }
> >
> > No need to register the filter if they are instanciated with
> > ms_filter_new_from_desc (it is only necessary when using ms_filter_new
> > or ms_filter_new_from_name ).
> >
> > >
> > > 3) do i still need the following two export entries now its not being
> > > statically linked?
> > >
> > > MS_FILTER_DESC_EXPORT(lismore_write_desc);
> > > and
> > > MS_FILTER_DESC_EXPORT(lismore_read_desc);
> >
> > The MS_FILTER_DESC_EXPORT is empty, it's just a marker for an awk script
> > in mediastreamer2/src/Makefile.am to collect all descs and automatically
> > generate a header file with them.
> >
> > >
> > > 4) The ID change is now MS_FILTER_PLUGIN_ID for both the read and write
> > > structs with a category of MS_FILTER_OTHER, is this ok?
> > That's ok. Category is just indicating whether the filter is an encoder,
> > a decoder, or something else.
> >
> > >
> > > Many thanks as always
> > you're welcome
> >
> > Simon
> >
> >
>
>
- RE: [Linphone-developers] Linphone customisation, M Walton, 2009/12/01
- RE: [Linphone-developers] Linphone customisation, Simon Morlat, 2009/12/01
- RE: [Linphone-developers] Linphone customisation, M Walton, 2009/12/03
- RE: [Linphone-developers] Linphone customisation, Simon Morlat, 2009/12/03
- RE: [Linphone-developers] Linphone customisation, M Walton, 2009/12/03
- RE: [Linphone-developers] Linphone customisation, Simon Morlat, 2009/12/03
- RE: [Linphone-developers] Linphone customisation, M Walton, 2009/12/03
- RE: [Linphone-developers] Sockets inside a plugin, M Walton, 2009/12/03
- RE: [Linphone-developers] Sockets inside a plugin,
Simon Morlat <=
RE: [Linphone-developers] Linphone customisation, M Walton, 2009/12/03