From patchwork Sun Apr 25 13:16:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27357 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3188079iob; Sun, 25 Apr 2021 07:16:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvj2LOChHhNwzBXYRmM3CdG7BQdPV/qz2l7ebERpM6pn/uT2E0ViMSviMWdtkpaxQovW4c X-Received: by 2002:a17:906:93f7:: with SMTP id yl23mr12817575ejb.407.1619360179096; Sun, 25 Apr 2021 07:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619360179; cv=none; d=google.com; s=arc-20160816; b=oV39BiJ/oZ8FCk1YM2b4IWC7KgA80AhsgVbkrCda6MrldjKlIwIAR5Ir/eT1L2HFb1 H44YOAq4OHC1XBaVzV2gzRgrPofA/JUvVKaQ2roC0i1A1qL6+TFeY1aSfxic6QV1vWRL CPLHfoYRcU60AbxP2BR7EZGW0H+jhHOReE4pQ2Stzuwt0b+ypaZ8GuC4mBjgIyOkzU/Y r9ySocrUFqruyuNtCLbyoF0HD0z1Sl/QM4h7vGE+7ub6JAEz+ANwZfyaqHttBz8yWx3O rvKAzUaQsgv+U6kamFsI3Bgu3AmcURMbPGP7fddPmXeHE7XL6FaT1kH8luNr9Lp0ZNWF 7HPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=Rq5SzirJ3NqX85sAOAPOnAeMOQkgRx3R950Zvyzmha4=; b=q5PebhuR3Sye92wk/cdx7ZWxeN6JP/axblXmySkA7NWzP/zyj77loOYzCsdWsFJokO VSG89v04ZN6ml0o8gAoC3GuD0pdQaz2c7WIAicRnpvYUddM1PC+VQx4+QpMBM7Oc169F fj2iVKyCjUJJkGdUTcWHCFvWg1FA56GSvrKWeNknDV27Ce4pNBIQo8Cwg5/QN5aa3eFM +WG2UngYqMSB4bmO1NihJ23gmixVFKwtP2diHOCkML+kYCM1PMLEseTBXjwx6jodXvDu SRHnkaMExTWcUClxO8/5hJMtvTqjt0c6TfX14h9jV2Eb1WAPrnc7XGmzesjiDQ+BP1Dt qoUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LeiYNnyS; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ca21si10743636ejb.227.2021.04.25.07.16.18; Sun, 25 Apr 2021 07:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LeiYNnyS; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A40A2688051; Sun, 25 Apr 2021 17:16:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E52A96809E0 for ; Sun, 25 Apr 2021 17:16:09 +0300 (EEST) Received: by mail-pg1-f177.google.com with SMTP id y32so38382600pga.11 for ; Sun, 25 Apr 2021 07:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0dNIXg3LTDX0khHZdixLB+qJHsRVwwy6EKDAkNjxUjw=; b=LeiYNnySTihKn1jDdeG704Z0lnfaEoP5nizbqUai7WS+qHKVrpgo9rGkqKVj4o6Aq+ YcxdAHDVA027Jo9Z9rjrbtY5nlE3RSRBj5ciyNCh7DJymvt+5QI/apP0wzQ1sPPNDB5G fzYhCNlGSGHLb1ybCPmJlsCge3urjtAhuIgcYVau2hza9CA8M1Qi0YGxRg01zFlgiZ6O D/fqXjstJpQKzMK9wHCA+eQMFs7HbWsVROFfIbI8VjY6DjM/dW+woFY6j+0Fkcv7km/P K9fXX7WMTDmno8gat1kL3jMm28S1mOEZmUz9Uk9+9KRuqlajS5ZYLR8/s1Qh2pRn+2Lh 0Hxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0dNIXg3LTDX0khHZdixLB+qJHsRVwwy6EKDAkNjxUjw=; b=OIJfqGOnvRJpZUvPzGf7hcdEL+RBo96aLXMJiSxFutoEMRUNZp24SrbHQBoMEdghpq gPSmmi0vS7NvYEQEEebWw1e6QTjeiSDUDAqQ6pvtmePzwILADfqTRGu0Z8h7yl5sAj2C n7VJ8Bboj/oOZZfLqJkzR9inExez3H3fDCtt2XlKA+j3P63rmanR8q4P8ETX6fUouW4c fcb0shMpI3RdBP4mtE4CK5RkHFbbrDFLIGSUeHrMcezMmHKryrP5nMbq4LRdsH9NdpXs ak7ociVEe2EZYeAUH7LhRjtHuD05eFB1G9dgLmh5uUInu7ra2QY7b0viC0r3U85AKP8B pCow== X-Gm-Message-State: AOAM5333ucO6fEz2yntxtG+KTYAqyXCDip5vJ9a5BKyxG7lOiHosoKb1 TfcqFTewGiaKaYObM0NIlo6YnMAshtAHzA== X-Received: by 2002:a62:15d1:0:b029:254:e939:91a6 with SMTP id 200-20020a6215d10000b0290254e93991a6mr12541503pfv.21.1619356662137; Sun, 25 Apr 2021 06:17:42 -0700 (PDT) Received: from localhost.localdomain ([117.212.37.136]) by smtp.googlemail.com with ESMTPSA id b5sm9392978pgb.0.2021.04.25.06.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Apr 2021 06:17:41 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Apr 2021 18:46:37 +0530 Message-Id: <20210425131636.46925-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavfilter: Add Documentation to Queue X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: shubhanshu02 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: IZto4OfaVKq6 From: shubhanshu02 Adds documentation to queue.h in libavfilter/dnn Signed-off-by: shubhanshu02 --- libavfilter/dnn/queue.h | 75 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/libavfilter/dnn/queue.h b/libavfilter/dnn/queue.h index 4d7121366a..2524d5fa59 100644 --- a/libavfilter/dnn/queue.h +++ b/libavfilter/dnn/queue.h @@ -22,20 +22,95 @@ #ifndef AVFILTER_DNN_QUEUE_H #define AVFILTER_DNN_QUEUE_H +/** + * Linear double-ended data structure + */ typedef struct Queue Queue; +/** + * @brief Create a Queue instance. + * It initializes the length of the Queue as 0. + * + * @return Pointer to the Queue + * @retval NULL if allocation fails + */ Queue *ff_queue_create(void); + +/** + * @brief Destroy the Queue instance. + * It also frees all elements of the Queue. + */ void ff_queue_destroy(Queue *q); +/** + * @brief Return the length of the Queue + */ size_t ff_queue_size(Queue *q); +/** + * @brief Return a pointer to the data + * at the head of the queue. + * + * @retval NULL if null pointer was passed + * or queue is empty + */ void *ff_queue_peek_front(Queue *q); + +/** + * @brief Return a pointer to the data at + * the tail of the queue. + * + * @retval NULL if null pointer was passed + * or queue is empty + */ void *ff_queue_peek_back(Queue *q); +/** + * @brief Add data to the head of the queue. + * It increases the length of Queue by one. + * + * @param q pointer to the Queue. + * @param v data to be added + * @return The length of the Queue + * @retval 0 if the pointer to queue is NULL + * @retval -1 if new entry cannot be created + */ int ff_queue_push_front(Queue *q, void *v); + +/** + * @brief Add data to the tail of the queue. + * It increases the length of Queue by one. + * + * @param q pointer to the Queue + * @param v data to be added + * @return The length of the Queue + * @retval 0 if the pointer to queue is NULL + * @retval -1 if new entry cannot be created + */ int ff_queue_push_back(Queue *q, void *v); +/** + * @brief Remove and free first element from + * the Queue. It shrinks the length of Queue + * by one. + * + * @param q pointer to the Queue. + * @return The value of first element as void. + * If a null pointer or empty queue is passed, + * it returns NULL + */ void *ff_queue_pop_front(Queue *q); + +/** + * @brief Remove and free last element from + * the Queue. It shrinks the length of Queue + * by one. + * + * @param q pointer to the Queue. + * @return The value of last element as void. + * If a null pointer or empty queue is passed, + * it returns NULL + */ void *ff_queue_pop_back(Queue *q); #endif