From 0842187e6ee0b491439e443cff58300693a7e1ef Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 20 Nov 2018 04:09:52 -0600 Subject: [PATCH] nvdec: Rely on upstream's value for interlace-mode with hevc The nvdec API doesn't seem to produce interlacing information with hevc streams so rely on upstreams value for interlace-mode --- sys/nvdec/gstnvdec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/nvdec/gstnvdec.c b/sys/nvdec/gstnvdec.c index 2d7c66402b..71396b69de 100644 --- a/sys/nvdec/gstnvdec.c +++ b/sys/nvdec/gstnvdec.c @@ -694,10 +694,17 @@ handle_pending_frames (GstNvDec * nvdec) vinfo = &state->info; vinfo->fps_n = fps_n; vinfo->fps_d = fps_d; - if (format->progressive_sequence) + if (format->progressive_sequence) { vinfo->interlace_mode = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; - else + + /* nvdec doesn't seem to deal with interlacing with hevc so rely + * on upstream's value */ + if (format->codec == cudaVideoCodec_HEVC) { + vinfo->interlace_mode = nvdec->input_state->info.interlace_mode; + } + } else { vinfo->interlace_mode = GST_VIDEO_INTERLACE_MODE_MIXED; + } GST_LOG_OBJECT (decoder, "Reading colorimetry information full-range %d matrix %d transfer %d primaries %d",