rtpenc: Merge the h264 and hevc packetizers

They share a great deal of common structure; only a few minor
bits in the headers differ.

This also fixes an off-by-one in sending of the last fragment
of large HEVC nals (where it previously sent len+2 bytes, even
if it should have been len+RTP_HEVC_HEADERS_SIZE aka len+3).

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2015-02-23 23:06:01 +02:00
parent 3567b91e49
commit c82bf15dca
6 changed files with 211 additions and 312 deletions

View File

@@ -577,7 +577,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
rtp_send_mpegts_raw(s1, pkt->data, size);
break;
case AV_CODEC_ID_H264:
ff_rtp_send_h264(s1, pkt->data, size);
ff_rtp_send_h264_hevc(s1, pkt->data, size);
break;
case AV_CODEC_ID_H261:
ff_rtp_send_h261(s1, pkt->data, size);
@@ -596,7 +596,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
ff_rtp_send_h263(s1, pkt->data, size);
break;
case AV_CODEC_ID_HEVC:
ff_rtp_send_hevc(s1, pkt->data, size);
ff_rtp_send_h264_hevc(s1, pkt->data, size);
break;
case AV_CODEC_ID_VORBIS:
case AV_CODEC_ID_THEORA: