Changeset 5479 for pjproject


Ignore:
Timestamp:
Nov 4, 2016 2:57:20 PM (8 years ago)
Author:
riza
Message:

Closed #1978: Add function to get RTP session from stream/video stream.

Location:
pjproject/trunk/pjmedia
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/stream.h

    r5242 r5479  
    3434#include <pjmedia/transport.h> 
    3535#include <pjmedia/vid_codec.h> 
     36#include <pjmedia/stream_common.h> 
    3637#include <pj/sock.h> 
    3738 
     
    431432pjmedia_stream_send_rtcp_bye( pjmedia_stream *stream ); 
    432433 
     434 
     435/** 
     436 * Get the RTP session information of the media stream. This function can be  
     437 * useful for app with custom media transport to inject/filter some  
     438 * outgoing/incoming proprietary packets into normal audio RTP traffics. 
     439 * This will return the original pointer to the internal states of the stream,  
     440 * and generally it is not advisable for app to modify them. 
     441 * 
     442 * @param stream        The media stream. 
     443 * 
     444 * @param session_info  The stream session info. 
     445 * 
     446 * @return              PJ_SUCCESS on success. 
     447 */ 
     448PJ_DECL(pj_status_t) 
     449pjmedia_stream_get_rtp_session_info(pjmedia_stream *stream, 
     450                                   pjmedia_stream_rtp_sess_info *session_info); 
     451 
     452 
    433453/** 
    434454 * @} 
  • pjproject/trunk/pjmedia/include/pjmedia/stream_common.h

    r3664 r5479  
    2828#include <pjmedia/codec.h> 
    2929#include <pjmedia/sdp.h> 
     30#include <pjmedia/rtp.h> 
     31#include <pjmedia/rtcp.h> 
    3032 
    3133 
    3234PJ_BEGIN_DECL 
     35 
     36/** 
     37 * This structure describes rtp/rtcp session information of the media stream. 
     38 */ 
     39typedef struct pjmedia_stream_rtp_sess_info 
     40{ 
     41    /** 
     42     * The decode RTP session. 
     43     */ 
     44    const pjmedia_rtp_session *rx_rtp; 
     45 
     46    /** 
     47     * The encode RTP session. 
     48     */ 
     49    const pjmedia_rtp_session *tx_rtp; 
     50 
     51    /** 
     52     * The decode RTCP session. 
     53     */ 
     54    const pjmedia_rtcp_session *rtcp; 
     55 
     56} pjmedia_stream_rtp_sess_info; 
     57 
     58 
    3359 
    3460/** 
  • pjproject/trunk/pjmedia/include/pjmedia/vid_stream.h

    r5410 r5479  
    3232#include <pjmedia/transport.h> 
    3333#include <pjmedia/vid_codec.h> 
     34#include <pjmedia/stream_common.h> 
    3435#include <pj/sock.h> 
    3536 
     
    446447                                                pjmedia_vid_stream *stream); 
    447448 
     449/** 
     450 * Get the RTP session information of the video media stream. This function  
     451 * can be useful for app with custom media transport to inject/filter some  
     452 * outgoing/incoming proprietary packets into normal video RTP traffics. 
     453 * This will return the original pointer to the internal states of the stream, 
     454 * and generally it is not advisable for app to modify them. 
     455 *  
     456 * @param stream        The video media stream. 
     457 * 
     458 * @param session_info  The stream session info. 
     459 * 
     460 * @return              PJ_SUCCESS on success. 
     461 */ 
     462PJ_DECL(pj_status_t) 
     463pjmedia_vid_stream_get_rtp_session_info(pjmedia_vid_stream *stream, 
     464                                   pjmedia_stream_rtp_sess_info *session_info); 
     465 
    448466 
    449467/** 
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r5478 r5479  
    2323#include <pjmedia/rtcp.h> 
    2424#include <pjmedia/jbuf.h> 
    25 #include <pjmedia/stream_common.h> 
    2625#include <pj/array.h> 
    2726#include <pj/assert.h> 
     
    29242923    return PJ_SUCCESS; 
    29252924} 
     2925 
     2926 
     2927/** 
     2928 * Get RTP session information from stream. 
     2929 */ 
     2930PJ_DEF(pj_status_t) 
     2931pjmedia_stream_get_rtp_session_info(pjmedia_stream *stream, 
     2932                                    pjmedia_stream_rtp_sess_info *session_info) 
     2933{ 
     2934    session_info->rx_rtp = &stream->dec->rtp; 
     2935    session_info->tx_rtp = &stream->enc->rtp; 
     2936    session_info->rtcp = &stream->rtcp; 
     2937    return PJ_SUCCESS; 
     2938} 
  • pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c

    r5478 r5479  
    2323#include <pjmedia/rtcp.h> 
    2424#include <pjmedia/jbuf.h> 
    25 #include <pjmedia/stream_common.h> 
    2625#include <pj/array.h> 
    2726#include <pj/assert.h> 
     
    20642063 
    20652064 
     2065/** 
     2066 * Get RTP session information from video stream. 
     2067 */ 
     2068PJ_DEF(pj_status_t) 
     2069pjmedia_vid_stream_get_rtp_session_info(pjmedia_vid_stream *stream, 
     2070                                    pjmedia_stream_rtp_sess_info *session_info) 
     2071{ 
     2072    session_info->rx_rtp = &stream->dec->rtp; 
     2073    session_info->tx_rtp = &stream->enc->rtp; 
     2074    session_info->rtcp = &stream->rtcp; 
     2075    return PJ_SUCCESS; 
     2076} 
     2077 
     2078 
    20662079#endif /* PJMEDIA_HAS_VIDEO */ 
Note: See TracChangeset for help on using the changeset viewer.