Ignore:
Timestamp:
Mar 27, 2015 8:47:20 AM (7 years ago)
Author:
riza
Message:

Re #1833: Support bdSound's bdiMad v2.0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/bdimad_dev.c

    r4748 r5037  
    55 Author: bdSound Development Team (techsupport@bdsound.com) 
    66  
    7  Date: 30/10/2012 
    8  Version 1.0.206 
    9  
    10  Copyright (c) 2012 bdSound s.r.l. (www.bdsound.com) 
     7 Date: 12/03/2015 
     8 Version 2.0.0 rev.1618 
     9 
     10 Copyright (c) 2015 bdSound s.r.l. (www.bdsound.com) 
    1111 All Rights Reserved. 
    1212  
     
    3737/* Only mono mode */ 
    3838#define BD_IMAD_MAX_CHANNELS                1                                   
    39 /* Frequency default value (admitted 8000 Hz, 16000 Hz, 32000 Hz and 48000Hz) */ 
     39/* Frequency default value (admitted 8000 Hz, 16000 Hz, 32000 Hz, 44100 Hz and 48000 Hz) */ 
    4040#define BD_IMAD_DEFAULT_FREQ                48000                               
    4141/* Default milliseconds per buffer */ 
     
    4646#define BD_IMAD_STARTING_OUTPUT_VOLUME      100                                 
    4747/* Diagnostic Enable/Disable */ 
    48 #define BD_IMAD_DIAGNOSTIC                  BD_IMAD_DIAGNOSTIC_DISABLE          
     48#define BD_IMAD_DIAGNOSTIC                  BD_IMAD_DIAGNOSTIC_DISABLE 
    4949 
    5050/* Diagnostic folder path */  
    51 wchar_t * bdImadPjDiagnosticFolderPath   = L"";                                 
     51#define BD_IMAD_DIAGNOSTIC_PATH  "/mnt/sdcard/MUSIC/" 
     52 
     53static wchar_t bdImadPjDiagnosticFolderPath[200];                           
    5254 
    5355#define THIS_FILE            "bdimad_dev.c" 
     
    303305    for(i=0;i<captureDeviceCount;i++) { 
    304306        wf->dev_info[i].deviceId = i; 
    305         wf->dev_info[i].info.caps = PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING |  
    306                                     PJMEDIA_AUD_DEV_CAP_EC; 
     307                bdIMADpj_getDeviceCapabilities(BD_IMAD_CAPTURE_DEVICES,&wf->dev_info[i].info.caps); 
    307308        wf->dev_info[i].info.default_samples_per_sec = BD_IMAD_DEFAULT_FREQ; 
    308309        strcpy(wf->dev_info[i].info.driver, "BD_IMAD"); 
     
    318319    for(i=0;i<playbackDeviceCount;i++) { 
    319320        wf->dev_info[captureDeviceCount+i].deviceId = captureDeviceCount+i; 
    320         wf->dev_info[captureDeviceCount+i].info.caps =  
    321                                 PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE; 
     321                bdIMADpj_getDeviceCapabilities(BD_IMAD_PLAYBACK_DEVICES,&wf->dev_info[captureDeviceCount+i].info.caps); 
    322322        wf->dev_info[captureDeviceCount+i].info.default_samples_per_sec =  
    323323                                BD_IMAD_DEFAULT_FREQ; 
     
    707707    strm->bdIMADpjSettingsPtr->FrameSize_ms = ptime; 
    708708    strm->bdIMADpjSettingsPtr->DiagnosticEnable = BD_IMAD_DIAGNOSTIC; 
    709     strm->bdIMADpjSettingsPtr->DiagnosticFolderPath =  
    710                                             bdImadPjDiagnosticFolderPath; 
     709    mbstowcs(bdImadPjDiagnosticFolderPath, BD_IMAD_DIAGNOSTIC_PATH, strlen(BD_IMAD_DIAGNOSTIC_PATH)); 
     710    strm->bdIMADpjSettingsPtr->DiagnosticFolderPath = bdImadPjDiagnosticFolderPath; 
    711711    strm->bdIMADpjSettingsPtr->validate = (void *)manage_code; 
    712712 
    713713    if(prm->clock_rate != 8000 && prm->clock_rate != 16000  
    714            && prm->clock_rate != 32000 && prm->clock_rate != 48000) { 
     714           && prm->clock_rate != 32000 && prm->clock_rate != 44100 && prm->clock_rate != 48000) { 
    715715        PJ_LOG(4, (THIS_FILE,  
    716                    "BDIMAD support 8000 Hz, 16000 Hz, 32000 Hz and 48000 Hz " 
     716                   "BDIMAD support 8000 Hz, 16000 Hz, 32000 Hz, 44100 Hz and 48000 Hz " 
    717717                   "frequency.")); 
    718718    } 
     
    767767                              BD_PARAM_IMAD_PJ_MIC_CONTROL_ENABLE,  
    768768                              &auxInt); 
     769                 
     770                // Enable GUI Socket Communication [default->disabled] 
     771                bdIMADpj_enableGuiSocketCommunication(strm->bdIMADpjInstance,27000,0); 
    769772    } 
    770773 
     
    934937        if(cap == PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE) { 
    935938                pjmedia_aud_dev_route outputRoute = *(pjmedia_aud_dev_route*)pval; 
    936                 if(strm->param.output_route!=outputRoute) 
    937                         res = bdIMADpj_setRouteOutputDevice(strm->bdIMADpjInstance, (bdIMADpj_out_dev_route) outputRoute, &strm->bdIMADpjWarningPtr); 
     939                res = bdIMADpj_setRouteOutputDevice(strm->bdIMADpjInstance, (bdIMADpj_out_dev_route) outputRoute, &strm->bdIMADpjWarningPtr); 
    938940                if(res == BD_PJ_OK) { 
    939941                        strm->param.output_route = outputRoute; 
     
    12201222 
    12211223#if defined (_MSC_VER) 
    1222 #ifdef _DEBUG 
    1223 #pragma comment ( lib, "bdClientValidationd.lib" ) 
    1224 #pragma comment ( lib, "bdIMADpjd.lib" ) 
    1225 #else 
    12261224#pragma comment ( lib, "bdClientValidation.lib" ) 
    12271225#pragma comment ( lib, "bdIMADpj.lib" ) 
    12281226#endif 
    1229 #endif 
    12301227 
    12311228 
Note: See TracChangeset for help on using the changeset viewer.