summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_parse.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-04-30 13:05:52 -0300
committerJames Almer <jamrial@gmail.com>2017-05-05 17:30:38 -0300
commit6a72578cc21ec608f3c2d8a8e5904e93284b3277 (patch)
treee9c1b23dc3e860da6b9a08ba6ed3069721a7a44e /libavcodec/hevc_parse.c
parentbf1e3be5a3f655b8035a6866c2e78ee95993ca90 (diff)
avcodec/hevc_parse: decode SEI message NALUs in extradata
They may be available in hvcc style extradata. Based on a patch by Hendrik Leppkes. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_parse.c')
-rw-r--r--libavcodec/hevc_parse.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c
index ee4cd54d3e..1122a60af3 100644
--- a/libavcodec/hevc_parse.c
+++ b/libavcodec/hevc_parse.c
@@ -22,8 +22,8 @@
#include "hevc_parse.h"
static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets *ps,
- int is_nalff, int nal_length_size, int err_recognition,
- int apply_defdispwin, void *logctx)
+ HEVCSEIContext *sei, int is_nalff, int nal_length_size,
+ int err_recognition, int apply_defdispwin, void *logctx)
{
int i;
int ret = 0;
@@ -54,6 +54,12 @@ static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets
if (ret < 0)
goto done;
break;
+ case HEVC_NAL_SEI_PREFIX:
+ case HEVC_NAL_SEI_SUFFIX:
+ ret = ff_hevc_decode_nal_sei(&nal->gb, logctx, sei, ps, nal->type);
+ if (ret < 0)
+ goto done;
+ break;
default:
av_log(logctx, AV_LOG_VERBOSE, "Ignoring NAL type %d in extradata\n", nal->type);
break;
@@ -69,8 +75,8 @@ done:
}
int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
- int *is_nalff, int *nal_length_size, int err_recognition,
- int apply_defdispwin, void *logctx)
+ HEVCSEIContext *sei, int *is_nalff, int *nal_length_size,
+ int err_recognition, int apply_defdispwin, void *logctx)
{
int ret = 0;
GetByteContext gb;
@@ -108,8 +114,9 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
return AVERROR_INVALIDDATA;
}
- ret = hevc_decode_nal_units(gb.buffer, nalsize, ps, *is_nalff, *nal_length_size,
- err_recognition, apply_defdispwin, logctx);
+ ret = hevc_decode_nal_units(gb.buffer, nalsize, ps, sei, *is_nalff,
+ *nal_length_size, err_recognition, apply_defdispwin,
+ logctx);
if (ret < 0) {
av_log(logctx, AV_LOG_ERROR,
"Decoding nal unit %d %d from hvcC failed\n",
@@ -125,7 +132,7 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
*nal_length_size = nal_len_size;
} else {
*is_nalff = 0;
- ret = hevc_decode_nal_units(data, size, ps, *is_nalff, *nal_length_size,
+ ret = hevc_decode_nal_units(data, size, ps, sei, *is_nalff, *nal_length_size,
err_recognition, apply_defdispwin, logctx);
if (ret < 0)
return ret;