From patchwork Sun Jan 10 22:28:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 24889 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A2AEC44B57F for ; Mon, 11 Jan 2021 00:28:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7799D68AB0A; Mon, 11 Jan 2021 00:28:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5D78B6881E4 for ; Mon, 11 Jan 2021 00:28:47 +0200 (EET) Received: by mail-qk1-f179.google.com with SMTP id 143so13187073qke.10 for ; Sun, 10 Jan 2021 14:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Oxrqk0AHKZFcxHL7jwAKeAXtuE6BghYb/rbVyWSCA28=; b=QD1EH2t4p+hRQtLh2qhEPw0HArHuncwPUjWikeC6X4JL2uH/i37ugf/1gom+m5EesE 70aFHQctV5QZYgYtECRu8cpn4KlGS/TjJcy0ty40ko1cFG8rLn6cpI5QcEDeF8QLeAIc HPibXdu4mhveblYXDs0eAz9t4IjVdOBFdGa08fz4oVH2ABavv4iQyiG5BO6Y9xn2O2Dh RIfx8KD28ezjtiv2XVF8A7ESSUTIA04EhcZ6zRZRzyCpljeiQaqBgLQRgUl5dKM7/CA8 /sh7y/pEqDM9L8lEnk+PL3LkpHweGoh3n+M3Ksy/Ys0Cp2ITNnDkb/e8ikHbDOFCeMrU kQ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Oxrqk0AHKZFcxHL7jwAKeAXtuE6BghYb/rbVyWSCA28=; b=h8WTTkJmcTHaq4Bo3bywDo4fnu1sIeb4n7M4xyarmiuuRl7phJhmPn44jjGr/iUsku qyjV3eLwL9TsylnbgThmNygnCoaaDlzXqKeY6o6gyTnK1JBmLut1uO6XiWhBk09XXGBk 2tDOg2Xt1QJ//6nUKN/8O+iYqqEjcbx3vuUoxNOWd8nOzPreQK0Xcr3+D4ZQoEI0Fbkj l8ogOlG9fIXkW+LyiH7dedud70bdolaGCgc/ijvSJHfQFQNjqPMW6Co0sgUHqONsT9Nf s9kQjROBPLSoGlHSiGywyHPJ4WJNNdlTF/+lSf+4GyiSKMo3SPj8viFn9apJ5E3SDZWl 7qXg== X-Gm-Message-State: AOAM531PaAEdOCfs5vmy+jRqlnjRMsKZeQ7+o9e8lOkgKl64clgOY101 DpM3wosCFjd6D4Ra9CMQF4rPvunPu4n/FQ== X-Google-Smtp-Source: ABdhPJyeW9KPaNpwqKEUrjFlHDpYtGaGOFHlAVs7H3ZmddUltNjJnUJJVUUqcSvdM/Y+ptxvA8kmjg== X-Received: by 2002:a05:620a:ec7:: with SMTP id x7mr13705252qkm.405.1610317725650; Sun, 10 Jan 2021 14:28:45 -0800 (PST) Received: from localhost.localdomain ([191.84.246.103]) by smtp.gmail.com with ESMTPSA id 60sm6957930qth.14.2021.01.10.14.28.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 14:28:44 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 10 Jan 2021 19:28:01 -0300 Message-Id: <20210110222801.3157-1-jamrial@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/cbs: constify decompose_unit_types X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" CBS doesn't change its contents in any way whatsoever internally, and most users already set it to a const array. Signed-off-by: James Almer --- libavcodec/av1_frame_split_bsf.c | 2 +- libavcodec/av1_parser.c | 2 +- libavcodec/cbs.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/av1_frame_split_bsf.c b/libavcodec/av1_frame_split_bsf.c index 13bebe19f5..fa8b887b6c 100644 --- a/libavcodec/av1_frame_split_bsf.c +++ b/libavcodec/av1_frame_split_bsf.c @@ -214,7 +214,7 @@ static int av1_frame_split_init(AVBSFContext *ctx) if (ret < 0) return ret; - s->cbc->decompose_unit_types = (CodedBitstreamUnitType*)decompose_unit_types; + s->cbc->decompose_unit_types = decompose_unit_types; s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types); if (!ctx->par_in->extradata_size) diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c index 181ff3a1be..6a76ffb7bc 100644 --- a/libavcodec/av1_parser.c +++ b/libavcodec/av1_parser.c @@ -191,7 +191,7 @@ static av_cold int av1_parser_init(AVCodecParserContext *ctx) if (ret < 0) return ret; - s->cbc->decompose_unit_types = (CodedBitstreamUnitType *)decompose_unit_types; + s->cbc->decompose_unit_types = decompose_unit_types; s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types); return 0; diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index 3fd0a0ef33..f022282b75 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -196,7 +196,7 @@ typedef struct CodedBitstreamContext { * Types not in this list will be available in bitstream form only. * If NULL, all supported types will be decomposed. */ - CodedBitstreamUnitType *decompose_unit_types; + const CodedBitstreamUnitType *decompose_unit_types; /** * Length of the decompose_unit_types array. */