/*
* RTP input format
- * Copyright (c) 2002 Fabrice Bellard.
+ * Copyright (c) 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
/* needed for gethostname() */
#define _XOPEN_SOURCE 600
-#include "libavcodec/bitstream.h"
+#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "mpegts.h"
#include <unistd.h>
#include "network.h"
-#include "rtp_internal.h"
+#include "rtpdec.h"
+#include "rtp_asf.h"
#include "rtp_h264.h"
+#include "rtp_vorbis.h"
//#define DEBUG
ff_register_dynamic_payload_handler(&mp4v_es_handler);
ff_register_dynamic_payload_handler(&mpeg4_generic_handler);
ff_register_dynamic_payload_handler(&ff_h264_dynamic_handler);
+ ff_register_dynamic_payload_handler(&ff_vorbis_dynamic_handler);
+
+ ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
+ ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
}
static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len)
addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time, s->st->time_base.den, (uint64_t)s->st->time_base.num << 32);
pkt->pts = addend + delta_timestamp;
}
- pkt->stream_index = s->st->index;
}
/**
/* return the next packets, if any */
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....
- rv= s->parse_packet(s->dynamic_protocol_context,
+ rv= s->parse_packet(s->ic, s->dynamic_protocol_context,
s->st, pkt, ×tamp, NULL, 0, flags);
finalize_packet(s, pkt, timestamp);
return rv;
return -1;
}
payload_type = buf[1] & 0x7f;
+ if (buf[1] & 0x80)
+ flags |= RTP_FLAG_MARKER;
seq = AV_RB16(buf + 2);
timestamp = AV_RB32(buf + 4);
ssrc = AV_RB32(buf + 8);
s->read_buf_index = 0;
return 1;
}
+ return 0;
} else if (s->parse_packet) {
- rv = s->parse_packet(s->dynamic_protocol_context,
+ rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
s->st, pkt, ×tamp, buf, len, flags);
} else {
// at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise.
break;
}
- // now perform timestamp things....
- finalize_packet(s, pkt, timestamp);
+ pkt->stream_index = st->index;
}
+
+ // now perform timestamp things....
+ finalize_packet(s, pkt, timestamp);
+
return rv;
}