From patchwork Mon Nov 23 19:10:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 23983 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 82C3244AC61 for ; Mon, 23 Nov 2020 21:19:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 64CA468BB9E; Mon, 23 Nov 2020 21:19:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 862E768B7BF for ; Mon, 23 Nov 2020 21:19:08 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id q3so18248801edr.12 for ; Mon, 23 Nov 2020 11:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ICuo+vGLAHGYsnmwdMu67RKYlPKxg1dDe9jq4rU1BEg=; b=L7inJ57s0nYAhBwzamovW8quHw2srC9gEuuB8KYfNq00P4P5dWVryWKXE7nab6HWkd 5s4GvzJS1Bsb7GLTQheXxbugfEMTbVJpxH2wpKR4bct94WPcks7JYqOjazAuQitouKBU MmGPdgda3RLMqHpjcEmRoeMEn0X7zfajLntYqdiRefHotY+Ao5MJguehOwejgqa7a9XY i7JoDZuef7pIV0YHWhFi5AjQ4VBwp7G6UWDSWJKlFxX8hNcfVe7dRT20znWJKbYumBQ+ ZSFSxJQvZ+zPF6GM1tmHQ8YNADuCbu0AzuuXT+NgtSyaLcO+UWbaWX+2soJFUx1BlNTY UC4A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ICuo+vGLAHGYsnmwdMu67RKYlPKxg1dDe9jq4rU1BEg=; b=PqYi+mo0xHehF3NWUL+dPhvHUu1e4A/EnAjprxAtGuwCQmX/bxwqwfC6kaS2Z5meiR AJga20hHJtveNm8DfWUdOMfusfOBFmbsoWcKqv4sI+xtt+D6tMy05Rk1z8/Dfrb1fBCc fCEHR/p/ejYnGOLgCVHLaetcsgVQlNG9XMdrmgX4CrisKRt7cP38Rf836+wnbjAX4ooC pGLGqVKm2IM2/KU6iCnhl2a29v8L4EhfHHtfGj93nBg+ZkoStkdi8oYPjTRqrYabugEF DIvqvSGC844Xo7G/0BZwEOiR99ogxLoVx4Ej9uhilGlVy3tcyZd4tU8B/U2O6g08YRNW mkTA== X-Gm-Message-State: AOAM533pRrCgkVk9EFtLE/rP81bqwlmnXvOemQJt9Pwa7c3O2c2FZBr4 Wq7+eq1piMjO1xjMlOrsztt5jdhmV9XiWA== X-Google-Smtp-Source: ABdhPJzlOrwjDSIHhy+fZ5eQOyis50yIxRsPLW3S83PV0+CIkknDH7cqEfX9DmHPu8qkIH6sxtqjMQ== X-Received: by 2002:a2e:9dcd:: with SMTP id x13mr322640ljj.147.1606158655631; Mon, 23 Nov 2020 11:10:55 -0800 (PST) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id j19sm1469995lfb.29.2020.11.23.11.10.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 11:10:54 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Nov 2020 21:10:43 +0200 Message-Id: <20201123191046.28887-4-jeebjp@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201123191046.28887-1-jeebjp@gmail.com> References: <20201123191046.28887-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avcodec/av1{dec, parser}: move to ff_cbs_read_extradata_from_codec 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" This lets us re-utilize the extradata-related checks in the CBS to add support for passing the AV1CodecConfigurationRecord as extradata as-is without further filtering. --- libavcodec/av1_parser.c | 2 +- libavcodec/av1dec.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c index 14826d816e..181ff3a1be 100644 --- a/libavcodec/av1_parser.c +++ b/libavcodec/av1_parser.c @@ -73,7 +73,7 @@ static int av1_parser_parse(AVCodecParserContext *ctx, if (avctx->extradata_size && !s->parsed_extradata) { s->parsed_extradata = 1; - ret = ff_cbs_read(s->cbc, td, avctx->extradata, avctx->extradata_size); + ret = ff_cbs_read_extradata_from_codec(s->cbc, td, avctx); if (ret < 0) { av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata.\n"); } diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index c1967f03bd..ce051d4e6d 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -616,8 +616,9 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) return ret; if (avctx->extradata && avctx->extradata_size) { - ret = ff_cbs_read(s->cbc, &s->current_obu, avctx->extradata, - avctx->extradata_size); + ret = ff_cbs_read_extradata_from_codec(s->cbc, + &s->current_obu, + avctx); if (ret < 0) { av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n"); return ret;