From patchwork Mon Apr 26 07:54:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27412 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp3745247iob; Mon, 26 Apr 2021 00:54:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyctdwDn3buzB5htmvkVHXcx1bzM/OijDRQQnn3c7Z+TCl2Jv4ZVH/jRnzTlqidvefTH+KX X-Received: by 2002:a17:906:564f:: with SMTP id v15mr6486977ejr.96.1619423686647; Mon, 26 Apr 2021 00:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619423686; cv=none; d=google.com; s=arc-20160816; b=RZCXOQJ0v1tS2Fmcm5ZpufaruQYDrpBld440k4Jh/X76hIrJ08NLWUfm5PP7inZAQG hI9JC7BKS+zhLevCN2DsO8UnUJlhTj0rW6zSI+WqlrtG/pnmF+P446g8z5sszSOJ+O9y 0PQ2ZbC1UcUVu5HZXwbkPAApJFoctXWe3d25MjDAFljUZmcBj+hGe/4qcXXjqhsGbjCF HATDmGju5il9tClsZHTmkMkfy//2izaDv51Lme++KXhEvM5xvBHdWhW0o6hKr0JgADJh k+9fLYjkvt6fq2uvJUqqYE6kubmFls4EjudPzW5nECnTdPbqTQZUJRxAsaKL3zKQuBu7 m29A== 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=KfaNzGRHkgKu6VbMcnp3xTuzNsyXRP625wX4d0O0TJc=; b=t/sRTwHQh4/x2IdJ7CsFGuqyrsG1ZB544/nUZye2ZGw44DTSnVNANWySi3fSCJS39c dpKy1KifNtlLoZgHzRBtNK6Jh0oOkriqkokfFX0+TRj5PZQ5LTuusZpu1LUslIGqJ14B hPR4p4R2gdbf5/vqEaDAvy3+6Aeq1zBhL1BTzr5mQO0NEptp2KplUL3OPctGSwSEEL6/ UmY7OXt/rzOXpTbFpYimTqhD/lgQTI4Vvz0w5nFg02iP8NYuHuUV0fMxp1elxcAKBr4y qH1zLVBE3033S8OpEhRpAHez4Cv9LV5g1/Qjl5+ySfdhbJN/Mi3qjyrNcb7EeBvZsqcT JAXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="EE9t/tLU"; 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 u19si13454519edo.410.2021.04.26.00.54.46; Mon, 26 Apr 2021 00:54:46 -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="EE9t/tLU"; 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 825BA689985; Mon, 26 Apr 2021 10:54:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5297B6898F1 for ; Mon, 26 Apr 2021 10:54:36 +0300 (EEST) Received: by mail-pj1-f48.google.com with SMTP id f6-20020a17090a6546b029015088cf4a1eso4786132pjs.2 for ; Mon, 26 Apr 2021 00:54:36 -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=EmhdEL9xg5B+QhuUnrUfd79KNEMKQBCEogxsro6cmXs=; b=EE9t/tLUkNJtvfC3VGtf6Dr1mKDjeZ1uMKh4UGdvR8GeTBZMzCfRewAD/5nJYOGpK/ wLpSh4qDOuUC9z/vseDhXZtQBU7u+JiMJEB6TX1gUi6eoIhwVGgYTGtKTHXedtb0tqoh AfVkolHmTK4Fsxzp9141O3+AMebRWEAUDhTxoud5ESsFn6ByrHUw2ERUYslAe7Hoils7 OWD6lvsWz/UFYmtZ5o7Vv3Qz8zbzE/0yODJslOwn/8RZJqG1ykC2OTI/UGnIrAz9Ngna CubffxY6tWhfO9eOK/uIRT+NMvVlGmauCvlgGkjPgfYDb5Fmr0tf35iB6XSdfp285cjx FPXA== 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=EmhdEL9xg5B+QhuUnrUfd79KNEMKQBCEogxsro6cmXs=; b=A6pb31szDcwruHi7+ztsLLusILor5DFI0p9RCh5jJpdi+cka30GyIV7P9nZf8KwYR7 B/f308BdkCYLU0z/JRCfxO4NqYce6lEUUi/MbXSyU/NjuunXHMDepoHq2OG4/9i17s/t OfOQvaq71ZMEvffjoJTtYEqyzI7xEucFAca1hwZg1TZ1ghkfgwcdRO5ZIGnbuCdw6KZh GDfuvGKnUEHiM1ixQMWsmuK2mL+OkA5A5bduJqiS3FTAxWtJUFG4dCj4OCURioEEoAyM ZJc9DPg9oCraTJKmCqxTeBca0xU2AnzDfa0M+KqsBk6WlHr7pcMKrxZtl+HuJYmZ0wl4 DI1w== X-Gm-Message-State: AOAM532VTmyKL9YI/k5exxh7BDmCj17Rp5x+3w4r7Z2Vv7IKEkyoJYeC my0zLA5P7/SQFh2Fb8MVeWcFtNN5074fWw== X-Received: by 2002:a17:90a:ce8b:: with SMTP id g11mr7626136pju.173.1619423674326; Mon, 26 Apr 2021 00:54:34 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.157.221.194]) by smtp.googlemail.com with ESMTPSA id z17sm9922956pfe.181.2021.04.26.00.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 00:54:34 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Apr 2021 13:24:09 +0530 Message-Id: <20210426075408.8993-1-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] lavfi/dnn/queue.h: 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: Shubhanshu Saxena Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 81XbPDrlGTN3 Documentation for Queue Signed-off-by: Shubhanshu Saxena --- 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