Hello Frank,
For the first:
Again: Thank you for your help !
For the second:
You can see, that the output contains absolutely no error message !
except "Cannot open directory /usr/local/lib/liblinphone/plugins: No such file or directory"
I will comment this problem a little bit later in this forum entry.
For the third:
>> sprintf(st,"=> id = %u dist = %u adr1 = %x\n", count, dist, (unsigned int) *decode_asm);
I think, definitely that is the wrong way !
In the c - programming language a address of a function is defined using the functions name;
that means: (unsigned int) decode_asm
not (unsigned int) *decode_asm.
In your code you would get the first 32 bit value of the code, the function pointer points to.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Add: I tried all the versions auf calling but the value of the pointer is the same
It doesen't matter if using *decode_asm or decode_asm.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Again: I think, definitely that is the wrong way !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
For the fourth:
>> I would expect 0x40000000+ for a shared library address.
In my environment the pointer has a value of about 3078322667.
For the fifth:
>> Do I have to "get a call" or "make a call" to trigger this, or have I done something wrong?
In the real world you should do a call to a phone that can handle the G722 mode.
But you don't have to call such an device because you can use the init function
to call decode_asm. You can use a 0 (for pointer arguments NULL) value for all
of the parameters of the function. That is no problem because the function does
absolutely nothing except initializing the return value (0x00000000) in eax.
This init function is declared in msg722.c and the output is shown on the terminal.
********************** code for libmsg722_init **********************
void libmsg722_init(void)
{
/* no longer required due to official Linphone integration
payload_type_set_user_data(&payload_type_g722,(void*)9);
rtp_profile_set_payload(&av_profile, 9, &payload_type_g722);
ms_message("payload type g722 assigned\n");
*/
ms_filter_register(&ms_g722_dec_desc);
ms_message("G.722 decoder registered\n"); // first output
ms_filter_register(&ms_g722_enc_desc);
ms_message("G.722 encoder registered\n"); // second output
// ****************** my note **************************************
Here is the right place to call decode_asm because the called function simply does nothing
except setting up the return value in eax to 0.
The runtime linker has already done its work at the current time.
So, the function call to decode_asm should be possible without any problems.
// ***************************************************************
}
**********************************************************
These to messages are outputted by this function:
ortp-message-Loading plugin /usr/local/lib/mediastreamer/plugins/libmsg722.so.0.0.0...
ortp-message-G.722 decoder registered
ortp-message-G.722 encoder registered
ortp-message-Plugin loaded (/usr/local/lib/mediastreamer/plugins/libmsg722.so.0.0.0)
ortp-message-ms_init() done
>> Is that "cannot open directory" my problem?
That is not the problem because the g722 library could be
initialized properly. That means, the runtime linker has done its work properly.
The brown coloured output shows, that the library libmsg722.so.0.0.0 can be
called without any problems. Because you don't call anyone, that is no problem.
The only problem is, that the call of decode_asm results in an segmentation fault.
So, you can call the assembler function after registering encoder
and decoder part of the library.
You can use the purple coloured part of the init function to place a call to decode_asm.
****************************************************************
>> msg722.c:148: error: 'MS_G722_ENC_ID' undeclared here (not in a function)
>> msg722.c:469: error: 'MS_G722_DEC_ID' undeclared here (not in a function)
>> msg722.c:511:2: warning: no newline at end of file
>> make[2]: *** [libmsg722_la-msg722.lo] Error 1
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all] Error 2
I will send you an email that contains all the values needed by linphonec. You have installed the downloaded version
and these values are not defined in this version.
Today I will try to check the address-offsets of the mmx.o file using objdump to find out, if there is something wrong.
If I have a news regarding this problem, I will create a new entry in this forum to let you know about that.
Thank you for your help !
Zasti