Mercurial > libavformat.hg
comparison rtpdec.c @ 3976:64056a0c38ce libavformat
Change function prototype of RTPDynamicPayloadHandler.parse_packet() to
not use RTPDemuxContext, but rather take a pointer to the payload context
directly. This allows using payload handlers regardless over the transport
over which they were sent, and prepares for the introduction of a future
RDTDemuxContext. See discussion in "RDT/Realmedia patches #2" thread on ML.
author | rbultje |
---|---|
date | Sat, 04 Oct 2008 04:15:06 +0000 |
parents | 874534fb6d0f |
children | 1f1c4535f421 |
comparison
equal
deleted
inserted
replaced
3975:44561554cb7e | 3976:64056a0c38ce |
---|---|
397 | 397 |
398 if (!buf) { | 398 if (!buf) { |
399 /* return the next packets, if any */ | 399 /* return the next packets, if any */ |
400 if(s->st && s->parse_packet) { | 400 if(s->st && s->parse_packet) { |
401 timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned.... | 401 timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned.... |
402 rv= s->parse_packet(s, pkt, ×tamp, NULL, 0, flags); | 402 rv= s->parse_packet(s->dynamic_protocol_context, |
403 s->st, pkt, ×tamp, NULL, 0, flags); | |
403 finalize_packet(s, pkt, timestamp); | 404 finalize_packet(s, pkt, timestamp); |
404 return rv; | 405 return rv; |
405 } else { | 406 } else { |
406 // TODO: Move to a dynamic packet handler (like above) | 407 // TODO: Move to a dynamic packet handler (like above) |
407 if (s->read_buf_index >= s->read_buf_size) | 408 if (s->read_buf_index >= s->read_buf_size) |
461 memcpy(s->buf, buf + ret, s->read_buf_size); | 462 memcpy(s->buf, buf + ret, s->read_buf_size); |
462 s->read_buf_index = 0; | 463 s->read_buf_index = 0; |
463 return 1; | 464 return 1; |
464 } | 465 } |
465 } else if (s->parse_packet) { | 466 } else if (s->parse_packet) { |
466 rv = s->parse_packet(s, pkt, ×tamp, buf, len, flags); | 467 rv = s->parse_packet(s->dynamic_protocol_context, |
468 s->st, pkt, ×tamp, buf, len, flags); | |
467 } else { | 469 } else { |
468 // at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise. | 470 // at this point, the RTP header has been stripped; This is ASSUMING that there is only 1 CSRC, which in't wise. |
469 switch(st->codec->codec_id) { | 471 switch(st->codec->codec_id) { |
470 case CODEC_ID_MP2: | 472 case CODEC_ID_MP2: |
471 /* better than nothing: skip mpeg audio RTP header */ | 473 /* better than nothing: skip mpeg audio RTP header */ |