summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc.c
diff options
context:
space:
mode:
authorThomas Volkert <thomas@homer-conferencing.com>2014-09-21 12:10:42 +0200
committerMartin Storsjö <martin@martin.st>2014-09-24 23:33:26 +0300
commitddf5fb71ee9c8b2d9a23c0f661a84896cd7050fc (patch)
tree5c37636b248cd6025ca45727d7b442e181f3ac76 /libavformat/rtpenc.c
parenta2efbecc4ed12d287cf29856418c4da4a7648d95 (diff)
rtpenc: HEVC/H.265 support
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r--libavformat/rtpenc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 7bc73735c2..647a8073b7 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -52,6 +52,7 @@ static int is_supported(enum AVCodecID id)
case AV_CODEC_ID_H263:
case AV_CODEC_ID_H263P:
case AV_CODEC_ID_H264:
+ case AV_CODEC_ID_HEVC:
case AV_CODEC_ID_MPEG1VIDEO:
case AV_CODEC_ID_MPEG2VIDEO:
case AV_CODEC_ID_MPEG4:
@@ -196,6 +197,15 @@ static int rtp_write_header(AVFormatContext *s1)
s->nal_length_size = (st->codec->extradata[4] & 0x03) + 1;
}
break;
+ case AV_CODEC_ID_HEVC:
+ /* Only check for the standardized hvcC version of extradata, keeping
+ * things simple and similar to the avcC/H264 case above, instead
+ * of trying to handle the pre-standardization versions (as in
+ * libavcodec/hevc.c). */
+ if (st->codec->extradata_size > 21 && st->codec->extradata[0] == 1) {
+ s->nal_length_size = (st->codec->extradata[21] & 0x03) + 1;
+ }
+ break;
case AV_CODEC_ID_VORBIS:
case AV_CODEC_ID_THEORA:
if (!s->max_frames_per_packet) s->max_frames_per_packet = 15;
@@ -566,6 +576,9 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
case AV_CODEC_ID_H263P:
ff_rtp_send_h263(s1, pkt->data, size);
break;
+ case AV_CODEC_ID_HEVC:
+ ff_rtp_send_hevc(s1, pkt->data, size);
+ break;
case AV_CODEC_ID_VORBIS:
case AV_CODEC_ID_THEORA:
ff_rtp_send_xiph(s1, pkt->data, size);