From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8629B466AD for ; Fri, 30 Jun 2023 20:17:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D8C9768C40D; Fri, 30 Jun 2023 23:16:58 +0300 (EEST) Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A77C668C390 for ; Fri, 30 Jun 2023 23:16:52 +0300 (EEST) Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-55b85b94bb0so1376606eaf.0 for ; Fri, 30 Jun 2023 13:16:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20221208.gappssmtp.com; s=20221208; t=1688156210; x=1690748210; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/qIOhQlM5ixR8HTa0eSLOhGGRVUByvfCDKOXGT6H9N4=; b=QY8dwg06VC2GW5LrQIDV1I13w3j2YVJQHIbkUPvc1m2plO3YZ1ryHPzwNUWRQRoQzQ x2WengS2rtjDbmLD4QbLkmCeArbTZU3/o29qfSdb3yckcdKz10uCrL4aJcBDwoLwoG1L +WGfonqltZMv4oqcbdXgev+2/IyxlLruOAIjWLaCSwgMLrJBQJWOZluee1ay34MuwQKB hO+6Z/XVULueYUCUqHFG8RJjVy1kpkIOH+tv8YqPRGWzoxE79A3Z45LvbrH6ATmTe5/H Qs+qzlADTNFFbfDQlAUKbF7FL6QlAicSU8kgFnvnMnDOUnyx4PyEDnJS9QBPZmCVhZTC rIHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688156210; x=1690748210; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/qIOhQlM5ixR8HTa0eSLOhGGRVUByvfCDKOXGT6H9N4=; b=kohhTgqWYPdblUIgiW3UT57AehS/Xf0JsA3+xEpuXvtZ74CE7gARzSy3cin7J1PJvt H4/l3TLI7ZGyunuwf4Qhj0/c2dMbPMWB0pEDhl2XBuvtqrA1lokS0cO5xyy/DSvKh9U7 ftQ9g3ZitffEbUL96njOZmFwucz+XqGk7lmpFkmK6NDl7tiRP7FNFRYc39eNgpwGIyd/ iXPsSicm+hPHTGHruxy3xjK6WxFqHV/j/VBssj8PTWh6UjP15Cc7jUrJERpDAv7wYkGF pMVVqN3Nslvf6JcYk19okxUBB0OYA2GSUvI/bNS+4qjc6iaF6PVlac7IsFBntibY7nYx 5sbA== X-Gm-Message-State: ABy/qLY+mzwCoQe7wYpiI541GlU0FVW34yx1POaSEpGCnUu0pzRfyRVS zRsu4Yr5DdP1gY/rqLf/DUO2Pxk5jLUygGMVYd8= X-Google-Smtp-Source: APBJJlEYwKvC3jquCO6H7Mm54wfuyb1A6st5oJJ6/84XbMr3ueSxziV7SPq50LSx7NMszEkMLS0Z9A== X-Received: by 2002:a05:6358:1a91:b0:134:d030:e5da with SMTP id gm17-20020a0563581a9100b00134d030e5damr1581710rwb.21.1688156210175; Fri, 30 Jun 2023 13:16:50 -0700 (PDT) Received: from ltnt-nyc-580testdevin.livetimenet.com (pool-71-105-132-214.nycmny.fios.verizon.net. [71.105.132.214]) by smtp.gmail.com with ESMTPSA id h12-20020ac8776c000000b003f9efa2ddb4sm2294999qtu.66.2023.06.30.13.16.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jun 2023 13:16:49 -0700 (PDT) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Jun 2023 17:14:38 -0400 Message-Id: <1688159679-3623-1-git-send-email-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH v3 1/2] decklink: move queue_size to an argument for ff_decklink_packet_queue_init 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: Devin Heitmueller MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The existing queue initialization function would always sets it's maximum queue size to ctx->queue_size. But because we are introducing more queues we may want the sizes to differ between them. Move the specification of the queue size into an argument, which can be passed from the caller. This patch makes no functional change to the behavior. It is being made to accommodate Marton Balin's request to split out the queue size for the new VANC queue being introduced in a later patch. Signed-off-by: Devin Heitmueller --- libavdevice/decklink_common.cpp | 4 ++-- libavdevice/decklink_common.h | 2 +- libavdevice/decklink_dec.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp index b6cc8d7..5e8d612 100644 --- a/libavdevice/decklink_common.cpp +++ b/libavdevice/decklink_common.cpp @@ -390,14 +390,14 @@ int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t directio return ff_decklink_set_format(avctx, 0, 0, 0, 0, AV_FIELD_UNKNOWN, direction); } -void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q) +void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q, int64_t queue_size) { struct decklink_cctx *ctx = (struct decklink_cctx *)avctx->priv_data; memset(q, 0, sizeof(DecklinkPacketQueue)); pthread_mutex_init(&q->mutex, NULL); pthread_cond_init(&q->cond, NULL); q->avctx = avctx; - q->max_q_size = ctx->queue_size; + q->max_q_size = queue_size; } void ff_decklink_packet_queue_flush(DecklinkPacketQueue *q) diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index ebb5b94..53e9983 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -235,7 +235,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct void ff_decklink_cleanup(AVFormatContext *avctx); int ff_decklink_init_device(AVFormatContext *avctx, const char* name); -void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q); +void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q, int64_t queue_size); void ff_decklink_packet_queue_flush(DecklinkPacketQueue *q); void ff_decklink_packet_queue_end(DecklinkPacketQueue *q); unsigned long long ff_decklink_packet_queue_size(DecklinkPacketQueue *q); diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 66abee1..11640f7 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -1297,7 +1297,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) goto error; } - ff_decklink_packet_queue_init(avctx, &ctx->queue); + ff_decklink_packet_queue_init(avctx, &ctx->queue, cctx->queue_size); if (ctx->dli->StartStreams() != S_OK) { av_log(avctx, AV_LOG_ERROR, "Cannot start input stream\n"); -- 1.8.3.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".