3 * Copyright (c) 2002 Fabrice Bellard.
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #define RTP_MIN_PACKET_LENGTH 12
25 #define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */
28 int rtp_get_codec_info(AVCodecContext *codec, int payload_type);
30 /** return < 0 if unknown payload type */
31 int rtp_get_payload_type(AVCodecContext *codec);
33 typedef struct RTPDemuxContext RTPDemuxContext;
34 typedef struct rtp_payload_data_s rtp_payload_data_s;
35 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_s *rtp_payload_data);
36 int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
37 const uint8_t *buf, int len);
38 void rtp_parse_close(RTPDemuxContext *s);
40 extern AVOutputFormat rtp_muxer;
41 extern AVInputFormat rtp_demuxer;
43 int rtp_get_local_port(URLContext *h);
44 int rtp_set_remote_url(URLContext *h, const char *uri);
45 void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
48 * some rtp servers assume client is dead if they don't hear from them...
49 * so we send a Receiver Report to the provided ByteIO context
50 * (we don't have access to the rtcp handle from here)
52 int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count);
54 extern URLProtocol rtp_protocol;
56 #define RTP_PT_PRIVATE 96
58 #define RTP_MAX_SDES 256 /**< maximum text length for SDES */
60 /* RTCP paquets use 0.5 % of the bandwidth */
61 #define RTCP_TX_RATIO_NUM 5
62 #define RTCP_TX_RATIO_DEN 1000
64 /* Structure listing useful vars to parse RTP packet payload*/
65 typedef struct rtp_payload_data_s
75 /* mpeg 4 AU headers */
87 int au_headers_length_bytes;
91 typedef struct AVRtpPayloadType_s
94 const char enc_name[50]; /* XXX: why 50 ? */
95 enum CodecType codec_type;
96 enum CodecID codec_id;
122 RTCP_SDES_SOURCE = 11
126 extern AVRtpPayloadType_t AVRtpPayloadTypes[];