annotate rtp.h @ 1061:b1ac9677e7f5 libavformat

indention
author bcoudurier
date Wed, 19 Apr 2006 12:53:47 +0000
parents edbe5c3717f9
children d89d7ef290da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1 /*
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
2 * RTP definitions
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
3 * Copyright (c) 2002 Fabrice Bellard.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
896
edbe5c3717f9 Update licensing information: The FSF changed postal address.
diego
parents: 885
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18 */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
19 #ifndef RTP_H
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20 #define RTP_H
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
21
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 #define RTP_MIN_PACKET_LENGTH 12
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
23 #define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
25 int rtp_init(void);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26 int rtp_get_codec_info(AVCodecContext *codec, int payload_type);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
27 int rtp_get_payload_type(AVCodecContext *codec);
294
6091b76cfc2a added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents: 0
diff changeset
28
6091b76cfc2a added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents: 0
diff changeset
29 typedef struct RTPDemuxContext RTPDemuxContext;
774
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
30 typedef struct rtp_payload_data_s rtp_payload_data_s;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
31 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, int payload_type, rtp_payload_data_s *rtp_payload_data);
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 803
diff changeset
32 int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
294
6091b76cfc2a added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents: 0
diff changeset
33 const uint8_t *buf, int len);
6091b76cfc2a added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents: 0
diff changeset
34 void rtp_parse_close(RTPDemuxContext *s);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
35
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
36 extern AVOutputFormat rtp_mux;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
37 extern AVInputFormat rtp_demux;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
38
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
39 int rtp_get_local_port(URLContext *h);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
40 int rtp_set_remote_url(URLContext *h, const char *uri);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
41 void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
42
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
43 extern URLProtocol rtp_protocol;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
44
774
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
45 #define RTP_PT_PRIVATE 96
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
46 #define RTP_VERSION 2
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
47 #define RTP_MAX_SDES 256 /* maximum text length for SDES */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
48
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
49 /* RTCP paquets use 0.5 % of the bandwidth */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
50 #define RTCP_TX_RATIO_NUM 5
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
51 #define RTCP_TX_RATIO_DEN 1000
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
52
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
53 /* Structure listing usefull vars to parse RTP packet payload*/
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
54 typedef struct rtp_payload_data_s
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
55 {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
56 int sizelength;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
57 int indexlength;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
58 int indexdeltalength;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
59 int profile_level_id;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
60 int streamtype;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
61 int objecttype;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
62 char *mode;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
63
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
64 /* mpeg 4 AU headers */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
65 struct AUHeaders {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
66 int size;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
67 int index;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
68 int cts_flag;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
69 int cts;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
70 int dts_flag;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
71 int dts;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
72 int rap_flag;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
73 int streamstate;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
74 } *au_headers;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
75 int nb_au_headers;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
76 int au_headers_length_bytes;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
77 int cur_au_index;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
78 } rtp_payload_data_t;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
79
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
80 typedef struct AVRtpPayloadType_s
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
81 {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
82 int pt;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
83 const char enc_name[50]; /* XXX: why 50 ? */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
84 enum CodecType codec_type;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
85 enum CodecID codec_id;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
86 int clock_rate;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
87 int audio_channels;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
88 } AVRtpPayloadType_t;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
89
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
90 typedef struct AVRtpDynamicPayloadType_s /* payload type >= 96 */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
91 {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
92 const char enc_name[50]; /* XXX: still why 50 ? ;-) */
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
93 enum CodecType codec_type;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
94 enum CodecID codec_id;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
95 } AVRtpDynamicPayloadType_t;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
96
803
021c8bf015c2 RTCP_* conflict with live.com and they seem not to be used anywhere so commenting them out
michael
parents: 774
diff changeset
97 #if 0
774
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
98 typedef enum {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
99 RTCP_SR = 200,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
100 RTCP_RR = 201,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
101 RTCP_SDES = 202,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
102 RTCP_BYE = 203,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
103 RTCP_APP = 204
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
104 } rtcp_type_t;
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
105
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
106 typedef enum {
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
107 RTCP_SDES_END = 0,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
108 RTCP_SDES_CNAME = 1,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
109 RTCP_SDES_NAME = 2,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
110 RTCP_SDES_EMAIL = 3,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
111 RTCP_SDES_PHONE = 4,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
112 RTCP_SDES_LOC = 5,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
113 RTCP_SDES_TOOL = 6,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
114 RTCP_SDES_NOTE = 7,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
115 RTCP_SDES_PRIV = 8,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
116 RTCP_SDES_IMG = 9,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
117 RTCP_SDES_DOOR = 10,
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
118 RTCP_SDES_SOURCE = 11
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
119 } rtcp_sdes_type_t;
803
021c8bf015c2 RTCP_* conflict with live.com and they seem not to be used anywhere so commenting them out
michael
parents: 774
diff changeset
120 #endif
774
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
121
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
122 extern AVRtpPayloadType_t AVRtpPayloadTypes[];
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
123 extern AVRtpDynamicPayloadType_t AVRtpDynamicPayloadTypes[];
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 294
diff changeset
124
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
125 #endif /* RTP_H */