From patchwork Thu Jan 5 11:11:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Bouron X-Patchwork-Id: 2064 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp5281951vsb; Thu, 5 Jan 2017 03:19:05 -0800 (PST) X-Received: by 10.28.236.149 with SMTP id h21mr49133749wmi.65.1483615145029; Thu, 05 Jan 2017 03:19:05 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gg6si53956629wjd.241.2017.01.05.03.19.04; Thu, 05 Jan 2017 03:19:04 -0800 (PST) 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=@gmail.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; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 11C5268A130; Thu, 5 Jan 2017 13:18:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2063A68A127 for ; Thu, 5 Jan 2017 13:18:42 +0200 (EET) Received: by mail-wm0-f66.google.com with SMTP id l2so70548529wml.2 for ; Thu, 05 Jan 2017 03:18:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/iz1boFPGVUFZ9wa+t19xBmKj66hzWJHpb5KNjIiI/0=; b=IwXb9C6/9NtcEqtv/4Rojc1XTod2fE+11tMRg5gxY2ty50cl6MchsvqffX1Pz0ZzKT 87xCsmEUOCPFkIiDDHjCBK6GFTTKLLW22DOOQZkvuDQ7bEKnrHyHJZH8xzFiTAeCeF70 x/VBZ4r/a5rMNLdtCvxj9o6OgnyFZkXLyhOun+5j9ZcaFbQyCWFQ7RvmKqsJjTc32LnR /JdpFcuhwLynMm2pvlcXY3DoOzC+nZSwM/XyPRiDPXMiD6XPJzH83XhpJJIQUDgxHyh2 G+NNfhjdCrExYjrSvvTgDhcgNdzV+4etona07Wcedlc1f0PH+m69kY0QVGD4r2HiY1Pf BA3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/iz1boFPGVUFZ9wa+t19xBmKj66hzWJHpb5KNjIiI/0=; b=WgC4BIA5HL2NGrtUCKmXA7BQrNUHPEiJrK8sK2avagj1Eu/prqTUfAcTeMBqASNp3n WAeMTuFcLVFliFyz0AURoJhEHkwXJTxD7XpU5iFYEzGJPmbyA4mbxjJ2tyoFjLwYR3rn 2oLqDLACvoA9TsckhVVxo2ovp5EH+1Sf+7pLY2hDosHsgu+4+i+qF17+ACOZCWVK7c7S wmN0jxLsaHyZTaiRhiMD3LwZzqHKjihIh/nSoLXRhAY0VdBz3ZW/5ecvcdG+8DFII9pr BRPraYTWjFmqf3SduiCviQ3osu6Lu0d9xuRKeaNP3Tz79SAyr72BCkmsxMMC15bu4Q79 W7/A== X-Gm-Message-State: AIkVDXLfn34OayMHfdc4hwCx9Q9RlfPy+m/VoFb7+hFAmkvzgBQtZtNQ75/kc37W9T138A== X-Received: by 10.28.87.21 with SMTP id l21mr46071316wmb.48.1483614679809; Thu, 05 Jan 2017 03:11:19 -0800 (PST) Received: from boken.gopro.lcl (LPuteaux-656-1-74-135.w80-12.abo.wanadoo.fr. [80.12.80.135]) by smtp.gmail.com with ESMTPSA id j6sm103326617wjk.25.2017.01.05.03.11.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 03:11:19 -0800 (PST) From: Matthieu Bouron To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Jan 2017 12:11:32 +0100 Message-Id: <20170105111136.31854-2-matthieu.bouron@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170105111136.31854-1-matthieu.bouron@gmail.com> References: <1462895161-21148-1-git-send-email-matthieu.bouron@gmail.com> <20170105111136.31854-1-matthieu.bouron@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/5] lavfi/framepool: rename FFVideoFramePool to FFFramePool 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: Matthieu Bouron MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavfilter/avfilter.c | 2 +- libavfilter/avfilter.h | 4 ++-- libavfilter/framepool.c | 24 ++++++++++++------------ libavfilter/framepool.h | 32 ++++++++++++++++---------------- libavfilter/video.c | 20 ++++++++++---------- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 0020ee163a..12f12d1406 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -179,7 +179,7 @@ void avfilter_link_free(AVFilterLink **link) av_frame_free(&(*link)->partial_buf); ff_framequeue_free(&(*link)->fifo); - ff_video_frame_pool_uninit((FFVideoFramePool**)&(*link)->video_frame_pool); + ff_frame_pool_uninit((FFFramePool**)&(*link)->frame_pool); av_freep(link); } diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 828b270b6c..02df8a3632 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -531,9 +531,9 @@ struct AVFilterLink { int64_t frame_count_in, frame_count_out; /** - * A pointer to a FFVideoFramePool struct. + * A pointer to a FFFramePool struct. */ - void *video_frame_pool; + void *frame_pool; /** * True if a frame is currently wanted on the output of this filter. diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c index 6df574ea41..36c6e8fd04 100644 --- a/libavfilter/framepool.c +++ b/libavfilter/framepool.c @@ -26,7 +26,7 @@ #include "libavutil/mem.h" #include "libavutil/pixfmt.h" -struct FFVideoFramePool { +struct FFFramePool { int width; int height; @@ -37,20 +37,20 @@ struct FFVideoFramePool { }; -FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), - int width, - int height, - enum AVPixelFormat format, - int align) +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), + int width, + int height, + enum AVPixelFormat format, + int align) { int i, ret; - FFVideoFramePool *pool; + FFFramePool *pool; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format); if (!desc) return NULL; - pool = av_mallocz(sizeof(FFVideoFramePool)); + pool = av_mallocz(sizeof(FFFramePool)); if (!pool) return NULL; @@ -100,11 +100,11 @@ FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), return pool; fail: - ff_video_frame_pool_uninit(&pool); + ff_frame_pool_uninit(&pool); return NULL; } -int ff_video_frame_pool_get_config(FFVideoFramePool *pool, +int ff_frame_pool_get_video_config(FFFramePool *pool, int *width, int *height, enum AVPixelFormat *format, @@ -122,7 +122,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, } -AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool) +AVFrame *ff_frame_pool_get(FFFramePool *pool) { int i; AVFrame *frame; @@ -174,7 +174,7 @@ fail: return NULL; } -void ff_video_frame_pool_uninit(FFVideoFramePool **pool) +void ff_frame_pool_uninit(FFFramePool **pool) { int i; diff --git a/libavfilter/framepool.h b/libavfilter/framepool.h index 2a6c9e8636..4824824894 100644 --- a/libavfilter/framepool.h +++ b/libavfilter/framepool.h @@ -25,11 +25,11 @@ #include "libavutil/frame.h" /** - * Video frame pool. This structure is opaque and not meant to be accessed - * directly. It is allocated with ff_video_frame_pool_init() and freed with - * ff_video_frame_pool_uninit(). + * Frame pool. This structure is opaque and not meant to be accessed + * directly. It is allocated with ff_frame_pool_init() and freed with + * ff_frame_pool_uninit(). */ -typedef struct FFVideoFramePool FFVideoFramePool; +typedef struct FFFramePool FFFramePool; /** * Allocate and initialize a video frame pool. @@ -41,21 +41,21 @@ typedef struct FFVideoFramePool FFVideoFramePool; * @param height height of each frame in this pool * @param format format of each frame in this pool * @param align buffers alignement of each frame in this pool - * @return newly created video frame pool on success, NULL on error. + * @return newly created frame pool on success, NULL on error. */ -FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size), - int width, - int height, - enum AVPixelFormat format, - int align); +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(int size), + int width, + int height, + enum AVPixelFormat format, + int align); /** - * Deallocate the video frame pool. It is safe to call this function while - * some of the allocated video frame are still in use. + * Deallocate the frame pool. It is safe to call this function while + * some of the allocated frame are still in use. * - * @param pool pointer to the video frame pool to be freed. It will be set to NULL. + * @param pool pointer to the frame pool to be freed. It will be set to NULL. */ -void ff_video_frame_pool_uninit(FFVideoFramePool **pool); +void ff_frame_pool_uninit(FFFramePool **pool); /** * Get the video frame pool configuration. @@ -66,7 +66,7 @@ void ff_video_frame_pool_uninit(FFVideoFramePool **pool); * @param align buffers alignement of each frame in this pool * @return 0 on success, a negative AVERROR otherwise. */ -int ff_video_frame_pool_get_config(FFVideoFramePool *pool, +int ff_frame_pool_get_video_config(FFFramePool *pool, int *width, int *height, enum AVPixelFormat *format, @@ -78,7 +78,7 @@ int ff_video_frame_pool_get_config(FFVideoFramePool *pool, * * @return a new AVFrame on success, NULL on error. */ -AVFrame *ff_video_frame_pool_get(FFVideoFramePool *pool); +AVFrame *ff_frame_pool_get(FFFramePool *pool); #endif /* AVFILTER_FRAMEPOOL_H */ diff --git a/libavfilter/video.c b/libavfilter/video.c index 2744be6360..fabdafd0d9 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -47,13 +47,13 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) int pool_align = 0; enum AVPixelFormat pool_format = AV_PIX_FMT_NONE; - if (!link->video_frame_pool) { - link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, - link->format, BUFFER_ALIGN); - if (!link->video_frame_pool) + if (!link->frame_pool) { + link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, + link->format, BUFFER_ALIGN); + if (!link->frame_pool) return NULL; } else { - if (ff_video_frame_pool_get_config(link->video_frame_pool, + if (ff_frame_pool_get_video_config(link->frame_pool, &pool_width, &pool_height, &pool_format, &pool_align) < 0) { return NULL; @@ -62,15 +62,15 @@ AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h) if (pool_width != w || pool_height != h || pool_format != link->format || pool_align != BUFFER_ALIGN) { - ff_video_frame_pool_uninit((FFVideoFramePool **)&link->video_frame_pool); - link->video_frame_pool = ff_video_frame_pool_init(av_buffer_allocz, w, h, - link->format, BUFFER_ALIGN); - if (!link->video_frame_pool) + ff_frame_pool_uninit((FFFramePool **)&link->frame_pool); + link->frame_pool = ff_frame_pool_video_init(av_buffer_allocz, w, h, + link->format, BUFFER_ALIGN); + if (!link->frame_pool) return NULL; } } - return ff_video_frame_pool_get(link->video_frame_pool); + return ff_frame_pool_get(link->frame_pool); } AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h)