Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp332642imm; Tue, 7 Aug 2018 20:13:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwIhsyo/yqAhHB9t29cGLeT2wr1q6sNqS5Z5Bl2dQJ2p85s4AgRyZ3zUyMziE3/xskI/LuK X-Received: by 2002:a63:cf4a:: with SMTP id b10-v6mr815178pgj.235.1533697981151; Tue, 07 Aug 2018 20:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533697981; cv=none; d=google.com; s=arc-20160816; b=jVcCMnDBL9iEtOlB7f4iUK2mWcXpG8N22pBRz/glWx2cCb9OJ2IY9QkXP955PMzmsC ibbHSsrMDTLZeqZaaMVEU2RI5dFEjUVE+bSwZMVqiDYntY84qF1SF3pUfa4UtI1TmUJa 2SEhl4fONNZvXsmQ4e98J4Wl6yqSU4tZWRy4skMvKnS6VFN1KD2YFNunO8oeh4iSfzoi +sRS/eXXDKBrWD8cuv2m9T3mkWJkYEGfMu18w3cxnJ0vxtQq5oOgu0i+zOFN5h9KjqCB AEC1w81Truz6iKpR8ZYPdF37Y2QF3cJWIfNWO9RLav1LQE7/4rsnc2I5OWvHFP+RV+c0 gsmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=zC3niLuPy2w0kKM13uDFSVH56eGPPC0hBsBDEIAlxrA=; b=qRcbUYFN8CyIJh0zJrLIDCF1hK7tB9nwyp/VUhSl+mARaAFIwR60Qbv+5o1RoGa2sH UJfJLCjyfUk+KKi6VaETqvJ4ImQAYwcIzFPKSYi/WIrKSmWeU1sqe66cBQvLrHO8eTmQ qU3R/6ZUQ+znzbC39dnLnKvzVyt3w0kBgZpymmrdn5KL43TgbumwXEzogxtks1z3iq7Q AJy8AeyYliLcYpBJd4+m3PZmb7mvLeflgRRgLk07d/JwiT4yhQaI5bUgoAWdRw2Ya817 zD5q72NcUPR49lzdibFm1ZyFWQEbYgSM2fvX9UHPNENSPk87deodbKDovjjXRHDCRKua YttA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PO00nhMl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g87-v6si3368973pfg.225.2018.08.07.20.12.45; Tue, 07 Aug 2018 20:13:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PO00nhMl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbeHHF3Y (ORCPT + 99 others); Wed, 8 Aug 2018 01:29:24 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:43263 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726258AbeHHF3Y (ORCPT ); Wed, 8 Aug 2018 01:29:24 -0400 Received: by mail-yw1-f65.google.com with SMTP id l189-v6so537116ywb.10 for ; Tue, 07 Aug 2018 20:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zC3niLuPy2w0kKM13uDFSVH56eGPPC0hBsBDEIAlxrA=; b=PO00nhMla5iyxQcOaf2GHDxrlXFxtJZ7PrX/a4tyW8fPWQ7Awhu6p5V+w/6nJHV0Ii /Nut8sQPuPXHZ5u9fXFVS+RvLPw+hWXqL6IWtYQIJ8bkq+Qy36G0M0qiTJvaoQcNK6qU f47ki8mxVxpebMyk7MijS2NueQ49KpKLim1wU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zC3niLuPy2w0kKM13uDFSVH56eGPPC0hBsBDEIAlxrA=; b=HxJrp9btxtditM8OyDL15nKapZ3oNi9lnBm0Bv/g7stbRCbjAAvj2D4EfTcuwbuXes KSl51mUF6LBvACAWo7gqZZi1/LvaaJnizPnVT8Dtyj+qTrZw02P3RbNozGfTg9R2sblP G1OCwismvIjcZGVJPZ6Rh5bIi/TANJsX15Ym9RsnmfWwFgYZz4EX4JZjMHxlZRkkCEXJ sko4kv/pZMeJGcrMmIjO2COxmt/6q7o94ljtDIq88tzuwhnJwGqrxxZDtXA3i9KIr0vg F+rpbJAxXW2Poikcj88q8SLzlIhhXe6z+Nt6l7EdGXb+W7Dwz6ZRlWsLa+bwFd/KaFkJ fLng== X-Gm-Message-State: AOUpUlHFnr+jOcNABBvPGIsGfly9mAgqdFOlZ/XQKgcFKDaGNINyg0He cxtUgktlUjCo8J/wAomiogt2Ygj5zR8= X-Received: by 2002:a0d:ea95:: with SMTP id t143-v6mr525889ywe.383.1533697915455; Tue, 07 Aug 2018 20:11:55 -0700 (PDT) Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com. [209.85.161.47]) by smtp.gmail.com with ESMTPSA id l11-v6sm1033523ywh.99.2018.08.07.20.11.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Aug 2018 20:11:54 -0700 (PDT) Received: by mail-yw1-f47.google.com with SMTP id e23-v6so531901ywe.13 for ; Tue, 07 Aug 2018 20:11:54 -0700 (PDT) X-Received: by 2002:a0d:dcc3:: with SMTP id f186-v6mr550213ywe.66.1533697913635; Tue, 07 Aug 2018 20:11:53 -0700 (PDT) MIME-Version: 1.0 References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> <37a8faea-a226-2d52-36d4-f9df194623cc@xs4all.nl> In-Reply-To: From: Tomasz Figa Date: Wed, 8 Aug 2018 12:11:42 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Hans Verkuil Cc: Linux Media Mailing List , Linux Kernel Mailing List , Stanimir Varbanov , Mauro Carvalho Chehab , Pawel Osciak , Alexandre Courbot , kamil@wypas.org, a.hajda@samsung.com, Kyungmin Park , jtp.park@samsung.com, Philipp Zabel , =?UTF-8?B?VGlmZmFueSBMaW4gKOael+aFp+ePiik=?= , =?UTF-8?B?QW5kcmV3LUNUIENoZW4gKOmZs+aZuui/qik=?= , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , Laurent Pinchart , dave.stevenson@raspberrypi.org, Ezequiel Garcia Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 7, 2018 at 4:13 PM Hans Verkuil wrote: > > On 07/26/2018 12:20 PM, Tomasz Figa wrote: > > Hi Hans, > > > > On Wed, Jul 25, 2018 at 8:59 PM Hans Verkuil wrote: > >>> + > >>> +14. Call :c:func:`VIDIOC_STREAMON` to initiate decoding frames. > >>> + > >>> +Decoding > >>> +======== > >>> + > >>> +This state is reached after a successful initialization sequence. In this > >>> +state, client queues and dequeues buffers to both queues via > >>> +:c:func:`VIDIOC_QBUF` and :c:func:`VIDIOC_DQBUF`, following standard > >>> +semantics. > >>> + > >>> +Both queues operate independently, following standard behavior of V4L2 > >>> +buffer queues and memory-to-memory devices. In addition, the order of > >>> +decoded frames dequeued from ``CAPTURE`` queue may differ from the order of > >>> +queuing coded frames to ``OUTPUT`` queue, due to properties of selected > >>> +coded format, e.g. frame reordering. The client must not assume any direct > >>> +relationship between ``CAPTURE`` and ``OUTPUT`` buffers, other than > >>> +reported by :c:type:`v4l2_buffer` ``timestamp`` field. > >> > >> Is there a relationship between capture and output buffers w.r.t. the timestamp > >> field? I am not aware that there is one. > > > > I believe the decoder was expected to copy the timestamp of matching > > OUTPUT buffer to respective CAPTURE buffer. Both s5p-mfc and coda seem > > to be implementing it this way. I guess it might be a good idea to > > specify this more explicitly. > > What about an output buffer producing multiple capture buffers? Or the case > where the encoded bitstream of a frame starts at one output buffer and ends > at another? What happens if you have B frames and the order of the capture > buffers is different from the output buffers? > > In other words, for codecs there is no clear 1-to-1 relationship between an > output buffer and a capture buffer. And we never defined what the 'copy timestamp' > behavior should be in that case or if it even makes sense. You're perfectly right. There is no 1:1 relationship, but it doesn't prevent copying timestamps. It just makes it possible for multiple CAPTURE buffers to have the same timestamp or some OUTPUT timestamps not to be found in any CAPTURE buffer. Best regards, Tomasz