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

Ported pjmedia to WinCE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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; 
Note: See TracChangeset for help on using the changeset viewer.