Use bpp from header in error message
[libav.git] / libavformat / rtp_internal.h
CommitLineData
4934884a
RM
1/*
2 * RTP definitions
3 * Copyright (c) 2006 Ryan Martell <rdm4@martellventures.com>
4 *
9eeec55d
GP
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
4934884a
RM
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
cbced386 10 * version 2.1 of the License, or (at your option) any later version.
4934884a 11 *
cbced386 12 * FFmpeg is distributed in the hope that it will be useful,
4934884a
RM
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
550b2843 18 * License along with FFmpeg; if not, write to the Free Software
4934884a
RM
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
26typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s,
27 AVPacket * pkt,
d0deedcb 28 uint32_t *timestamp,
4934884a
RM
29 const uint8_t * buf,
30 int len);
31
32typedef 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..
50struct 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;
dbf30963
T
63 /* used to send back RTCP RR */
64 URLContext *rtp_ctx;
65 char hostname[256];
4934884a
RM
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
89extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler;
90#endif /* RTP_INTERNAL_H */
91