rtp.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <pthread.h>
#include <stdint.h>
#include "comm.h"
#include "transport.h"
#include "rtpptdefs.h"

Include dependency graph for rtp.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rtp_pkt

Defines

#define RTP_VERSION   2
#define RTP_AVP_UDP   "RTP/AVP"
 Default low-trasport is UDP. See RFC2326 12.39.
#define RTP_AVP_TCP   "RTP/AVP/TCP"
 interleaved TCP low transport.
#define RTP_AVP_SCTP   "RTP/AVP/SCTP"
 multistream SCTP low transport.
#define RTP_SEQ_MOD   (1<<16)
#define MIN_SEQUENTIAL   2
#define MAX_DROPOUT   3000
#define MAX_MISORDER   100
#define BANDWIDTH   16000
 bytes-per-second
#define RTP_OK   0
#define RTP_ERROR   1
#define RTP_ERRALLOC   -1
#define RTP_PKT_CC(pkt)   (pkt->cc)
#define RTP_PKT_MARK(pkt)   (pkt->mark)
#define RTP_PKT_PT(pkt)   (pkt->pt)
#define RTP_PKT_SEQ(pkt)   ntohs(pkt->seq)
#define RTP_PKT_TS(pkt)   ntohl(pkt->time)
#define RTP_PKT_SSRC(pkt)   ntohl(pkt->ssrc)
#define RTP_PKT_DATA(pkt)   (pkt->data + pkt->cc)
#define RTP_PAYLOAD_SIZE(pkt, pkt_len)   ((pkt) ? pkt_len - ((pkt->data)-(uint8_t *)pkt) - pkt->cc - ((*(((uint8_t *)pkt)+pkt_len-1)) * pkt->pad) : 0)
#define RTPPT_ISDYNAMIC(pt)   (pt >= 96)
#define RTP_TRANSPORT_SPEC   10
#define RTP_TRANSPORT_SOCKTYPE   11
#define RTP_TRANSPORT_DELIVERY   20
#define RTP_TRANSPORT_SRCADDR   30
#define RTP_TRANSPORT_SRCADDRSTR   31
#define RTP_TRANSPORT_DSTADDR   40
#define RTP_TRANSPORT_DSTADDRSTR   41
#define RTP_TRANSPORT_LAYERS   50
#define RTP_TRANSPORT_MODE   60
#define RTP_TRANSPORT_APPEND   70
#define RTP_TRANSPORT_TTL   80
#define RTP_TRANSPORT_MCSRTP   90
#define RTP_TRANSPORT_MCSRTCP   91
#define RTP_TRANSPORT_MCSPORTS   92
#define RTP_TRANSPORT_CLIRTP   100
#define RTP_TRANSPORT_CLIRTCP   101
#define RTP_TRANSPORT_CLIPORTS   102
#define RTP_TRANSPORT_SRVRTP   110
#define RTP_TRANSPORT_SRVRTCP   111
#define RTP_TRANSPORT_SRVPORTS   112
#define RTP_TRANSPORT_ILVDRTP   120
#define RTP_TRANSPORT_ILVDRTCP   121
#define RTP_TRANSPORT_INTERLEAVED   122
#define RTP_TRANSPORT_STREAMRTP   130
#define RTP_TRANSPORT_STREAMRTCP   131
#define RTP_TRANSPORT_STREAMS   132
#define RTP_TRANSPORT_SSRC   140
#define RTP_TRANSPORT_NOTSET   -1
#define RTP_TRANSPORT_SET   0
#define RTP_TRANSPORT_ERR   1
#define SSRC_KNOWN   0
#define SSRC_NEW   1
#define SSRC_RTPNEW   2
#define SSRC_RTCPNEW   3
#define SSRC_COLLISION   4
#define RTP_FILL_OK   0
#define RTP_BUFF_EMPTY   91
#define RTP_PARSE_ERROR   92
#define RTP_PKT_UNKNOWN   93
#define RTP_IN_PRM_ERR   94
#define RTP_SSRC_NOTVALID   97
#define RTP_BUFFERING   99
#define RTP_PKT_DATA_LEN(pkt, len)   (len > 0) ? len - ((uint8_t *)(pkt->data)-(uint8_t *)pkt) - pkt->cc - ((*(((uint8_t *)pkt)+len-1)) * pkt->pad) : 0

Typedefs

typedef struct rtp_ssrc_s rtp_ssrc
typedef int(* rtp_parser_init )(struct rtp_session_s *rtp_sess, unsigned pt)
typedef int(* rtp_parser )(rtp_ssrc *stm_src, rtp_frame *fr, rtp_buff *conf)
typedef int(* rtp_parser_uninit )(rtp_ssrc *stm_src, unsigned pt)
typedef struct rtp_session_s rtp_session

Enumerations

enum  deliveries { unicast, multicast }
enum  modes { play, record }
enum  rtp_protos { RTP, RTCP }

Functions

