Ignore:
Timestamp:
Jan 17, 2008 5:29:36 PM (16 years ago)
Author:
nanang
Message:

Ticket #452:

  • Add directory srtp to third_party/build directory
  • Add libsrtp project & integrate it to pjproject vs8 solution
  • Add transport_srtp.h & .c
  • Modify project dependencies to include libsrtp
  • Modify Samples-vc.mak, add libsrtp as third party library
  • Modify transport interface
  • Modify transport_ice & transport_udp to accomodate new transport interface
  • Modify other files that uses transport
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/users/nanang/pjmedia/include/pjmedia/transport.h

    r1098 r1698  
    172172 */ 
    173173typedef struct pjmedia_transport pjmedia_transport; 
     174typedef struct pjmedia_sdp_session pjmedia_sdp_session; 
    174175 
    175176 
     
    243244                             const void *pkt, 
    244245                             pj_size_t size); 
     246 
     247    /** 
     248     * This function is called by application to generate the SDP parts 
     249     * related to transport type, e.g: ICE, SRTP. 
     250     * 
     251     * Application should call #pjmedia_transport_media_create() instead of  
     252     * calling this function directly. 
     253     */ 
     254    pj_status_t (*media_create)(pjmedia_transport *tp, 
     255                                pj_pool_t *pool, 
     256                                pjmedia_sdp_session *sdp_local, 
     257                                const pjmedia_sdp_session *sdp_remote); 
     258 
     259    /** 
     260     * This function is called by application to start the transport 
     261     * based on SDP negotiation result. 
     262     * 
     263     * Application should call #pjmedia_transport_media_start() instead of  
     264     * calling this function directly. 
     265     */ 
     266    pj_status_t (*media_start) (pjmedia_transport *tp, 
     267                                pj_pool_t *pool, 
     268                                pjmedia_sdp_session *sdp_local, 
     269                                const pjmedia_sdp_session *sdp_remote, 
     270                                unsigned media_index); 
     271 
     272    /** 
     273     * This function is called by application to stop the transport. 
     274     * 
     275     * Application should call #pjmedia_transport_media_stop() instead of  
     276     * calling this function directly. 
     277     */ 
     278    pj_status_t (*media_stop)  (pjmedia_transport *tp); 
     279 
     280    /** 
     281     * This function can be called to simulate packet lost. 
     282     * 
     283     * Application should call #pjmedia_transport_simulate_lost() instead of  
     284     * calling this function directly. 
     285     */ 
     286    pj_status_t (*simulate_lost)(pjmedia_transport *tp, 
     287                                 pjmedia_dir dir, 
     288                                 unsigned pct_lost); 
    245289 
    246290    /** 
     
    411455 
    412456/** 
     457 * Generate local SDP parts that are related to the specified media transport. 
     458 * Remote SDP might be needed as reference when application is in deciding 
     459 * side of negotiation (callee side), otherwise it should be NULL. 
     460 * This is just a simple wrapper which calls <tt>media_create()</tt> member  
     461 * of the transport. 
     462 * 
     463 * @param tp            The media transport. 
     464 * @param pool          The memory pool. 
     465 * @param sdp_local     Local SDP. 
     466 * @param sdp_remote    Remote SDP. 
     467 * 
     468 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     469 */ 
     470PJ_INLINE(pj_status_t) pjmedia_transport_media_create(pjmedia_transport *tp, 
     471                                    pj_pool_t *pool, 
     472                                    pjmedia_sdp_session *sdp_local, 
     473                                    const pjmedia_sdp_session *sdp_remote) 
     474{ 
     475    return (*tp->op->media_create)(tp, pool, sdp_local, sdp_remote); 
     476} 
     477 
     478/** 
     479 * Start the transport with regards to SDP negotiation result.  
     480 * This is just a simple wrapper which calls <tt>media_start()</tt> member  
     481 * of the transport. 
     482 * 
     483 * @param tp            The media transport. 
     484 * @param pool          The memory pool. 
     485 * @param sdp_local     Local SDP. 
     486 * @param sdp_remote    Remote SDP. 
     487 * @param media_index   Media index to start. 
     488 * 
     489 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     490 */ 
     491PJ_INLINE(pj_status_t) pjmedia_transport_media_start(pjmedia_transport *tp, 
     492                                    pj_pool_t *pool, 
     493                                    pjmedia_sdp_session *sdp_local, 
     494                                    const pjmedia_sdp_session *sdp_remote, 
     495                                    unsigned media_index) 
     496{ 
     497    return (*tp->op->media_start)(tp, pool, sdp_local, sdp_remote, media_index); 
     498} 
     499 
     500 
     501/** 
     502 * Stop the transport.  
     503 * This is just a simple wrapper which calls <tt>media_stop()</tt> member  
     504 * of the transport. 
     505 * 
     506 * @param tp            The media transport. 
     507 * 
     508 * @return              PJ_SUCCESS on success, or the appropriate error code. 
     509 */ 
     510PJ_INLINE(pj_status_t) pjmedia_transport_media_stop(pjmedia_transport *tp) 
     511{ 
     512    return (*tp->op->media_stop)(tp); 
     513} 
     514 
     515/** 
    413516 * Close media transport. This is just a simple wrapper which calls  
    414517 * <tt>destroy()</tt> member of the transport. This function will free 
     
    427530} 
    428531 
     532/** 
     533 * Simulate packet lost in the specified direction (for testing purposes). 
     534 * When enabled, the transport will randomly drop packets to the specified 
     535 * direction. 
     536 * 
     537 * @param tp        The media transport. 
     538 * @param dir       Media direction to which packets will be randomly dropped. 
     539 * @param pct_lost  Percent lost (0-100). Set to zero to disable packet 
     540 *                  lost simulation. 
     541 * 
     542 * @return          PJ_SUCCESS on success. 
     543 */ 
     544PJ_INLINE(pj_status_t) pjmedia_transport_simulate_lost(pjmedia_transport *tp, 
     545                                                       pjmedia_dir dir, 
     546                                                       unsigned pct_lost) 
     547{ 
     548    return (*tp->op->simulate_lost)(tp, dir, pct_lost); 
     549} 
     550 
    429551 
    430552PJ_END_DECL 
Note: See TracChangeset for help on using the changeset viewer.