1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Add a flags field to the RTPDynamicPayloadPacketHandlerProc (PKT_FLAG_*).

This can be used later by RDT to get the flags from the RTP packet and
use that for the RealMedia packet (such as whether this RTP packet
represents a keyframe or not). For discussion, see "[PATCH] Realmedia
/ RTSP (RDT)".

Originally committed as revision 11557 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ronald S. Bultje 2008-01-18 20:48:32 +00:00
parent e2d3e82dfd
commit f841a0fca1
3 changed files with 15 additions and 6 deletions

View File

@ -163,7 +163,7 @@ static int h264_handle_packet(RTPDemuxContext * s,
AVPacket * pkt, AVPacket * pkt,
uint32_t * timestamp, uint32_t * timestamp,
const uint8_t * buf, const uint8_t * buf,
int len) int len, int flags)
{ {
#ifdef DEBUG #ifdef DEBUG
h264_rtp_extra_data *data = s->dynamic_protocol_context; h264_rtp_extra_data *data = s->dynamic_protocol_context;

View File

@ -41,12 +41,21 @@ typedef struct {
uint32_t jitter; ///< estimated jitter. uint32_t jitter; ///< estimated jitter.
} RTPStatistics; } RTPStatistics;
/**
* Packet parsing for "private" payloads in the RTP specs.
*
* @param s stream context
* @param pkt packet in which to write the parsed data
* @param timestamp pointer in which to write the timestamp of this RTP packet
* @param buf pointer to raw RTP packet data
* @param len length of buf
* @param flags flags from the RTP packet header (PKT_FLAG_*)
*/
typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s, typedef int (*DynamicPayloadPacketHandlerProc) (struct RTPDemuxContext * s,
AVPacket * pkt, AVPacket * pkt,
uint32_t *timestamp, uint32_t *timestamp,
const uint8_t * buf, const uint8_t * buf,
int len); int len, int flags);
typedef struct RTPDynamicProtocolHandler_s { typedef struct RTPDynamicProtocolHandler_s {
// fields from AVRtpDynamicPayloadType_s // fields from AVRtpDynamicPayloadType_s

View File

@ -402,7 +402,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
const uint8_t *buf, int len) const uint8_t *buf, int len)
{ {
unsigned int ssrc, h; unsigned int ssrc, h;
int payload_type, seq, ret; int payload_type, seq, ret, flags = 0;
AVStream *st; AVStream *st;
uint32_t timestamp; uint32_t timestamp;
int rv= 0; int rv= 0;
@ -411,7 +411,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
/* return the next packets, if any */ /* return the next packets, if any */
if(s->st && s->parse_packet) { if(s->st && s->parse_packet) {
timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned.... timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned....
rv= s->parse_packet(s, pkt, &timestamp, NULL, 0); rv= s->parse_packet(s, pkt, &timestamp, NULL, 0, flags);
finalize_packet(s, pkt, timestamp); finalize_packet(s, pkt, timestamp);
return rv; return rv;
} else { } else {
@ -475,7 +475,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
return 1; return 1;
} }
} else if (s->parse_packet) { } else if (s->parse_packet) {
rv = s->parse_packet(s, pkt, &timestamp, buf, len); rv = s->parse_packet(s, pkt, &timestamp, buf, len, flags);
} else { } else {
// at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise. // at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise.
switch(st->codec->codec_id) { switch(st->codec->codec_id) {