Changeset 3446
- Timestamp:
- Mar 15, 2011 11:20:35 AM (14 years ago)
- Location:
- pjproject/branches/projects/2.0-dev/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/stream.h
r3420 r3446 89 89 * its own RTP/RTCP socket pair. 90 90 */ 91 struct pjmedia_stream_info91 typedef struct pjmedia_stream_info 92 92 { 93 93 pjmedia_type type; /**< Media type (audio, video) */ … … 135 135 is enabled? */ 136 136 #endif 137 }; 138 139 140 /** 141 * @see pjmedia_stream_info. 142 */ 143 typedef struct pjmedia_stream_info pjmedia_stream_info; 137 } pjmedia_stream_info; 144 138 145 139 … … 247 241 248 242 /** 243 * Get the stream info. 244 * 245 * @param stream The media stream. 246 * @param info Stream info. 247 * 248 * @return PJ_SUCCESS on success. 249 */ 250 PJ_DECL(pj_status_t) pjmedia_stream_get_info( const pjmedia_stream *stream, 251 pjmedia_stream_info *info); 252 253 /** 249 254 * Get the stream statistics. See also 250 255 * #pjmedia_stream_get_stat_jbuf() -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/session.c
r3379 r3446 141 141 } 142 142 143 143 #if 0 // Moved to stream.c 144 144 /* 145 145 * Create stream info from SDP media line. … … 605 605 return PJ_SUCCESS; 606 606 } 607 607 #endif 608 608 609 609 /* -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stream.c
r3435 r3446 66 66 #endif 67 67 68 #ifndef PJMEDIA_STREAM_SIZE 69 # define PJMEDIA_STREAM_SIZE 1000 70 #endif 71 72 #ifndef PJMEDIA_STREAM_INC 73 # define PJMEDIA_STREAM_INC 1000 74 #endif 68 75 69 76 … … 101 108 pjmedia_endpt *endpt; /**< Media endpoint. */ 102 109 pjmedia_codec_mgr *codec_mgr; /**< Codec manager instance. */ 103 110 pjmedia_stream_info si; /**< Creation parameter. */ 104 111 pjmedia_port port; /**< Port interface. */ 105 112 pjmedia_channel *enc; /**< Encoding channel. */ 106 113 pjmedia_channel *dec; /**< Decoding channel. */ 114 115 pj_pool_t *own_pool; /**< Only created if not given */ 107 116 108 117 pjmedia_dir dir; /**< Stream direction. */ … … 1944 1953 unsigned jb_init, jb_max, jb_min_pre, jb_max_pre, len; 1945 1954 pjmedia_audio_format_detail *afd; 1955 pj_pool_t *own_pool = NULL; 1946 1956 char *p; 1947 1957 pj_status_t status; 1948 1958 1949 PJ_ASSERT_RETURN(pool && info && p_stream, PJ_EINVAL); 1959 PJ_ASSERT_RETURN(endpt && info && p_stream, PJ_EINVAL); 1960 1961 if (pool == NULL) { 1962 own_pool = pjmedia_endpt_create_pool( endpt, "strm%p", 1963 PJMEDIA_STREAM_SIZE, 1964 PJMEDIA_STREAM_INC); 1965 PJ_ASSERT_RETURN(own_pool != NULL, PJ_ENOMEM); 1966 pool = own_pool; 1967 } 1950 1968 1951 1969 /* Allocate the media stream: */ … … 1953 1971 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_stream); 1954 1972 PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM); 1973 stream->own_pool = own_pool; 1974 pj_memcpy(&stream->si, info, sizeof(*info)); 1955 1975 1956 1976 /* Init stream/port name */ … … 2443 2463 #endif 2444 2464 2465 if (stream->own_pool) { 2466 pj_pool_t *pool = stream->own_pool; 2467 stream->own_pool = NULL; 2468 pj_pool_release(pool); 2469 } 2445 2470 return PJ_SUCCESS; 2446 2471 } … … 2495 2520 } 2496 2521 2522 2523 PJ_DEF(pj_status_t) pjmedia_stream_get_info( const pjmedia_stream *stream, 2524 pjmedia_stream_info *info) 2525 { 2526 PJ_ASSERT_RETURN(stream && info, PJ_EINVAL); 2527 2528 pj_memcpy(info, &stream->si, sizeof(pjmedia_stream_info)); 2529 return PJ_SUCCESS; 2530 } 2497 2531 2498 2532 /*
Note: See TracChangeset
for help on using the changeset viewer.