Mercurial > libavformat.hg
annotate rtp_internal.h @ 1425:00d9393a126f libavformat
make ffmpeg able to send back a RTCP receiver report.
Patch by Thijs thijsvermeir A telenet P be
Original thread:
Date: Oct 27, 2006 12:58 PM
Subject: [Ffmpeg-devel] [PATCH proposal] RTCP receiver report
author | gpoirier |
---|---|
date | Fri, 27 Oct 2006 18:19:29 +0000 |
parents | 0c8c68a6b35f |
children | 2d8a17631520 |
rev | line source |
---|---|
1419 | 1 /* |
2 * RTP definitions | |
3 * Copyright (c) 2006 Ryan Martell <rdm4@martellventures.com> | |
4 * | |
1421 | 5 * This file is part of FFmpeg. |
6 * | |
7 * FFmpeg is free software; you can redistribute it and/or | |
1419 | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | |
1420 | 10 * version 2.1 of the License, or (at your option) any later version. |
1419 | 11 * |
1420 | 12 * FFmpeg is distributed in the hope that it will be useful, |
1419 | 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 | |
1422 | 18 * License along with FFmpeg; if not, write to the Free Software |
1419 | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 */ | |
21 | |
22 // this is a bit of a misnomer, because rtp & rtsp internal structures and prototypes are in here. | |
23 #ifndef RTP_INTERNAL_H | |
24 #define RTP_INTERNAL_H | |
25 | |
26 typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s, | |
27 AVPacket * pkt, | |
28 uint32_t timestamp, | |
29 const uint8_t * buf, | |
30 int len); | |
31 | |
32 typedef struct RTPDynamicProtocolHandler_s { | |
33 // fields from AVRtpDynamicPayloadType_s | |
34 const char enc_name[50]; /* XXX: still why 50 ? ;-) */ | |
35 enum CodecType codec_type; | |
36 enum CodecID codec_id; | |
37 | |
38 // may be null | |
39 int (*parse_sdp_a_line) (AVStream * stream, | |
40 void *protocol_data, | |
41 const char *line); ///< Parse the a= line from the sdp field | |
42 void *(*open) (); ///< allocate any data needed by the rtp parsing for this dynamic data. | |
43 void (*close)(void *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data. | |
44 DynamicPayloadPacketHandlerProc parse_packet; ///< parse handler for this dynamic packet. | |
45 | |
46 struct RTPDynamicProtocolHandler_s *next; | |
47 } RTPDynamicProtocolHandler; | |
48 | |
49 // moved out of rtp.c, because the h264 decoder needs to know about this structure.. | |
50 struct RTPDemuxContext { | |
51 AVFormatContext *ic; | |
52 AVStream *st; | |
53 int payload_type; | |
54 uint32_t ssrc; | |
55 uint16_t seq; | |
56 uint32_t timestamp; | |
57 uint32_t base_timestamp; | |
58 uint32_t cur_timestamp; | |
59 int max_payload_size; | |
60 struct MpegTSContext *ts; /* only used for MP2T payloads */ | |
61 int read_buf_index; | |
62 int read_buf_size; | |
1425
00d9393a126f
make ffmpeg able to send back a RTCP receiver report.
gpoirier
parents:
1422
diff
changeset
|
63 /* used to send back RTCP RR */ |
00d9393a126f
make ffmpeg able to send back a RTCP receiver report.
gpoirier
parents:
1422
diff
changeset
|
64 URLContext *rtp_ctx; |
00d9393a126f
make ffmpeg able to send back a RTCP receiver report.
gpoirier
parents:
1422
diff
changeset
|
65 char hostname[256]; |
1419 | 66 |
67 /* rtcp sender statistics receive */ | |
68 int64_t last_rtcp_ntp_time; // TODO: move into statistics | |
69 int64_t first_rtcp_ntp_time; // TODO: move into statistics | |
70 uint32_t last_rtcp_timestamp; // TODO: move into statistics | |
71 | |
72 /* rtcp sender statistics */ | |
73 unsigned int packet_count; // TODO: move into statistics (outgoing) | |
74 unsigned int octet_count; // TODO: move into statistics (outgoing) | |
75 unsigned int last_octet_count; // TODO: move into statistics (outgoing) | |
76 int first_packet; | |
77 /* buffer for output */ | |
78 uint8_t buf[RTP_MAX_PACKET_LENGTH]; | |
79 uint8_t *buf_ptr; | |
80 | |
81 /* special infos for au headers parsing */ | |
82 rtp_payload_data_t *rtp_payload_data; // TODO: Move into dynamic payload handlers | |
83 | |
84 /* dynamic payload stuff */ | |
85 DynamicPayloadPacketHandlerProc parse_packet; ///< This is also copied from the dynamic protocol handler structure | |
86 void *dynamic_protocol_context; ///< This is a copy from the values setup from the sdp parsing, in rtsp.c don't free me. | |
87 }; | |
88 | |
89 extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler; | |
90 #endif /* RTP_INTERNAL_H */ | |
91 |