Changeset 183


Ignore:
Timestamp:
Feb 14, 2006 9:08:51 PM (19 years ago)
Author:
bennylp
Message:

Ported pjmedia to WinCE

Location:
pjproject/trunk/pjmedia
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/build/pjmedia_codec.dsp

    r176 r183  
    4242# PROP Target_Dir "" 
    4343# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 
    44 # ADD CPP /nologo /W4 /GX /O2 /I "../include" /I "../../pjlib/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /YX /FD /c 
     44# ADD CPP /nologo /MD /W4 /GX /O2 /I "../include" /I "../../pjlib/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /YX /FD /c 
    4545# ADD BASE RSC /l 0x409 /d "NDEBUG" 
    4646# ADD RSC /l 0x409 /d "NDEBUG" 
  • pjproject/trunk/pjmedia/src/pjmedia/errno.c

    r162 r183  
    127127             
    128128            msg.ptr = (char*)err_str[first].msg; 
    129             msg.slen = pj_native_strlen(err_str[first].msg); 
     129            msg.slen = pj_ansi_strlen(err_str[first].msg); 
    130130 
    131131            errstr.ptr = buf; 
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/dsound_wrapper.c

    r65 r183  
    9696    return E_NOTIMPL; 
    9797} 
     98 
     99#ifndef _T 
     100#   define _T(s)    s 
     101#endif 
     102 
    98103/************************************************************************************/ 
    99104void DSW_InitializeDSoundEntryPoints(void) 
    100105{ 
    101     dswDSoundEntryPoints.hInstance_ = LoadLibrary("dsound.dll"); 
     106    dswDSoundEntryPoints.hInstance_ = LoadLibrary(_T("dsound.dll")); 
    102107    if( dswDSoundEntryPoints.hInstance_ != NULL ) 
    103108    { 
    104109        dswDSoundEntryPoints.DirectSoundCreate = 
    105110                (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN)) 
    106                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCreate" ); 
     111                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundCreate") ); 
    107112        if( dswDSoundEntryPoints.DirectSoundCreate == NULL ) 
    108113            dswDSoundEntryPoints.DirectSoundCreate = DummyDirectSoundCreate; 
     
    110115        dswDSoundEntryPoints.DirectSoundEnumerateW = 
    111116                (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) 
    112                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundEnumerateW" ); 
     117                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundEnumerateW") ); 
    113118        if( dswDSoundEntryPoints.DirectSoundEnumerateW == NULL ) 
    114119            dswDSoundEntryPoints.DirectSoundEnumerateW = DummyDirectSoundEnumerateW; 
     
    116121        dswDSoundEntryPoints.DirectSoundEnumerateA = 
    117122                (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) 
    118                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundEnumerateA" ); 
     123                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundEnumerateA") ); 
    119124        if( dswDSoundEntryPoints.DirectSoundEnumerateA == NULL ) 
    120125            dswDSoundEntryPoints.DirectSoundEnumerateA = DummyDirectSoundEnumerateA; 
     
    122127        dswDSoundEntryPoints.DirectSoundCaptureCreate = 
    123128                (HRESULT (WINAPI *)(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN)) 
    124                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureCreate" ); 
     129                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundCaptureCreate") ); 
    125130        if( dswDSoundEntryPoints.DirectSoundCaptureCreate == NULL ) 
    126131            dswDSoundEntryPoints.DirectSoundCaptureCreate = DummyDirectSoundCaptureCreate; 
     
    128133        dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = 
    129134                (HRESULT (WINAPI *)(LPDSENUMCALLBACKW, LPVOID)) 
    130                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateW" ); 
     135                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundCaptureEnumerateW") ); 
    131136        if( dswDSoundEntryPoints.DirectSoundCaptureEnumerateW == NULL ) 
    132137            dswDSoundEntryPoints.DirectSoundCaptureEnumerateW = DummyDirectSoundCaptureEnumerateW; 
     
    134139        dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = 
    135140                (HRESULT (WINAPI *)(LPDSENUMCALLBACKA, LPVOID)) 
    136                 GetProcAddress( dswDSoundEntryPoints.hInstance_, "DirectSoundCaptureEnumerateA" ); 
     141                GetProcAddress( dswDSoundEntryPoints.hInstance_, _T("DirectSoundCaptureEnumerateA") ); 
    137142        if( dswDSoundEntryPoints.DirectSoundCaptureEnumerateA == NULL ) 
    138143            dswDSoundEntryPoints.DirectSoundCaptureEnumerateA = DummyDirectSoundCaptureEnumerateA; 
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_ds.c

    r65 r183  
    6868#include "pa_cpuload.h" 
    6969#include "pa_process.h" 
    70  
    7170#include "dsound_wrapper.h" 
    7271 
     
    7675#endif 
    7776 
     77 
     78#include <pj/unicode.h> 
    7879 
    7980#define PRINT(x) /* { printf x; fflush(stdout); } */ 
     
    326327    DSDeviceNameAndGUIDVector *namesAndGUIDs = (DSDeviceNameAndGUIDVector*)lpContext; 
    327328    PaError error; 
     329    PJ_DECL_ANSI_TEMP_BUF(atemp,128) 
    328330 
    329331    (void) lpszDrvName; /* unused variable */ 
     
    353355 
    354356    namesAndGUIDs->items[namesAndGUIDs->count].name = 
    355             DuplicateDeviceNameString( namesAndGUIDs->allocations, lpszDesc ); 
     357            DuplicateDeviceNameString( namesAndGUIDs->allocations,  
     358            PJ_NATIVE_TO_STRING(lpszDesc,atemp,sizeof(atemp))); 
    356359    if( namesAndGUIDs->items[namesAndGUIDs->count].name == NULL ) 
    357360    { 
     
    10241027 
    10251028    /* Let user determine minimal latency by setting environment variable. */ 
     1029#ifdef UNDER_CE 
     1030    hresult = 0; 
     1031#else 
    10261032    hresult = GetEnvironmentVariable( PA_LATENCY_ENV_NAME, envbuf, PA_ENV_BUF_SIZE ); 
     1033#endif 
    10271034    if( (hresult > 0) && (hresult < PA_ENV_BUF_SIZE) ) 
    10281035    { 
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_util.c

    r65 r183  
    129129    else 
    130130    { 
     131#ifndef UNDER_CE 
    131132        return timeGetTime() * .001; 
     133#else 
     134        return GetTickCount() * .001; 
     135#endif 
    132136    } 
    133137} 
  • pjproject/trunk/pjmedia/src/pjmedia/portaudio/pa_win_wmme.c

    r65 r183  
    106106#include <windows.h> 
    107107#include <mmsystem.h> 
     108#ifndef UNDER_CE 
    108109#include <process.h> 
     110#endif 
    109111#include <assert.h> 
    110112/* PLB20010422 - "memory.h" doesn't work on CodeWarrior for PC. Thanks Mike Berry for the mod. */ 
     
    125127#include "pa_win_wmme.h" 
    126128 
    127 #if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ 
     129#include <pj/string.h> 
     130#include <pj/unicode.h> 
     131 
     132#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) && \ 
     133    !defined(UNDER_CE) 
     134/* MSC version 6 and above */ 
    128135#pragma comment(lib, "winmm.lib") 
    129136#endif 
     
    160167#define PA_MME_MIN_TIMEOUT_MSEC_        (1000) 
    161168 
    162 static const char constInputMapperSuffix_[] = " - Input"; 
    163 static const char constOutputMapperSuffix_[] = " - Output"; 
     169static const pj_char_t constInputMapperSuffix_[] = PJ_T(" - Input"); 
     170static const pj_char_t constOutputMapperSuffix_[] = PJ_T(" - Output"); 
    164171 
    165172/********************************************************************/ 
     
    553560    WAVEINCAPS wic; 
    554561    PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; 
     562    PJ_DECL_ANSI_TEMP_BUF(abuf,128) 
    555563     
    556564    *success = 0; 
     
    575583    { 
    576584        /* Append I/O suffix to WAVE_MAPPER device. */ 
    577         deviceName = (char *)PaUtil_GroupAllocateMemory( 
    578                     winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); 
     585        deviceName = (char*)PaUtil_GroupAllocateMemory( 
     586                    winMmeHostApi->allocations,  
     587                    pj_native_strlen( wic.szPname ) + sizeof(pj_char_t) + sizeof(constInputMapperSuffix_) ); 
    579588        if( !deviceName ) 
    580589        { 
     
    582591            goto error; 
    583592        } 
    584         strcpy( deviceName, wic.szPname ); 
    585         strcat( deviceName, constInputMapperSuffix_ ); 
     593        strcpy( deviceName, PJ_NATIVE_TO_STRING(wic.szPname,abuf,sizeof(abuf)) ); 
     594        strcat( deviceName, PJ_NATIVE_TO_STRING(constInputMapperSuffix_,abuf,sizeof(abuf)) ); 
    586595    } 
    587596    else 
    588597    { 
    589598        deviceName = (char*)PaUtil_GroupAllocateMemory( 
    590                     winMmeHostApi->allocations, strlen( wic.szPname ) + 1 ); 
     599                    winMmeHostApi->allocations, pj_native_strlen( wic.szPname ) + sizeof(pj_char_t) ); 
    591600        if( !deviceName ) 
    592601        { 
     
    594603            goto error; 
    595604        } 
    596         strcpy( deviceName, wic.szPname  ); 
     605        strcpy( deviceName, PJ_NATIVE_TO_STRING(wic.szPname,abuf,sizeof(abuf))  ); 
    597606    } 
    598607    deviceInfo->name = deviceName; 
     
    629638    WAVEOUTCAPS woc; 
    630639    PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; 
     640    PJ_DECL_ANSI_TEMP_BUF(abuf,128) 
    631641     
    632642    *success = 0; 
     
    652662        /* Append I/O suffix to WAVE_MAPPER device. */ 
    653663        deviceName = (char *)PaUtil_GroupAllocateMemory( 
    654                     winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); 
     664                    winMmeHostApi->allocations, pj_native_strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); 
    655665        if( !deviceName ) 
    656666        { 
     
    658668            goto error; 
    659669        } 
    660         strcpy( deviceName, woc.szPname ); 
    661         strcat( deviceName, constOutputMapperSuffix_ ); 
     670        strcpy( deviceName, PJ_NATIVE_TO_STRING(woc.szPname,abuf,sizeof(abuf)) ); 
     671        strcat( deviceName, PJ_NATIVE_TO_STRING(constOutputMapperSuffix_,abuf,sizeof(abuf)) ); 
    662672    } 
    663673    else 
    664674    { 
    665675        deviceName = (char*)PaUtil_GroupAllocateMemory( 
    666                     winMmeHostApi->allocations, strlen( woc.szPname ) + 1 ); 
     676                    winMmeHostApi->allocations, pj_native_strlen( woc.szPname ) + 1 ); 
    667677        if( !deviceName ) 
    668678        { 
     
    670680            goto error; 
    671681        } 
    672         strcpy( deviceName, woc.szPname  ); 
     682        strcpy( deviceName, PJ_NATIVE_TO_STRING(woc.szPname,abuf,sizeof(abuf))  ); 
    673683    } 
    674684    deviceInfo->name = deviceName; 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp.c

    r164 r183  
    169169 
    170170    name.ptr = (char*)c_name; 
    171     name.slen = pj_native_strlen(c_name); 
     171    name.slen = pj_ansi_strlen(c_name); 
    172172 
    173173    return pjmedia_sdp_attr_find(count, attr_array, &name, c_fmt); 
     
    199199 
    200200    attr_name.ptr = (char*)name; 
    201     attr_name.slen = pj_native_strlen(name); 
     201    attr_name.slen = pj_ansi_strlen(name); 
    202202 
    203203    for (i=0; i<*count; ) { 
Note: See TracChangeset for help on using the changeset viewer.