WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

pjmedia_transport_op Struct Reference

#include <transport.h>

Data Fields

pj_status_t(* get_info )(pjmedia_transport *tp, pjmedia_transport_info *info)
 
pj_status_t(* attach )(pjmedia_transport *tp, void *user_data, const pj_sockaddr_t *rem_addr, const pj_sockaddr_t *rem_rtcp, unsigned addr_len, void(*rtp_cb)(void *user_data, void *pkt, pj_ssize_t size), void(*rtcp_cb)(void *user_data, void *pkt, pj_ssize_t size))
 
void(* detach )(pjmedia_transport *tp, void *user_data)
 
pj_status_t(* send_rtp )(pjmedia_transport *tp, const void *pkt, pj_size_t size)
 
pj_status_t(* send_rtcp )(pjmedia_transport *tp, const void *pkt, pj_size_t size)
 
pj_status_t(* send_rtcp2 )(pjmedia_transport *tp, const pj_sockaddr_t *addr, unsigned addr_len, const void *pkt, pj_size_t size)
 
pj_status_t(* media_create )(pjmedia_transport *tp, pj_pool_t *sdp_pool, unsigned options, const pjmedia_sdp_session *remote_sdp, unsigned media_index)
 
pj_status_t(* encode_sdp )(pjmedia_transport *tp, pj_pool_t *sdp_pool, pjmedia_sdp_session *sdp_local, const pjmedia_sdp_session *rem_sdp, unsigned media_index)
 
pj_status_t(* media_start )(pjmedia_transport *tp, pj_pool_t *tmp_pool, const pjmedia_sdp_session *sdp_local, const pjmedia_sdp_session *sdp_remote, unsigned media_index)
 
pj_status_t(* media_stop )(pjmedia_transport *tp)
 
pj_status_t(* simulate_lost )(pjmedia_transport *tp, pjmedia_dir dir, unsigned pct_lost)
 
pj_status_t(* destroy )(pjmedia_transport *tp)
 
pj_status_t(* attach2 )(pjmedia_transport *tp, pjmedia_transport_attach_param *att_param)
 

Detailed Description

This structure describes the operations for the stream transport.

See also
pjmedia_transport_op.

Field Documentation

◆ get_info

pj_status_t(* pjmedia_transport_op::get_info) (pjmedia_transport *tp, pjmedia_transport_info *info)

Get media socket info from the specified transport.

Application should call pjmedia_transport_get_info() instead

Referenced by pjmedia_transport_get_info().

◆ attach

pj_status_t(* pjmedia_transport_op::attach) (pjmedia_transport *tp, void *user_data, const pj_sockaddr_t *rem_addr, const pj_sockaddr_t *rem_rtcp, unsigned addr_len, void(*rtp_cb)(void *user_data, void *pkt, pj_ssize_t size), void(*rtcp_cb)(void *user_data, void *pkt, pj_ssize_t size))

This function is called by the stream when the transport is about to be used by the stream for the first time, and it tells the transport about remote RTP address to send the packet and some callbacks to be called for incoming packets. This function exists for backwards compatibility. Transports should implement attach2 instead.

Application should call pjmedia_transport_attach() instead of calling this function directly.

Referenced by pjmedia_transport_attach(), and pjmedia_transport_attach2().

◆ detach

void(* pjmedia_transport_op::detach) (pjmedia_transport *tp, void *user_data)

This function is called by the stream when the stream no longer needs the transport (normally when the stream is about to be closed). After the transport is detached, it will ignore incoming RTP/RTCP packets, and will refuse to send outgoing RTP/RTCP packets. Application may re-attach the media transport to another transport user (e.g. stream) after the transport has been detached.

Application should call pjmedia_transport_detach() instead of calling this function directly.

Referenced by pjmedia_transport_detach().

◆ send_rtp

pj_status_t(* pjmedia_transport_op::send_rtp) (pjmedia_transport *tp, const void *pkt, pj_size_t size)

This function is called by the stream to send RTP packet using the transport.

Application should call pjmedia_transport_send_rtp() instead of calling this function directly.

Referenced by pjmedia_transport_send_rtp().

◆ send_rtcp

pj_status_t(* pjmedia_transport_op::send_rtcp) (pjmedia_transport *tp, const void *pkt, pj_size_t size)

This function is called by the stream to send RTCP packet using the transport.

Application should call pjmedia_transport_send_rtcp() instead of calling this function directly.

Referenced by pjmedia_transport_send_rtcp().

◆ send_rtcp2

pj_status_t(* pjmedia_transport_op::send_rtcp2) (pjmedia_transport *tp, const pj_sockaddr_t *addr, unsigned addr_len, const void *pkt, pj_size_t size)

This function is called by the stream to send RTCP packet using the transport with destination address other than default specified in pjmedia_transport_attach().

Application should call pjmedia_transport_send_rtcp2() instead of calling this function directly.

Referenced by pjmedia_transport_send_rtcp2().

◆ media_create

pj_status_t(* pjmedia_transport_op::media_create) (pjmedia_transport *tp, pj_pool_t *sdp_pool, unsigned options, const pjmedia_sdp_session *remote_sdp, unsigned media_index)

Prepare the transport for a new media session.

Application should call pjmedia_transport_media_create() instead of calling this function directly.

Referenced by pjmedia_transport_media_create().

◆ encode_sdp

pj_status_t(* pjmedia_transport_op::encode_sdp) (pjmedia_transport *tp, pj_pool_t *sdp_pool, pjmedia_sdp_session *sdp_local, const pjmedia_sdp_session *rem_sdp, unsigned media_index)

This function is called by application to generate the SDP parts related to transport type, e.g: ICE, SRTP.

Application should call pjmedia_transport_encode_sdp() instead of calling this function directly.

Referenced by pjmedia_transport_encode_sdp().

◆ media_start

pj_status_t(* pjmedia_transport_op::media_start) (pjmedia_transport *tp, pj_pool_t *tmp_pool, const pjmedia_sdp_session *sdp_local, const pjmedia_sdp_session *sdp_remote, unsigned media_index)

This function is called by application to start the transport based on local and remote SDP.

Application should call pjmedia_transport_media_start() instead of calling this function directly.

Referenced by pjmedia_transport_media_start().

◆ media_stop

pj_status_t(* pjmedia_transport_op::media_stop) (pjmedia_transport *tp)

This function is called by application to stop the transport.

Application should call pjmedia_transport_media_stop() instead of calling this function directly.

Referenced by pjmedia_transport_media_stop().

◆ simulate_lost

pj_status_t(* pjmedia_transport_op::simulate_lost) (pjmedia_transport *tp, pjmedia_dir dir, unsigned pct_lost)

This function can be called to simulate packet lost.

Application should call pjmedia_transport_simulate_lost() instead of calling this function directly.

Referenced by pjmedia_transport_simulate_lost().

◆ destroy

pj_status_t(* pjmedia_transport_op::destroy) (pjmedia_transport *tp)

This function can be called to destroy this transport.

Application should call pjmedia_transport_close() instead of calling this function directly.

Referenced by pjmedia_transport_close().

◆ attach2

pj_status_t(* pjmedia_transport_op::attach2) (pjmedia_transport *tp, pjmedia_transport_attach_param *att_param)

This function is called by the stream when the transport is about to be used by the stream for the first time, and it tells the transport about remote RTP address to send the packet and some callbacks to be called for incoming packets.

Application should call pjmedia_transport_attach2() instead of calling this function directly.

Referenced by pjmedia_transport_attach(), and pjmedia_transport_attach2().


The documentation for this struct was generated from the following file:

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.