00001
00002
00003
00004
00005 #ifndef RTP_H
00006 #define RTP_H
00007
00008 #define RTP_MIN_PACKET_LENGTH 12
00009 #define RTP_MAX_PACKET_LENGTH 1500
00010
00011 int rtp_init(void);
00012 int rtp_get_codec_info(AVCodecContext *codec, int payload_type);
00013 int rtp_get_payload_type(AVCodecContext *codec);
00014
00015 typedef struct RTPDemuxContext RTPDemuxContext;
00016 typedef struct rtp_payload_data_s rtp_payload_data_s;
00017 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_s *rtp_payload_data);
00018 int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
00019 const uint8_t *buf, int len);
00020 void rtp_parse_close(RTPDemuxContext *s);
00021
00022 extern AVOutputFormat rtp_muxer;
00023 extern AVInputFormat rtp_demuxer;
00024
00025 int rtp_get_local_port(URLContext *h);
00026 int rtp_set_remote_url(URLContext *h, const char *uri);
00027 void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
00028 int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count);
00029
00030 extern URLProtocol rtp_protocol;
00031
00032 #define RTP_PT_PRIVATE 96
00033 #define RTP_VERSION 2
00034 #define RTP_MAX_SDES 256
00035
00036 #define RTCP_TX_RATIO_NUM 5
00037 #define RTCP_TX_RATIO_DEN 1000
00038
00039 typedef struct rtp_payload_data_s
00040 {
00041 int sizelength;
00042 int indexlength;
00043 int indexdeltalength;
00044 int profile_level_id;
00045 int streamtype;
00046 int objecttype;
00047 char *mode;
00048
00049
00050 struct AUHeaders {
00051 int size;
00052 int index;
00053 int cts_flag;
00054 int cts;
00055 int dts_flag;
00056 int dts;
00057 int rap_flag;
00058 int streamstate;
00059 } *au_headers;
00060 int nb_au_headers;
00061 int au_headers_length_bytes;
00062 int cur_au_index;
00063 } rtp_payload_data_t;
00064
00065 typedef struct AVRtpPayloadType_s
00066 {
00067 int pt;
00068 const char enc_name[50];
00069 enum CodecType codec_type;
00070 enum CodecID codec_id;
00071 int clock_rate;
00072 int audio_channels;
00073 } AVRtpPayloadType_t;
00074
00075 #if 0
00076 typedef enum {
00077 RTCP_SR = 200,
00078 RTCP_RR = 201,
00079 RTCP_SDES = 202,
00080 RTCP_BYE = 203,
00081 RTCP_APP = 204
00082 } rtcp_type_t;
00083
00084 typedef enum {
00085 RTCP_SDES_END = 0,
00086 RTCP_SDES_CNAME = 1,
00087 RTCP_SDES_NAME = 2,
00088 RTCP_SDES_EMAIL = 3,
00089 RTCP_SDES_PHONE = 4,
00090 RTCP_SDES_LOC = 5,
00091 RTCP_SDES_TOOL = 6,
00092 RTCP_SDES_NOTE = 7,
00093 RTCP_SDES_PRIV = 8,
00094 RTCP_SDES_IMG = 9,
00095 RTCP_SDES_DOOR = 10,
00096 RTCP_SDES_SOURCE = 11
00097 } rtcp_sdes_type_t;
00098 #endif
00099
00100 extern AVRtpPayloadType_t AVRtpPayloadTypes[];
00101 #endif