annotate rtp_internal.h @ 1420:af616468863c libavformat

Fix licence header (aka <pedantic mode='on' /> )
author gpoirier
date Thu, 26 Oct 2006 22:40:18 +0000
parents 8fb4910bdcc0
children 2a02386efc5a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1419
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
1 /*
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
2 * RTP definitions
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
3 * Copyright (c) 2006 Ryan Martell <rdm4@martellventures.com>
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
4 *
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
1420
af616468863c Fix licence header (aka <pedantic mode='on' /> )
gpoirier
parents: 1419
diff changeset
8 * version 2.1 of the License, or (at your option) any later version.
1419
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
9 *
1420
af616468863c Fix licence header (aka <pedantic mode='on' /> )
gpoirier
parents: 1419
diff changeset
10 * FFmpeg is distributed in the hope that it will be useful,
1419
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
13 * Lesser General Public License for more details.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
14 *
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
18 */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
19
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
20 // this is a bit of a misnomer, because rtp & rtsp internal structures and prototypes are in here.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
21 #ifndef RTP_INTERNAL_H
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
22 #define RTP_INTERNAL_H
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
23
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
24 typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
25 AVPacket * pkt,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
26 uint32_t timestamp,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
27 const uint8_t * buf,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
28 int len);
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
29
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
30 typedef struct RTPDynamicProtocolHandler_s {
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
31 // fields from AVRtpDynamicPayloadType_s
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
32 const char enc_name[50]; /* XXX: still why 50 ? ;-) */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
33 enum CodecType codec_type;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
34 enum CodecID codec_id;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
35
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
36 // may be null
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
37 int (*parse_sdp_a_line) (AVStream * stream,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
38 void *protocol_data,
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
39 const char *line); ///< Parse the a= line from the sdp field
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
40 void *(*open) (); ///< allocate any data needed by the rtp parsing for this dynamic data.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
41 void (*close)(void *protocol_data); ///< free any data needed by the rtp parsing for this dynamic data.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
42 DynamicPayloadPacketHandlerProc parse_packet; ///< parse handler for this dynamic packet.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
43
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
44 struct RTPDynamicProtocolHandler_s *next;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
45 } RTPDynamicProtocolHandler;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
46
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
47 // moved out of rtp.c, because the h264 decoder needs to know about this structure..
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
48 struct RTPDemuxContext {
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
49 AVFormatContext *ic;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
50 AVStream *st;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
51 int payload_type;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
52 uint32_t ssrc;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
53 uint16_t seq;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
54 uint32_t timestamp;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
55 uint32_t base_timestamp;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
56 uint32_t cur_timestamp;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
57 int max_payload_size;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
58 struct MpegTSContext *ts; /* only used for MP2T payloads */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
59 int read_buf_index;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
60 int read_buf_size;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
61
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
62 /* rtcp sender statistics receive */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
63 int64_t last_rtcp_ntp_time; // TODO: move into statistics
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
64 int64_t first_rtcp_ntp_time; // TODO: move into statistics
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
65 uint32_t last_rtcp_timestamp; // TODO: move into statistics
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
66
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
67 /* rtcp sender statistics */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
68 unsigned int packet_count; // TODO: move into statistics (outgoing)
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
69 unsigned int octet_count; // TODO: move into statistics (outgoing)
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
70 unsigned int last_octet_count; // TODO: move into statistics (outgoing)
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
71 int first_packet;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
72 /* buffer for output */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
73 uint8_t buf[RTP_MAX_PACKET_LENGTH];
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
74 uint8_t *buf_ptr;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
75
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
76 /* special infos for au headers parsing */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
77 rtp_payload_data_t *rtp_payload_data; // TODO: Move into dynamic payload handlers
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
78
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
79 /* dynamic payload stuff */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
80 DynamicPayloadPacketHandlerProc parse_packet; ///< This is also copied from the dynamic protocol handler structure
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
81 void *dynamic_protocol_context; ///< This is a copy from the values setup from the sdp parsing, in rtsp.c don't free me.
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
82 };
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
83
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
84 extern RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler;
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
85 #endif /* RTP_INTERNAL_H */
8fb4910bdcc0 Add support for H264 over RTP
gpoirier
parents:
diff changeset
86