comparison rtpdec.c @ 6179:736165b749f8 libavformat

RTSP, rtpdec: Move RTPPayloadData into rtpdec_mpeg4 and remove all references to rtp_payload_data in rtpdec and rtsp Patch by Josh Allmann, joshua dot allmann at gmail
author mstorsjo
date Fri, 25 Jun 2010 08:02:50 +0000
parents 7aca26f37b02
children c4c35a9d4ab5
comparison
equal deleted inserted replaced
6178:7aca26f37b02 6179:736165b749f8
313 313
314 /** 314 /**
315 * open a new RTP parse context for stream 'st'. 'st' can be NULL for 315 * open a new RTP parse context for stream 'st'. 'st' can be NULL for
316 * MPEG2TS streams to indicate that they should be demuxed inside the 316 * MPEG2TS streams to indicate that they should be demuxed inside the
317 * rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned) 317 * rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned)
318 * TODO: change this to not take rtp_payload data, and use the new dynamic payload system.
319 */ 318 */
320 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, RTPPayloadData *rtp_payload_data) 319 RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type)
321 { 320 {
322 RTPDemuxContext *s; 321 RTPDemuxContext *s;
323 322
324 s = av_mallocz(sizeof(RTPDemuxContext)); 323 s = av_mallocz(sizeof(RTPDemuxContext));
325 if (!s) 324 if (!s)
327 s->payload_type = payload_type; 326 s->payload_type = payload_type;
328 s->last_rtcp_ntp_time = AV_NOPTS_VALUE; 327 s->last_rtcp_ntp_time = AV_NOPTS_VALUE;
329 s->first_rtcp_ntp_time = AV_NOPTS_VALUE; 328 s->first_rtcp_ntp_time = AV_NOPTS_VALUE;
330 s->ic = s1; 329 s->ic = s1;
331 s->st = st; 330 s->st = st;
332 s->rtp_payload_data = rtp_payload_data;
333 rtp_init_statistics(&s->statistics, 0); // do we know the initial sequence from sdp? 331 rtp_init_statistics(&s->statistics, 0); // do we know the initial sequence from sdp?
334 if (!strcmp(ff_rtp_enc_name(payload_type), "MP2T")) { 332 if (!strcmp(ff_rtp_enc_name(payload_type), "MP2T")) {
335 s->ts = ff_mpegts_parse_open(s->ic); 333 s->ts = ff_mpegts_parse_open(s->ic);
336 if (s->ts == NULL) { 334 if (s->ts == NULL) {
337 av_free(s); 335 av_free(s);
526 return rv; 524 return rv;
527 } 525 }
528 526
529 void rtp_parse_close(RTPDemuxContext *s) 527 void rtp_parse_close(RTPDemuxContext *s)
530 { 528 {
531 // TODO: fold this into the protocol specific data fields.
532 av_free(s->rtp_payload_data->mode);
533 av_free(s->rtp_payload_data->au_headers);
534 if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) { 529 if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) {
535 ff_mpegts_parse_close(s->ts); 530 ff_mpegts_parse_close(s->ts);
536 } 531 }
537 av_free(s); 532 av_free(s);
538 } 533 }