Changeset 2461


Ignore:
Timestamp:
Feb 18, 2009 3:23:47 PM (11 years ago)
Author:
nanang
Message:
  • Updated audio route API for Symbian APS.
Location:
pjproject/branches/projects/aps-direct
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/symbian_sound_aps.h

    r2456 r2461  
    3232 
    3333/** 
    34  * Activate/deactivate loudspeaker, when loudspeaker is inactive, audio 
    35  * will be routed to earpiece. 
     34 * Set audio routing for APS sound device. 
    3635 * 
    3736 * @param stream        The sound device stream, the stream should be started  
    3837 *                      before calling this function. 
    39  * @param active        Specify PJ_TRUE to activate loudspeaker, and PJ_FALSE 
    40  *                      otherwise. 
     38 * @param route         Audio routing to be set. 
    4139 * 
    4240 * @return              PJ_SUCCESS on success. 
    4341 */ 
    44 PJ_DECL(pj_status_t) pjmedia_snd_aps_activate_loudspeaker( 
    45                                                 pjmedia_snd_stream *stream, 
    46                                                 pj_bool_t active); 
     42PJ_DECL(pj_status_t) pjmedia_snd_aps_set_route( pjmedia_snd_stream *stream, 
     43                                                pjmedia_snd_route route); 
    4744 
    4845PJ_END_DECL 
  • pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/symbian_sound_aps.cpp

    r2460 r2461  
    13991399 * Activate/deactivate loudspeaker. 
    14001400 */ 
    1401 PJ_DEF(pj_status_t) pjmedia_snd_aps_activate_loudspeaker( 
    1402                                         pjmedia_snd_stream *stream, 
    1403                                         pj_bool_t active) 
     1401PJ_DEF(pj_status_t) pjmedia_snd_aps_set_route( pjmedia_snd_stream *stream, 
     1402                                               pjmedia_snd_route route) 
    14041403{ 
    14051404    PJ_ASSERT_RETURN(stream && stream->engine, PJ_EINVAL); 
     1405 
     1406    TBool loudspk_active; 
    14061407     
    1407     TInt err = stream->engine->ActivateSpeaker(active); 
     1408    switch (route) { 
     1409    case PJMEDIA_SND_ROUTE_DEFAULT: 
     1410    case PJMEDIA_SND_ROUTE_EARPIECE: 
     1411        loudspk_active = EFalse; 
     1412        break; 
     1413    case PJMEDIA_SND_ROUTE_LOUDSPEAKER: 
     1414        loudspk_active = ETrue; 
     1415        break; 
     1416    default: 
     1417        return PJ_EINVAL; 
     1418    } 
     1419     
     1420    TInt err = stream->engine->ActivateSpeaker(loudspk_active); 
    14081421    if (err != KErrNone) 
    14091422        return PJ_RETURN_OS_ERROR(err); 
  • pjproject/branches/projects/aps-direct/pjsip-apps/src/symbian_ua/ua.cpp

    r2460 r2461  
    526526    case 't': 
    527527        do { 
    528             static pjmedia_snd_route route = PJMEDIA_SND_ROUTE_LOUDSPEAKER; 
    529              
    530             pjsua_set_snd_route(route); 
     528            static pjmedia_snd_route route = PJMEDIA_SND_ROUTE_DEFAULT; 
    531529             
    532530            if (route == PJMEDIA_SND_ROUTE_LOUDSPEAKER) 
     
    534532            else 
    535533                route = PJMEDIA_SND_ROUTE_LOUDSPEAKER; 
    536                  
     534 
     535            pjsua_set_snd_route(route); 
    537536        } while(0); 
    538537        break; 
  • pjproject/branches/projects/aps-direct/pjsip/src/pjsua-lib/pjsua_media.c

    r2460 r2461  
    25862586PJ_DEF(pj_status_t) pjsua_set_snd_route(pjmedia_snd_route route) 
    25872587{ 
     2588#if defined(PJ_SYMBIAN) || PJ_SYMBIAN==1 
     2589    pjmedia_snd_stream *strm; 
     2590 
     2591    if (!pjsua_var.snd_port) 
     2592        return PJ_ENOTFOUND; 
     2593 
     2594    strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 
     2595    return pjmedia_snd_aps_set_route(strm, route); 
     2596#else 
    25882597    PJ_UNUSED_ARG(route); 
    2589  
    2590     PJ_TODO(IMPLEMENT_SETTING_AUDIO_ROUTE); 
    25912598    return PJ_ENOTSUP; 
     2599#endif 
    25922600} 
    25932601 
Note: See TracChangeset for help on using the changeset viewer.