Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4388968imm; Tue, 7 Aug 2018 00:16:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvizsG37VO+t0Z/VbrCgdT3BHrzZ5XOAunqzq59miX81VuBZg97UpT+zw/Ns0jHsibKxW4 X-Received: by 2002:a17:902:6193:: with SMTP id u19-v6mr16651618plj.133.1533626168498; Tue, 07 Aug 2018 00:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533626168; cv=none; d=google.com; s=arc-20160816; b=wamYf1EibO8nF7k5ihSS3qLv/Bond/Gr0b/6M/GkKDxtEqp/zXJ91MtWlffF/ohqnc OXMpKwMOFLpxjtb+PsrEL/jyYq2u1gChUQLFP4XC3cc84RuVOeIDYUxZGEN4Z7/g3LAb Vyxa60ch57I+rogmkYYqK9nTzWrAKf3V0DeUULsw7V4jYnTIjFW8i5plWqsWp1xlgtsN CfVHzlzoZhDHQk4lSvkX7pEX0zrvSR2bBmfzKkI4akF5Np/o+BFw+mHCcu7s1JQAybjK R0SEXJqPQXcd5uXLcuBdgbWE/ys54FuqGt7Xa/5BQcfQ0qtfIn2u1qTB2f75NYQlaDMQ Hxkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=te5sIamGmfWsKHp8azVsWLf3kLi+uHE/GzpXZODVdI0=; b=nvMzfl6IYHgQimwiGMEDdZ5Vq01K4oOKFL92N8oiSIl8NzlFB7pkpbJctf0VkRemzr v/gF67Ve0FHZL1GljLop7RQbeu5S8CGp5eEIJbLIGWoF76X00r9tVSxj/2eytjZADZS/ Yq3yq/7OhtN7ACMajF+JS0iwh3s1HCNb9SEA6SPVXtvef7nnNNUApmJp6RE2CJk03UmO V/Rmr57e609qE5sPXIsSef9vmtmFzoHfKaAK1vDklvrGpARy7MR/D34JuP64Ho36vvbi xmYt/JxnrKGRXXf6R46z/Aeo0TIKl4GqgGAhi/zfX36649zxym7LSkoYjOfmW2tinYl1 OOdg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36-v6si526318pld.8.2018.08.07.00.15.53; Tue, 07 Aug 2018 00:16:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388723AbeHGJ0d (ORCPT + 99 others); Tue, 7 Aug 2018 05:26:33 -0400 Received: from lb3-smtp-cloud9.xs4all.net ([194.109.24.30]:44023 "EHLO lb3-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388581AbeHGJ0d (ORCPT ); Tue, 7 Aug 2018 05:26:33 -0400 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id mwBKfJV22EJtcmwBNf4P0x; Tue, 07 Aug 2018 09:13:34 +0200 Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Tomasz Figa 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 References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> <37a8faea-a226-2d52-36d4-f9df194623cc@xs4all.nl> From: Hans Verkuil Message-ID: Date: Tue, 7 Aug 2018 09:13:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfMrWev36GF+g/YWCUtXiFb5HE2J2KggqZp8aJ/viLGrcymOKiYFeTNaz6WjjNUrfBFHk+SBMsFj92zJDG/unks0aVUZR6FW0CHSAjmSQuH44iDyvRDi8 WKR5BRYVFJBEJw2Xxavce+vXBCgqv6yhSatxi8u2/674nvbz+uBmUCHsGdacFRft0ruZRr85gHO3w/NPFdN1jbxAQlQ4wK8Giw3p/It9QgQ0FCo6e/fheXeh XNup/8+TEG1lEShoAtgPg8Mo6tS9j0P+LREA5HW4wC1bCGs2JKiBSzEPpG9HwSEDRMfBwZGPJlGYwgeqrctGotmda9d5yW8AOe9SunsWe/H9MpAXK/5YA23j 07Klf+0alwTxJhK5PSfMigrj/eko7WystqizUvhvh/noEMKAQD4WEVhjbhDO75RF9ksDSXqWdIODr+yj/JcjPbyyVArRgGaD/k1ONX2F7lM/CaM7HizREk5y yiDYL88HnvK/2qmlfwcBqyaqCfMEM7NUz7YXshalQ23aP+fdtoyRywYhSp1RZyb8jzykSClqA8rN1Zw78YMp4L91FnLtb0Cz1LLA3pvuOEu4kCHHMhVOXxJ3 d2xvyWAthPQXiHzzHmV5LYgpCSMe2tcE2mCOWgFtvLrg/RBgAnrEmyKpj5JPBiEIxD6MsTqvf4UCKMjpJH1UdeIxY88kj3aZ0W9WkMRZNOM+/+Q+4APpehcL mpOa/GoZOZw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Hans