Mercurial > libavformat.hg
annotate rtp.h @ 850:89897453def2 libavformat
a few more raw yuv fourccs
author | michael |
---|---|
date | Tue, 06 Sep 2005 15:02:43 +0000 |
parents | 021c8bf015c2 |
children | da1d5db0ce5c |
rev | line source |
---|---|
0 | 1 /* |
2 * RTP definitions | |
3 * Copyright (c) 2002 Fabrice Bellard. | |
4 * | |
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. | |
9 * | |
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. | |
14 * | |
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 | |
18 */ | |
19 #ifndef RTP_H | |
20 #define RTP_H | |
21 | |
22 #define RTP_MIN_PACKET_LENGTH 12 | |
23 #define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */ | |
24 | |
25 int rtp_init(void); | |
26 int rtp_get_codec_info(AVCodecContext *codec, int payload_type); | |
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 | 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); | |
294
6091b76cfc2a
added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents:
0
diff
changeset
|
32 int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, |
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 | 35 |
36 extern AVOutputFormat rtp_mux; | |
37 extern AVInputFormat rtp_demux; | |
38 | |
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); | |
42 | |
43 extern URLProtocol rtp_protocol; | |
44 | |
774 | 45 #define RTP_PT_PRIVATE 96 |
46 #define RTP_VERSION 2 | |
47 #define RTP_MAX_SDES 256 /* maximum text length for SDES */ | |
48 | |
49 /* RTCP paquets use 0.5 % of the bandwidth */ | |
50 #define RTCP_TX_RATIO_NUM 5 | |
51 #define RTCP_TX_RATIO_DEN 1000 | |
52 | |
53 /* Structure listing usefull vars to parse RTP packet payload*/ | |
54 typedef struct rtp_payload_data_s | |
55 { | |
56 int sizelength; | |
57 int indexlength; | |
58 int indexdeltalength; | |
59 int profile_level_id; | |
60 int streamtype; | |
61 int objecttype; | |
62 char *mode; | |
63 | |
64 /* mpeg 4 AU headers */ | |
65 struct AUHeaders { | |
66 int size; | |
67 int index; | |
68 int cts_flag; | |
69 int cts; | |
70 int dts_flag; | |
71 int dts; | |
72 int rap_flag; | |
73 int streamstate; | |
74 } *au_headers; | |
75 int nb_au_headers; | |
76 int au_headers_length_bytes; | |
77 int cur_au_index; | |
78 } rtp_payload_data_t; | |
79 | |
80 typedef struct AVRtpPayloadType_s | |
81 { | |
82 int pt; | |
83 const char enc_name[50]; /* XXX: why 50 ? */ | |
84 enum CodecType codec_type; | |
85 enum CodecID codec_id; | |
86 int clock_rate; | |
87 int audio_channels; | |
88 } AVRtpPayloadType_t; | |
89 | |
90 typedef struct AVRtpDynamicPayloadType_s /* payload type >= 96 */ | |
91 { | |
92 const char enc_name[50]; /* XXX: still why 50 ? ;-) */ | |
93 enum CodecType codec_type; | |
94 enum CodecID codec_id; | |
95 } AVRtpDynamicPayloadType_t; | |
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 | 98 typedef enum { |
99 RTCP_SR = 200, | |
100 RTCP_RR = 201, | |
101 RTCP_SDES = 202, | |
102 RTCP_BYE = 203, | |
103 RTCP_APP = 204 | |
104 } rtcp_type_t; | |
105 | |
106 typedef enum { | |
107 RTCP_SDES_END = 0, | |
108 RTCP_SDES_CNAME = 1, | |
109 RTCP_SDES_NAME = 2, | |
110 RTCP_SDES_EMAIL = 3, | |
111 RTCP_SDES_PHONE = 4, | |
112 RTCP_SDES_LOC = 5, | |
113 RTCP_SDES_TOOL = 6, | |
114 RTCP_SDES_NOTE = 7, | |
115 RTCP_SDES_PRIV = 8, | |
116 RTCP_SDES_IMG = 9, | |
117 RTCP_SDES_DOOR = 10, | |
118 RTCP_SDES_SOURCE = 11 | |
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 | 121 |
122 extern AVRtpPayloadType_t AVRtpPayloadTypes[]; | |
123 extern AVRtpDynamicPayloadType_t AVRtpDynamicPayloadTypes[]; | |
124 | |
0 | 125 #endif /* RTP_H */ |