Changeset 121 for pjproject


Ignore:
Timestamp:
Jan 18, 2006 11:12:57 PM (19 years ago)
Author:
bennylp
Message:

Compiled cleanly first time for the new pjlib

Location:
pjproject/trunk/pjmedia
Files:
2 added
4 deleted
16 edited
12 moved

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/build

    • Property svn:ignore set to
      *.ncb
      *.opt
  • pjproject/trunk/pjmedia/build/output

    • Property svn:ignore set to
      *
  • pjproject/trunk/pjmedia/build/pjaut.dsp

    r112 r121  
    1 # Microsoft Developer Studio Project File - Name="pjmedia_audio_tool" - Package Owner=<4> 
     1# Microsoft Developer Studio Project File - Name="pjaut" - Package Owner=<4> 
    22# Microsoft Developer Studio Generated Build File, Format Version 6.00 
    33# ** DO NOT EDIT ** 
     
    55# TARGTYPE "Win32 (x86) Console Application" 0x0103 
    66 
    7 CFG=pjmedia_audio_tool - Win32 Debug 
     7CFG=pjaut - Win32 Debug 
    88!MESSAGE This is not a valid makefile. To build this project using NMAKE, 
    99!MESSAGE use the Export Makefile command and run 
    1010!MESSAGE  
    11 !MESSAGE NMAKE /f "pjmedia_audio_tool.mak". 
     11!MESSAGE NMAKE /f "pjaut.mak". 
    1212!MESSAGE  
    1313!MESSAGE You can specify a configuration when running NMAKE 
    1414!MESSAGE by defining the macro CFG on the command line. For example: 
    1515!MESSAGE  
    16 !MESSAGE NMAKE /f "pjmedia_audio_tool.mak" CFG="pjmedia_audio_tool - Win32 Debug" 
     16!MESSAGE NMAKE /f "pjaut.mak" CFG="pjaut - Win32 Debug" 
    1717!MESSAGE  
    1818!MESSAGE Possible choices for configuration are: 
    1919!MESSAGE  
    20 !MESSAGE "pjmedia_audio_tool - Win32 Release" (based on "Win32 (x86) Console Application") 
    21 !MESSAGE "pjmedia_audio_tool - Win32 Debug" (based on "Win32 (x86) Console Application") 
     20!MESSAGE "pjaut - Win32 Release" (based on "Win32 (x86) Console Application") 
     21!MESSAGE "pjaut - Win32 Debug" (based on "Win32 (x86) Console Application") 
    2222!MESSAGE  
    2323 
     
    2929RSC=rc.exe 
    3030 
    31 !IF  "$(CFG)" == "pjmedia_audio_tool - Win32 Release" 
     31!IF  "$(CFG)" == "pjaut - Win32 Release" 
    3232 
    3333# PROP BASE Use_MFC 0 
    3434# PROP BASE Use_Debug_Libraries 0 
    35 # PROP BASE Output_Dir ".\output\pjmedia_audio_tool_vc6_Release" 
    36 # PROP BASE Intermediate_Dir ".\output\pjmedia_audio_tool_vc6_Release" 
     35# PROP BASE Output_Dir ".\output\pjaut_i386_win32_vc6_release" 
     36# PROP BASE Intermediate_Dir ".\output\pjaut_i386_win32_vc6_release" 
    3737# PROP BASE Target_Dir "" 
    3838# PROP Use_MFC 0 
    3939# PROP Use_Debug_Libraries 0 
    40 # PROP Output_Dir ".\output\pjmedia_audio_tool_vc6_Release" 
    41 # PROP Intermediate_Dir ".\output\pjmedia_audio_tool_vc6_Release" 
     40# PROP Output_Dir ".\output\pjaut_i386_win32_vc6_release" 
     41# PROP Intermediate_Dir ".\output\pjaut_i386_win32_vc6_release" 
    4242# PROP Ignore_Export_Lib 0 
    4343# PROP Target_Dir "" 
     
    5353# ADD LINK32 dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../bin/pjaut_vc6.exe" 
    5454 
    55 !ELSEIF  "$(CFG)" == "pjmedia_audio_tool - Win32 Debug" 
     55!ELSEIF  "$(CFG)" == "pjaut - Win32 Debug" 
    5656 
    5757# PROP BASE Use_MFC 0 
    5858# PROP BASE Use_Debug_Libraries 1 
    59 # PROP BASE Output_Dir ".\output\pjmedia_audio_tool_vc6_Debug" 
    60 # PROP BASE Intermediate_Dir ".\output\pjmedia_audio_tool_vc6_Debug" 
     59# PROP BASE Output_Dir ".\output\pjaut_i386_win32_vc6_debug" 
     60# PROP BASE Intermediate_Dir ".\output\pjaut_i386_win32_vc6_debug" 
    6161# PROP BASE Target_Dir "" 
    6262# PROP Use_MFC 0 
    6363# PROP Use_Debug_Libraries 1 
    64 # PROP Output_Dir ".\output\pjmedia_audio_tool_vc6_Debug" 
    65 # PROP Intermediate_Dir ".\output\pjmedia_audio_tool_vc6_Debug" 
     64# PROP Output_Dir ".\output\pjaut_i386_win32_vc6_debug" 
     65# PROP Intermediate_Dir ".\output\pjaut_i386_win32_vc6_debug" 
    6666# PROP Ignore_Export_Lib 0 
    6767# PROP Target_Dir "" 
     
    8181# Begin Target 
    8282 
    83 # Name "pjmedia_audio_tool - Win32 Release" 
    84 # Name "pjmedia_audio_tool - Win32 Debug" 
     83# Name "pjaut - Win32 Release" 
     84# Name "pjaut - Win32 Debug" 
    8585# Begin Group "Source Files" 
    8686 
  • pjproject/trunk/pjmedia/build/pjmedia.dsp

    r65 r121  
    3333# PROP BASE Use_MFC 0 
    3434# PROP BASE Use_Debug_Libraries 0 
    35 # PROP BASE Output_Dir ".\output\pjmedia_vc6_Release" 
    36 # PROP BASE Intermediate_Dir ".\output\pjmedia_vc6_Release" 
     35# PROP BASE Output_Dir ".\output\pjmedia_i386_win32_vc6_release" 
     36# PROP BASE Intermediate_Dir ".\output\pjmedia_i386_win32_vc6_release" 
    3737# PROP BASE Target_Dir "" 
    3838# PROP Use_MFC 0 
    3939# PROP Use_Debug_Libraries 0 
    40 # PROP Output_Dir ".\output\pjmedia_vc6_Release" 
    41 # PROP Intermediate_Dir ".\output\pjmedia_vc6_Release" 
     40# PROP Output_Dir ".\output\pjmedia_i386_win32_vc6_release" 
     41# PROP Intermediate_Dir ".\output\pjmedia_i386_win32_vc6_release" 
    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 /MD /W4 /GX /O2 /I "../../pjlib/src" /I "../src" /I "../../pjsdp/src" /I "../src/pjmedia/portaudio" /D "NDEBUG" /D "PA_NO_ASIO" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c 
     44# ADD CPP /nologo /MD /W4 /GX /O2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../src/pjmedia/portaudio" /D "NDEBUG" /D "PA_NO_ASIO" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FD /c 
    4545# SUBTRACT CPP /YX 
    4646# ADD BASE RSC /l 0x409 /d "NDEBUG" 
     
    5757# PROP BASE Use_MFC 0 
    5858# PROP BASE Use_Debug_Libraries 1 
    59 # PROP BASE Output_Dir ".\output\pjmedia_vc6_Debug" 
    60 # PROP BASE Intermediate_Dir ".\output\pjmedia_vc6_Debug" 
     59# PROP BASE Output_Dir ".\output\pjmedia_i386_win32_vc6_debug" 
     60# PROP BASE Intermediate_Dir ".\output\pjmedia_i386_win32_vc6_debug" 
    6161# PROP BASE Target_Dir "" 
    6262# PROP Use_MFC 0 
    6363# PROP Use_Debug_Libraries 1 
    64 # PROP Output_Dir ".\output\pjmedia_vc6_Debug" 
    65 # PROP Intermediate_Dir ".\output\pjmedia_vc6_Debug" 
     64# PROP Output_Dir ".\output\pjmedia_i386_win32_vc6_debug" 
     65# PROP Intermediate_Dir ".\output\pjmedia_i386_win32_vc6_debug" 
    6666# PROP Target_Dir "" 
    6767# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 
    68 # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../../pjlib/src" /I "../src" /I "../../pjsdp/src" /I "../src/pjmedia/portaudio" /D "_DEBUG" /D "PA_NO_ASIO" /D "WIN32" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c 
     68# ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../src/pjmedia/portaudio" /D "_DEBUG" /D "PA_NO_ASIO" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /GZ /c 
    6969# SUBTRACT CPP /YX 
    7070# ADD BASE RSC /l 0x409 /d "_DEBUG" 
     
    142142# Begin Source File 
    143143 
    144 SOURCE=..\src\pjmedia\codec.h 
    145 # End Source File 
    146 # Begin Source File 
    147  
    148 SOURCE=..\src\pjmedia\config.h 
    149 # End Source File 
    150 # Begin Source File 
    151  
    152 SOURCE=..\src\pjmedia\jbuf.h 
    153 # End Source File 
    154 # Begin Source File 
    155  
    156 SOURCE=..\src\pjmedia\mediamgr.h 
    157 # End Source File 
    158 # Begin Source File 
    159  
    160 SOURCE=..\src\pjmedia.h 
    161 # End Source File 
    162 # Begin Source File 
    163  
    164 SOURCE=..\src\pjmedia\rtcp.h 
    165 # End Source File 
    166 # Begin Source File 
    167  
    168 SOURCE=..\src\pjmedia\rtp.h 
    169 # End Source File 
    170 # Begin Source File 
    171  
    172 SOURCE=..\src\pjmedia\sdp.h 
    173 # End Source File 
    174 # Begin Source File 
    175  
    176 SOURCE=..\src\pjmedia\session.h 
    177 # End Source File 
    178 # Begin Source File 
    179  
    180 SOURCE=..\src\pjmedia\sound.h 
    181 # End Source File 
    182 # Begin Source File 
    183  
    184 SOURCE=..\src\pjmedia\stream.h 
     144SOURCE=..\include\pjmedia\codec.h 
     145# End Source File 
     146# Begin Source File 
     147 
     148SOURCE=..\include\pjmedia\config.h 
     149# End Source File 
     150# Begin Source File 
     151 
     152SOURCE=..\include\pjmedia\jbuf.h 
     153# End Source File 
     154# Begin Source File 
     155 
     156SOURCE=..\include\pjmedia\mediamgr.h 
     157# End Source File 
     158# Begin Source File 
     159 
     160SOURCE=..\include\pjmedia.h 
     161# End Source File 
     162# Begin Source File 
     163 
     164SOURCE=..\include\pjmedia\rtcp.h 
     165# End Source File 
     166# Begin Source File 
     167 
     168SOURCE=..\include\pjmedia\rtp.h 
     169# End Source File 
     170# Begin Source File 
     171 
     172SOURCE=..\include\pjmedia\sdp.h 
     173# End Source File 
     174# Begin Source File 
     175 
     176SOURCE=..\include\pjmedia\session.h 
     177# End Source File 
     178# Begin Source File 
     179 
     180SOURCE=..\include\pjmedia\sound.h 
     181# End Source File 
     182# Begin Source File 
     183 
     184SOURCE=..\include\pjmedia\stream.h 
    185185# End Source File 
    186186# End Group 
  • pjproject/trunk/pjmedia/build/pjmedia.dsw

    r65 r121  
    44############################################################################### 
    55 
    6 Project: "pjaudio_tool"=.\pjaudio_tool.dsp - Package Owner=<4> 
     6Project: "pjaut"=.\pjaut.dsp - Package Owner=<4> 
    77 
    88Package=<5> 
    99{{{ 
    10     begin source code control 
    11     "$/pjproject/pjmedia/build", TKAAAAAA 
    12     . 
    13     end source code control 
    1410}}} 
    1511 
     
    3026Package=<5> 
    3127{{{ 
    32     begin source code control 
    33     "$/pjproject/pjmedia/build", TKAAAAAA 
    34     . 
    35     end source code control 
     28}}} 
     29 
     30Package=<4> 
     31{{{ 
     32}}} 
     33 
     34############################################################################### 
     35 
     36Project: "pjlib_util"="..\..\pjlib-util\build\pjlib_util.dsp" - Package Owner=<4> 
     37 
     38Package=<5> 
     39{{{ 
    3640}}} 
    3741 
     
    4650Package=<5> 
    4751{{{ 
    48     begin source code control 
    49     "$/pjproject/pjmedia/build", TKAAAAAA 
    50     . 
    51     end source code control 
    5252}}} 
    5353 
     
    6565Package=<5> 
    6666{{{ 
    67     begin source code control 
    68     "$/pjproject/pjmedia/build", TKAAAAAA 
    69     . 
    70     end source code control 
    7167}}} 
    7268 
     
    9086Package=<5> 
    9187{{{ 
    92     begin source code control 
    93     "$/pjproject/pjmedia/build", TKAAAAAA 
    94     . 
    95     end source code control 
    9688}}} 
    9789 
  • pjproject/trunk/pjmedia/include/pjmedia.h

    • Property svn:keywords set to Id
    r112 r121  
    1 /* $Id$ 
     1/* $Id$ */ 
     2/*  
     3 * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org> 
    24 * 
    3  */ 
    4 /*  
    5  * PJMEDIA - Multimedia over IP Stack  
    6  * (C)2003-2005 Benny Prijono <bennylp@bulukucing.org> 
     5 * This program is free software; you can redistribute it and/or modify 
     6 * it under the terms of the GNU General Public License as published by 
     7 * the Free Software Foundation; either version 2 of the License, or 
     8 * (at your option) any later version. 
    79 * 
    8  * Author: 
    9  *  Benny Prijono <bennylp@bulukucing.org> 
     10 * This program is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * GNU General Public License for more details. 
    1014 * 
    11  * This library is free software; you can redistribute it and/or 
    12  * modify it under the terms of the GNU Lesser General Public 
    13  * License as published by the Free Software Foundation; either 
    14  * version 2.1 of the License, or (at your option) any later version. 
    15  *  
    16  * This library is distributed in the hope that it will be useful, 
    17  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
    19  * Lesser General Public License for more details. 
    20  *  
    21  * You should have received a copy of the GNU Lesser General Public 
    22  * License along with this library; if not, write to the Free Software 
    23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     15 * You should have received a copy of the GNU General Public License 
     16 * along with this program; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    2418 */ 
    2519#ifndef __PJMEDIA_H__ 
  • pjproject/trunk/pjmedia/include/pjmedia/codec.h

    • Property svn:keywords set to Id
    r112 r121  
    215215{ 
    216216    /** Entries to put this codec instance in codec factory's list. */ 
    217     PJ_DECL_LIST_MEMBER(struct pj_codec) 
     217    PJ_DECL_LIST_MEMBER(struct pj_codec); 
    218218 
    219219    /** Codec's private data. */ 
     
    283283{ 
    284284    /** Entries to put this structure in the codec manager list. */ 
    285     PJ_DECL_LIST_MEMBER(struct pj_codec_factory) 
     285    PJ_DECL_LIST_MEMBER(struct pj_codec_factory); 
    286286 
    287287    /** The factory's private data. */ 
  • pjproject/trunk/pjmedia/include/pjmedia/config.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/jbuf.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/mediamgr.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/rtcp.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/rtp.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/sdp.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/session.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/sound.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/include/pjmedia/stream.h

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/src/pjmedia/codec.c

    • Property svn:keywords set to Id
    r65 r121  
    2020#include <pj/pool.h> 
    2121#include <pj/string.h> 
     22#include <pj/assert.h> 
    2223#include <pj/log.h> 
    2324 
     
    6667PJ_DEF(void) pj_codec_mgr_unregister_factory (pj_codec_mgr *mgr, pj_codec_factory *factory) 
    6768{ 
    68     PJ_UNUSED_ARG(mgr) 
     69    PJ_UNUSED_ARG(mgr); 
    6970    pj_list_erase(factory); 
    7071    enum_all_codecs (mgr); 
     
    101102PJ_DEF(void) pj_codec_mgr_dealloc_codec (pj_codec_mgr *mgr, pj_codec *codec) 
    102103{ 
    103     PJ_UNUSED_ARG(mgr) 
     104    PJ_UNUSED_ARG(mgr); 
    104105    (*codec->factory->op->dealloc_codec)(codec->factory, codec); 
    105106} 
  • pjproject/trunk/pjmedia/src/pjmedia/dsound.c

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/src/pjmedia/g711.c

    • Property svn:keywords set to Id
    r65 r121  
    2323#include <pj/pool.h> 
    2424#include <pj/string.h> 
    25 #include <string.h>     /* memset */ 
     25#include <pj/assert.h> 
     26 
    2627 
    2728#define G711_BPS        64000 
     
    129130static pj_status_t g711_match_id( pj_codec_factory *factory, const pj_codec_id *id ) 
    130131{ 
    131     PJ_UNUSED_ARG(factory) 
     132    PJ_UNUSED_ARG(factory); 
    132133 
    133134    /* It's sufficient to check payload type only. */ 
     
    139140                                      pj_codec_attr *attr ) 
    140141{ 
    141     PJ_UNUSED_ARG(factory) 
     142    PJ_UNUSED_ARG(factory); 
    142143 
    143144    memset(attr, 0, sizeof(pj_codec_attr)); 
     
    156157                                  unsigned count, pj_codec_id codecs[]) 
    157158{ 
    158     PJ_UNUSED_ARG(factory) 
     159    PJ_UNUSED_ARG(factory); 
    159160 
    160161    if (count > 0) { 
     
    230231{ 
    231232    /* There's nothing to do here really */ 
    232     PJ_UNUSED_ARG(codec) 
    233     PJ_UNUSED_ARG(pool) 
     233    PJ_UNUSED_ARG(codec); 
     234    PJ_UNUSED_ARG(pool); 
    234235 
    235236    return PJ_SUCCESS; 
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.c

    • Property svn:keywords set to Id
    r65 r121  
    2020#include <pj/log.h> 
    2121#include <pj/pool.h> 
    22 #include <string.h>     /* memset() */ 
     22#include <pj/assert.h> 
     23#include <pj/string.h> 
     24 
    2325 
    2426/* 
     
    6870    PJ_LOG(5, (THIS_FILE, "..pj_frame_list_init [lst=%p], maxcount=%d", lst, maxcount)); 
    6971 
    70     memset(lst, 0, sizeof(*lst)); 
     72    pj_memset(lst, 0, sizeof(*lst)); 
    7173    lst->maxcount = maxcount; 
    7274    lst->frames = pj_pool_calloc( pool, maxcount, sizeof(*lst->frames) ); 
  • pjproject/trunk/pjmedia/src/pjmedia/mediamgr.c

    • Property svn:keywords set to Id
  • pjproject/trunk/pjmedia/src/pjmedia/nullsound.c

    • Property svn:keywords set to Id
    r65 r121  
    1818 */ 
    1919#include <pjmedia/sound.h> 
     20#include <pj/assert.h> 
    2021 
    21 /* 
    22  * Null Factory Operations 
    23  */ 
    24 static pj_status_t null_sound_init(void); 
    25 static const char *null_sound_get_name(void); 
    26 static pj_status_t null_sound_destroy(void); 
    27 static pj_status_t null_sound_enum_devices(int *count, char *dev_names[]); 
    28 static pj_status_t null_sound_create_dev(const char *dev_name, pj_snd_dev *dev); 
    29 static pj_status_t null_sound_destroy_dev(pj_snd_dev *dev); 
     22static pj_snd_dev_info null_info =  
     23{ 
     24    "Null Device", 
     25    1, 
     26    1, 
     27    8000 
     28}; 
    3029 
    3130 
    32 /* 
    33  * Null Device Operations 
    34  */ 
    35 static pj_status_t null_sound_dev_open( pj_snd_dev *dev, pj_snd_role_t role ); 
    36 static pj_status_t null_sound_dev_close( pj_snd_dev *dev ); 
    37 static pj_status_t null_sound_dev_play( pj_snd_dev *dev ); 
    38 static pj_status_t null_sound_dev_record( pj_snd_dev *dev ); 
    39  
    40  
    41 static pj_snd_dev_factory null_sound_factory =  
     31PJ_DEF(pj_status_t) pj_snd_init(pj_pool_factory *factory) 
    4232{ 
    43     &null_sound_init, 
    44     &null_sound_get_name, 
    45     &null_sound_destroy, 
    46     &null_sound_enum_devices, 
    47     &null_sound_create_dev, 
    48     &null_sound_destroy_dev 
    49 }; 
    50  
    51 static struct pj_snd_dev_op null_sound_dev_op =  
    52 { 
    53     &null_sound_dev_open, 
    54     &null_sound_dev_close, 
    55     &null_sound_dev_play, 
    56     &null_sound_dev_record 
    57 }; 
    58  
    59 PJ_DEF(pj_snd_dev_factory*) pj_nullsound_get_factory() 
    60 { 
    61     return &null_sound_factory; 
     33    PJ_UNUSED_ARG(factory); 
     34    return PJ_SUCCESS; 
    6235} 
    6336 
    64 static pj_status_t null_sound_init(void) 
     37PJ_DEF(int) pj_snd_get_dev_count(void) 
    6538{ 
    66     return 0; 
     39    return 1; 
    6740} 
    6841 
    69 static const char *null_sound_get_name(void) 
     42PJ_DEF(const pj_snd_dev_info*) pj_snd_get_dev_info(unsigned index) 
    7043{ 
    71     return "nullsound"; 
     44    PJ_ASSERT_RETURN(index==0, NULL); 
     45    return &null_info; 
    7246} 
    7347 
    74 static pj_status_t null_sound_destroy(void) 
     48PJ_DEF(pj_snd_stream*) pj_snd_open_recorder( int index, 
     49                                             const pj_snd_stream_info *param, 
     50                                             pj_snd_rec_cb rec_cb, 
     51                                             void *user_data) 
    7552{ 
    76     return 0; 
     53    PJ_UNUSED_ARG(index); 
     54    PJ_UNUSED_ARG(param); 
     55    PJ_UNUSED_ARG(rec_cb); 
     56    PJ_UNUSED_ARG(user_data); 
     57    return (void*)1; 
    7758} 
    7859 
    79 static pj_status_t null_sound_enum_devices(int *count, char *dev_names[]) 
     60PJ_DEF(pj_snd_stream*) pj_snd_open_player( int index, 
     61                                           const pj_snd_stream_info *param, 
     62                                           pj_snd_play_cb play_cb, 
     63                                           void *user_data) 
    8064{ 
    81     *count = 1; 
    82     dev_names[0] = "nullsound"; 
    83     return 0; 
     65    PJ_UNUSED_ARG(index); 
     66    PJ_UNUSED_ARG(param); 
     67    PJ_UNUSED_ARG(play_cb); 
     68    PJ_UNUSED_ARG(user_data); 
     69    return (void*)1; 
    8470} 
    8571 
    86 static pj_status_t null_sound_create_dev(const char *dev_name, pj_snd_dev *dev) 
     72PJ_DEF(pj_status_t) pj_snd_stream_start(pj_snd_stream *stream) 
    8773{ 
    88     PJ_UNUSED_ARG(dev_name); 
    89     dev->op = &null_sound_dev_op; 
    90     return 0; 
     74    PJ_UNUSED_ARG(stream); 
     75    return PJ_SUCCESS; 
    9176} 
    9277 
    93 static pj_status_t null_sound_destroy_dev(pj_snd_dev *dev) 
     78PJ_DEF(pj_status_t) pj_snd_stream_stop(pj_snd_stream *stream) 
    9479{ 
    95     PJ_UNUSED_ARG(dev); 
    96     return 0; 
     80    PJ_UNUSED_ARG(stream); 
     81    return PJ_SUCCESS; 
    9782} 
    9883 
    99  
    100 /* 
    101  * Null Device Operations 
    102  */ 
    103 static pj_status_t null_sound_dev_open( pj_snd_dev *dev, pj_snd_role_t role ) 
     84PJ_DEF(pj_status_t) pj_snd_stream_close(pj_snd_stream *stream) 
    10485{ 
    105     PJ_UNUSED_ARG(dev); 
    106     PJ_UNUSED_ARG(role); 
    107     return 0; 
     86    PJ_UNUSED_ARG(stream); 
     87    return PJ_SUCCESS; 
    10888} 
    10989 
    110 static pj_status_t null_sound_dev_close( pj_snd_dev *dev ) 
     90PJ_DEF(pj_status_t) pj_snd_deinit(void) 
    11191{ 
    112     PJ_UNUSED_ARG(dev); 
    113     return 0; 
     92    return PJ_SUCCESS; 
    11493} 
    115  
    116 static pj_status_t null_sound_dev_play( pj_snd_dev *dev ) 
    117 { 
    118     PJ_UNUSED_ARG(dev); 
    119     return 0; 
    120 } 
    121  
    122 static pj_status_t null_sound_dev_record( pj_snd_dev *dev ) 
    123 { 
    124     PJ_UNUSED_ARG(dev); 
    125     return 0; 
    126 } 
    127  
  • pjproject/trunk/pjmedia/src/pjmedia/pasound.c

    • Property svn:keywords set to Id
    r65 r121  
    6161    pj_status_t status; 
    6262 
    63     PJ_UNUSED_ARG(output) 
    64     PJ_UNUSED_ARG(timeInfo) 
     63    PJ_UNUSED_ARG(output); 
     64    PJ_UNUSED_ARG(timeInfo); 
    6565 
    6666    if (stream->quit_flag) 
     
    6868 
    6969    if (stream->thread_initialized == 0) { 
    70         stream->thread = pj_thread_register("pa_rec", stream->thread_desc); 
     70        status = pj_thread_register("pa_rec", stream->thread_desc, &stream->thread); 
    7171        stream->thread_initialized = 1; 
    7272    } 
     
    101101    unsigned size = frameCount * stream->bytes_per_sample; 
    102102 
    103     PJ_UNUSED_ARG(input) 
    104     PJ_UNUSED_ARG(timeInfo) 
     103    PJ_UNUSED_ARG(input); 
     104    PJ_UNUSED_ARG(timeInfo); 
    105105 
    106106    if (stream->quit_flag) 
     
    108108 
    109109    if (stream->thread_initialized == 0) { 
    110         stream->thread = pj_thread_register("pa_rec", stream->thread_desc); 
     110        status = pj_thread_register("pa_rec", stream->thread_desc, &stream->thread); 
    111111        stream->thread_initialized = 1; 
    112112    } 
  • pjproject/trunk/pjmedia/src/pjmedia/rtcp.c

    r66 r121  
    2020#include <pj/os.h>      /* pj_gettimeofday */ 
    2121#include <pj/sock.h>    /* pj_htonx, pj_ntohx */ 
    22 #include <string.h>     /* memset */ 
     22#include <pj/string.h>  /* pj_memset */ 
     23 
    2324 
    2425#define RTCP_SR   200 
     
    4748    pj_rtcp_pkt *rtcp_pkt = &s->rtcp_pkt; 
    4849     
    49     memset(rtcp_pkt, 0, sizeof(pj_rtcp_pkt)); 
     50    pj_memset(rtcp_pkt, 0, sizeof(pj_rtcp_pkt)); 
    5051     
    5152    /* Init time */ 
     
    6869{ 
    6970    /* Nothing to do. */ 
    70     PJ_UNUSED_ARG(session) 
     71    PJ_UNUSED_ARG(session); 
    7172} 
    7273 
  • pjproject/trunk/pjmedia/src/pjmedia/rtp.c

    r66 r121  
    2121#include <pj/os.h>      /* pj_gettimeofday() */ 
    2222#include <pj/sock.h>    /* pj_htonx, pj_htonx */ 
    23 #include <string.h>     /* memset() */ 
     23#include <pj/assert.h> 
     24#include <pj/string.h> 
     25 
    2426 
    2527#define THIS_FILE   "rtp.c" 
     
    6264 
    6365    /* Build default header for outgoing RTP packet. */ 
    64     memset(ses, 0, sizeof(*ses)); 
     66    pj_memset(ses, 0, sizeof(*ses)); 
    6567    ses->out_hdr.v = RTP_VERSION; 
    6668    ses->out_hdr.p = 0; 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp.c

    r66 r121  
    1818 */ 
    1919#include <pjmedia/sdp.h> 
    20 #include <pj/scanner.h> 
     20#include <pjlib-util/scanner.h> 
    2121#include <pj/except.h> 
    2222#include <pj/log.h> 
     
    2424#include <pj/string.h> 
    2525#include <pj/pool.h> 
     26#include <pj/assert.h> 
    2627 
    2728enum { 
     
    124125 */ 
    125126static int is_initialized; 
    126 static pj_char_spec cs_token; 
     127static pj_cis_buf_t cis_buf; 
     128static pj_cis_t cs_token; 
    127129 
    128130static void init_sdp_parser(void) 
     
    134136        } 
    135137    } 
    136     pj_cs_add_alpha(cs_token); 
    137     pj_cs_add_num(cs_token); 
    138     pj_cs_add_str( cs_token, TOKEN); 
     138 
     139    pj_cis_buf_init(&cis_buf); 
     140    pj_cis_init(&cis_buf, &cs_token); 
     141    pj_cis_add_alpha(&cs_token); 
     142    pj_cis_add_num(&cs_token); 
     143    pj_cis_add_str(&cs_token, TOKEN); 
    139144} 
    140145 
     
    203208static int print_name_only_attr(const pjsdp_attr *attr, char *buf, int len) 
    204209{ 
    205     PJ_UNUSED_ARG(attr) 
    206     PJ_UNUSED_ARG(buf) 
    207     PJ_UNUSED_ARG(len) 
     210    PJ_UNUSED_ARG(attr); 
     211    PJ_UNUSED_ARG(buf); 
     212    PJ_UNUSED_ARG(len); 
    208213    return 0; 
    209214} 
     
    707712 
    708713    /* port */ 
    709     pj_scan_get(scanner, cs_token, &str); 
     714    pj_scan_get(scanner, &cs_token, &str); 
    710715    med->desc.port = (unsigned short)pj_strtoul(&str); 
    711     if (*scanner->current == '/') { 
     716    if (*scanner->curptr == '/') { 
    712717        /* port count */ 
    713718        pj_scan_get_char(scanner); 
    714         pj_scan_get(scanner, cs_token, &str); 
     719        pj_scan_get(scanner, &cs_token, &str); 
    715720        med->desc.port_count = pj_strtoul(&str); 
    716721 
     
    728733    /* format list */ 
    729734    med->desc.fmt_count = 0; 
    730     while (*scanner->current == ' ') { 
     735    while (*scanner->curptr == ' ') { 
    731736        pj_scan_get_char(scanner); 
    732         pj_scan_get(scanner, cs_token, &med->desc.fmt[med->desc.fmt_count++]); 
     737        pj_scan_get(scanner, &cs_token, &med->desc.fmt[med->desc.fmt_count++]); 
    733738    } 
    734739 
     
    752757    pj_scan_get_until_ch(scanner, '/', &rtpmap->encoding_name); 
    753758    pj_scan_get_char(scanner); 
    754     pj_scan_get(scanner, cs_token, &str); 
     759    pj_scan_get(scanner, &cs_token, &str); 
    755760    rtpmap->clock_rate = pj_strtoul(&str); 
    756761 
    757     if (*scanner->current == '/') { 
     762    if (*scanner->curptr == '/') { 
    758763        pj_scan_get_char(scanner); 
    759764        pj_scan_get_until_ch(scanner, '\r', &rtpmap->parameter); 
     
    794799    pjsdp_attr *attr; 
    795800 
    796     PJ_UNUSED_ARG(scanner) 
     801    PJ_UNUSED_ARG(scanner); 
    797802    attr = pj_pool_calloc(pool, 1, sizeof(*attr)); 
    798803    return attr; 
     
    825830     
    826831    /* get attr name. */ 
    827     pj_scan_get(scanner, cs_token, &attrname); 
     832    pj_scan_get(scanner, &cs_token, &attrname); 
    828833 
    829834    /* find entry to handle attrname */ 
     
    852857static void on_scanner_error(pj_scanner *scanner) 
    853858{ 
    854     PJ_UNUSED_ARG(scanner) 
     859    PJ_UNUSED_ARG(scanner); 
    855860 
    856861    PJ_THROW(SYNTAX_ERROR); 
     
    879884    PJ_TRY { 
    880885        while (!pj_scan_is_eof(&scanner)) { 
    881                 cur_name = *scanner.current; 
     886                cur_name = *scanner.curptr; 
    882887                switch (cur_name) { 
    883888                case 'a': 
     
    925930    PJ_CATCH(SYNTAX_ERROR) { 
    926931        PJ_LOG(2, (LOG_THIS, "Syntax error in SDP parser '%c' line %d col %d", 
    927                 cur_name, scanner.line, scanner.col)); 
     932                cur_name, scanner.line, pj_scan_get_col(&scanner))); 
    928933        if (!pj_scan_is_eof(&scanner)) { 
    929             if (*scanner.current != '\r') { 
     934            if (*scanner.curptr != '\r') { 
    930935                pj_scan_get_until_ch(&scanner, '\r', &dummy); 
    931936            } 
  • pjproject/trunk/pjmedia/src/pjmedia/session.c

    r66 r121  
    2222#include <pj/pool.h> 
    2323#include <pj/string.h> 
     24#include <pj/assert.h> 
     25 
    2426 
    2527typedef struct pj_media_stream_desc 
     
    772774    scp.rtcp_sock = sd->info.sock_info.rtcp_sock; 
    773775    scp.remote_addr = pj_pool_calloc (session->pool, 1, sizeof(pj_sockaddr_in)); 
    774     pj_sockaddr_init (scp.remote_addr, &sd->info.rem_addr, sd->info.rem_port); 
     776    pj_sockaddr_in_init(scp.remote_addr, &sd->info.rem_addr, sd->info.rem_port); 
    775777    scp.ssrc = tv.sec; 
    776778    scp.jb_min = 1; 
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r66 r121  
    2525#include <pj/string.h>      /* memcpy() */ 
    2626#include <pj/pool.h> 
     27#include <pj/assert.h> 
     28#include <pj/compat/socket.h> 
     29#include <pj/sock_select.h> 
     30#include <pj/errno.h> 
    2731#include <stdlib.h> 
     32 
    2833 
    2934#define THISFILE    "stream.c" 
     
    9297    struct pj_audio_frame frame_in, frame_out; 
    9398 
    94     PJ_UNUSED_ARG(timestamp) 
     99    PJ_UNUSED_ARG(timestamp); 
    95100 
    96101    /* Lock mutex */ 
     
    153158    void *rtphdr; 
    154159    int rtphdrlen; 
    155     int sent; 
     160    pj_ssize_t sent; 
    156161#if 0 
    157162    static FILE *fhnd = NULL; 
    158163#endif 
    159164 
    160     PJ_UNUSED_ARG(timestamp) 
     165    PJ_UNUSED_ARG(timestamp); 
    161166 
    162167    /* Start locking channel mutex */ 
     
    203208 
    204209    /* Send. */ 
    205     sent = pj_sock_sendto (channel->rtp_sock, channel->out_pkt, frame_out.size+sizeof(pj_rtp_hdr), 0,  
     210    sent = frame_out.size+sizeof(pj_rtp_hdr); 
     211    status = pj_sock_sendto (channel->rtp_sock, channel->out_pkt, &sent, 0,  
    206212                           &channel->dst_addr, sizeof(channel->dst_addr)); 
    207     if (sent != (int)frame_out.size + (int)sizeof(pj_rtp_hdr))  { 
    208         pj_perror(THISFILE, "Error sending RTP packet to %s:%d",  
    209                   pj_sockaddr_get_str_addr(&channel->dst_addr), 
    210                   pj_sockaddr_get_port(&channel->dst_addr)); 
     213    if (status != PJ_SUCCESS) 
    211214        goto on_return; 
    212     } 
    213215 
    214216    /* Update stat */ 
     
    232234 
    233235 
    234 static void* PJ_THREAD_FUNC stream_decoder_transport_thread (void*arg) 
     236static int PJ_THREAD_FUNC stream_decoder_transport_thread (void*arg) 
    235237{ 
    236238    pj_media_stream_t *channel = arg; 
    237239 
    238240    while (!channel->thread_quit_flag) { 
    239         int len, size; 
     241        pj_ssize_t len, size; 
    240242        const pj_rtp_hdr *hdr; 
    241243        const void *payload; 
     
    245247 
    246248        /* Wait for packet. */ 
    247         fd_set fds; 
     249        pj_fd_set_t fds; 
    248250        pj_time_val timeout; 
    249251 
     
    259261 
    260262        /* Get packet from socket. */ 
    261         len = pj_sock_recv (channel->rtp_sock, channel->in_pkt, channel->in_pkt_size, 0); 
    262         if (len < 1) { 
    263             if (pj_getlasterror() == PJ_ECONNRESET) { 
     263        len = channel->in_pkt_size; 
     264        status = pj_sock_recv (channel->rtp_sock, channel->in_pkt, &len, 0); 
     265        if (len < 1 || status != PJ_SUCCESS) { 
     266            if (pj_get_netos_error() == PJ_STATUS_FROM_OS(OSERR_ECONNRESET)) { 
    264267                /* On Win2K SP2 (or above) and WinXP, recv() will get WSAECONNRESET 
    265268                   when the sending side receives ICMP port unreachable. 
     
    267270                continue; 
    268271            } 
    269             pj_perror(THISFILE, "Error receiving packet from socket (len=%d)", len); 
     272            //pj_perror(THISFILE, "Error receiving packet from socket (len=%d)", len); 
    270273            pj_thread_sleep(1); 
    271274            continue; 
     
    326329    } 
    327330 
    328     return NULL; 
     331    return 0; 
    329332} 
    330333 
     
    349352    void *ptr; 
    350353    unsigned size; 
    351     int status; 
     354    pj_status_t status; 
    352355     
    353356    /* Allocate memory for channel descriptor */ 
     
    370373 
    371374    /* Create mutex for the channel. */ 
    372     channel->mutex = pj_mutex_create(pool, NULL, PJ_MUTEX_SIMPLE); 
    373     if (channel->mutex == NULL) 
     375    status = pj_mutex_create_simple(pool, NULL, &channel->mutex); 
     376    if (status != PJ_SUCCESS) 
    374377        goto err_cleanup; 
    375378 
     
    485488        } 
    486489 
    487         channel->transport_thread = pj_thread_create(pool, "decode",  
    488                                                      &stream_decoder_transport_thread, channel, 
    489                                                      0, NULL, 0); 
    490         if (!channel->transport_thread) { 
    491             pj_perror(THISFILE, "Unable to create transport thread"); 
     490        status = pj_thread_create(pool, "decode",  
     491                                  &stream_decoder_transport_thread, channel, 
     492                                  0, 0, &channel->transport_thread); 
     493        if (status != PJ_SUCCESS) { 
     494            //pj_perror(THISFILE, "Unable to create transport thread"); 
    492495            goto err_cleanup; 
    493496        } 
     
    574577PJ_DEF(pj_status_t) pj_media_stream_pause (pj_media_stream_t *channel) 
    575578{ 
    576     PJ_UNUSED_ARG(channel) 
     579    PJ_UNUSED_ARG(channel); 
    577580    return -1; 
    578581} 
     
    580583PJ_DEF(pj_status_t) pj_media_stream_resume (pj_media_stream_t *channel) 
    581584{ 
    582     PJ_UNUSED_ARG(channel) 
     585    PJ_UNUSED_ARG(channel); 
    583586    return -1; 
    584587} 
Note: See TracChangeset for help on using the changeset viewer.