Ignore:
Timestamp:
Mar 11, 2008 9:38:05 PM (14 years ago)
Author:
bennylp
Message:

Ticket #479: allow media transport framework to return transport specific info (for example, to know whether SRTP is enabled)

File:
1 edited

Legend:

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

    r1810 r1860  
    208208#include <pjmedia/sdp.h> 
    209209 
     210 
    210211/** 
    211212 * Forward declaration for media transport. 
    212213 */ 
    213214typedef struct pjmedia_transport pjmedia_transport; 
     215 
     216/** 
     217 * Forward declaration for media transport info. 
     218 */ 
     219typedef struct pjmedia_transport_info pjmedia_transport_info; 
    214220 
    215221/** 
     
    229235} pjmedia_tranport_media_option; 
    230236 
     237 
    231238/** 
    232239 * This structure describes the operations for the stream transport. 
     
    240247     */ 
    241248    pj_status_t (*get_info)(pjmedia_transport *tp, 
    242                             pjmedia_sock_info *info); 
     249                            pjmedia_transport_info *info); 
    243250 
    244251    /** 
     
    369376 
    370377    /** Media transport using ICE */ 
    371     PJMEDIA_TRANSPORT_TYPE_ICE 
     378    PJMEDIA_TRANSPORT_TYPE_ICE, 
     379 
     380    /**  
     381     * Media transport SRTP, this transport is actually security adapter to be 
     382     * stacked with other transport to enable encryption on the underlying 
     383     * transport. 
     384     */ 
     385    PJMEDIA_TRANSPORT_TYPE_SRTP 
    372386 
    373387} pjmedia_transport_type; 
     
    389403    /** Transport's "virtual" function table. */ 
    390404    pjmedia_transport_op    *op; 
     405}; 
     406 
     407/** 
     408 * This structure describes buffer storage of transport specific info. 
     409 * The actual transport specific info contents will be defined by transport 
     410 * implementation. Note that some transport implementations do not need to 
     411 * provide specific info, since the general socket info is enough. 
     412 */ 
     413typedef struct pjmedia_transport_specific_info 
     414{ 
     415    /** 
     416     * Specify media transport type. 
     417     */ 
     418    pjmedia_transport_type   type; 
     419 
     420    /** 
     421     * Specify storage buffer size of transport specific info. 
     422     */ 
     423    int                      cbsize; 
     424 
     425    /** 
     426     * Storage buffer of transport specific info. 
     427     */ 
     428    char                     buffer[PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE]; 
     429 
     430} pjmedia_transport_specific_info; 
     431 
     432 
     433/** 
     434 * This structure describes transport informations, including general  
     435 * socket information and specific information of single transport or  
     436 * stacked transports (e.g: SRTP stacked on top of UDP) 
     437 */ 
     438struct pjmedia_transport_info 
     439{ 
     440    /** 
     441     * General socket info. 
     442     */ 
     443    pjmedia_sock_info sock_info; 
     444 
     445    /** 
     446     * Specifies number of transport specific info included. 
     447     */ 
     448    int specific_info_cnt; 
     449 
     450    /** 
     451     * Buffer storage of transport specific info. 
     452     */ 
     453    pjmedia_transport_specific_info spc_info[PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXCNT]; 
     454 
    391455}; 
    392456 
     
    404468 */ 
    405469PJ_INLINE(pj_status_t) pjmedia_transport_get_info(pjmedia_transport *tp, 
    406                                                   pjmedia_sock_info *info) 
     470                                                  pjmedia_transport_info *info) 
    407471{ 
    408472    if (tp->op->get_info) 
Note: See TracChangeset for help on using the changeset viewer.