Ignore:
Timestamp:
Oct 3, 2013 10:26:14 AM (11 years ago)
Author:
ming
Message:

Re #1697: Add device info in pj_get_sys_info() and set default clock rate for iPhone 5 running iOS7 to 44100Hz

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_info.c

    r4537 r4610  
    5858 
    5959#if defined(PJ_DARWINOS) && PJ_DARWINOS != 0 && TARGET_OS_IPHONE 
     60#   include <sys/types.h> 
     61#   include <sys/sysctl.h> 
    6062    void pj_iphone_os_get_sys_info(pj_sys_info *si, pj_str_t *si_buffer); 
    6163#endif 
     
    152154    { 
    153155        pj_str_t buf = {si_buffer + PJ_SYS_INFO_BUFFER_SIZE - left, left}; 
    154         pj_str_t machine = {"arm", 3}; 
     156        pj_str_t machine = {"arm-", 4}; 
    155157        pj_str_t sdk_name = {"iOS-SDK", 7}; 
     158        size_t size = PJ_SYS_INFO_BUFFER_SIZE - machine.slen; 
    156159        char tmp[PJ_SYS_INFO_BUFFER_SIZE]; 
    157          
     160        int name[] = {CTL_HW,HW_MACHINE}; 
     161 
    158162        pj_iphone_os_get_sys_info(&si, &buf); 
    159163        left -= si.os_name.slen + 1; 
    160164 
    161165        si.os_ver = parse_version(si.machine.ptr); 
    162          
    163         si.machine = machine; 
     166 
     167        pj_memcpy(tmp, machine.ptr, machine.slen); 
     168        sysctl(name, 2, tmp+machine.slen, &size, NULL, 0); 
     169        ALLOC_CP_STR(tmp, machine); 
    164170        si.sdk_name = sdk_name; 
    165171 
Note: See TracChangeset for help on using the changeset viewer.