Changeset 407 for pjproject


Ignore:
Timestamp:
Apr 20, 2006 11:13:32 AM (19 years ago)
Author:
bennylp
Message:

Added stream.c example to demonstrate how to stream audio from both sound device or WAV file

Location:
pjproject/trunk/pjsip-apps
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/build/Samples-vc.mak

    r379 r407  
    3838 
    3939 
    40 SAMPLES = $(BINDIR)\simpleua.exe $(BINDIR)\playfile.exe $(BINDIR)\playsine.exe \ 
     40SAMPLES = $(BINDIR)\simpleua.exe $(BINDIR)\playfile.exe $(BINDIR)\playsine.exe\ 
    4141          $(BINDIR)\confsample.exe $(BINDIR)\sndinfo.exe \ 
    4242          $(BINDIR)\level.exe $(BINDIR)\recfile.exe  \ 
    43           $(BINDIR)\resampleplay.exe $(BINDIR)\siprtp.exe 
     43          $(BINDIR)\resampleplay.exe $(BINDIR)\siprtp.exe $(BINDIR)\stream.exe 
    4444 
    4545 
  • pjproject/trunk/pjsip-apps/build/Samples.mak

    r379 r407  
    4040 
    4141SAMPLES := simpleua playfile playsine confsample sndinfo level recfile resampleplay \ 
    42            siprtp 
     42           siprtp stream 
    4343 
    4444EXES := $(foreach file, $(SAMPLES), $(BINDIR)/$(file)-$(MACHINE_NAME)-$(OS_NAME)-$(CC_NAME)$(HOST_EXE)) 
  • pjproject/trunk/pjsip-apps/build/samples.dsp

    r375 r407  
    121121SOURCE=..\src\samples\sndinfo.c 
    122122# End Source File 
     123# Begin Source File 
     124 
     125SOURCE=..\src\samples\stream.c 
     126# End Source File 
    123127# End Group 
    124128# Begin Group "Header Files" 
     
    138142SOURCE=".\Samples-vc.mak" 
    139143# End Source File 
     144# Begin Source File 
     145 
     146SOURCE=.\Samples.mak 
     147# End Source File 
    140148# End Target 
    141149# End Project 
  • pjproject/trunk/pjsip-apps/src/samples/debug.c

    r375 r407  
    2828 *  #include "playfile.c" 
    2929 */ 
    30 #include "siprtp.c" 
     30#include "stream.c" 
    3131 
  • pjproject/trunk/pjsip-apps/src/samples/playfile.c

    r361 r407  
    177177    return 0; 
    178178} 
     179 
  • pjproject/trunk/pjsip-apps/src/samples/siprtp.c

    r395 r407  
    1919 
    2020 
     21 
     22 
     23/* Usage */ 
     24static const char *USAGE =  
     25" PURPOSE:                                                                  \n" 
     26"   This program establishes SIP INVITE session and media, and calculate    \n" 
     27"   the media quality (packet lost, jitter, rtt, etc.). Unlike normal       \n" 
     28"   pjmedia applications, this program bypasses all pjmedia stream          \n" 
     29"   framework and transmit encoded RTP packets manually using own thread.   \n" 
     30"\n" 
     31" USAGE:\n" 
     32"   siprtp [options]        => to start in server mode\n" 
     33"   siprtp [options] URL    => to start in client mode\n" 
     34"\n" 
     35" Program options:\n" 
     36"   --count=N,        -c    Set number of calls to create (default:1) \n" 
     37"\n" 
     38" Address and ports options:\n" 
     39"   --local-port=PORT,-p    Set local SIP port (default: 5060)\n" 
     40"   --rtp-port=PORT,  -r    Set start of RTP port (default: 4000)\n" 
     41"   --ip-addr=IP,     -i    Set local IP address to use (otherwise it will\n" 
     42"                           try to determine local IP address from hostname)\n" 
     43"\n" 
     44" Logging Options:\n" 
     45"   --log-level=N,    -l    Set log verbosity level (default=5)\n" 
     46"   --app-log-level=N       Set app screen log verbosity (default=3)\n" 
     47"   --log-file=FILE         Write log to file FILE\n" 
     48"\n" 
     49" Codec Options:\n" 
     50"   --a-pt=PT               Set audio payload type to PT (default=0)\n" 
     51"   --a-name=NAME           Set audio codec name to NAME (default=pcmu)\n" 
     52"   --a-clock=RATE          Set audio codec rate to RATE Hz (default=8000Hz)\n" 
     53"   --a-bitrate=BPS         Set audio codec bitrate to BPS (default=64000bps)\n" 
     54"   --a-ptime=MS            Set audio frame time to MS msec (default=20ms)\n" 
     55; 
     56 
     57 
    2158/* Include all headers. */ 
    2259#include <pjsip.h> 
     
    724761    return 0; 
    725762} 
    726  
    727  
    728 /* Usage */ 
    729 static const char *USAGE =  
    730 "Usage:\n" 
    731 "   siprtp [options]        => to start in server mode\n" 
    732 "   siprtp [options] URL    => to start in client mode\n" 
    733 "\n" 
    734 "Program options:\n" 
    735 "   --count=N,        -c    Set number of calls to create (default:1) \n" 
    736 "\n" 
    737 "Address and ports options:\n" 
    738 "   --local-port=PORT,-p    Set local SIP port (default: 5060)\n" 
    739 "   --rtp-port=PORT,  -r    Set start of RTP port (default: 4000)\n" 
    740 "   --ip-addr=IP,     -i    Set local IP address to use (otherwise it will\n" 
    741 "                           try to determine local IP address from hostname)\n" 
    742 "\n" 
    743 "Logging Options:\n" 
    744 "   --log-level=N,    -l    Set log verbosity level (default=5)\n" 
    745 "   --app-log-level=N       Set app screen log verbosity (default=3)\n" 
    746 "   --log-file=FILE         Write log to file FILE\n" 
    747 "\n" 
    748 "Codec Options:\n" 
    749 "   --a-pt=PT               Set audio payload type to PT (default=0)\n" 
    750 "   --a-name=NAME           Set audio codec name to NAME (default=pcmu)\n" 
    751 "   --a-clock=RATE          Set audio codec rate to RATE Hz (default=8000 Hz)\n" 
    752 "   --a-bitrate=BPS         Set audio codec bitrate to BPS (default=64000 bps)\n" 
    753 "   --a-ptime=MS            Set audio frame time to MS msec (default=20 msec)\n" 
    754 ; 
    755763 
    756764 
  • pjproject/trunk/pjsip-apps/src/samples/util.h

    r393 r407  
    3737 * common sound options. 
    3838 */ 
    39 static pj_status_t get_snd_options( const char *app_name, 
    40                                     int argc,  
    41                                     char *argv[], 
    42                                     int *dev_id, 
    43                                     int *clock_rate, 
    44                                     int *channel_count, 
    45                                     int *samples_per_frame, 
    46                                     int *bits_per_sample) 
     39pj_status_t get_snd_options(const char *app_name, 
     40                            int argc,  
     41                            char *argv[], 
     42                            int *dev_id, 
     43                            int *clock_rate, 
     44                            int *channel_count, 
     45                            int *samples_per_frame, 
     46                            int *bits_per_sample) 
    4747{ 
    4848    struct pj_getopt_option long_options[] = { 
     
    134134 
    135135/* Dump memory pool usage. */ 
    136 static void dump_pool_usage( const char *app_name, pj_caching_pool *cp ) 
     136void dump_pool_usage( const char *app_name, pj_caching_pool *cp ) 
    137137{ 
    138138#if !defined(PJ_HAS_POOL_ALT_API) || PJ_HAS_POOL_ALT_API==0 
Note: See TracChangeset for help on using the changeset viewer.