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