From patchwork Fri Dec 6 05:14:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 16612 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 1FF7844900B for ; Fri, 6 Dec 2019 07:15:24 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0C40D68B613; Fri, 6 Dec 2019 07:15:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpproxy21.qq.com (unknown [203.205.195.102]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4A2668B60F for ; Fri, 6 Dec 2019 07:15:16 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1575609296; bh=TK8pAe7rUzX3QZjpOvNfLwH2DV0x81rnogJ8uQTzgSA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=OF2o3QiUsk3Dm6CfqTnspVPXNRm8KusrOInVNuySKb3xe6Af1bIhfhks9HKJb8Ilv B5MdJc/ccWcNbo8C4m1R1S5BqvVLHN/9dUo2MyUfa6+9o/60h7O79Xus4GRV5veHLv sWf5ZLEf0FJ+KjDgy129ftHheMp+Nb2BDJCXGab8= X-QQ-mid: esmtp7t1575609296txyus51fp Received: from ZHILIZHAO-MB1.tencent.com (unknown [14.17.22.53]) by esmtp4.qq.com (ESMTP) with id ; Fri, 06 Dec 2019 13:14:55 +0800 (CST) X-QQ-SSF: 01000000000000N0VG3006000000002 X-QQ-FEAT: rnkQtAPcueWggkWQ1gnxt+8Dz4XNbMn6OTMQsyyJ2t2a3G5nJmM14aoalFdYF E1SQp302gxs6iAE1Z7YtTOB1sVpypGjsWa9NUjYfNh/R4siyog+JY9bF6KFiJa8FfAJnHcT 6CE0DMsweOPE7FlB2KkmKJtgO+btzP1kXJLKllbqhnt4RY0GwPBqF8atigujWDbAee2112H PjacGjHTIuB6KwXnRSWSRTv0x8v1K9oXBHHaTtIxvQI0iuqef/PE9sLYSi5eZNFKCRXCP4r +Fydp63CqLa/6YY88fYex+9RkxmvMX0+pIKg== X-QQ-GoodBg: 0 From: quinkblack@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Dec 2019 13:14:47 +0800 Message-Id: <20191206051447.31830-3-quinkblack@foxmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191206051447.31830-1-quinkblack@foxmail.com> References: <20191206051447.31830-1-quinkblack@foxmail.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign12 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/buffersink: remove AVBufferSinkParams and AVABufferSinkParams 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 Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Zhao Zhili The patch breaks API in theory. Since there is no reason to allocate an object which you can do nothing with it, the API break should have no effect. --- libavfilter/buffersink.c | 20 -------------------- libavfilter/buffersink.h | 32 -------------------------------- 2 files changed, 52 deletions(-) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 5f2ed0e4b3..5d30c55281 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -125,26 +125,6 @@ int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx, return get_frame_internal(ctx, frame, 0, nb_samples); } -AVBufferSinkParams *av_buffersink_params_alloc(void) -{ - static const int pixel_fmts[] = { AV_PIX_FMT_NONE }; - AVBufferSinkParams *params = av_malloc(sizeof(AVBufferSinkParams)); - if (!params) - return NULL; - - params->pixel_fmts = pixel_fmts; - return params; -} - -AVABufferSinkParams *av_abuffersink_params_alloc(void) -{ - AVABufferSinkParams *params = av_mallocz(sizeof(AVABufferSinkParams)); - - if (!params) - return NULL; - return params; -} - static av_cold int common_init(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h index 3c846bb527..be63bd1af1 100644 --- a/libavfilter/buffersink.h +++ b/libavfilter/buffersink.h @@ -59,38 +59,6 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag */ #define AV_BUFFERSINK_FLAG_NO_REQUEST 2 -/** - * Struct to use for initializing a buffersink context. - */ -typedef struct AVBufferSinkParams { - const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE -} AVBufferSinkParams; - -/** - * Create an AVBufferSinkParams structure. - * - * Must be freed with av_free(). - */ -AVBufferSinkParams *av_buffersink_params_alloc(void); - -/** - * Struct to use for initializing an abuffersink context. - */ -typedef struct AVABufferSinkParams { - const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE - const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1 - const int *channel_counts; ///< list of allowed channel counts, terminated by -1 - int all_channel_counts; ///< if not 0, accept any channel count or layout - int *sample_rates; ///< list of allowed sample rates, terminated by -1 -} AVABufferSinkParams; - -/** - * Create an AVABufferSinkParams structure. - * - * Must be freed with av_free(). - */ -AVABufferSinkParams *av_abuffersink_params_alloc(void); - /** * Set the frame size for an audio buffer sink. *