Mercurial > libavformat.hg
annotate rtp.h @ 2357:e9d7db467cf0 libavformat
merge some REGISTER_MUXER/DEMUXER into REGISTER_MUXDEMUX
author | aurel |
---|---|
date | Fri, 10 Aug 2007 01:44:50 +0000 |
parents | a6d6b2b19341 |
children | 89030c7e2fa7 |
rev | line source |
---|---|
0 | 1 /* |
2 * RTP definitions | |
3 * Copyright (c) 2002 Fabrice Bellard. | |
4 * | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
5 * This file is part of FFmpeg. |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
6 * |
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
0 | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
0 | 11 * |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
0 | 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. | |
16 * | |
17 * You should have received a copy of the GNU Lesser General Public | |
1358
0899bfe4105c
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
1167
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
896
edbe5c3717f9
Update licensing information: The FSF changed postal address.
diego
parents:
885
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 20 */ |
21 #ifndef RTP_H | |
22 #define RTP_H | |
23 | |
2171 | 24 #include "avcodec.h" |
25 #include "avformat.h" | |
26 | |
0 | 27 #define RTP_MIN_PACKET_LENGTH 12 |
28 #define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */ | |
29 | |
30 int rtp_init(void); | |
31 int rtp_get_codec_info(AVCodecContext *codec, int payload_type); | |
1856
99d50be70d9a
Move rtp_get_payload_type()'s unaltered comments to the header file.
takis
parents:
1807
diff
changeset
|
32 |
1866
8d7a19c937dc
Doxygenize the existing comments without altering the actual contents of the
takis
parents:
1857
diff
changeset
|
33 /** return < 0 if unknown payload type */ |
0 | 34 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
|
35 |
6091b76cfc2a
added MPEG2TS support in RTP, SDP and RTSP - replaced fake RTP demux by a specific API
bellard
parents:
0
diff
changeset
|
36 typedef struct RTPDemuxContext RTPDemuxContext; |
774 | 37 typedef struct rtp_payload_data_s rtp_payload_data_s; |
1425
00d9393a126f
make ffmpeg able to send back a RTCP receiver report.
gpoirier
parents:
1419
diff
changeset
|
38 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_s *rtp_payload_data); |
885 | 39 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
|
40 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
|
41 void rtp_parse_close(RTPDemuxContext *s); |
0 | 42 |
1167 | 43 extern AVOutputFormat rtp_muxer; |
44 extern AVInputFormat rtp_demuxer; | |
0 | 45 |
46 int rtp_get_local_port(URLContext *h); | |
47 int rtp_set_remote_url(URLContext *h, const char *uri); | |
48 void rtp_get_file_handles(URLContext *h, int *prtp_fd, int *prtcp_fd); | |
1857
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
49 |
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
50 /** |
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
51 * some rtp servers assume client is dead if they don't hear from them... |
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
52 * so we send a Receiver Report to the provided ByteIO context |
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
53 * (we don't have access to the rtcp handle from here) |
17893fe08372
Move rtp_check_and_send_back_rr()'s unaltered comments to the header file.
takis
parents:
1856
diff
changeset
|
54 */ |
1745 | 55 int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count); |
0 | 56 |
57 extern URLProtocol rtp_protocol; | |
58 | |
774 | 59 #define RTP_PT_PRIVATE 96 |
60 #define RTP_VERSION 2 | |
1867
04f5cfe20a92
Doxygenize the unaltered comments for the RTP_MAX_SDES definition.
takis
parents:
1866
diff
changeset
|
61 #define RTP_MAX_SDES 256 /**< maximum text length for SDES */ |
774 | 62 |
63 /* RTCP paquets use 0.5 % of the bandwidth */ | |
64 #define RTCP_TX_RATIO_NUM 5 | |
65 #define RTCP_TX_RATIO_DEN 1000 | |
66 | |
1868
b92a67b0b4bd
Doxygenize the unaltered comments for the rtp_payload_data_s struct.
takis
parents:
1867
diff
changeset
|
67 /** Structure listing useful vars to parse RTP packet payload*/ |
774 | 68 typedef struct rtp_payload_data_s |
69 { | |
70 int sizelength; | |
71 int indexlength; | |
72 int indexdeltalength; | |
73 int profile_level_id; | |
74 int streamtype; | |
75 int objecttype; | |
76 char *mode; | |
77 | |
1869
48b1d0b70e09
Doxygenize the unaltered comments for the AUHeaders structure.
takis
parents:
1868
diff
changeset
|
78 /** mpeg 4 AU headers */ |
774 | 79 struct AUHeaders { |
80 int size; | |
81 int index; | |
82 int cts_flag; | |
83 int cts; | |
84 int dts_flag; | |
85 int dts; | |
86 int rap_flag; | |
87 int streamstate; | |
88 } *au_headers; | |
89 int nb_au_headers; | |
90 int au_headers_length_bytes; | |
91 int cur_au_index; | |
92 } rtp_payload_data_t; | |
93 | |
94 typedef struct AVRtpPayloadType_s | |
95 { | |
96 int pt; | |
97 const char enc_name[50]; /* XXX: why 50 ? */ | |
98 enum CodecType codec_type; | |
99 enum CodecID codec_id; | |
100 int clock_rate; | |
101 int audio_channels; | |
102 } AVRtpPayloadType_t; | |
103 | |
803
021c8bf015c2
RTCP_* conflict with live.com and they seem not to be used anywhere so commenting them out
michael
parents:
774
diff
changeset
|
104 #if 0 |
774 | 105 typedef enum { |
106 RTCP_SR = 200, | |
107 RTCP_RR = 201, | |
108 RTCP_SDES = 202, | |
109 RTCP_BYE = 203, | |
110 RTCP_APP = 204 | |
111 } rtcp_type_t; | |
112 | |
113 typedef enum { | |
114 RTCP_SDES_END = 0, | |
115 RTCP_SDES_CNAME = 1, | |
116 RTCP_SDES_NAME = 2, | |
117 RTCP_SDES_EMAIL = 3, | |
118 RTCP_SDES_PHONE = 4, | |
119 RTCP_SDES_LOC = 5, | |
120 RTCP_SDES_TOOL = 6, | |
121 RTCP_SDES_NOTE = 7, | |
122 RTCP_SDES_PRIV = 8, | |
123 RTCP_SDES_IMG = 9, | |
124 RTCP_SDES_DOOR = 10, | |
125 RTCP_SDES_SOURCE = 11 | |
126 } 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
|
127 #endif |
774 | 128 |
129 extern AVRtpPayloadType_t AVRtpPayloadTypes[]; | |
0 | 130 #endif /* RTP_H */ |