/*
* RTP input format
- * Copyright (c) 2002 Fabrice Bellard.
+ * Copyright (c) 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned)
* TODO: change this to not take rtp_payload data, and use the new dynamic payload system.
*/
-RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_t *rtp_payload_data)
+RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, RTPPayloadData *rtp_payload_data)
{
RTPDemuxContext *s;
return s;
}
+void
+rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
+ RTPDynamicProtocolHandler *handler)
+{
+ s->dynamic_protocol_context = ctx;
+ s->parse_packet = handler->parse_packet;
+}
+
static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
{
int au_headers_length, au_header_size, i;
GetBitContext getbitcontext;
- rtp_payload_data_t *infos;
+ RTPPayloadData *infos;
infos = s->rtp_payload_data;
/* 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, pkt, ×tamp, NULL, 0, flags);
+ rv= s->parse_packet(s->dynamic_protocol_context,
+ s->st, pkt, ×tamp, NULL, 0, flags);
finalize_packet(s, pkt, timestamp);
return rv;
} else {
return 1;
}
} else if (s->parse_packet) {
- rv = s->parse_packet(s, pkt, ×tamp, buf, len, flags);
+ rv = s->parse_packet(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.
switch(st->codec->codec_id) {
if (rtp_parse_mp4_au(s, buf))
return -1;
{
- rtp_payload_data_t *infos = s->rtp_payload_data;
+ RTPPayloadData *infos = s->rtp_payload_data;
if (infos == NULL)
return -1;
buf += infos->au_headers_length_bytes + 2;