rtp_thread * rtp_init (void)
int rtp_thread_create (rtp_thread *)
int rtp_announce_pt (rtp_session *rtp_sess, unsigned pt, rtp_media_type media_type)
int rtp_dynpt_reg (rtp_session *rtp_sess, unsigned pt, char *mime)
rtp_pt * rtp_get_pt_info (rtp_session *rtp_sess, unsigned pt)
int rtp_recv (rtp_session *)
rtp_ssrc * rtp_active_ssrc_queue (rtp_session *rtp_sess_head)
rtp_ssrc * rtp_next_active_ssrc (rtp_ssrc *ssrc)
int rtp_ssrc_check (rtp_session *, uint32_t, rtp_ssrc **, nms_sockaddr *, enum rtp_protos)
int rtp_ssrc_init (rtp_session *, rtp_ssrc **, uint32_t, nms_sockaddr *, enum rtp_protos)
int rtp_fill_buffers (rtp_thread *)
int rtp_fill_buffer (rtp_ssrc *, rtp_frame *, rtp_buff *)
double rtp_get_next_ts (rtp_ssrc *)
int16_t rtp_get_next_pt (rtp_ssrc *)
void rtp_update_fps (rtp_ssrc *stm_src, uint32_t, unsigned)
float rtp_get_fps (rtp_ssrc *)
rtp_pktrtp_get_n_pkt (rtp_ssrc *, unsigned int *, unsigned)
rtp_pktrtp_get_pkt (rtp_ssrc *, size_t *)
int rtp_rm_pkt (rtp_ssrc *)
void rtp_rm_all_pkts (rtp_ssrc *)
int rtp_transport_set (rtp_session *, int, void *)
int rtp_transport_get (rtp_session *, int, void *, uint32_t)
char * rtp_get_spec (rtp_session *)
sock_type rtp_get_socktype (rtp_session *)
enum deliveries rtp_get_delivery (rtp_session *)
int rtp_get_srcaddrstr (rtp_session *, char *, uint32_t)
nms_addr * rtp_get_srcaddr (rtp_session *)
int rtp_get_dstaddrstr (rtp_session *, char *, uint32_t)
nms_addr * rtp_get_dstaddr (rtp_session *)
int rtp_get_layers (rtp_session *)
enum modes rtp_get_mode (rtp_session *)
int rtp_get_append (rtp_session *)
int rtp_get_ttl (rtp_session *)
int rtp_get_mcsports (rtp_session *, in_port_t[2])
in_port_t rtp_get_mcsrtpport (rtp_session *)
in_port_t rtp_get_mcsrtcpport (rtp_session *)
int rtp_get_srvports (rtp_session *, in_port_t[2])
in_port_t rtp_get_srvrtpport (rtp_session *)
in_port_t rtp_get_srvrtcpport (rtp_session *)
int rtp_get_cliports (rtp_session *, in_port_t[2])
in_port_t rtp_get_clirtpport (rtp_session *)
in_port_t rtp_get_clirtcpport (rtp_session *)
int rtp_get_interleaved (rtp_session *, uint8_t[2])
uint8_t rtp_get_ilvdrtp (rtp_session *)
uint8_t rtp_get_ilvdrtcp (rtp_session *)
int rtp_get_streams (rtp_session *, uint16_t[2])
uint16_t rtp_get_rtpstream (rtp_session *)
uint16_t rtp_get_rtcpstream (rtp_session *)
uint32_t rtp_get_ssrc (rtp_session *)
int rtp_set_delivery (rtp_session *, enum deliveries)
int rtp_set_socktype (rtp_session *, sock_type)
int rtp_set_srcaddrstr (rtp_session *, char *)
int rtp_set_srcaddr (rtp_session *, nms_addr *)
int rtp_set_dstaddrstr (rtp_session *, char *)
int rtp_set_dstaddr (rtp_session *, nms_addr *)
int rtp_set_layers (rtp_session *, int)
int rtp_set_mode (rtp_session *, enum modes)
int rtp_set_append (rtp_session *, int)
int rtp_set_ttl (rtp_session *, int)
int rtp_set_mcsports (rtp_session *, in_port_t[2])
int rtp_set_mcsrtpport (rtp_session *, in_port_t)
int rtp_set_mcsrtcpport (rtp_session *, in_port_t)
int rtp_set_srvports (rtp_session *, in_port_t[2])
int rtp_set_srvrtpport (rtp_session *, in_port_t)
int rtp_set_srvrtcpport (rtp_session *, in_port_t)
int rtp_set_cliports (rtp_session *, in_port_t[2])
int rtp_set_clirtpport (rtp_session *, in_port_t)
int rtp_set_clirtcpport (rtp_session *, in_port_t)
int rtp_set_interleaved (rtp_session *, uint8_t[2])
int rtp_set_ilvdrtp (rtp_session *, uint8_t)
int rtp_set_ilvdrtcp (rtp_session *, uint8_t)
int rtp_set_streams (rtp_session *, uint16_t[2])
int rtp_set_rtpstream (rtp_session *, uint16_t)
int rtp_set_rtcpstream (rtp_session *, uint16_t)
int rtp_set_ssrc (rtp_session *, uint32_t)
rtp_session * rtp_session_init (nms_sockaddr *local, nms_sockaddr *peer)
rtp_ssrc * rtp_session_get_ssrc (rtp_session *sess, struct rtsp_ctrl_t *ctl)


Detailed Description

RTP layer public header

Definition in file rtp.h.


Define Documentation

#define RTP_FILL_OK   0

rtp_fill error codes

Definition at line 301 of file rtp.h.

Referenced by aac_parse(), h263_parse(), h264_parse(), and m4v_parse().


Typedef Documentation

typedef int(* rtp_parser_init)(struct rtp_session_s *rtp_sess, unsigned pt)

the rtp_parser_init function is called at rtp thread start (in rtp_thread_create) for all the parsers registered for announced payload types (present in the announced_fmts list)

Definition at line 254 of file rtp.h.


Generated on Tue Feb 3 03:10:02 2009 for libnemesi by  doxygen 1.5.4