rtpdec: Split mpegts parsing to a normal depacketizer
This gets rid of a number of special cases from the common rtpdec code. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
d5bb8cc2dd
commit
2326558d52
6 changed files with 131 additions and 55 deletions
|
@ -180,7 +180,8 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler,
|
|||
{
|
||||
if (!handler)
|
||||
return;
|
||||
codec->codec_id = handler->codec_id;
|
||||
if (codec)
|
||||
codec->codec_id = handler->codec_id;
|
||||
rtsp_st->dynamic_handler = handler;
|
||||
if (handler->alloc) {
|
||||
rtsp_st->dynamic_protocol_context = handler->alloc();
|
||||
|
@ -382,8 +383,17 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
|
|||
|
||||
if (!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T")) {
|
||||
/* no corresponding stream */
|
||||
if (rt->transport == RTSP_TRANSPORT_RAW && !rt->ts && CONFIG_RTPDEC)
|
||||
rt->ts = ff_mpegts_parse_open(s);
|
||||
if (rt->transport == RTSP_TRANSPORT_RAW) {
|
||||
if (!rt->ts && CONFIG_RTPDEC)
|
||||
rt->ts = ff_mpegts_parse_open(s);
|
||||
} else {
|
||||
RTPDynamicProtocolHandler *handler;
|
||||
handler = ff_rtp_handler_find_by_id(
|
||||
rtsp_st->sdp_payload_type, AVMEDIA_TYPE_DATA);
|
||||
init_rtp_handler(handler, rtsp_st, NULL);
|
||||
if (handler && handler->init)
|
||||
handler->init(s, -1, rtsp_st->dynamic_protocol_context);
|
||||
}
|
||||
} else if (rt->server_type == RTSP_SERVER_WMS &&
|
||||
codec_type == AVMEDIA_TYPE_DATA) {
|
||||
/* RTX stream, a stream that carries all the other actual
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue