From patchwork Mon May 31 10:03:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 28018 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp2732154iof; Mon, 31 May 2021 03:04:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYhJB86DCsrQ67eLD4S1kVLIBby4Cl5CLyx0ec0dydeTI32GQR8RR0tWNGMOVlW4iMfpep X-Received: by 2002:a17:906:9706:: with SMTP id k6mr9153598ejx.456.1622455443773; Mon, 31 May 2021 03:04:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622455443; cv=none; d=google.com; s=arc-20160816; b=Xkjg6hv8G0zCJUu3fH69koC1vTdtaeM7lmAjODT9uWgLAlHwHJex4kStz74rInd9ef JAkjAcGWpzPQfLMsiqyaq8tglg0Mm6aOC/qlbAuzl408jmmMMfjOX6EJSn2AHRx+9b3E WluAkn3eu4ssLXqfTIiGJTXJR3G2EwPcpGGK1/E0MmdWFp5UygLhJuIEwSNLR9Lsq6fV 66YW6ckpnF3bhovZN7zDEPBrUGzQMmoQNfJD+V7EbQpAmX6QscRUaY8L6HXLdqZTGfMY QUN6aGeSy1AnQGFEhCLvI8pdVTbc/63t963x2g/6KL17SmCei2RMlWRV72VSz95gsCkz KwwQ== 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:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=s43ef9a+p6cHzUbnD+ZK2Jfp/QNbq3oHGbT8MHdRELw=; b=QIY8CYCFdkwp21gUDQPnv6JnWyc5R3eyx8VFWrWI2uNvSFyPbrs5J7d7FZJNkKGmNf thjKHBrGSDPY0Nn2aCdPsKcCdaXgxwruSMRuhj/DSrk8XwsxJt/hIb+EC927H8fpesth FTZwMh1UOEdb0AuV9AgMq5eaJJyAnjF8DEVdF7NxyzJch9mYaEOMLWIuA15g9x9gDLU1 OduFLwVkQo4wzDKw1NZxOpWPSajsyexgK3S0BfE3L416GNdga8BjIyrR1+M79zDOMNoW 0CAd1TD9AoZ1jsRB91gn8cWfRSzt54cmWMuB0aCm27WOSuaQcO5r4Zk7hia3Gun6Wrev XPJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 dx1si12624946ejb.657.2021.05.31.03.04.02; Mon, 31 May 2021 03:04:03 -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; 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 7E1BF688181; Mon, 31 May 2021 13:03:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EFA386803C7 for ; Mon, 31 May 2021 13:03:52 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 89F64240476 for ; Mon, 31 May 2021 12:03:52 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id t_ilz_96gLnC for ; Mon, 31 May 2021 12:03:51 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 3E35E24042A for ; Mon, 31 May 2021 12:03:51 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 2237B3A125B; Mon, 31 May 2021 12:03:51 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 31 May 2021 12:03:45 +0200 Message-Id: <20210531100345.27379-1-anton@khirnov.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <4fd71493-7173-68c7-ae72-102e05d7f064@gmail.com> References: <4fd71493-7173-68c7-ae72-102e05d7f064@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavc/cbs: avoid avcodec.h dependency 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: 4MKQxpQAJETr Include only the headers that are actually needed. --- libavcodec/cbs.c | 1 + libavcodec/cbs.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index bbfafb6530..8d50ea1432 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/opt.h" +#include "avcodec.h" #include "cbs.h" #include "cbs_internal.h" diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index f022282b75..b7acf98347 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -24,7 +24,9 @@ #include "libavutil/buffer.h" -#include "avcodec.h" +#include "codec_id.h" +#include "codec_par.h" +#include "packet.h" /* @@ -40,6 +42,7 @@ * bitstream. */ +struct AVCodecContext; struct CodedBitstreamType; /** @@ -271,7 +274,7 @@ int ff_cbs_read_extradata(CodedBitstreamContext *ctx, */ int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, - const AVCodecContext *avctx); + const struct AVCodecContext *avctx); /** * Read the data bitstream from a packet into a fragment, then