From patchwork Tue Sep 3 01:02:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 14877 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9842344A4A6 for ; Tue, 3 Sep 2019 04:10:51 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 827C8688000; Tue, 3 Sep 2019 04:10:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f67.google.com (mail-ot1-f67.google.com [209.85.210.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 53E3B687FB1 for ; Tue, 3 Sep 2019 04:10:50 +0300 (EEST) Received: by mail-ot1-f67.google.com with SMTP id z17so15041222otk.13 for ; Mon, 02 Sep 2019 18:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmm1-net.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2xPQ8eM4/n4LWnRGgEME1JTiHktuDbc8T140ezDzwxQ=; b=CN7i+5JJxSy7PeL8wetfpco/ZIDGdJNmtSHNt0/VfTtknYWTuvWJf90+d7W9mBlj07 oTk3iFyXrGPocDFVHPWBLThGzZIKvscxh4oDBIg56btQGf6Igsa5gviWzMaU6//t+VoZ nyUFMWx6jsBVnN+0ECoei0u4/RMx5tgJ1tIUBgry1j2ok8Q8kwr4GtlfcB7YC6lkVQN8 tjEaC4nEvQOsAvM7k/rXG6Z00FPSDYUXPtfnJ2Hwd2e/hZ9PGpeYrzQEMsJ85uGaLqAR avR0s88q1zpYn2Haad5BkcZHUtJrTy7V0o9vVFYEj+GjcgzNODYIU3Ez5VVjEIGKhokf 3x9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2xPQ8eM4/n4LWnRGgEME1JTiHktuDbc8T140ezDzwxQ=; b=XnSIuGFZ6PGfUKE3KjDoP//ONRsm2oV0WOG5XYT5lC4iHJoL3kBhEdIa+cgx8+hxy2 XCOC7YBKeVAjQz9RXQXS25Vs8FMgqdEyKNH6ZJ3EO3Bos+FZHa+QnTqSEt3E9ouCUYXK x30EYr6rQTLGXd+i6Zmyl0R48cbNOlF6b5DyM2rUc/0RN9ekOR8rIvDwE/V+qDUMRfET C6wBzVejKgYox8YIXuhizmpdtsHD2LcAs+jiRpGu84r9k0Goh+d+BaqHKaVhihBl+Dmc LVOusCtihLX5LioTE6ZEFIkMFUnAETzq69S8ZT2psNl8MJgk4qhHBS3dzuihmP7RvD20 sKpA== X-Gm-Message-State: APjAAAVepaPcgVmBo03sds0+8lyVAf/Oou8XjU0EZANUQ0plCqCVvo36 +Yr6dxt1C7geDDFDfe4FpF/ki2bX7zU= X-Google-Smtp-Source: APXvYqwXTjxmdmrvx9CUQJvRu0rCSUA4fteqEIZ6DxmFX3svc5D1JB7M+2LZkftmFVA/+LIaHF8oGg== X-Received: by 2002:a05:6830:11d9:: with SMTP id v25mr12570465otq.137.1567472584331; Mon, 02 Sep 2019 18:03:04 -0700 (PDT) Received: from tmm1-imac.lan (ip184-189-221-177.sb.sd.cox.net. [184.189.221.177]) by smtp.gmail.com with ESMTPSA id a21sm4299633oie.9.2019.09.02.18.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Sep 2019 18:03:03 -0700 (PDT) From: Aman Gupta To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Sep 2019 18:02:15 -0700 Message-Id: <20190903010230.96236-11-ffmpeg@tmm1.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190903010230.96236-1-ffmpeg@tmm1.net> References: <20190903010230.96236-1-ffmpeg@tmm1.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/25] avcodec/v4l2_m2m_dec: set pkt_dts on decoded frames to NOPTS X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: lorusak@gmail.com, Aman Gupta , jorge.ramirez.ortiz@gmail.com, Aman Gupta Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Aman Gupta Without this ffmpeg will attempt to copy the dts from the most recently enqueued packet into the most recently dequeued frame, which does not account for the buffering inside v4l2 and is not accurate. Signed-off-by: Aman Gupta --- libavcodec/v4l2_buffers.c | 1 + libavcodec/v4l2_m2m_dec.c | 1 + 2 files changed, 2 insertions(+) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c index e7234d3ca7..4982fc564e 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -392,6 +392,7 @@ int ff_v4l2_buffer_buf_to_avframe(AVFrame *frame, V4L2Buffer *avbuf) frame->color_range = v4l2_get_color_range(avbuf); frame->color_trc = v4l2_get_color_trc(avbuf); frame->pts = v4l2_get_pts(avbuf); + frame->pkt_dts = AV_NOPTS_VALUE; /* these two values are updated also during re-init in v4l2_process_driver_event */ frame->height = s->output.height; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index fb2bfde714..a3744208f3 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -242,6 +242,7 @@ static const AVOption options[] = { .close = v4l2_decode_close, \ .bsfs = bsf_name, \ .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ + .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \ .wrapper_name = "v4l2m2m", \ };