3 * Copyright (c) 2006 Ryan Martell <rdm4@martellventures.com>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 // this is a bit of a misnomer, because rtp & rtsp internal structures and prototypes are in here.
21 #ifndef RTP_INTERNAL_H
22 #define RTP_INTERNAL_H
24 typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s,
30 typedef struct RTPDynamicProtocolHandler_s {
31 // fields from AVRtpDynamicPayloadType_s
32 const char enc_name[50]; /* XXX: still why 50 ? ;-) */
33 enum CodecType codec_type;
34 enum CodecID codec_id;
37 int (*parse_sdp_a_line) (AVStream * stream,
39 const char *line); ///< Parse the a= line from the sdp field
40 void *(*open) (); ///< allocate any data needed by the rtp parsing for this dynamic data.
41 void (*close)(void *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
42 DynamicPayloadPacketHandlerProc parse_packet; ///< parse handler for this dynamic packet.
44 struct RTPDynamicProtocolHandler_s *next;
45 } RTPDynamicProtocolHandler;
47 // moved out of rtp.c, because the h264 decoder needs to know about this structure..
48 struct RTPDemuxContext {
55 uint32_t base_timestamp;
56 uint32_t cur_timestamp;
58 struct MpegTSContext *ts; /* only used for MP2T payloads */
62 /* rtcp sender statistics receive */
63 int64_t last_rtcp_ntp_time; // TODO: move into statistics
64 int64_t first_rtcp_ntp_time; // TODO: move into statistics
65 uint32_t last_rtcp_timestamp; // TODO: move into statistics
67 /* rtcp sender statistics */
68 unsigned int packet_count; // TODO: move into statistics (outgoing)
69 unsigned int octet_count; // TODO: move into statistics (outgoing)
70 unsigned int last_octet_count; // TODO: move into statistics (outgoing)
72 /* buffer for output */
73 uint8_t buf[RTP_MAX_PACKET_LENGTH];
76 /* special infos for au headers parsing */
77 rtp_payload_data_t *rtp_payload_data; // TODO: Move into dynamic payload handlers
79 /* dynamic payload stuff */
80 DynamicPayloadPacketHandlerProc parse_packet; ///< This is also copied from the dynamic protocol handler structure
81 void *dynamic_protocol_context; ///< This is a copy from the values setup from the sdp parsing, in rtsp.c don't free me.
84 extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler;
85 #endif /* RTP_INTERNAL_H */