diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-03-24 16:21:05 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2017-03-24 16:21:28 +0100 |
commit | 0f3c77126b3512d3020ded2a7e72e79faffe1cc7 (patch) | |
tree | be134c043aa62d34831cbf2cf56f5c7516e538f9 /modules | |
parent | 10f3ba2b2c63cf564664ad5ed719fb38c0262ecd (diff) |
h265: check for changes in colorspace
Diffstat (limited to 'modules')
-rw-r--r-- | modules/h265/encode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/h265/encode.c b/modules/h265/encode.c index 955d8dd..239abe6 100644 --- a/modules/h265/encode.c +++ b/modules/h265/encode.c @@ -153,6 +153,11 @@ static inline int packetize(bool marker, const uint8_t *buf, size_t len, const size_t flen = maxlen - sizeof(fu_hdr); err = h265_nal_decode(&nal, buf); + if (err) { + warning("h265: encode: could not decode" + " NAL of %zu bytes (%m)\n", len, err); + return err; + } h265_nal_encode(fu_hdr, H265_NAL_FU, nal.nuh_temporal_id_plus1); @@ -207,7 +212,11 @@ int h265_encode(struct videnc_state *st, bool update, return EINVAL; } - if (!st->x265 || !vidsz_cmp(&st->size, &frame->size)) { + if (!st->x265 || !vidsz_cmp(&st->size, &frame->size) || + st->param->internalCsp != colorspace) { + + debug("h265: encoder: reset %u x %u (%s)\n", + frame->size.w, frame->size.h, vidfmt_name(frame->fmt)); st->param->internalCsp = colorspace; |