Changeset 188
- Timestamp:
- Feb 15, 2006 12:24:23 PM (19 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 1 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/pjmedia.dsp
r159 r188 162 162 # Begin Source File 163 163 164 SOURCE=..\include\pjmedia\doxygen.h 165 # End Source File 166 # Begin Source File 167 164 168 SOURCE=..\include\pjmedia\endpoint.h 165 169 # End Source File -
pjproject/trunk/pjmedia/docs
-
Property
svn:ignore
set to
html
latex
rtf
-
Property
svn:ignore
set to
-
pjproject/trunk/pjmedia/docs/doxygen.cfg
r1 r188 134 134 # the path. It is allowed to use relative paths in the argument list. 135 135 136 STRIP_FROM_PATH = " "136 STRIP_FROM_PATH = "c:\project\pjproject" 137 137 138 138 # The INTERNAL_DOCS tag determines if documentation … … 167 167 # which an include is specified. Set to NO to disable this. 168 168 169 VERBATIM_HEADERS = NO169 VERBATIM_HEADERS = YES 170 170 171 171 # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen … … 214 214 # declaration order. 215 215 216 SORT_MEMBER_DOCS = NO216 SORT_MEMBER_DOCS = YES 217 217 218 218 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC … … 346 346 # with spaces. 347 347 348 INPUT = src/pjmedia348 INPUT = include/pjmedia 349 349 350 350 # If the value of the INPUT tag contains directories, you can use the … … 501 501 # standard header. 502 502 503 HTML_HEADER = 503 HTML_HEADER = ../pjlib/docs/header.html 504 504 505 505 # The HTML_FOOTER tag can be used to specify a personal HTML footer for … … 507 507 # standard footer. 508 508 509 HTML_FOOTER = 509 HTML_FOOTER = ../pjlib/docs/footer.html 510 510 511 511 # The HTML_STYLESHEET tag can be used to specify a user defined cascading … … 514 514 # will generate a default style sheet 515 515 516 HTML_STYLESHEET = 516 HTML_STYLESHEET = ../pjlib/docs/doxygen.css 517 517 518 518 # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, … … 1007 1007 SEARCHENGINE = NO 1008 1008 1009 # The CGI_NAME tag should be the name of the CGI script that1010 # starts the search engine (doxysearch) with the correct parameters.1011 # A script with this name will be generated by doxygen.1012 1013 CGI_NAME = search.cgi1014 1015 # The CGI_URL tag should be the absolute URL to the directory where the1016 # cgi binaries are located. See the documentation of your http daemon for1017 # details.1018 1019 CGI_URL =1020 1021 # The DOC_URL tag should be the absolute URL to the directory where the1022 # documentation is located. If left blank the absolute path to the1023 # documentation, with file:// prepended to it, will be used.1024 1025 DOC_URL =1026 1027 # The DOC_ABSPATH tag should be the absolute path to the directory where the1028 # documentation is located. If left blank the directory on the local machine1029 # will be used.1030 1031 DOC_ABSPATH =1032 1033 # The BIN_ABSPATH tag must point to the directory where the doxysearch binary1034 # is installed.1035 1036 BIN_ABSPATH = /usr/local/bin/1037 1038 # The EXT_DOC_PATHS tag can be used to specify one or more paths to1039 # documentation generated for other projects. This allows doxysearch to search1040 # the documentation for these projects as well.1041 1042 EXT_DOC_PATHS = -
pjproject/trunk/pjmedia/include/pjmedia.h
r162 r188 20 20 #define __PJMEDIA_H__ 21 21 22 /** 23 * @file pjmedia.h 24 * @brief PJMEDIA main header file. 25 */ 26 22 27 #include <pjmedia/types.h> 23 28 #include <pjmedia/errno.h> -
pjproject/trunk/pjmedia/include/pjmedia/codec.h
r176 r188 44 44 enum pjmedia_rtp_pt 45 45 { 46 PJMEDIA_RTP_PT_PCMU = 0, /* audio PCMU */47 PJMEDIA_RTP_PT_GSM = 3, /* audio GSM */48 PJMEDIA_RTP_PT_G723 = 4, /* audio G723 */49 PJMEDIA_RTP_PT_DVI4_8K = 5, /* audio DVI4 8KHz*/50 PJMEDIA_RTP_PT_DVI4_16K = 6, /* audio DVI4 16Khz*/51 PJMEDIA_RTP_PT_LPC = 7, /* audio LPC */52 PJMEDIA_RTP_PT_PCMA = 8, /* audio PCMA */53 PJMEDIA_RTP_PT_G722 = 9, /* audio G722 */54 PJMEDIA_RTP_PT_L16_2 = 10, /* audio 16bit linear 44.1KHz stereo*/55 PJMEDIA_RTP_PT_L16_1 = 11, /* audio 16bit linear 44.1KHz mono*/56 PJMEDIA_RTP_PT_QCELP = 12, /* audio QCELP */57 PJMEDIA_RTP_PT_CN = 13, /* audio Comfort Noise */58 PJMEDIA_RTP_PT_MPA = 14, /* audio MPEG1/MPEG2 elementarystreams */59 PJMEDIA_RTP_PT_G728 = 15, /* audio G728 */60 PJMEDIA_RTP_PT_DVI4_11K = 16, /* audio DVI4 11.025KHz mono */61 PJMEDIA_RTP_PT_DVI4_22K = 17, /* audio DVI4 22.050KHz mono */62 PJMEDIA_RTP_PT_G729 = 18, /* audio G729 */63 64 PJMEDIA_RTP_PT_CELB = 25, /* video/comb Cell-B by Sun (RFC 2029)*/65 PJMEDIA_RTP_PT_JPEG = 26, /* video JPEG */66 PJMEDIA_RTP_PT_NV = 28, /* video NV by nv program by Xerox*/67 PJMEDIA_RTP_PT_H261 = 31, /* video H261 */68 PJMEDIA_RTP_PT_MPV = 32, /* video MPEG1 or MPEG2 elementary*/69 PJMEDIA_RTP_PT_MP2T = 33, /* video MPEG2 transport */70 PJMEDIA_RTP_PT_H263 = 34, /* video H263 */71 72 PJMEDIA_RTP_PT_DYNAMIC = 96, /* start of dynamic RTP payload */46 PJMEDIA_RTP_PT_PCMU = 0, /**< audio PCMU */ 47 PJMEDIA_RTP_PT_GSM = 3, /**< audio GSM */ 48 PJMEDIA_RTP_PT_G723 = 4, /**< audio G723 */ 49 PJMEDIA_RTP_PT_DVI4_8K = 5, /**< audio DVI4 8KHz */ 50 PJMEDIA_RTP_PT_DVI4_16K = 6, /**< audio DVI4 16Khz */ 51 PJMEDIA_RTP_PT_LPC = 7, /**< audio LPC */ 52 PJMEDIA_RTP_PT_PCMA = 8, /**< audio PCMA */ 53 PJMEDIA_RTP_PT_G722 = 9, /**< audio G722 */ 54 PJMEDIA_RTP_PT_L16_2 = 10, /**< audio 16bit linear 44.1KHz stereo */ 55 PJMEDIA_RTP_PT_L16_1 = 11, /**< audio 16bit linear 44.1KHz mono */ 56 PJMEDIA_RTP_PT_QCELP = 12, /**< audio QCELP */ 57 PJMEDIA_RTP_PT_CN = 13, /**< audio Comfort Noise */ 58 PJMEDIA_RTP_PT_MPA = 14, /**< audio MPEG1/MPEG2 elemetr. streams */ 59 PJMEDIA_RTP_PT_G728 = 15, /**< audio G728 */ 60 PJMEDIA_RTP_PT_DVI4_11K = 16, /**< audio DVI4 11.025KHz mono */ 61 PJMEDIA_RTP_PT_DVI4_22K = 17, /**< audio DVI4 22.050KHz mono */ 62 PJMEDIA_RTP_PT_G729 = 18, /**< audio G729 */ 63 64 PJMEDIA_RTP_PT_CELB = 25, /**< video/comb Cell-B by Sun (RFC2029) */ 65 PJMEDIA_RTP_PT_JPEG = 26, /**< video JPEG */ 66 PJMEDIA_RTP_PT_NV = 28, /**< video NV by nv program by Xerox */ 67 PJMEDIA_RTP_PT_H261 = 31, /**< video H261 */ 68 PJMEDIA_RTP_PT_MPV = 32, /**< video MPEG1 or MPEG2 elementary */ 69 PJMEDIA_RTP_PT_MP2T = 33, /**< video MPEG2 transport */ 70 PJMEDIA_RTP_PT_H263 = 34, /**< video H263 */ 71 72 PJMEDIA_RTP_PT_DYNAMIC = 96, /**< start of dynamic RTP payload */ 73 73 74 74 }; … … 362 362 struct pjmedia_codec_mgr 363 363 { 364 /** List of codec factories registered to codec manager. */ 364 365 pjmedia_codec_factory factory_list; 366 367 /** Number of supported codesc. */ 365 368 unsigned codec_cnt; 369 370 /** Array of codec info. */ 366 371 pjmedia_codec_info codecs[PJMEDIA_CODEC_MGR_MAX_CODECS]; 367 372 }; -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r121 r188 20 20 #define __PJMED_CONFIG_H__ 21 21 22 /**23 * @defgroup PJMEDIA Media Stack24 */25 26 22 27 23 #endif /* __PJMED_CONFIG_H__ */ -
pjproject/trunk/pjmedia/include/pjmedia/endpoint.h
r176 r188 22 22 23 23 /** 24 * @file mediamgr.h25 * @brief Media Manager.24 * @file endpoint.h 25 * @brief Media endpoint. 26 26 */ 27 27 /** 28 * @defgroup PJMED_ENDPT M edia Endpoint28 * @defgroup PJMED_ENDPT Multimedia Endpoint 29 29 * @ingroup PJMEDIA 30 30 * @{ … … 92 92 * this media endpoint. 93 93 */ 94 PJ_DECL(pjmedia_codec_mgr*) pjmedia_endpt_get_codec_mgr(pjmedia_endpt * mgr);94 PJ_DECL(pjmedia_codec_mgr*) pjmedia_endpt_get_codec_mgr(pjmedia_endpt *endpt); 95 95 96 96 -
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r176 r188 251 251 /** 252 252 * @hideinitializer 253 * Unable to create codec.253 * Codec internal creation error. 254 254 */ 255 255 #define PJMEDIA_CODEC_EFAILED (PJMEDIA_ERRNO_START+81) /* 220081 */ … … 298 298 299 299 /************************************************************ 300 * JITTER BUFFER 300 * RTP SESSION ERRORS 301 ***********************************************************/ 302 /** 303 * @hideinitializer 304 * General invalid RTP packet error. 305 */ 306 #define PJMEDIA_RTP_EINPKT (PJMEDIA_ERRNO_START+120) /* 220120 */ 307 /** 308 * @hideinitializer 309 * Invalid RTP packet packing. 310 */ 311 #define PJMEDIA_RTP_EINPACK (PJMEDIA_ERRNO_START+121) /* 220121 */ 312 /** 313 * @hideinitializer 314 * Invalid RTP packet version. 315 */ 316 #define PJMEDIA_RTP_EINVER (PJMEDIA_ERRNO_START+122) /* 220122 */ 317 /** 318 * @hideinitializer 319 * RTP SSRC id mismatch. 320 */ 321 #define PJMEDIA_RTP_EINSSRC (PJMEDIA_ERRNO_START+123) /* 220123 */ 322 /** 323 * @hideinitializer 324 * RTP payload type mismatch. 325 */ 326 #define PJMEDIA_RTP_EINPT (PJMEDIA_ERRNO_START+124) /* 220124 */ 327 /** 328 * @hideinitializer 329 * Invalid RTP packet length. 330 */ 331 #define PJMEDIA_RTP_EINLEN (PJMEDIA_ERRNO_START+125) /* 220125 */ 332 /** 333 * @hideinitializer 334 * RTP session restarted. 335 */ 336 #define PJMEDIA_RTP_ESESSRESTART (PJMEDIA_ERRNO_START+130) /* 220130 */ 337 /** 338 * @hideinitializer 339 * RTP session in probation 340 */ 341 #define PJMEDIA_RTP_ESESSPROBATION (PJMEDIA_ERRNO_START+131) /* 220131 */ 342 /** 343 * @hideinitializer 344 * Bad RTP sequence number 345 */ 346 #define PJMEDIA_RTP_EBADSEQ (PJMEDIA_ERRNO_START+132) /* 220132 */ 347 348 349 /************************************************************ 350 * JITTER BUFFER ERRORS 301 351 ***********************************************************/ 302 352 -
pjproject/trunk/pjmedia/include/pjmedia/jbuf.h
r169 r188 25 25 * @brief Adaptive jitter buffer implementation. 26 26 */ 27 #include <pjmedia/types.h> 28 27 29 /** 28 30 * @defgroup PJMED_JBUF Adaptive jitter buffer 29 31 * @ingroup PJMEDIA 30 32 * @{ 33 * 31 34 */ 32 33 #include <pjmedia/types.h>34 35 35 36 … … 37 38 38 39 40 /** 41 * Types of frame returned by the jitter buffer. 42 */ 39 43 enum pjmedia_jb_frame_type 40 44 { 41 PJMEDIA_JB_MISSING_FRAME = 0, 42 PJMEDIA_JB_NORMAL_FRAME = 1, 43 PJMEDIA_JB_ZERO_FRAME = 2, 45 PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing. */ 46 PJMEDIA_JB_NORMAL_FRAME = 1, /**< Normal frame is being returned. */ 47 PJMEDIA_JB_ZERO_FRAME = 2, /**< Zero frame is being returned. */ 44 48 }; 45 49 46 50 47 #define PJMEDIA_JB_DEFAULT_INIT_PREFETCH 15 51 /** 52 * The constant PJMEDIA_JB_DEFAULT_INIT_DELAY specifies default jitter 53 * buffer prefetch count during jitter buffer creation. 54 */ 55 #define PJMEDIA_JB_DEFAULT_INIT_DELAY 15 48 56 49 57 58 /** 59 * Create the jitter buffer. This function may allocate large chunk of 60 * memory to keep the frames in the buffer. 61 * 62 * @param pool The pool to allocate memory. 63 * @param frame_size The size of each frame that will be kept in the 64 * jitter buffer. The value here normaly corresponds 65 * to the RTP payload size according to the codec 66 * being used. 67 * @param init_delay Initial jitter buffer delay, in number of frames. 68 * @param max_count Maximum jitter buffer delay, in number of frames. 69 * @param p_jb Pointer to receive jitter buffer instance. 70 * 71 * @return PJ_SUCCESS on success. 72 */ 50 73 PJ_DECL(pj_status_t) pjmedia_jbuf_create(pj_pool_t *pool, 51 74 int frame_size, 52 int init ial_prefetch,75 int init_delay, 53 76 int max_count, 54 77 pjmedia_jbuf **p_jb); 78 79 /** 80 * Destroy jitter buffer instance. 81 * 82 * @param jb The jitter buffer. 83 * 84 * @return PJ_SUCCESS on success. 85 */ 55 86 PJ_DECL(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb); 87 88 89 /** 90 * Put a frame to the jitter buffer. If the frame can be accepted (based 91 * on the sequence number), the jitter buffer will copy the frame and put 92 * it in the appropriate position in the buffer. 93 * 94 * Application MUST manage it's own synchronization when multiple threads 95 * are accessing the jitter buffer at the same time. 96 * 97 * @param jb The jitter buffer. 98 * @param frame Pointer to frame buffer to be stored in the jitter 99 * buffer. 100 * @param size The frame size. 101 * @param frame_seq The frame sequence number. 102 * 103 * @return PJ_SUCCESS on success. 104 */ 56 105 PJ_DECL(pj_status_t) pjmedia_jbuf_put_frame(pjmedia_jbuf *jb, 57 106 const void *frame, 58 pj_size_t frame_size,107 pj_size_t size, 59 108 int frame_seq); 109 110 /** 111 * Get a frame from the jitter buffer. The jitter buffer will return the 112 * oldest frame from it's buffer, when it is available. 113 * 114 * Application MUST manage it's own synchronization when multiple threads 115 * are accessing the jitter buffer at the same time. 116 * 117 * @param jb The jitter buffer. 118 * @param frame Buffer to receive the payload from the jitter buffer. 119 * Application MUST make sure that the buffer has 120 * appropriate size (i.e. not less than the frame size, 121 * as specified when the jitter buffer was created). 122 * The jitter buffer only copied a frame to this 123 * buffer when the frame type returned by this function 124 * is PJMEDIA_JB_NORMAL_FRAME. 125 * @param p_frm_type Pointer to receive frame type. If jitter buffer is 126 * currently empty or bufferring, the frame type will 127 * be set to PJMEDIA_JB_ZERO_FRAME, and no frame will 128 * be copied. If the jitter buffer detects that frame is 129 * missing with current sequence number, the frame type 130 * will be set to PJMEDIA_JB_MISSING_FRAME, and no 131 * frame will be copied. If there is a frame, the jitter 132 * buffer will copy the frame to the buffer, and frame 133 * type will be set to PJMEDIA_JB_NORMAL_FRAME. 134 * 135 * @return Always returns PJ_SUCCESS. 136 */ 60 137 PJ_DECL(pj_status_t) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb, 61 138 void *frame, 62 char *p_frame_type); 63 PJ_DECL(unsigned) pjmedia_jbuf_get_prefetch_size(pjmedia_jbuf *jb); 64 PJ_DECL(unsigned) pjmedia_jbuf_get_current_size(pjmedia_jbuf *jb); 139 char *p_frm_type); 140 141 /** 142 * Retrieve the current value of jitter buffer minimum delay, in number 143 * of frames. 144 * 145 * @param jb The jitter buffer. 146 * 147 * @return Number of frames, indicating the minimum delay that 148 * will be applied by the jitter buffer between frame 149 * arrival and frame retrieval. 150 */ 151 PJ_DECL(unsigned) pjmedia_jbuf_get_min_delay_size(pjmedia_jbuf *jb); 152 153 154 /** 155 * Retrieve the current delay value, in number of frames. 156 * 157 * @param jb The jitter buffer. 158 * 159 * @return Number of frames, indicating the delay between frame 160 * arrival and frame retrieval. 161 */ 162 PJ_DECL(unsigned) pjmedia_jbuf_get_delay(pjmedia_jbuf *jb); 65 163 66 164 -
pjproject/trunk/pjmedia/include/pjmedia/rtcp.h
r121 r188 25 25 */ 26 26 27 #include <pj /types.h>27 #include <pjmedia/types.h> 28 28 #include <pjmedia/rtp.h> 29 29 … … 32 32 33 33 /** 34 * @defgroup PJMED_RTCP RTCP 34 * @defgroup PJMED_RTCP RTCP Management 35 35 * @ingroup PJMEDIA 36 36 * @{ … … 42 42 struct pj_rtcp_sr 43 43 { 44 pj_uint32_t ssrc; 45 pj_uint32_t ntp_sec; 46 pj_uint32_t ntp_frac; 47 pj_uint32_t rtp_ts; 48 pj_uint32_t sender_pcount; 49 pj_uint32_t sender_bcount; 50 }; 51 44 pj_uint32_t ssrc; /**< SSRC identification. */ 45 pj_uint32_t ntp_sec; /**< NTP time, seconds part. */ 46 pj_uint32_t ntp_frac; /**< NTP time, fractions part. */ 47 pj_uint32_t rtp_ts; /**< RTP timestamp. */ 48 pj_uint32_t sender_pcount; /**< Sender packet cound. */ 49 pj_uint32_t sender_bcount; /**< Sender octet/bytes count. */ 50 }; 51 52 /** 53 * @see pj_rtcp_sr 54 */ 52 55 typedef struct pj_rtcp_sr pj_rtcp_sr; 53 56 … … 57 60 struct pj_rtcp_rr 58 61 { 59 pj_uint32_t ssrc; 62 pj_uint32_t ssrc; /**< SSRC identification. */ 60 63 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 61 pj_uint32_t fract_lost:8; 62 pj_uint32_t total_lost_2:8; 63 pj_uint32_t total_lost_1:8; 64 pj_uint32_t total_lost_0:8; 64 pj_uint32_t fract_lost:8; /**< Fraction lost. */ 65 pj_uint32_t total_lost_2:8; /**< Total lost, bit 16-23. */ 66 pj_uint32_t total_lost_1:8; /**< Total lost, bit 8-15. */ 67 pj_uint32_t total_lost_0:8; /**< Total lost, bit 0-7. */ 65 68 #else 66 pj_uint32_t fract_lost:8; 67 pj_uint32_t total_lost_0:8; 68 pj_uint32_t total_lost_1:8; 69 pj_uint32_t total_lost_2:8; 69 pj_uint32_t fract_lost:8; /**< Fraction lost. */ 70 pj_uint32_t total_lost_0:8; /**< Total lost, bit 0-7. */ 71 pj_uint32_t total_lost_1:8; /**< Total lost, bit 8-15. */ 72 pj_uint32_t total_lost_2:8; /**< Total lost, bit 16-23. */ 70 73 #endif 71 pj_uint32_t last_seq; 72 pj_uint32_t jitter; 73 pj_uint32_t lsr; 74 pj_uint32_t dlsr; 75 }; 76 74 pj_uint32_t last_seq; /**< Last sequence number. */ 75 pj_uint32_t jitter; /**< Jitter. */ 76 pj_uint32_t lsr; /**< Last SR. */ 77 pj_uint32_t dlsr; /**< Delay since last SR. */ 78 }; 79 80 /** 81 * @see pj_rtcp_rr 82 */ 77 83 typedef struct pj_rtcp_rr pj_rtcp_rr; 78 84 85 79 86 /** 80 87 * RTCP common header. … … 83 90 { 84 91 #if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0 85 unsigned version:2; /* packet type */86 unsigned p:1; /* padding flag */87 unsigned count:5; /* varies by payload type */88 unsigned pt:8; /* payload type */92 unsigned version:2; /**< packet type */ 93 unsigned p:1; /**< padding flag */ 94 unsigned count:5; /**< varies by payload type */ 95 unsigned pt:8; /**< payload type */ 89 96 #else 90 unsigned count:5; /* varies by payload type */91 unsigned p:1; /* padding flag */92 unsigned version:2; /* packet type */93 unsigned pt:8; /* payload type */97 unsigned count:5; /**< varies by payload type */ 98 unsigned p:1; /**< padding flag */ 99 unsigned version:2; /**< packet type */ 100 unsigned pt:8; /**< payload type */ 94 101 #endif 95 pj_uint16_t length; /* packet length */ 96 }; 97 102 pj_uint16_t length; /**< packet length */ 103 }; 104 105 /** 106 * @see pj_rtcp_common 107 */ 98 108 typedef struct pj_rtcp_common pj_rtcp_common; 99 109 … … 103 113 struct pj_rtcp_pkt 104 114 { 105 pj_rtcp_common common; 106 pj_rtcp_sr sr; 107 pj_rtcp_rr rr; /* variable-length list */ 108 }; 109 115 pj_rtcp_common common; /**< Common header. */ 116 pj_rtcp_sr sr; /**< Sender report. */ 117 pj_rtcp_rr rr; /**< variable-length list */ 118 }; 119 120 /** 121 * @see pj_rtcp_pkt 122 */ 110 123 typedef struct pj_rtcp_pkt pj_rtcp_pkt; 111 124 125 112 126 /** 113 127 * NTP time representation. … … 115 129 struct pj_rtcp_ntp_rec 116 130 { 117 pj_uint32_t hi; 118 pj_uint32_t lo; 119 }; 120 131 pj_uint32_t hi; /**< High order 32-bit part. */ 132 pj_uint32_t lo; /**< Lo order 32-bit part. */ 133 }; 134 135 /** 136 * @see pj_rtcp_ntp_rec 137 */ 121 138 typedef struct pj_rtcp_ntp_rec pj_rtcp_ntp_rec; 122 139 140 141 123 142 /** 124 143 * RTCP session. … … 126 145 struct pj_rtcp_session 127 146 { 128 pj_rtcp_pkt rtcp_pkt;147 pj_rtcp_pkt rtcp_pkt; /**< Cached RTCP packet. */ 129 148 130 pj _rtp_seq_session seq_ctrl;131 132 pj_uint32_t received; /* packets received*/133 pj_uint32_t expected_prior; /* packet expected at last interval*/134 pj_uint32_t received_prior; /* packet received at last interval*/135 pj_int32_t transit; /* relative trans time for prev pkt*/136 pj_uint32_t jitter; /* estimated jitter*/149 pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */ 150 151 pj_uint32_t received; /**< # pkts received */ 152 pj_uint32_t expected_prior; /**< # pkts expected at last interval */ 153 pj_uint32_t received_prior; /**< # pkts received at last interval */ 154 pj_int32_t transit; /**< Relative trans time for prev pkt */ 155 pj_uint32_t jitter; /**< Estimated jitter */ 137 156 138 pj_rtcp_ntp_rec rtcp_lsr; /* NTP timestamp in last sender report received*/139 unsigned rtcp_lsr_time; /* Time when last RTCP SR is received.*/140 unsigned peer_ssrc; /* Peer SSRC*/157 pj_rtcp_ntp_rec rtcp_lsr; /**< NTP ts in last SR received */ 158 unsigned rtcp_lsr_time; /**< Time when last SR is received. */ 159 pj_uint32_t peer_ssrc; /**< Peer SSRC */ 141 160 142 161 }; 143 162 163 /** 164 * @see pj_rtcp_session 165 */ 144 166 typedef struct pj_rtcp_session pj_rtcp_session; 145 167 146 /** 147 * Init RTCP session. 148 * @param session The session 149 * @param ssrc The SSRC used in to identify the session. 168 169 /** 170 * Initialize RTCP session. 171 * 172 * @param session The session 173 * @param ssrc The SSRC used in to identify the session. 150 174 */ 151 175 PJ_DECL(void) pj_rtcp_init( pj_rtcp_session *session, pj_uint32_t ssrc ); 152 176 153 /** 154 * Deinit RTCP session. 155 * @param session The session. 177 178 /** 179 * Deinitialize RTCP session. 180 * 181 * @param session The session. 156 182 */ 157 183 PJ_DECL(void) pj_rtcp_fini( pj_rtcp_session *session); 184 158 185 159 186 /** 160 187 * Call this function everytime an RTP packet is received to let the RTCP 161 188 * session do its internal calculations. 162 * @param session The session. 163 * @param seq The RTP packet sequence number, in host byte order. 164 * @param ts The RTP packet timestamp, in host byte order. 165 */ 166 PJ_DECL(void) pj_rtcp_rx_rtp( pj_rtcp_session *session, pj_uint16_t seq, pj_uint32_t ts ); 189 * 190 * @param session The session. 191 * @param seq The RTP packet sequence number, in host byte order. 192 * @param ts The RTP packet timestamp, in host byte order. 193 */ 194 PJ_DECL(void) pj_rtcp_rx_rtp( pj_rtcp_session *session, pj_uint16_t seq, 195 pj_uint32_t ts ); 196 167 197 168 198 /** 169 199 * Call this function everytime an RTP packet is sent to let the RTCP session 170 200 * do its internal calculations. 171 * @param session The session. 172 * @param bytes_payload_size The payload size of the RTP packet (ie packet minus 173 * RTP header). 174 */ 175 PJ_DECL(void) pj_rtcp_tx_rtp( pj_rtcp_session *session, pj_uint16_t bytes_payload_size ); 201 * 202 * @param session The session. 203 * @param ptsize The payload size of the RTP packet (ie packet minus 204 * RTP header) in bytes. 205 */ 206 PJ_DECL(void) pj_rtcp_tx_rtp( pj_rtcp_session *session, pj_uint16_t ptsize ); 207 176 208 177 209 /** 178 210 * Build a RTCP SR/RR packet to be transmitted to remote RTP peer. 179 211 * @param session The session. 180 * @param rtcp_pkt [output] Upon return, it will contain pointer to the RTCP packet. 181 * @param len [output] Upon return, it will indicate the size of the RTCP packet. 182 */ 183 PJ_DECL(void) pj_rtcp_build_rtcp( pj_rtcp_session *session, pj_rtcp_pkt **rtcp_pkt, int *len ); 212 * 213 * @param rtcp_pkt [output] Upon return, it will contain pointer to the 214 * RTCP packet. 215 * @param len [output] Upon return, it will indicate the size of 216 * the RTCP packet. 217 */ 218 PJ_DECL(void) pj_rtcp_build_rtcp( pj_rtcp_session *session, 219 pj_rtcp_pkt **rtcp_pkt, 220 int *len ); 221 184 222 185 223 /** -
pjproject/trunk/pjmedia/include/pjmedia/rtp.h
r159 r188 20 20 #define __PJMEDIA_RTP_H__ 21 21 22 #include <pj/types.h>23 22 24 23 /** 25 24 * @file rtp.h 26 * @brief RTP implementation. 27 */ 25 * @brief RTP packet and RTP session declarations. 26 */ 27 #include <pjmedia/types.h> 28 28 29 29 30 PJ_BEGIN_DECL … … 31 32 32 33 /** 33 * @defgroup PJMED_RTP RTP 34 * @defgroup PJMED_RTP RTP Packet and RTP Session Management 34 35 * @ingroup PJMEDIA 35 36 * @{ … … 39 40 * on any transports (sockets), to promote even more use. 40 41 * 41 * An RTCP implementation is a lso separated from thismodule.42 * An RTCP implementation is available, in separate module. 42 43 * 43 44 * The functions that are provided by this module: … … 50 51 * \section P1 How to Use the RTP Module 51 52 * 52 * First application must call #pj _rtp_session_initto initialize the RTP53 * First application must call #pjmedia_rtp_session_init() to initialize the RTP 53 54 * session. 54 55 * 55 56 * When application wants to send RTP packet, it needs to call 56 * #pj _rtp_encode_rtpto build the RTP header. Note that this WILL NOT build57 * #pjmedia_rtp_encode_rtp() to build the RTP header. Note that this WILL NOT build 57 58 * the complete RTP packet, but instead only the header. Application can 58 59 * then either concatenate the header with the payload, or send the two … … 61 62 * 62 63 * When application receives an RTP packet, first it should call 63 * #pj _rtp_decode_rtp to decode RTP header and payload, then it should call64 * #pj _rtp_session_update to check whether we can process the RTP payload,64 * #pjmedia_rtp_decode_rtp to decode RTP header and payload, then it should call 65 * #pjmedia_rtp_session_update to check whether we can process the RTP payload, 65 66 * and to let the RTP session updates its internal status. The decode function 66 67 * is guaranteed to point the payload to the correct position regardless of … … 70 71 71 72 72 #ifdef _MSC_VER 73 # pragma warning ( disable : 4214 ) 73 #pragma pack(1) 74 75 /** 76 * RTP packet header. 77 */ 78 struct pjmedia_rtp_hdr 79 { 80 #if defined(PJ_IS_BIG_ENDIAN) && (PJ_IS_BIG_ENDIAN!=0) 81 int v:2; /**< packet type/version */ 82 int p:1; /**< padding flag */ 83 int x:1; /**< extension flag */ 84 int cc:4; /**< CSRC count */ 85 int m:1; /**< marker bit */ 86 int pt:7; /**< payload type */ 87 #else 88 int cc:4; /**< CSRC count */ 89 int x:1; /**< header extension flag */ 90 int p:1; /**< padding flag */ 91 int v:2; /**< packet type/version */ 92 int pt:7; /**< payload type */ 93 int m:1; /**< marker bit */ 74 94 #endif 75 76 77 /** 78 * Error codes. 79 */ 80 enum pj_rtp_error_t 81 { 82 PJMEDIA_RTP_ERR_RTP_PACKING, /**< Invalid RTP packet. */ 83 PJMEDIA_RTP_ERR_INVALID_VERSION, /**< Invalid RTP version. */ 84 PJMEDIA_RTP_ERR_INVALID_SSRC, /**< Invalid SSRC. */ 85 PJMEDIA_RTP_ERR_INVALID_PT, /**< Invalid payload type. */ 86 PJMEDIA_RTP_ERR_INVALID_PACKET, /**< Invalid packet. */ 87 PJMEDIA_RTP_ERR_SESSION_RESTARTED, /**< Session has just been restarted. */ 88 PJMEDIA_RTP_ERR_SESSION_PROBATION, /**< Session in probation. */ 89 PJMEDIA_RTP_ERR_BAD_SEQUENCE, /**< Bad RTP sequence number. */ 90 }; 91 92 #pragma pack(1) 93 /** 94 * RTP packet header. 95 */ 96 struct pj_rtp_hdr 97 { 98 #if defined(PJ_IS_BIG_ENDIAN) && (PJ_IS_BIG_ENDIAN!=0) 99 pj_uint16_t v:2; /**< packet type/version */ 100 pj_uint16_t p:1; /**< padding flag */ 101 pj_uint16_t x:1; /**< extension flag */ 102 pj_uint16_t cc:4; /**< CSRC count */ 103 pj_uint16_t m:1; /**< marker bit */ 104 pj_uint16_t pt:7; /**< payload type */ 105 #else 106 pj_uint16_t cc:4; /**< CSRC count */ 107 pj_uint16_t x:1; /**< header extension flag */ 108 pj_uint16_t p:1; /**< padding flag */ 109 pj_uint16_t v:2; /**< packet type/version */ 110 pj_uint16_t pt:7; /**< payload type */ 111 pj_uint16_t m:1; /**< marker bit */ 112 #endif 113 pj_uint16_t seq; /**< sequence number */ 114 pj_uint32_t ts; /**< timestamp */ 115 pj_uint32_t ssrc; /**< synchronization source */ 116 }; 95 pj_uint16_t seq; /**< sequence number */ 96 pj_uint32_t ts; /**< timestamp */ 97 pj_uint32_t ssrc; /**< synchronization source */ 98 }; 99 117 100 #pragma pack() 118 101 119 typedef struct pj_rtp_hdr pj_rtp_hdr; 102 /** 103 * @see pjmedia_rtp_hdr 104 */ 105 typedef struct pjmedia_rtp_hdr pjmedia_rtp_hdr; 106 120 107 121 108 /** 122 109 * RTP extendsion header. 123 110 */ 124 struct pj_rtp_ext_hdr 125 { 126 pj_uint16_t profile_data; 127 pj_uint16_t length; 128 }; 129 130 typedef struct pj_rtp_ext_hdr pj_rtp_ext_hdr; 111 struct pjmedia_rtp_ext_hdr 112 { 113 pj_uint16_t profile_data; /**< Profile data. */ 114 pj_uint16_t length; /**< Length. */ 115 }; 116 117 /** 118 * @see pjmedia_rtp_ext_hdr 119 */ 120 typedef struct pjmedia_rtp_ext_hdr pjmedia_rtp_ext_hdr; 121 131 122 132 123 /** 133 124 * A generic sequence number management, used by both RTP and RTCP. 134 125 */ 135 struct pj_rtp_seq_session 136 { 137 pj_uint16_t max_seq; /**< highest sequence number heard */ 138 pj_uint32_t cycles; /**< shifted count of seq. number cycles */ 139 pj_uint32_t base_seq; /**< base seq number */ 140 pj_uint32_t bad_seq; /**< last 'bad' seq number + 1 */ 141 pj_uint32_t probation; /**< sequ. packets till source is valid */ 142 }; 143 144 typedef struct pj_rtp_seq_session pj_rtp_seq_session; 126 struct pjmedia_rtp_seq_session 127 { 128 pj_uint16_t max_seq; /**< Highest sequence number heard */ 129 pj_uint32_t cycles; /**< Shifted count of seq number cycles */ 130 pj_uint32_t base_seq; /**< Base seq number */ 131 pj_uint32_t bad_seq; /**< Last 'bad' seq number + 1 */ 132 pj_uint32_t probation; /**< Sequ. packets till source is valid */ 133 }; 134 135 /** 136 * @see pjmedia_rtp_seq_session 137 */ 138 typedef struct pjmedia_rtp_seq_session pjmedia_rtp_seq_session; 139 145 140 146 141 /** 147 142 * RTP session descriptor. 148 143 */ 149 struct pj_rtp_session 150 { 151 pj_rtp_hdr out_hdr; /**< Saved header for outgoing packets. */ 152 pj_rtp_seq_session seq_ctrl; /**< Sequence number management. */ 153 pj_uint16_t out_pt; /**< Default outgoing payload type. */ 154 pj_uint32_t out_extseq; /**< Outgoing extended sequence number. */ 155 pj_uint32_t peer_ssrc; /**< Peer SSRC. */ 156 pj_uint32_t received; /**< Number of received packets. */ 157 }; 158 159 typedef struct pj_rtp_session pj_rtp_session; 160 161 /** 162 * \brief Initialize RTP session. 144 struct pjmedia_rtp_session 145 { 146 pjmedia_rtp_hdr out_hdr; /**< Saved hdr for outgoing pkts. */ 147 pjmedia_rtp_seq_session seq_ctrl; /**< Sequence number management. */ 148 pj_uint16_t out_pt; /**< Default outgoing payload type. */ 149 pj_uint32_t out_extseq; /**< Outgoing extended seq #. */ 150 pj_uint32_t peer_ssrc; /**< Peer SSRC. */ 151 pj_uint32_t received; /**< Number of received packets. */ 152 }; 153 154 /** 155 * @see pjmedia_rtp_session 156 */ 157 typedef struct pjmedia_rtp_session pjmedia_rtp_session; 158 159 160 /** 163 161 * This function will initialize the RTP session according to given parameters. 164 162 * … … 167 165 * @param sender_ssrc SSRC used for outgoing packets. 168 166 * 169 * @return zeroif successfull.170 */ 171 PJ_DECL(pj_status_t) pj _rtp_session_init( pj_rtp_session *ses,172 int default_pt, pj_uint32_t sender_ssrc );173 174 /** 175 * \brief Encode outgoing RTP packet header. 167 * @return PJ_SUCCESS if successfull. 168 */ 169 PJ_DECL(pj_status_t) pjmedia_rtp_session_init( pjmedia_rtp_session *ses, 170 int default_pt, 171 pj_uint32_t sender_ssrc ); 172 173 /** 176 174 * Create the RTP header based on arguments and current state of the RTP 177 175 * session. … … 185 183 * @param hdrlen Upon return will indicate the size of RTP packet header 186 184 * 187 * @return zero if successfull. 188 */ 189 PJ_DECL(pj_status_t) pj_rtp_encode_rtp( pj_rtp_session *ses, int pt, int m, 190 int payload_len, int ts_len, 191 const void **rtphdr, int *hdrlen ); 192 193 /** 194 * \brief Decode an incoming RTP packet. 195 * This function will decode incoming packet into RTP header and payload. 185 * @return PJ_SUCCESS if successfull. 186 */ 187 PJ_DECL(pj_status_t) pjmedia_rtp_encode_rtp( pjmedia_rtp_session *ses, 188 int pt, int m, 189 int payload_len, int ts_len, 190 const void **rtphdr, 191 int *hdrlen ); 192 193 /** 194 * This function decodes incoming packet into RTP header and payload. 196 195 * The decode function is guaranteed to point the payload to the correct 197 196 * position regardless of any options present in the RTP packet. … … 206 205 * @param payloadlen Upon return will indicate the size of the payload. 207 206 * 208 * @return zero if successfull. 209 */ 210 PJ_DECL(pj_status_t) pj_rtp_decode_rtp( pj_rtp_session *ses, 211 const void *pkt, int pkt_len, 212 const pj_rtp_hdr **hdr, 213 const void **payload, 214 unsigned *payloadlen); 215 216 /** 217 * \brief Update RTP session with an incoming RTP packet. 218 * Call this function everytime 219 * an RTP packet is received to check whether the packet can be received and to 220 * let the RTP session performs its internal calculations. 207 * @return PJ_SUCCESS if successfull. 208 */ 209 PJ_DECL(pj_status_t) pjmedia_rtp_decode_rtp( pjmedia_rtp_session *ses, 210 const void *pkt, int pkt_len, 211 const pjmedia_rtp_hdr **hdr, 212 const void **payload, 213 unsigned *payloadlen); 214 215 /** 216 * Call this function everytime an RTP packet is received to check whether 217 * the packet can be received and to let the RTP session performs its internal 218 * calculations. 221 219 * 222 220 * @param ses The session. 223 221 * @param hdr The RTP header of the incoming packet. 224 222 * 225 * @return zero if the packet is valid and can be processed, otherwise will 226 * return one of the error in #pj_rtp_error_t. 227 */ 228 PJ_DECL(pj_status_t) pj_rtp_session_update( pj_rtp_session *ses, 229 const pj_rtp_hdr *hdr); 223 * @return PJ_SUCCESS if the packet is valid and can be processed, 224 * otherwise will return the appropriate status code. 225 */ 226 PJ_DECL(pj_status_t) pjmedia_rtp_session_update( pjmedia_rtp_session *ses, 227 const pjmedia_rtp_hdr *hdr); 228 229 230 /* 231 * INTERNAL: 232 */ 230 233 231 234 /** 232 * \brief Internal. 233 * Internal function for sequence control, shared by RTCP implementation. 234 */ 235 void pj_rtp_seq_init(pj_rtp_seq_session *seq_ctrl, pj_uint16_t seq); 235 * Internal function for creating sequence number control, shared by RTCP 236 * implementation. 237 * 238 * @param seq_ctrl The sequence control instance. 239 * @param seq Sequence number to initialize. 240 */ 241 void pjmedia_rtp_seq_init(pjmedia_rtp_seq_session *seq_ctrl, 242 pj_uint16_t seq); 243 236 244 237 245 /** 238 * \brief Internal. 239 * Internal function for sequence control, shared by RTCP implementation. 240 */ 241 void pj_rtp_seq_restart(pj_rtp_seq_session *seq_ctrl, pj_uint16_t seq); 246 * Internal function to restart the sequence number control, shared by RTCP 247 * implementation. 248 * 249 * @param seq_ctrl The sequence control instance. 250 * @param seq Sequence number to restart. 251 */ 252 void pjmedia_rtp_seq_restart(pjmedia_rtp_seq_session *seq_ctrl, 253 pj_uint16_t seq); 242 254 243 255 /** 244 * \brief Internal. 245 * Internal function for sequence control, shared by RTCP implementation. 246 */ 247 int pj_rtp_seq_update(pj_rtp_seq_session *seq_ctrl, pj_uint16_t seq); 256 * Internal function update sequence control, shared by RTCP implementation. 257 * 258 * @param seq_ctrl The sequence control instance. 259 * @param seq Sequence number to update. 260 * 261 * @return PJ_SUCCESS if the sequence number can be accepted. 262 */ 263 pj_status_t pjmedia_rtp_seq_update(pjmedia_rtp_seq_session *seq_ctrl, 264 pj_uint16_t seq); 248 265 249 266 /** -
pjproject/trunk/pjmedia/include/pjmedia/sdp.h
r129 r188 21 21 22 22 /** 23 * @defgroup PJSDP SDP Library24 */25 /**26 23 * @file sdp.h 27 24 * @brief SDP header file. 28 25 */ 29 /** 30 * @defgroup PJ_SDP_H SDP stack. 31 * @ingroup PJSDP 26 #include <pjmedia/types.h> 27 28 29 /** 30 * @defgroup PJ_SDP SDP Parsing and Data Structure 31 * @ingroup PJMEDIA 32 32 * @{ 33 33 * 34 * This SDP module consists of SDP parser, SDP structure, and function to 35 * print back the structure as SDP message. 36 */ 37 38 #include <pjmedia/types.h> 34 * The basic SDP session descriptor and elements are described in header 35 * file <pre><pjmedia/sdp.h></pre>. This file contains declaration for 36 * SDP session descriptor and SDP media descriptor, along with their 37 * attributes. This file also declares functions to parse SDP message. 38 */ 39 39 40 40 41 PJ_BEGIN_DECL 41 42 42 #define PJSDP_MAX_FMT 32 43 #define PJSDP_MAX_ATTR 32 44 #define PJSDP_MAX_MEDIA 16 45 46 47 /**************************************************************************** 43 /** 44 * The PJMEDIA_MAX_SDP_FMT macro defines maximum format in a media line. 45 */ 46 #ifndef PJMEDIA_MAX_SDP_FMT 47 # define PJMEDIA_MAX_SDP_FMT 16 48 #endif 49 50 /** 51 * The PJMEDIA_MAX_SDP_ATTR macro defines maximum SDP attributes in media and 52 * session descriptor. 53 */ 54 #ifndef PJMEDIA_MAX_SDP_ATTR 55 # define PJMEDIA_MAX_SDP_ATTR (PJMEDIA_MAX_SDP_FMT*2 + 4) 56 #endif 57 58 /** 59 * The PJMEDIA_MAX_SDP_MEDIA macro defines maximum SDP media lines in a 60 * SDP session descriptor. 61 */ 62 #ifndef PJMEDIA_MAX_SDP_MEDIA 63 # define PJMEDIA_MAX_SDP_MEDIA 16 64 #endif 65 66 67 /* ************************************************************************** 48 68 * SDP ATTRIBUTES 49 *************************************************************************** *69 *************************************************************************** 50 70 */ 51 71 52 72 /** 53 * SDP genericattribute.73 * Generic representation of attribute. 54 74 */ 55 75 struct pjmedia_sdp_attr … … 91 111 * @param name Attribute name to find. 92 112 * @param fmt Optional string to indicate which payload format 93 * to find for rtpmap and fmt attributes. 113 * to find for \a rtpmap and \a fmt attributes. For other 114 * types of attributes, the value should be NULL. 94 115 * 95 116 * @return The specified attribute, or NULL if it can't be found. 96 117 * 97 * @see pjmedia_sdp_attr_find2, pjmedia_sdp_media_find_attr 118 * @see pjmedia_sdp_attr_find2, pjmedia_sdp_media_find_attr, 119 * pjmedia_sdp_media_find_attr2 98 120 */ 99 121 PJ_DECL(pjmedia_sdp_attr*) … … 109 131 * @param name Attribute name to find. 110 132 * @param fmt Optional string to indicate which payload format 111 * to find for rtpmap and fmt attributes. 133 * to find for \a rtpmap and \a fmt attributes. For other 134 * types of attributes, the value should be NULL. 112 135 * 113 136 * @return The specified attribute, or NULL if it can't be found. 114 137 * 115 * @see pjmedia_sdp_attr_find, pjmedia_sdp_media_find_attr2 138 * @see pjmedia_sdp_attr_find, pjmedia_sdp_media_find_attr, 139 * pjmedia_sdp_media_find_attr2 116 140 */ 117 141 PJ_DECL(pjmedia_sdp_attr*) … … 136 160 137 161 /** 138 * Remove all attributes with the specified name when they present.162 * Remove all attributes with the specified name in array of attributes. 139 163 * 140 164 * @param count Number of attributes in the array. … … 156 180 * @param count Number of attributes in the array. 157 181 * @param attr_array Array of attributes. 158 * @param name Attribute name to find.182 * @param attr The attribute instance to remove. 159 183 * 160 184 * @return PJ_SUCCESS when attribute has been removed, or … … 169 193 170 194 /** 171 * SDP \a rtpmap attribute.195 * This structure declares SDP \a rtpmap attribute. 172 196 */ 173 197 struct pjmedia_sdp_rtpmap … … 181 205 182 206 /** 183 * Convert generic attribute to SDP rtpmap. 207 * Convert generic attribute to SDP \a rtpmap. This function allocates 208 * a new attribute and call #pjmedia_sdp_attr_get_rtpmap(). 184 209 * 185 210 * @param pool Pool used to create the rtpmap attribute. … … 188 213 * @param p_rtpmap Pointer to receive SDP rtpmap attribute. 189 214 * 190 * @return PJ_SUCCESS on success. 215 * @return PJ_SUCCESS if the attribute can be successfully 216 * converted to \a rtpmap type. 217 * 218 * @see pjmedia_sdp_attr_get_rtpmap 191 219 */ 192 220 PJ_DECL(pj_status_t) pjmedia_sdp_attr_to_rtpmap(pj_pool_t *pool, … … 200 228 * @param attr Generic attribute to be converted to rtpmap, which 201 229 * name must be "rtpmap". 202 * @param rtpmap SDP rtpmap attribute to be initialized. 203 * 204 * @return PJ_SUCCESS on success. 230 * @param rtpmap SDP \a rtpmap attribute to be initialized. 231 * 232 * @return PJ_SUCCESS if the attribute can be successfully 233 * converted to \a rtpmap attribute. 234 * 235 * @see pjmedia_sdp_attr_to_rtpmap 205 236 */ 206 237 PJ_DECL(pj_status_t) pjmedia_sdp_attr_get_rtpmap(const pjmedia_sdp_attr *attr, … … 209 240 210 241 /** 211 * Convert rtpmap attribute to generic attribute.242 * Convert \a rtpmap attribute to generic attribute. 212 243 * 213 244 * @param pool Pool to be used. 214 * @param rtpmap The rtpmap attribute.245 * @param rtpmap The \a rtpmap attribute. 215 246 * @param p_attr Pointer to receive the generic SDP attribute. 216 247 * 217 248 * @return PJ_SUCCESS on success. 218 249 */ 219 PJ_DECL(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool, 220 const pjmedia_sdp_rtpmap *rtpmap, 221 pjmedia_sdp_attr **p_attr); 222 223 224 /** 225 * SDP \a fmtp attribute. 250 PJ_DECL(pj_status_t) 251 pjmedia_sdp_rtpmap_to_attr( pj_pool_t *pool, 252 const pjmedia_sdp_rtpmap *rtpmap, 253 pjmedia_sdp_attr **p_attr); 254 255 256 /** 257 * This structure describes SDP \a fmtp attribute. 226 258 */ 227 259 struct pjmedia_sdp_fmtp … … 245 277 246 278 247 /* ***************************************************************************279 /* ************************************************************************** 248 280 * SDP CONNECTION INFO 249 281 **************************************************************************** … … 251 283 252 284 /** 253 * SDP connection info.285 * This structure describes SDP connection info ("c=" line). 254 286 */ 255 287 struct pjmedia_sdp_conn … … 262 294 263 295 /** 264 * Clone connection info.296 * Clone connection info. 265 297 * 266 298 * @param pool Pool to allocate memory for the new connection info. 267 299 * @param rhs The connection into to clone. 268 300 * 269 * @return the new connection info.301 * @return The new connection info. 270 302 */ 271 303 PJ_DECL(pjmedia_sdp_conn*) pjmedia_sdp_conn_clone(pj_pool_t *pool, … … 274 306 275 307 276 /* ***************************************************************************308 /* ************************************************************************** 277 309 * SDP MEDIA INFO/LINE 278 310 **************************************************************************** … … 280 312 281 313 /** 282 * SDP media description. 314 * This structure describes SDP media descriptor. A SDP media descriptor 315 * starts with "m=" line and contains the media attributes and optional 316 * connection line. 283 317 */ 284 318 struct pjmedia_sdp_media 285 319 { 320 /** Media descriptor line ("m=" line) */ 286 321 struct 287 322 { … … 291 326 pj_str_t transport; /**< Transport ("RTP/AVP") */ 292 327 unsigned fmt_count; /**< Number of formats. */ 293 pj_str_t fmt[PJ SDP_MAX_FMT]; /**< Media formats.*/328 pj_str_t fmt[PJMEDIA_MAX_SDP_FMT]; /**< Media formats. */ 294 329 } desc; 295 330 296 331 pjmedia_sdp_conn *conn; /**< Optional connection info. */ 297 332 unsigned attr_count; /**< Number of attributes. */ 298 pjmedia_sdp_attr*attr[PJ SDP_MAX_ATTR]; /**< Attributes.*/333 pjmedia_sdp_attr*attr[PJMEDIA_MAX_SDP_ATTR]; /**< Attributes. */ 299 334 300 335 }; … … 307 342 * @param rhs The media descriptin to clone. 308 343 * 309 * @return a new media description.344 * @return New media description. 310 345 */ 311 346 PJ_DECL(pjmedia_sdp_media*) … … 314 349 315 350 /** 316 * Find the first occurence of the specified attribute name. 351 * Find the first occurence of the specified attribute name in the media 352 * descriptor. Optionally the format may be specified. 317 353 * 318 354 * @param m The SDP media description. 319 355 * @param name Attribute name to find. 320 * @param fmt Optional payload format type to find in the 321 * attribute list. The payload format type will be 322 * compared for attributes such as rtpmap and fmtp. 356 * @param fmt Optional payload type to match in the 357 * attribute list, when the attribute is \a rtpmap 358 * or \a fmtp. For other types of SDP attributes, this 359 * value should be NULL. 323 360 * 324 361 * @return The first instance of the specified attribute or NULL. … … 330 367 331 368 /** 332 * Find the first occurence of the specified attribute name. 369 * Find the first occurence of the specified attribute name in the SDP media 370 * descriptor. Optionally the format may be specified. 333 371 * 334 372 * @param m The SDP media description. 335 373 * @param name Attribute name to find. 336 * @param fmt Optional payload format type to find in the 337 * attribute list. The payload format type will be 338 * compared for attributes such as rtpmap and fmtp. 374 * @param fmt Optional payload type to match in the 375 * attribute list, when the attribute is \a rtpmap 376 * or \a fmtp. For other types of SDP attributes, this 377 * value should be NULL. 339 378 * 340 379 * @return The first instance of the specified attribute or NULL. … … 348 387 * 349 388 * @param m The SDP media description. 350 * @param nameAttribute to add.389 * @param attr Attribute to add. 351 390 * 352 391 * @return PJ_SUCCESS or the appropriate error code. … … 356 395 357 396 /** 358 * Remove all attributes with the specified name. 397 * Remove all attributes with the specified name from the SDP media 398 * descriptor. 359 399 * 360 400 * @param m The SDP media description. … … 369 409 370 410 /** 371 * Remove the occurence of the specified attribute. 411 * Remove the occurence of the specified attribute from the SDP media 412 * descriptor. 413 * 414 * @param m The SDP media descriptor. 415 * @param attr The attribute to find and remove. 416 * 417 * @return PJ_SUCCESS if the attribute can be found and has 418 * been removed from the array. 372 419 */ 373 420 PJ_DECL(pj_status_t) … … 381 428 * @param sd1 The first SDP media to compare. 382 429 * @param sd2 The second SDP media to compare. 383 * @param option Comparison option. 384 * 385 * @return PJ_SUCCESS when both SDP medias are equal. 430 * @param option Comparison option, which should be zero for now. 431 * 432 * @return PJ_SUCCESS when both SDP medias are equal, or the 433 * appropriate status code describing which part of 434 * the descriptors that are not equal. 386 435 */ 387 436 PJ_DECL(pj_status_t) pjmedia_sdp_media_cmp(const pjmedia_sdp_media *sd1, … … 391 440 392 441 393 /* ***************************************************************************442 /* ************************************************************************** 394 443 * SDP SESSION DESCRIPTION 395 444 **************************************************************************** … … 398 447 399 448 /** 400 * This structure describes SDP session description. 449 * This structure describes SDP session description. A SDP session descriptor 450 * contains complete information about a session, and normally is exchanged 451 * with remote media peer using signaling protocol such as SIP. 401 452 */ 402 453 struct pjmedia_sdp_session 403 454 { 404 /** Origin (o= line) */455 /** Session origin (o= line) */ 405 456 struct 406 457 { … … 424 475 425 476 unsigned attr_count; /**< Number of attributes. */ 426 pjmedia_sdp_attr *attr[PJ SDP_MAX_ATTR]; /**< Attributes array.*/477 pjmedia_sdp_attr *attr[PJMEDIA_MAX_SDP_ATTR]; /**< Attributes array. */ 427 478 428 479 unsigned media_count; /**< Number of media. */ 429 pjmedia_sdp_media *media[PJ SDP_MAX_MEDIA]; /**< Media array.*/480 pjmedia_sdp_media *media[PJMEDIA_MAX_SDP_MEDIA]; /**< Media array. */ 430 481 431 482 }; … … 435 486 * Parse SDP message. 436 487 * 488 * @param pool The pool to allocate SDP session description. 437 489 * @param buf The message buffer. 438 490 * @param len The length of the message. 439 * @param pool The pool to allocate SDP session description. 440 * 441 * @return SDP session description. 491 * @param p_sdp Pointer to receive the SDP session descriptor. 492 * 493 * @return PJ_SUCCESS if message was successfully parsed into 494 * SDP session descriptor. 442 495 */ 443 496 PJ_DECL(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool, … … 448 501 * Print SDP description to a buffer. 449 502 * 503 * @param sdp The SDP session description. 450 504 * @param buf The buffer. 451 505 * @param size The buffer length. 452 * @param desc The SDP session description.453 * 454 * @return the length printed, or -1.455 */ 456 PJ_DECL(int) pjmedia_sdp_print( const pjmedia_sdp_session * desc,506 * 507 * @return the length printed, or -1 if the buffer is too 508 * short. 509 */ 510 PJ_DECL(int) pjmedia_sdp_print( const pjmedia_sdp_session *sdp, 457 511 char *buf, pj_size_t size); 458 512 459 513 460 514 /** 461 * Validate SDP descriptor. 515 * Perform semantic validation for the specified SDP session descriptor. 516 * This function perform validation beyond just syntactic verification, 517 * such as to verify the value of network type and address type, check 518 * the connection line, and verify that \a rtpmap attribute is present 519 * when dynamic payload type is used. 520 * 521 * @param sdp The SDP session descriptor to validate. 522 * 523 * @return PJ_SUCCESS on success. 462 524 */ 463 525 PJ_DECL(pj_status_t) pjmedia_sdp_validate(const pjmedia_sdp_session *sdp); … … 465 527 466 528 /** 467 * Clone SDP session .529 * Clone SDP session descriptor. 468 530 * 469 531 * @param pool The pool used to clone the session. 470 * @param s essThe SDP session to clone.532 * @param sdp The SDP session to clone. 471 533 * 472 534 * @return New SDP session. … … 474 536 PJ_DECL(pjmedia_sdp_session*) 475 537 pjmedia_sdp_session_clone( pj_pool_t *pool, 476 const pjmedia_sdp_session *s ess);538 const pjmedia_sdp_session *sdp); 477 539 478 540 … … 482 544 * @param sd1 The first SDP session to compare. 483 545 * @param sd2 The second SDP session to compare. 484 * 485 * @return PJ_SUCCESS when both SDPs are equal. 546 * @param option Must be zero for now. 547 * 548 * @return PJ_SUCCESS when both SDPs are equal, or otherwise 549 * the status code indicates which part of the session 550 * descriptors are not equal. 486 551 */ 487 552 PJ_DECL(pj_status_t) pjmedia_sdp_session_cmp(const pjmedia_sdp_session *sd1, -
pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h
r163 r188 22 22 23 23 /** 24 * @defgroup PJSDP SDP Library25 */26 /**27 24 * @file sdp_neg.h 28 25 * @brief SDP negotiator header file. … … 30 27 /** 31 28 * @defgroup PJ_SDP_NEG SDP Negotiator. 32 * @ingroup PJ SDP29 * @ingroup PJMEDIA 33 30 * @{ 34 *. 35 */ 36 37 #include <pjmedia/types.h> 38 39 PJ_BEGIN_DECL 40 41 /** 42 * This enumeration describes SDP negotiation state. The negotiator state 43 * is illustrated in the following diagram. 31 * 32 * The header file <b><pjmedia/sdp_neg.h></b> contains the declaration 33 * of SDP offer and answer negotiator. SDP offer and answer model is described 34 * in RFC 3264 <b>"An Offer/Answer Model with Session Description Protocol 35 * (SDP)"</b>. 36 * 37 * The SDP negotiator is represented with opaque type \a pjmedia_sdp_neg. 38 * This structure contains negotiation state and several SDP session 39 * descriptors currently being used in the negotiation. 40 * 41 * 42 * \section sdpneg_state_dia SDP Negotiator State Diagram 43 * 44 * The following diagram describes the state transition diagram of the 45 * SDP negotiator. 44 46 * 45 47 * <pre> 46 * reinit_local_offer()48 * 47 49 * modify_local_offer() 48 50 * create_w_local_offer() +-------------+ send_local_offer() … … 63 65 * 64 66 * </pre> 67 * 68 * 69 * 70 * \section sdpneg_offer_answer SDP Offer/Answer Model with Negotiator 71 * 72 * \subsection sdpneg_create_offer Creating Initial Offer 73 * 74 * Application creates an offer by manualy building the SDP session descriptor 75 * (pjmedia_sdp_session), or request PJMEDIA endpoint (pjmedia_endpt) to 76 * create SDP session descriptor based on capabilities that present in the 77 * endpoint by calling #pjmedia_endpt_create_sdp(). 78 * 79 * Application then creates SDP negotiator instance by calling 80 * #pjmedia_sdp_neg_create_w_local_offer(), passing the SDP offer in the 81 * function arguments. The SDP negotiator keeps a copy of current local offer, 82 * and update its state to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER. 83 * 84 * Application can then send the initial SDP offer that it creates to 85 * remote peer using signaling protocol such as SIP. 86 * 87 * 88 * \subsection sdpneg_subseq_offer Generating Subsequent Offer 89 * 90 * The negotiator can only create subsequent offer after it has finished 91 * the negotiation process of previous offer/answer session (i.e. the 92 * negotiator state is PJMEDIA_SDP_NEG_STATE_DONE). 93 * 94 * If any previous negotiation process was successfull (i.e. the return 95 * value of #pjmedia_sdp_neg_negotiate() was PJ_SUCCESS), the negotiator 96 * keeps both active local and active remote SDP. 97 * 98 * If application does not want send modified offer, it can just send 99 * the active local SDP as the offer. In this case, application calls 100 * #pjmedia_sdp_neg_send_local_offer() to get the active local SDP. 101 * 102 * If application wants to modify it's local offer, it MUST inform 103 * the negotiator about the modified SDP by calling 104 * #pjmedia_sdp_neg_modify_local_offer(). 105 * 106 * In both cases, the negotiator will internally create a copy of the offer, 107 * and move it's state to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, where it 108 * waits until application passes the remote answer. 109 * 110 * 111 * \subsection sdpneg_receive_offer Receiving Initial Offer 112 * 113 * Application receives an offer in the incoming request from remote to 114 * establish multimedia session, such as incoming INVITE message with SDP 115 * body. 116 * 117 * Initially, when the initial offer is received, application creates the 118 * SDP negotiator by calling #pjmedia_sdp_neg_create_w_remote_offer(), 119 * specifying the remote SDP offer in one of the argument. 120 * 121 * At this stage, application may or may not ready to create an answer. 122 * For example, a SIP B2BUA needs to make outgoing call and receive SDP 123 * from the outgoing call leg in order to create a SDP answer to the 124 * incoming call leg. 125 * 126 * If application is not ready to create an answer, it passes NULL as 127 * the local SDP when it calls #pjmedia_sdp_neg_create_w_remote_offer(). 128 * 129 * The section @ref sdpneg_create_answer describes the case when 130 * application is ready to create a SDP answer. 131 * 132 * 133 * \subsection sdpneg_subseq_offer Receiving Subsequent Offer 134 * 135 * Application passes subsequent SDP offer received from remote by 136 * calling #pjmedia_sdp_neg_set_remote_offer(). 137 * 138 * The negotiator can only receive subsequent offer after it has finished 139 * the negotiation process of previous offer/answer session (i.e. the 140 * negotiator state is PJMEDIA_SDP_NEG_STATE_DONE). 141 * 142 * 143 * \subsection sdpneg_recv_answer Receiving SDP Answer 144 * 145 * When application receives SDP answer from remote, it informs the 146 * negotiator by calling #pjmedia_sdp_neg_set_remote_answer(). The 147 * negotiator validates the answer (#pjmedia_sdp_validate()), and if 148 * succeeds, it moves it's state to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO. 149 * 150 * Application then instruct the negotiator to negotiate the remote 151 * answer by calling #pjmedia_sdp_neg_negotiate(). The purpose of 152 * this negotiation is to verify remote answer, and update the initial 153 * offer according to the answer. For example, the initial offer may 154 * specify that a stream is \a sendrecv, while the answer specifies 155 * that remote stream is \a inactive. In this case, the negotiator 156 * will update the stream in the local active media as \a inactive 157 * too. 158 * 159 * If #pjmedia_sdp_neg_negotiate() returns PJ_SUCCESS, the negotiator will 160 * keep the updated local answer and remote answer internally. These two 161 * SDPs are called active local SDP and active remote SDP, as it describes 162 * currently active session. 163 * 164 * Application can retrieve the active local SDP by calling 165 * #pjmedia_sdp_neg_get_active_local(), and active remote SDP by calling 166 * #pjmedia_sdp_neg_get_active_remote(). 167 * 168 * If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS), 169 * it WILL NOT update its active local and active remote SDP. 170 * 171 * Regardless of the return status of the #pjmedia_sdp_neg_negotiate(), 172 * the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE. 173 * 174 * 175 * \subsection sdpneg_create_answer Generating SDP Answer 176 * 177 * After remote offer has been set in the negotiator, application can 178 * request the SDP negotiator to generate appropriate answer based on local 179 * capability. 180 * 181 * To do this, first the application MUST have an SDP describing its local 182 * capabilities. This SDP can be built manually, or application can generate 183 * SDP to describe local media endpoint capability by calling 184 * #pjmedia_endpt_create_sdp(). When the application is a SIP B2BUA, 185 * application can treat the SDP received from the outgoing call leg as if 186 * it was it's local capability. 187 * 188 * The local SDP session descriptor DOES NOT have to match the SDP offer. 189 * For example, it can have more or less media lines than the offer, or 190 * their order may be different than the offer. The negotiator is capable 191 * to match and reorder local SDP according to remote offer, and create 192 * an answer that is suitable for the offer. 193 * 194 * After local SDP capability has been acquired, application can create 195 * a SDP answer. 196 * 197 * If application does not already have the negotiator instance, it creates 198 * one by calling #pjmedia_sdp_neg_create_w_remote_offer(), specifying 199 * both remote SDP offer and local SDP as the arguments. The SDP negotiator 200 * validates both remote and local SDP by calling #pjmedia_sdp_validate(), 201 * and if both SDPs are valid, the negotiator state will move to 202 * PJMEDIA_SDP_NEG_STATE_WAIT_NEGO where it is ready to negotiate the 203 * offer and answer. 204 * 205 * If application already has the negotiator instance, it sets the local 206 * SDP in the negotiator by calling #pjmedia_sdp_neg_set_local_answer(). 207 * The SDP negotiator then validates local SDP (#pjmedia_sdp_validate() ), 208 * and if it is valid, the negotiator state will move to 209 * PJMEDIA_SDP_NEG_STATE_WAIT_NEGO where it is ready to negotiate the 210 * offer and answer. 211 * 212 * After the SDP negotiator state has moved to PJMEDIA_SDP_NEG_STATE_WAIT_NEGO, 213 * application calls #pjmedia_sdp_neg_negotiate() to instruct the SDP 214 * negotiator to negotiate both offer and answer. This function returns 215 * PJ_SUCCESS if an answer can be generated AND at least one media stream 216 * is active in the session. 217 * 218 * If #pjmedia_sdp_neg_negotiate() returns PJ_SUCCESS, the negotiator will 219 * keep the remote offer and local answer internally. These two SDPs are 220 * called active local SDP and active remote SDP, as it describes currently 221 * active session. 222 * 223 * Application can retrieve the active local SDP by calling 224 * #pjmedia_sdp_neg_get_active_local(), and send this SDP to remote as the 225 * SDP answer. 226 * 227 * If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS), 228 * it WILL NOT update its active local and active remote SDP. 229 * 230 * Regardless of the return status of the #pjmedia_sdp_neg_negotiate(), 231 * the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE. 232 * 233 * 234 */ 235 236 #include <pjmedia/types.h> 237 238 PJ_BEGIN_DECL 239 240 /** 241 * This enumeration describes SDP negotiation state. 65 242 */ 66 243 enum pjmedia_sdp_neg_state … … 113 290 * will move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER state, where it waits 114 291 * until it receives answer from remote. When SDP answer from remote is 115 * received, application shouldcall #pjmedia_sdp_neg_set_remote_answer().292 * received, application must call #pjmedia_sdp_neg_set_remote_answer(). 116 293 * 117 294 * After calling this function, application should send the local SDP offer 118 * to remote party using higher layer signaling protocol (e.g. SIP) and119 * wait for SDPanswer.295 * to remote party using signaling protocol such as SIP and wait for SDP 296 * answer. 120 297 * 121 298 * @param pool Pool to allocate memory. The pool's lifetime needs … … 135 312 * Initialize the SDP negotiator with remote offer, and optionally 136 313 * specify the initial local capability, if known. Application normally 137 * calls this function when it receives initial offer 138 * from remote. 314 * calls this function when it receives initial offer from remote. 139 315 * 140 316 * If local media capability is specified, this capability will be set as … … 243 419 244 420 /** 245 * Completely replaces local offer with new SDP. After calling421 * Modify local session with a new SDP and treat this as a new offer. 246 422 * This function can only be called in state PJMEDIA_SDP_NEG_STATE_DONE. 247 * this function, application can send the modified offer to remote. 423 * After calling this function, application can send the SDP as offer 424 * to remote party, using signaling protocol such as SIP. 248 425 * The negotiator state will move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, 249 426 * where it waits for SDP answer from remote. … … 263 440 264 441 /** 265 * Negotiate local and remote answer. Before calling this function, the266 * SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state.267 * After calling this function, the negotiator state will move to268 * PJMEDIA_SDP_NEG_STATE_DONE regardless whether the negotiation has269 * been successfull or not.270 *271 * If the negotiation succeeds (i.e. the return value is PJ_SUCCESS),272 * the active local and remote SDP will be replaced with the new SDP273 * from the negotiation process.274 *275 * If the negotiation fails, the active local and remote SDP will not276 * change.277 *278 * @param pool Pool to allocate memory. The pool's lifetime needs279 * to be valid for the duration of the negotiator.280 * @param neg The SDP negotiator instance.281 * @param allow_asym Should be zero.282 *283 * @return PJ_SUCCESS when there is at least one media284 * is actuve common in both offer and answer, or285 * failure code when negotiation has failed.286 */287 PJ_DECL(pj_status_t) pjmedia_sdp_neg_negotiate( pj_pool_t *pool,288 pjmedia_sdp_neg *neg,289 pj_bool_t allow_asym);290 291 292 /**293 442 * This function can only be called in PJMEDIA_SDP_NEG_STATE_DONE state. 294 443 * Application calls this function to retrieve currently active 295 * local SDP to be sent to remote. The negotiator state will then move 296 * to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, where it waits for SDP answer 297 * from remote. When SDP answer has been received from remote, application 298 * must call #pjmedia_sdp_neg_set_remote_answer(). 444 * local SDP, and then send the SDP to remote as an offer. The negotiator 445 * state will then move to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER, where it waits 446 * for SDP answer from remote. 447 * 448 * When SDP answer has been received from remote, application must call 449 * #pjmedia_sdp_neg_set_remote_answer(). 299 450 * 300 451 * @param pool Pool to allocate memory. The pool's lifetime needs … … 381 532 382 533 534 /** 535 * Negotiate local and remote answer. Before calling this function, the 536 * SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state. 537 * After calling this function, the negotiator state will move to 538 * PJMEDIA_SDP_NEG_STATE_DONE regardless whether the negotiation has 539 * been successfull or not. 540 * 541 * If the negotiation succeeds (i.e. the return value is PJ_SUCCESS), 542 * the active local and remote SDP will be replaced with the new SDP 543 * from the negotiation process. 544 * 545 * If the negotiation fails, the active local and remote SDP will not 546 * change. 547 * 548 * @param pool Pool to allocate memory. The pool's lifetime needs 549 * to be valid for the duration of the negotiator. 550 * @param neg The SDP negotiator instance. 551 * @param allow_asym Should be zero. 552 * 553 * @return PJ_SUCCESS when there is at least one media 554 * is actuve common in both offer and answer, or 555 * failure code when negotiation has failed. 556 */ 557 PJ_DECL(pj_status_t) pjmedia_sdp_neg_negotiate( pj_pool_t *pool, 558 pjmedia_sdp_neg *neg, 559 pj_bool_t allow_asym); 560 561 383 562 384 563 -
pjproject/trunk/pjmedia/include/pjmedia/session.h
r169 r188 36 36 * @ingroup PJMEDIA 37 37 * @{ 38 * 39 * A media session represents multimedia communication between two 40 * parties. A media session represents the multimedia session that 41 * is described by SDP session descriptor. A media session consists 42 * of one or more media streams (pjmedia_stream), where each stream 43 * represents one media line (m= line) in SDP. 44 * 45 * This module provides functions to create and manage multimedia 46 * sessions. 38 47 */ 39 48 … … 45 54 struct pjmedia_session_info 46 55 { 56 /** Number of streams. */ 47 57 unsigned stream_cnt; 48 pjmedia_stream_info stream_info[PJSDP_MAX_MEDIA]; 58 59 /** Individual stream info. */ 60 pjmedia_stream_info stream_info[PJMEDIA_MAX_SDP_MEDIA]; 49 61 }; 50 62 … … 69 81 * successfully. 70 82 */ 71 PJ_DECL(pj_status_t) pjmedia_session_create( pjmedia_endpt *endpt, 72 unsigned stream_cnt, 73 const pjmedia_sock_info skinfo[], 74 const pjmedia_sdp_session *local_sdp, 75 const pjmedia_sdp_session *rem_sdp, 76 pjmedia_session **p_session ); 83 PJ_DECL(pj_status_t) 84 pjmedia_session_create( pjmedia_endpt *endpt, 85 unsigned stream_cnt, 86 const pjmedia_sock_info skinfo[], 87 const pjmedia_sdp_session *local_sdp, 88 const pjmedia_sdp_session *rem_sdp, 89 pjmedia_session **p_session ); 77 90 78 91 … … 151 164 * @return PJ_SUCCESS on success. 152 165 */ 153 PJ_DECL(pj_status_t) pjmedia_session_enum_streams(const pjmedia_session *session, 154 unsigned *count, 155 pjmedia_stream_info strm_info[]); 166 PJ_DECL(pj_status_t) 167 pjmedia_session_enum_streams( const pjmedia_session *session, 168 unsigned *count, 169 pjmedia_stream_info strm_info[]); 156 170 157 171 … … 162 176 * @param session The media session. 163 177 * @param index Stream index. 164 * @param sta tStream statistic.178 * @param sta Stream statistic. 165 179 * 166 180 * @return PJ_SUCCESS on success. … … 168 182 PJ_DECL(pj_status_t) pjmedia_session_get_stream_stat(pjmedia_session *session, 169 183 unsigned index, 170 pjmedia_stream_stat *sta t);184 pjmedia_stream_stat *sta); 171 185 172 186 /** -
pjproject/trunk/pjmedia/include/pjmedia/sound.h
r121 r188 56 56 typedef struct pj_snd_stream_info 57 57 { 58 unsigned samples_per_sec; /* Sampling rate.*/59 unsigned bits_per_sample; /* No of bits per sample.*/60 unsigned samples_per_frame; /* No of samples per frame.*/61 unsigned bytes_per_frame; /* No of bytes per frame.*/62 unsigned frames_per_packet; /* No of frames per packet.*/58 unsigned samples_per_sec; /**< Sampling rate. */ 59 unsigned bits_per_sample; /**< No of bits per sample. */ 60 unsigned samples_per_frame; /**< No of samples per frame. */ 61 unsigned bytes_per_frame; /**< No of bytes per frame. */ 62 unsigned frames_per_packet; /**< No of frames per packet. */ 63 63 } pj_snd_stream_info; 64 64 -
pjproject/trunk/pjmedia/include/pjmedia/stream.h
r159 r188 23 23 /** 24 24 * @file stream.h 25 * @brief Stream of media.25 * @brief Media Stream. 26 26 */ 27 27 … … 35 35 36 36 /** 37 * @defgroup PJMED_S ES Media session37 * @defgroup PJMED_STRM Media Stream 38 38 * @ingroup PJMEDIA 39 39 * @{ 40 * 41 * A media stream is a bidirectional multimedia communication between two 42 * endpoints. It corresponds to a media description (m= line) in SDP. 43 * 44 * A media stream consists of two unidirectional channels: 45 * - encoding channel, which transmits unidirectional media to remote, and 46 * - decoding channel, which receives unidirectional media from remote. 40 47 */ 41 48 … … 139 146 * Pause the individual channel in the stream. 140 147 * 141 * @param channelThe media channel.148 * @param stream The media channel. 142 149 * @param dir Which direction to pause. 143 150 * … … 150 157 * Resume the individual channel in the stream. 151 158 * 152 * @param channelThe media channel.159 * @param stream The media channel. 153 160 * @param dir Which direction to resume. 154 161 * -
pjproject/trunk/pjmedia/include/pjmedia/types.h
r169 r188 133 133 { 134 134 135 pj_sock_t rtp_sock; 136 pj_sockaddr_in rtp_addr_name; 137 pj_sock_t rtcp_sock; 138 pj_sockaddr_in rtcp_addr_name; 135 pj_sock_t rtp_sock; /**< Socket for RTP. */ 136 pj_sockaddr_in rtp_addr_name; /**< Local RTP address to be advertised.*/ 137 pj_sock_t rtcp_sock; /**< Socket for RTCP. */ 138 pj_sockaddr_in rtcp_addr_name; /**< Local RTCP addr to be advertised. */ 139 139 140 140 } pjmedia_sock_info; -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r183 r188 80 80 /* Codec errors. */ 81 81 { PJMEDIA_CODEC_EUNSUP, "Unsupported media codec" }, 82 { PJMEDIA_CODEC_EFAILED, "Codec internal creation error" }, 83 { PJMEDIA_CODEC_EFRMTOOSHORT, "Codec frame is too short" }, 84 { PJMEDIA_CODEC_EPCMTOOSHORT, "PCM frame is too short" }, 82 85 83 86 /* Media errors. */ … … 86 89 { PJMEDIA_EINVALIDPT, "Invalid media payload type" }, 87 90 { PJMEDIA_EMISSINGRTPMAP, "Missing rtpmap in media description" }, 91 { PJMEDIA_EINVALIMEDIATYPE, "Invalid media type" }, 92 93 /* RTP session errors. */ 94 { PJMEDIA_RTP_EINPKT, "Invalid RTP packet" }, 95 { PJMEDIA_RTP_EINPACK, "Invalid RTP packing (internal error)" }, 96 { PJMEDIA_RTP_EINVER, "Invalid RTP version" }, 97 { PJMEDIA_RTP_EINSSRC, "RTP packet SSRC id mismatch" }, 98 { PJMEDIA_RTP_EINPT, "RTP packet payload type mismatch" }, 99 { PJMEDIA_RTP_EINLEN, "Invalid RTP packet length" }, 100 { PJMEDIA_RTP_ESESSRESTART, "RTP session restarted" }, 101 { PJMEDIA_RTP_ESESSPROBATION, "RTP session in probation" }, 102 { PJMEDIA_RTP_EBADSEQ, "Bad sequence number in RTP packet" }, 103 88 104 }; 89 105 -
pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
r169 r188 391 391 } 392 392 393 PJ_DEF(unsigned) pjmedia_jbuf_get_ prefetch_size(pjmedia_jbuf *jb)393 PJ_DEF(unsigned) pjmedia_jbuf_get_min_delay_size(pjmedia_jbuf *jb) 394 394 { 395 395 return jb->jb_prefetch; 396 396 } 397 397 398 PJ_DEF(unsigned) pjmedia_jbuf_get_ current_size(pjmedia_jbuf *jb)398 PJ_DEF(unsigned) pjmedia_jbuf_get_delay(pjmedia_jbuf *jb) 399 399 { 400 400 return jb_framelist_size(&jb->jb_framelist); -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r164 r188 18 18 */ 19 19 #include <pjmedia/rtcp.h> 20 #include <pjmedia/errno.h> 20 21 #include <pj/os.h> /* pj_gettimeofday */ 21 22 #include <pj/sock.h> /* pj_htonx, pj_ntohx */ … … 80 81 s->jitter = 0; 81 82 82 pj _rtp_seq_restart(&s->seq_ctrl, seq);83 pjmedia_rtp_seq_restart(&s->seq_ctrl, seq); 83 84 } 84 85 … … 92 93 93 94 /* Update sequence numbers (received, lost, etc). */ 94 status = pj _rtp_seq_update(&s->seq_ctrl, seq);95 if (status == PJMEDIA_RTP_E RR_SESSION_RESTARTED) {95 status = pjmedia_rtp_seq_update(&s->seq_ctrl, seq); 96 if (status == PJMEDIA_RTP_ESESSRESTART) { 96 97 rtcp_init_seq(s, seq); 97 98 status = 0; -
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r164 r188 18 18 */ 19 19 #include <pjmedia/rtp.h> 20 #include <pjmedia/errno.h> 20 21 #include <pj/log.h> 21 22 #include <pj/os.h> /* pj_gettimeofday() */ … … 35 36 36 37 37 PJ_DEF(pj_status_t) pj _rtp_session_init( pj_rtp_session *ses,38 PJ_DEF(pj_status_t) pjmedia_rtp_session_init( pjmedia_rtp_session *ses, 38 39 int default_pt, pj_uint32_t sender_ssrc ) 39 40 { 40 PJ_LOG(4, (THIS_FILE, "pj _rtp_session_init: ses=%p, default_pt=%d, ssrc=0x%x",41 PJ_LOG(4, (THIS_FILE, "pjmedia_rtp_session_init: ses=%p, default_pt=%d, ssrc=0x%x", 41 42 ses, default_pt, sender_ssrc)); 42 43 43 44 /* Check RTP header packing. */ 44 if (sizeof(struct pj _rtp_hdr) != 12) {45 if (sizeof(struct pjmedia_rtp_hdr) != 12) { 45 46 pj_assert(!"Wrong RTP header packing!"); 46 return PJMEDIA_RTP_E RR_RTP_PACKING;47 return PJMEDIA_RTP_EINPACK; 47 48 } 48 49 … … 82 83 83 84 84 PJ_DEF(pj_status_t) pj _rtp_encode_rtp( pj_rtp_session *ses, int pt, int m,85 PJ_DEF(pj_status_t) pjmedia_rtp_encode_rtp( pjmedia_rtp_session *ses, int pt, int m, 85 86 int payload_len, int ts_len, 86 87 const void **rtphdr, int *hdrlen ) … … 89 90 90 91 PJ_LOG(6, (THIS_FILE, 91 "pj _rtp_encode_rtp: ses=%p, pt=%d, m=%d, pt_len=%d, ts_len=%d",92 "pjmedia_rtp_encode_rtp: ses=%p, pt=%d, m=%d, pt_len=%d, ts_len=%d", 92 93 ses, pt, m, payload_len, ts_len)); 93 94 … … 103 104 /* Return values */ 104 105 *rtphdr = &ses->out_hdr; 105 *hdrlen = sizeof(pj _rtp_hdr);106 107 return PJ_SUCCESS; 108 } 109 110 111 PJ_DEF(pj_status_t) pj _rtp_decode_rtp( pj_rtp_session *ses,106 *hdrlen = sizeof(pjmedia_rtp_hdr); 107 108 return PJ_SUCCESS; 109 } 110 111 112 PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp( pjmedia_rtp_session *ses, 112 113 const void *pkt, int pkt_len, 113 const pj _rtp_hdr **hdr,114 const pjmedia_rtp_hdr **hdr, 114 115 const void **payload, 115 116 unsigned *payloadlen) … … 120 121 121 122 PJ_LOG(6, (THIS_FILE, 122 "pj _rtp_decode_rtp: ses=%p, pkt=%p, pkt_len=%d",123 "pjmedia_rtp_decode_rtp: ses=%p, pkt=%p, pkt_len=%d", 123 124 ses, pkt, pkt_len)); 124 125 125 126 /* Assume RTP header at the start of packet. We'll verify this later. */ 126 *hdr = (pj _rtp_hdr*)pkt;127 *hdr = (pjmedia_rtp_hdr*)pkt; 127 128 128 129 /* Check RTP header sanity. */ 129 130 if ((*hdr)->v != RTP_VERSION) { 130 131 PJ_LOG(4, (THIS_FILE, " invalid RTP version!")); 131 return PJMEDIA_RTP_E RR_INVALID_VERSION;132 return PJMEDIA_RTP_EINVER; 132 133 } 133 134 134 135 /* Payload is located right after header plus CSRC */ 135 offset = sizeof(pj _rtp_hdr) + ((*hdr)->cc * sizeof(pj_uint32_t));136 offset = sizeof(pjmedia_rtp_hdr) + ((*hdr)->cc * sizeof(pj_uint32_t)); 136 137 137 138 /* Adjust offset if RTP extension is used. */ 138 139 if ((*hdr)->x) { 139 pj _rtp_ext_hdr *ext = (pj_rtp_ext_hdr*) (((pj_uint8_t*)pkt) + offset);140 pjmedia_rtp_ext_hdr *ext = (pjmedia_rtp_ext_hdr*) (((pj_uint8_t*)pkt) + offset); 140 141 offset += (pj_ntohs(ext->length) * sizeof(pj_uint32_t)); 141 142 } … … 143 144 /* Check that offset is less than packet size */ 144 145 if (offset >= pkt_len) 145 return PJMEDIA_RTP_E RR_INVALID_PACKET;146 return PJMEDIA_RTP_EINLEN; 146 147 147 148 /* Find and set payload. */ … … 153 154 154 155 155 PJ_DEF(pj_status_t) pj _rtp_session_update( pj_rtp_session *ses, const pj_rtp_hdr *hdr)156 PJ_DEF(pj_status_t) pjmedia_rtp_session_update( pjmedia_rtp_session *ses, const pjmedia_rtp_hdr *hdr) 156 157 { 157 158 int status; … … 161 162 /* 162 163 if (pj_ntohl(ses->peer_ssrc) != hdr->ssrc) { 163 PJ_LOG(4, (THIS_FILE, "pj _rtp_session_update: ses=%p, invalid ssrc 0x%p (!=0x%p)",164 PJ_LOG(4, (THIS_FILE, "pjmedia_rtp_session_update: ses=%p, invalid ssrc 0x%p (!=0x%p)", 164 165 ses, pj_ntohl(hdr->ssrc), ses->peer_ssrc)); 165 return PJMEDIA_RTP_E RR_INVALID_SSRC;166 return PJMEDIA_RTP_EINSSRC; 166 167 } 167 168 */ … … 169 170 /* Check payload type. */ 170 171 if (hdr->pt != ses->out_pt) { 171 PJ_LOG(4, (THIS_FILE, "pj _rtp_session_update: ses=%p, invalid payload type %d (!=%d)",172 PJ_LOG(4, (THIS_FILE, "pjmedia_rtp_session_update: ses=%p, invalid payload type %d (!=%d)", 172 173 ses, hdr->pt, ses->out_pt)); 173 return PJMEDIA_RTP_E RR_INVALID_PT;174 return PJMEDIA_RTP_EINPT; 174 175 } 175 176 176 177 /* Initialize sequence number on first packet received. */ 177 178 if (ses->received == 0) 178 pj _rtp_seq_init( &ses->seq_ctrl, pj_ntohs(hdr->seq) );179 pjmedia_rtp_seq_init( &ses->seq_ctrl, pj_ntohs(hdr->seq) ); 179 180 180 181 /* Check sequence number to see if remote session has been restarted. */ 181 status = pj _rtp_seq_update( &ses->seq_ctrl, pj_ntohs(hdr->seq));182 if (status == PJMEDIA_RTP_E RR_SESSION_RESTARTED) {183 pj _rtp_seq_restart( &ses->seq_ctrl, pj_ntohs(hdr->seq));182 status = pjmedia_rtp_seq_update( &ses->seq_ctrl, pj_ntohs(hdr->seq)); 183 if (status == PJMEDIA_RTP_ESESSRESTART) { 184 pjmedia_rtp_seq_restart( &ses->seq_ctrl, pj_ntohs(hdr->seq)); 184 185 ++ses->received; 185 } else if (status == 0 || status == PJMEDIA_RTP_E RR_SESSION_PROBATION) {186 } else if (status == 0 || status == PJMEDIA_RTP_ESESSPROBATION) { 186 187 ++ses->received; 187 188 } … … 192 193 193 194 194 void pj _rtp_seq_restart(pj_rtp_seq_session *sctrl, pj_uint16_t seq)195 void pjmedia_rtp_seq_restart(pjmedia_rtp_seq_session *sctrl, pj_uint16_t seq) 195 196 { 196 197 sctrl->base_seq = seq; … … 201 202 202 203 203 void pj _rtp_seq_init(pj_rtp_seq_session *sctrl, pj_uint16_t seq)204 { 205 pj _rtp_seq_restart(sctrl, seq);204 void pjmedia_rtp_seq_init(pjmedia_rtp_seq_session *sctrl, pj_uint16_t seq) 205 { 206 pjmedia_rtp_seq_restart(sctrl, seq); 206 207 207 208 sctrl->max_seq = (pj_uint16_t) (seq - 1); … … 210 211 211 212 212 int pj_rtp_seq_update(pj_rtp_seq_session *sctrl, pj_uint16_t seq) 213 pj_status_t pjmedia_rtp_seq_update(pjmedia_rtp_seq_session *sctrl, 214 pj_uint16_t seq) 213 215 { 214 216 pj_uint16_t udelta = (pj_uint16_t) (seq - sctrl->max_seq); … … 224 226 sctrl->max_seq = seq; 225 227 if (sctrl->probation == 0) { 226 return PJMEDIA_RTP_E RR_SESSION_RESTARTED;228 return PJMEDIA_RTP_ESESSRESTART; 227 229 } 228 230 } else { … … 230 232 sctrl->max_seq = seq; 231 233 } 232 return PJMEDIA_RTP_E RR_SESSION_PROBATION;234 return PJMEDIA_RTP_ESESSPROBATION; 233 235 234 236 } else if (udelta < MAX_DROPOUT) { … … 248 250 * (i.e., pretend this was the first packet). 249 251 */ 250 return PJMEDIA_RTP_E RR_SESSION_RESTARTED;252 return PJMEDIA_RTP_ESESSRESTART; 251 253 } 252 254 else { 253 255 sctrl->bad_seq = (seq + 1) & (RTP_SEQ_MOD-1); 254 return PJMEDIA_RTP_E RR_BAD_SEQUENCE;256 return PJMEDIA_RTP_EBADSEQ; 255 257 } 256 258 } else { … … 258 260 } 259 261 260 return 0;261 } 262 263 262 return PJ_SUCCESS; 263 } 264 265 -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r183 r188 180 180 { 181 181 PJ_ASSERT_RETURN(count && attr_array && attr, PJ_EINVAL); 182 PJ_ASSERT_RETURN(*count < PJ SDP_MAX_ATTR, PJ_ETOOMANY);182 PJ_ASSERT_RETURN(*count < PJMEDIA_MAX_SDP_ATTR, PJ_ETOOMANY); 183 183 184 184 attr_array[*count] = attr; -
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r163 r188 579 579 found_matching_other = 0; 580 580 unsigned pt_answer_count = 0; 581 pj_str_t pt_answer[PJ SDP_MAX_FMT];581 pj_str_t pt_answer[PJMEDIA_MAX_SDP_FMT]; 582 582 pjmedia_sdp_media *answer; 583 583 … … 757 757 pj_bool_t has_active = PJ_FALSE; 758 758 pjmedia_sdp_session *answer; 759 char media_used[PJ SDP_MAX_MEDIA];759 char media_used[PJMEDIA_MAX_SDP_MEDIA]; 760 760 unsigned i; 761 761 -
pjproject/trunk/pjmedia/src/pjmedia/session.c
r169 r188 32 32 pjmedia_endpt *endpt; 33 33 unsigned stream_cnt; 34 pjmedia_stream_info stream_info[PJ SDP_MAX_MEDIA];35 pjmedia_stream *stream[PJ SDP_MAX_MEDIA];34 pjmedia_stream_info stream_info[PJMEDIA_MAX_SDP_MEDIA]; 35 pjmedia_stream *stream[PJMEDIA_MAX_SDP_MEDIA]; 36 36 }; 37 37 -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r169 r188 18 18 */ 19 19 #include <pjmedia/stream.h> 20 #include <pjmedia/errno.h> 20 21 #include <pjmedia/rtp.h> 21 22 #include <pjmedia/rtcp.h> … … 59 60 unsigned pcm_buf_size; /**< Size of PCM buffer. */ 60 61 void *pcm_buf; /**< PCM buffer. */ 61 pj _rtp_session rtp; /**< RTP session. */62 pjmedia_rtp_session rtp; /**< RTP session. */ 62 63 }; 63 64 … … 196 197 frame_in.buf = (void*)frame; 197 198 frame_in.size = size; 198 frame_out.buf = ((char*)channel->out_pkt) + sizeof(pj _rtp_hdr);199 frame_out.buf = ((char*)channel->out_pkt) + sizeof(pjmedia_rtp_hdr); 199 200 status = stream->codec->op->encode( stream->codec, &frame_in, 200 channel->out_pkt_size - sizeof(pj _rtp_hdr),201 channel->out_pkt_size - sizeof(pjmedia_rtp_hdr), 201 202 &frame_out); 202 203 if (status != 0) { … … 208 209 /* Encapsulate. */ 209 210 ts_len = size / (channel->snd_info.bits_per_sample / 8); 210 status = pj _rtp_encode_rtp( &channel->rtp,211 status = pjmedia_rtp_encode_rtp( &channel->rtp, 211 212 channel->pt, 0, 212 213 frame_out.size, ts_len, … … 218 219 } 219 220 220 if (rtphdrlen != sizeof(pj _rtp_hdr)) {221 if (rtphdrlen != sizeof(pjmedia_rtp_hdr)) { 221 222 /* We don't support RTP with extended header yet. */ 222 223 PJ_TODO(SUPPORT_SENDING_RTP_WITH_EXTENDED_HEADER); … … 225 226 } 226 227 227 pj_memcpy(channel->out_pkt, rtphdr, sizeof(pj _rtp_hdr));228 pj_memcpy(channel->out_pkt, rtphdr, sizeof(pjmedia_rtp_hdr)); 228 229 229 230 /* Send. */ 230 sent = frame_out.size+sizeof(pj _rtp_hdr);231 sent = frame_out.size+sizeof(pjmedia_rtp_hdr); 231 232 status = pj_sock_sendto(stream->skinfo.rtp_sock, channel->out_pkt, &sent, 0, 232 233 &stream->rem_rtp_addr, sizeof(stream->rem_rtp_addr)); … … 236 237 /* Update stat */ 237 238 stream->stat.enc.pkt++; 238 stream->stat.enc.bytes += frame_out.size+sizeof(pj _rtp_hdr);239 stream->stat.enc.bytes += frame_out.size+sizeof(pjmedia_rtp_hdr); 239 240 240 241 return 0; … … 254 255 while (!stream->quit_flag) { 255 256 pj_ssize_t len; 256 const pj _rtp_hdr *hdr;257 const pjmedia_rtp_hdr *hdr; 257 258 const void *payload; 258 259 unsigned payloadlen; … … 300 301 301 302 /* Update RTP and RTCP session. */ 302 status = pj _rtp_decode_rtp(&channel->rtp, channel->in_pkt, len,303 status = pjmedia_rtp_decode_rtp(&channel->rtp, channel->in_pkt, len, 303 304 &hdr, &payload, &payloadlen); 304 305 if (status != PJ_SUCCESS) { … … 308 309 } 309 310 310 status = pj _rtp_session_update(&channel->rtp, hdr);311 status = pjmedia_rtp_session_update(&channel->rtp, hdr); 311 312 if (status != 0 && 312 status != PJMEDIA_RTP_E RR_SESSION_PROBATION &&313 status != PJMEDIA_RTP_E RR_SESSION_RESTARTED)313 status != PJMEDIA_RTP_ESESSPROBATION && 314 status != PJMEDIA_RTP_ESESSRESTART) 314 315 { 315 316 TRACE_((THIS_FILE, … … 393 394 /* Allocate buffer for outgoing packet. */ 394 395 395 channel->out_pkt_size = sizeof(pj _rtp_hdr) +396 channel->out_pkt_size = sizeof(pjmedia_rtp_hdr) + 396 397 codec_param->avg_bps/8 * 397 398 PJMEDIA_MAX_FRAME_DURATION_MS / … … 416 417 /* Create RTP and RTCP sessions: */ 417 418 418 status = pj _rtp_session_init(&channel->rtp, param->fmt.pt,419 status = pjmedia_rtp_session_init(&channel->rtp, param->fmt.pt, 419 420 param->ssrc); 420 421 if (status != PJ_SUCCESS) -
pjproject/trunk/pjmedia/src/test/rtp_test.c
r65 r188 22 22 int rtp_test() 23 23 { 24 pj _rtp_session rtp;24 pjmedia_rtp_session rtp; 25 25 FILE *fhnd = fopen("RTP.DAT", "wb"); 26 26 const void *rtphdr; … … 30 30 return -1; 31 31 32 pj _rtp_session_init (&rtp, 4, 0x12345678);33 pj _rtp_encode_rtp (&rtp, 4, 0, 0, 160, &rtphdr, &hdrlen);32 pjmedia_rtp_session_init (&rtp, 4, 0x12345678); 33 pjmedia_rtp_encode_rtp (&rtp, 4, 0, 0, 160, &rtphdr, &hdrlen); 34 34 fwrite (rtphdr, hdrlen, 1, fhnd); 35 35 fclose(fhnd);
Note: See TracChangeset
for help on using the changeset viewer.