Calling pjlib from unknown/external thread

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

 



Hi Jason,

your builder is complaining because your pj_boo_t variable
thread_registered has not been defined.

On the other hand, seems that your platform doesn't has a proper
declaration of pj_thread_t (it is forward declared in types.h).

Hope this helps,
Joel.


2014-06-13 11:00 GMT+02:00 Jason Chen ??? <Jason.Chen at tpv-tech.com>:

>  Dear all
>
>    I want to call  ?pjmedia_transport_send_rtp()?,  and I get the error
> message:
>
> 06-13 08:34:13.949: A/libc(3106): ../src/pj/os_core_unix.c:674:
> pj_thread_this: assertion "!"Calling pjlib from unknown/external thread.
> You must " "register external threads with pj_thread_register() " "before
> calling any pjlib functions."" failed
>
> 06-13 08:34:13.949: A/libc(3106): Fatal signal 11 (SIGSEGV) at 0xdeadbaad
> (code=1), thread 3159 (Thread-329)
>
>
>
> Then I change my code:
>
>
>
> void my_send_rtp(){
>
>     if(!thread_registered && !pj_thread_is_registered())
>
>     {
>
>              pj_thread_desc desc;
>
>         pj_bzero(desc, sizeof(desc));
>
>                    pj_thread_t t;
>
>         if (pj_thread_register(NULL,desc,&t) == PJ_SUCCESS)
>
>         {
>
>             thread_registered = PJ_TRUE;
>
>         }
>
>     }
>
>
>
>
>
>     if (!my_call_med->call || !my_call_med->call->inv || !my_call_med->tp)
> {
>
>          return;
>
>     }
>
>
>
>          pjmedia_transport_send_rtp(my_call_med->tp, "pkt", strlen("pkt"));
>
> }
>
>
>
>
>
> I get another error?
>
>
>
> ../src/pjsua-lib/pjsua_aud.c:639:9: error: 'thread_registered' undeclared
> (first use in this function)
>
>      if(!thread_registered && !pj_thread_is_registered())
>
>          ^
>
> ../src/pjsua-lib/pjsua_aud.c:639:9: note: each undeclared identifier is
> reported only once for each function it appears in
>
> ../src/pjsua-lib/pjsua_aud.c:643:15: error: storage size of 't' isn't known
>
>    pj_thread_t t;
>
>
>
>
>
> how can I do if I want to call pjmedia_transport_send_rtp()?
>
>
>
>
>
> *Best Regards, *
>
> *jason.chen*
>
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140613/3f83b3b4/attachment.html>


[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