- Timestamp:
- Oct 4, 2011 8:23:07 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h
r3664 r3786 288 288 289 289 /** 290 * Query if the stream is started on the specified direction. 291 * 292 * @param stream The video stream. 293 * @param dir The direction to be checked. 294 * 295 * @return PJ_TRUE if stream is started. 296 */ 297 PJ_DECL(pj_bool_t) pjmedia_vid_stream_is_running(pjmedia_vid_stream *stream, 298 pjmedia_dir dir); 299 300 /** 290 301 * Pause the individual channel in the stream. 291 302 * -
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r3776 r3786 1599 1599 1600 1600 /* 1601 * Check status. 1602 */ 1603 PJ_DEF(pj_bool_t) pjmedia_vid_stream_is_running(pjmedia_vid_stream *stream, 1604 pjmedia_dir dir) 1605 { 1606 pj_bool_t is_running = PJ_TRUE; 1607 1608 PJ_ASSERT_RETURN(stream, PJ_FALSE); 1609 1610 if (dir & PJMEDIA_DIR_ENCODING) { 1611 is_running &= (stream->enc && !stream->enc->paused); 1612 } 1613 1614 if (dir & PJMEDIA_DIR_DECODING) { 1615 is_running &= (stream->dec && !stream->dec->paused); 1616 } 1617 1618 return is_running; 1619 } 1620 1621 /* 1601 1622 * Pause stream. 1602 1623 */ -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r3784 r3786 3941 3941 3942 3942 /** 3943 * Determine if video stream for the specified call is currently running 3944 * (i.e. has been created, started, and not being paused) for the specified 3945 * direction. 3946 * 3947 * @param call_id Call identification. 3948 * @param med_idx Media stream index, or -1 to specify default video 3949 * media. 3950 * @param dir The direction to be checked. 3951 * 3952 * @return PJ_TRUE if stream is currently running for the 3953 * specified direction. 3954 */ 3955 PJ_DECL(pj_bool_t) pjsua_call_vid_stream_is_running(pjsua_call_id call_id, 3956 int med_idx, 3957 pjmedia_dir dir); 3958 3959 /** 3943 3960 * Add, remove, modify, and/or manipulate video media stream for the 3944 3961 * specified call. This may trigger a re-INVITE or UPDATE to be sent -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3778 r3786 2039 2039 2040 2040 2041 /* 2042 * Determine if video stream for the specified call is currently running 2043 * for the specified direction. 2044 */ 2045 PJ_DEF(pj_bool_t) pjsua_call_vid_stream_is_running( pjsua_call_id call_id, 2046 int med_idx, 2047 pjmedia_dir dir) 2048 { 2049 pjsua_call *call; 2050 pjsua_call_media *call_med; 2051 2052 PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls, 2053 PJ_EINVAL); 2054 2055 /* Verify and normalize media index */ 2056 if (med_idx == -1) { 2057 med_idx = pjsua_call_get_vid_stream_idx(call_id); 2058 } 2059 2060 call = &pjsua_var.calls[call_id]; 2061 PJ_ASSERT_RETURN(med_idx >= 0 && med_idx < call->med_cnt, PJ_EINVAL); 2062 2063 call_med = &call->media[med_idx]; 2064 2065 /* Verify if the stream is transmitting video */ 2066 if (call_med->type != PJMEDIA_TYPE_VIDEO || (call_med->dir & dir) == 0 || 2067 !call_med->strm.v.stream) 2068 { 2069 return PJ_FALSE; 2070 } 2071 2072 return pjmedia_vid_stream_is_running(call_med->strm.v.stream, dir); 2073 } 2074 2041 2075 #endif /* PJSUA_HAS_VIDEO */ 2042 2076
Note: See TracChangeset
for help on using the changeset viewer.