Changeset 371:61a33d6c8868 in mediastreamer2


Ignore:
Timestamp:
Mar 27, 2009 11:20:07 PM (4 years ago)
Author:
smorlat <smorlat@…>
Branch:
default
Message:

add waiting window and methods.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@374 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

Location:
linphone
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • linphone/coreapi/linphonecore.c

    r364 r371  
    10281028                } 
    10291029        } 
     1030 
     1031        ms_list_for_each(lc->sip_conf.proxies,(void (*)(void*))&linphone_proxy_config_update); 
     1032 
    10301033        if (lc->call!=NULL){ 
    10311034                LinphoneCall *call=lc->call; 
     
    22992302} 
    23002303 
     2304void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose){ 
     2305        if (lc->vtable.waiting){ 
     2306                lc->wait_ctx=lc->vtable.waiting(lc,NULL,LinphoneWaitingStart,purpose,0); 
     2307        } 
     2308} 
     2309 
     2310void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progress){ 
     2311        if (lc->vtable.waiting){ 
     2312                lc->wait_ctx=lc->vtable.waiting(lc,lc->wait_ctx,LinphoneWaitingProgress,purpose,progress); 
     2313        }else{ 
     2314#ifdef WIN32 
     2315                Sleep(50000); 
     2316#else 
     2317                usleep(50000); 
     2318#endif 
     2319        } 
     2320} 
     2321 
     2322void linphone_core_stop_waiting(LinphoneCore *lc){ 
     2323        if (lc->vtable.waiting){ 
     2324                lc->wait_ctx=lc->vtable.waiting(lc,lc->wait_ctx,LinphoneWaitingFinished,NULL,0); 
     2325        } 
     2326} 
     2327 
     2328 
    23012329void net_config_uninit(LinphoneCore *lc) 
    23022330{ 
  • linphone/coreapi/linphonecore.h

    r354 r371  
    296296        struct _SipSetupContext *ssctx; 
    297297        int auth_failures; 
    298         bool_t frozen; 
     298        bool_t commit; 
    299299        bool_t reg_sendregister; 
    300300        bool_t registered; 
     
    419419typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate); 
    420420typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf); 
     421typedef enum _LinphoneWaitingState{ 
     422        LinphoneWaitingStart, 
     423        LinphoneWaitingProgress, 
     424        LinphoneWaitingFinished 
     425} LinphoneWaitingState; 
     426typedef void * (*Waiting)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress); 
    421427 
    422428typedef struct _LinphoneVTable 
     
    441447        GeneralStateChange general_state; 
    442448        DtmfReceived dtmf_received; 
     449        Waiting waiting; 
    443450} LinphoneCoreVTable; 
    444451 
     
    505512        gstate_t gstate_reg; 
    506513        gstate_t gstate_call; 
     514        void *wait_ctx; 
    507515        bool_t use_files; 
    508516        bool_t apply_nat_settings; 
     
    768776const char * linphone_core_get_route(LinphoneCore *lc); 
    769777bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **real_url, osip_to_t **real_parsed_url, char **route); 
     778void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose); 
     779void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses); 
     780void linphone_core_stop_waiting(LinphoneCore *lc); 
     781 
    770782 
    771783#ifdef __cplusplus 
  • linphone/coreapi/private.h

    r346 r371  
    128128 
    129129void linphone_core_write_friends_config(LinphoneCore* lc); 
     130void linphone_proxy_config_update(LinphoneProxyConfig *cfg); 
    130131 
    131132#endif /* _PRIVATE_H */ 
  • linphone/coreapi/proxy.c

    r355 r371  
    219219 
    220220void linphone_proxy_config_edit(LinphoneProxyConfig *obj){ 
    221         obj->frozen=TRUE; 
    222221        obj->auth_failures=0; 
    223222        if (obj->reg_sendregister){ 
     
    256255{ 
    257256        if (!linphone_proxy_config_check(obj->lc,obj)) return -1; 
    258         obj->frozen=FALSE; 
     257        obj->commit=TRUE; 
    259258        linphone_proxy_config_register(obj); 
    260259        linphone_proxy_config_write_all_to_config_file(obj->lc); 
     
    589588} 
    590589 
    591  
    592 void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type){ 
    593         SipSetup *ss=sip_setup_lookup(type); 
     590static void linphone_proxy_config_activate_sip_setup(LinphoneProxyConfig *cfg){ 
    594591        SipSetupContext *ssc; 
    595         if (cfg->type) 
    596                 ms_free(cfg->type); 
    597         cfg->type=ms_strdup(type); 
     592        SipSetup *ss=sip_setup_lookup(cfg->type); 
    598593        if (!ss) return ; 
    599594        ssc=sip_setup_context_new(ss,cfg); 
     595 
     596        if (cfg->reg_identity==NULL){ 
     597                ms_error("Invalid identity for this proxy configuration."); 
     598                return; 
     599        } 
    600600        if (sip_setup_context_login_account(ssc,cfg->reg_identity,NULL)==0){ 
    601601                if (sip_setup_context_get_capabilities(ssc) & SIP_SETUP_CAP_PROXY_PROVIDER){ 
     
    609609} 
    610610 
     611void linphone_proxy_config_update(LinphoneProxyConfig *cfg){ 
     612        if (cfg->commit){ 
     613                if (cfg->type && cfg->ssctx==NULL){ 
     614                        linphone_proxy_config_activate_sip_setup(cfg); 
     615                } 
     616                cfg->commit=FALSE; 
     617        } 
     618} 
     619 
     620void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type){ 
     621        if (cfg->type) 
     622                ms_free(cfg->type); 
     623        cfg->type=ms_strdup(type); 
     624        if (linphone_proxy_config_get_addr(cfg)==NULL){ 
     625                /*put a placeholder so that the sip setup gets saved into the config */ 
     626                linphone_proxy_config_set_server_addr(cfg,"sip:undefined"); 
     627        } 
     628} 
     629 
    611630SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg){ 
    612631        return cfg->ssctx; 
  • linphone/coreapi/sipsetup.c

    r344 r371  
    9999} 
    100100 
    101 int sip_setup_new_account(SipSetup *funcs, const char *uri, const char *passwd){ 
    102         if (funcs->create_account) 
    103                 return funcs->create_account(uri, passwd); 
     101int sip_setup_context_create_account(SipSetupContext * ctx, const char *uri, const char *passwd){ 
     102        if (ctx->funcs->create_account) 
     103                return ctx->funcs->create_account(ctx,uri, passwd); 
    104104        else return -1; 
    105105} 
  • linphone/coreapi/sipsetup.h

    r318 r371  
    7676        bool_t (*init)(void); 
    7777        void (*init_instance)(SipSetupContext *ctx); 
    78         int (*create_account)( const char *uri, const char *passwd); 
     78        int (*create_account)(SipSetupContext *ctx, const char *uri, const char *passwd); 
    7979        int (*login_account)(SipSetupContext *ctx, const char *uri, const char *passwd); 
    8080        int (*get_proxy)(SipSetupContext *ctx, const char *domain, char *proxy, size_t sz); 
     
    101101void sip_setup_unregister_all(void); 
    102102 
    103 int sip_setup_new_account(SipSetup *s, const char *uri, const char *passwd); 
    104103SipSetupContext * sip_setup_context_new(SipSetup *s, struct _LinphoneProxyConfig *cfg); 
     104int sip_setup_context_create_account(SipSetupContext *ctx, const char *uri, const char *passwd); 
    105105int sip_setup_context_get_capabilities(SipSetupContext *ctx); 
    106106int sip_setup_context_login_account(SipSetupContext * ctx, const char *uri, const char *passwd); 
  • linphone/gtk-glade/Makefile.am

    r293 r371  
    99                call_logs.glade \ 
    1010                log.glade \ 
    11                 buddylookup.glade 
     11                buddylookup.glade \ 
     12                waiting.glade 
    1213 
    1314PIXMAPS=        linphone2.png \ 
     
    3334                        update.c \ 
    3435                        buddylookup.c \ 
     36                        utils.c \ 
    3537                        linphone.h 
    3638 
  • linphone/gtk-glade/linphone.h

    r340 r371  
    6969SipSetupContext* linphone_gtk_get_default_sip_setup_context(void); 
    7070void linphone_gtk_show_buddy_lookup_window(SipSetupContext *ctx); 
     71void * linphone_gtk_wait(LinphoneCore *lc, void *ctx, LinphoneWaitingState ws, const char *purpose, float progress); 
  • linphone/gtk-glade/main.c

    r341 r371  
    7575        .call_log_updated=linphone_gtk_call_log_updated, 
    7676        .text_received=linphone_gtk_text_received, 
    77         .general_state=linphone_gtk_general_state 
     77        .general_state=linphone_gtk_general_state, 
     78        .waiting=linphone_gtk_wait 
    7879}; 
    7980 
  • linphone/mediastreamer2/configure.ac

    r353 r371  
    4545[  --enable-strict       Enable error on compilation warning [default=no]], 
    4646[wall_werror=$enableval], 
    47 [wall_werror=yes] 
     47[ 
     48        if test "$USER" = "smorlat" ; then 
     49                wall_werror=yes 
     50        else 
     51                wall_werror=no 
     52        fi 
     53] 
    4854) 
    4955 
  • linphone/mediastreamer2/tests/Makefile.am

    r348 r371  
    99videodisplay_SOURCES=videodisplay.c 
    1010mtudiscover_SOURCES=mtudiscover.c 
    11 becnh_SOURCES=bench.c 
     11bench_SOURCES=bench.c 
    1212 
    1313libexec_PROGRAMS=mediastream 
Note: See TracChangeset for help on using the changeset viewer.