From patchwork Fri Oct 1 21:03:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30861 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083616iob; Fri, 1 Oct 2021 14:03:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSDM5v12aTa3AEzrYIJ7QM2Prwnr7pUi44P3rEfgmomh3Nt6sf1M1vEVUNFOm085nUcz9b X-Received: by 2002:a05:6402:5193:: with SMTP id q19mr219664edd.397.1633122214717; Fri, 01 Oct 2021 14:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122214; cv=none; d=google.com; s=arc-20160816; b=kUsJ3ZJUpKV1CZKtrAdujwdikuP6M7eYeV2gHTtCyn5mJIVCLhC/ALor/xHRjHjIrH 75D3GLMns+4DVnlB7bw5JKo7PF6lJq3OlnzDc6QgjHvQFviUhicjxowZVPFapKZohNz2 6J6otrui+Z4VDTOiPM5w+XztJq+2V0XmCX+UOac9i95+uIZvcTWRZ2P3I+TxN2r+48C/ 8O+CNTHDY/yDIGk8q+s66sZicKd2CvnnmAek1+5XwabY5Qsp2T1DJhmiG2GPJWAV5YU/ +y2s6C1kndvwEtEjsfjZvDfrshYOmRBf06c8U6t3EmSBJHXQrrQ6ZM72POFw+y0itEl1 MIiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=rnx3UZSRMuwCGKyccoMb3E6s6OyCCACfrQcwZFjTOXc=; b=lDiXBd/YXBc6mhSLUUew7CX2aEHdP6M/XCCQasVtA55GBKWBD8X03QguIV1DIK5lhf aBhBK+s1Lgs7L+8iqtPO9cek6k2KeuiYXiCmaWTq2UjJwd11iyurKLB1ZEjZyZHxbOTw DamIj/AT/4EJsIFoVWH8bHh6l6Q+b/y20mzz8n3NqiwoGL1xJN004Twp2gUZwXes+ISu OLUIJU6Vxurd69KBFCepelj5dqhnqyq3k8Q/g4xBxVbFPiQFFj9EZlISGQzxWAOUobae eSHAdZa54C8CrKw521oQsxLHMEzsxssdOLPKPbx+nQ7zwLS2kLHJ1y/E9pbMAyUq8+BM uGaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=n1dCqcYq; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e2si11954794ejs.346.2021.10.01.14.03.34; Fri, 01 Oct 2021 14:03:34 -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=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=n1dCqcYq; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7025168A878; Sat, 2 Oct 2021 00:03:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4BA9C68A867 for ; Sat, 2 Oct 2021 00:03:18 +0300 (EEST) Received: by mail-pj1-f49.google.com with SMTP id oj15-20020a17090b4d8f00b0019f8860d6e2so1087003pjb.5 for ; Fri, 01 Oct 2021 14:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=6Vx+Ya9EXdy4rIrkiIu8508VGURH82WFqGk1qzmK5Qs=; b=n1dCqcYqfCxL7SL7FXZR1KhQt/ecqb8hi9iSA3uTqXqR1b1Qcr/Ra6hmE2UAEFTbUY JDMX5he9W7LaKlYFOuFYTUxC8xq9VVqW0Lzb02jFDDHU9SSHETrMg2Nmb+3RPFFqx6mn bHvLiA2F2M2lahHqXNANGI9tuwSTZT9AuRb/Xg2qiZFjw0si4wkIknN2cJeTA+WbK8uT Ojng8lW2k/NlWQ7ZjctN/psJHUYROVYbi0rEaaM1CYxOfDF+u3KWI0h9mq7nPmKQTWqP ddZsqofuSLMu3o7/WC9oGz2y6WJ+WoAsEvdPYgUTnYICC6WJh+ngcU0qTS8EyyqePmrV kTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=6Vx+Ya9EXdy4rIrkiIu8508VGURH82WFqGk1qzmK5Qs=; b=SwRxyI1l7/kkPYr1sNzdlff/1+ySH1FRkxzIN4xugwm630xCMgtwZ4Tq4Asrf2w3PX S5rnFFRyHzMlTp4FUy2QeHDOeCWglsqz6oSRenwLD6l9A8TtZs6wbSH3MtE0VcVRDUc+ 2oOzqgd7xA8yziGWDFVMmLl00E8ECc1QoAPwiEhDO9gqsu/DZ5Xir1zKRoSLy1EylFTL ZKqaagXZSfck79Sp4+FdZfdMUAXkJt3q1q0k1WY4qg3ultNV/LJjbB0qAjL7pOMOWf5M okBoiw1Saktjqta3Xf8c5/+dq/kz6a3D0feDGvTm/3xbxjF4eDhYDg0XWZ6prh2N7hU6 4Atg== X-Gm-Message-State: AOAM533vcNg2qOWisKCrTuLNSH80MWko1xLsB17xkd4Pu9WiVn9mS4sw GgmsyMnTJ9u4VScQdxJmlPeoh0N/tDa1P1tY5Ys= X-Received: by 2002:a17:90a:a88b:: with SMTP id h11mr15478719pjq.44.1633122195849; Fri, 01 Oct 2021 14:03:15 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id f25sm7221933pge.7.2021.10.01.14.03.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:03:15 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <312ae7d1-dca9-46da-72d6-69d8920c25f8@triularity.org> Date: Fri, 1 Oct 2021 14:03:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 6/6] libavutil/: constify values from av_dict_get(). 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: mo8selGrkpvT Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavutil/hwcontext_qsv.c | 2 +- libavutil/hwcontext_vulkan.c | 6 +++--- libavutil/opt.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) case AV_OPT_TYPE_DICT: { AVDictionary *dict1 = NULL; AVDictionary *dict2 = *(AVDictionary **)dst; - AVDictionaryEntry *en1 = NULL; - AVDictionaryEntry *en2 = NULL; + const AVDictionaryEntry *en1 = NULL; + const AVDictionaryEntry *en2 = NULL; ret = av_dict_parse_string(&dict1, o->default_val.str, "=", ":", 0); if (ret < 0) { av_dict_free(&dict1); diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c18747f7eb..23023c005d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1451,7 +1451,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device, enum AVHWDeviceType child_device_type; AVHWDeviceContext *child_device; AVDictionary *child_device_opts; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; mfxIMPL impl; int ret; diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2c3216857a..259fa12cba 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -545,7 +545,7 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts, int optional_exts_num; uint32_t sup_ext_count; char *user_exts_str = NULL; - AVDictionaryEntry *user_exts; + const AVDictionaryEntry *user_exts; VkExtensionProperties *sup_ext; const VulkanOptExtension *optional_exts; @@ -671,7 +671,7 @@ static int create_instance(AVHWDeviceContext *ctx, AVDictionary *opts) VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; - AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); + const AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); const int debug_mode = debug_opt && strtol(debug_opt->value, NULL, 10); VkApplicationInfo application_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, @@ -1246,7 +1246,7 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, { int err = 0; VkResult ret; - AVDictionaryEntry *opt_d; + const AVDictionaryEntry *opt_d; VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; diff --git a/libavutil/opt.c b/libavutil/opt.c index c7001dbcd3..51b9157c2e 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1633,7 +1633,7 @@ void av_opt_free(void *obj) int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVDictionary *tmp = NULL; int ret; @@ -2005,8 +2005,8 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o)