Ignore:
Timestamp:
Mar 10, 2009 1:32:09 PM (15 years ago)
Author:
nanang
Message:
  • updated APS set_cap() to store output volume setting into stream param.
  • updated APS get_param() to return actual volume setting.
  • updated symbian_ua application to use the new pjsua-lib APIs: snd_set/get_setting().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjsip-apps/src/symbian_ua/ua.cpp

    r2491 r2498  
    535535    case 't': 
    536536        { 
    537             pjmedia_aud_stream *aud_stream = pjsua_get_aud_stream(); 
    538  
    539             if (aud_stream) { 
    540                 pjmedia_aud_dev_route route; 
    541                 pj_status_t status; 
    542                  
    543                 status = pjmedia_aud_stream_get_cap( 
    544                                             aud_stream, 
    545                                             PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 
    546                                             &route); 
    547                 if (status == PJ_SUCCESS) { 
    548                     if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) 
    549                         route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 
    550                     else 
    551                         route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 
    552  
    553                     status = pjmedia_aud_stream_set_cap( 
    554                                         aud_stream, 
    555                                         PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 
    556                                         &route); 
    557                 } 
    558  
    559                 if (status != PJ_SUCCESS) 
    560                     pjsua_perror(THIS_FILE, "Error switch audio route", status); 
    561             } else { 
    562                 PJ_LOG(3,(THIS_FILE, "No active sound device.")); 
     537            pjmedia_aud_dev_route route; 
     538            pj_status_t status; 
     539             
     540            status = pjsua_snd_get_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE,  
     541                                           &route); 
     542             
     543            if (status == PJ_SUCCESS) { 
     544                if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) 
     545                    route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 
     546                else 
     547                    route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 
     548 
     549                status = pjsua_snd_set_setting( 
     550                                    PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 
     551                                    &route, PJ_TRUE); 
    563552            } 
     553 
     554            if (status != PJ_SUCCESS) 
     555                pjsua_perror(THIS_FILE, "Error switch audio route", status); 
    564556        } 
    565557        break; 
Note: See TracChangeset for help on using the changeset viewer.