3 * Copyright (c) 2002 Fabrice Bellard.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define RTP_MIN_PACKET_LENGTH 12
23 #define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */
26 int rtp_get_codec_info(AVCodecContext *codec, int payload_type);
27 int rtp_get_payload_type(AVCodecContext *codec);
29 typedef struct RTPDemuxContext RTPDemuxContext;
30 typedef struct rtp_payload_data_s rtp_payload_data_s;
31 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, rtp_payload_data_s *rtp_payload_data);
32 int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
33 const uint8_t *buf, int len);
34 void rtp_parse_close(RTPDemuxContext *s);
36 extern AVOutputFormat rtp_mux;
37 extern AVInputFormat rtp_demux;
39 int rtp_get_local_port(URLContext *h);
40 int rtp_set_remote_url(URLContext *h, const char *uri);
41 void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
43 extern URLProtocol rtp_protocol;
45 #define RTP_PT_PRIVATE 96
47 #define RTP_MAX_SDES 256 /* maximum text length for SDES */
49 /* RTCP paquets use 0.5 % of the bandwidth */
50 #define RTCP_TX_RATIO_NUM 5
51 #define RTCP_TX_RATIO_DEN 1000
53 /* Structure listing usefull vars to parse RTP packet payload*/
54 typedef struct rtp_payload_data_s
64 /* mpeg 4 AU headers */
76 int au_headers_length_bytes;
80 typedef struct AVRtpPayloadType_s
83 const char enc_name[50]; /* XXX: why 50 ? */
84 enum CodecType codec_type;
85 enum CodecID codec_id;
90 typedef struct AVRtpDynamicPayloadType_s /* payload type >= 96 */
92 const char enc_name[50]; /* XXX: still why 50 ? ;-) */
93 enum CodecType codec_type;
94 enum CodecID codec_id;
95 } AVRtpDynamicPayloadType_t;
117 RTCP_SDES_SOURCE = 11
120 extern AVRtpPayloadType_t AVRtpPayloadTypes[];
121 extern AVRtpDynamicPayloadType_t AVRtpDynamicPayloadTypes[];