From patchwork Tue Feb 7 01:54:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2440 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2042198vsb; Mon, 6 Feb 2017 17:54:22 -0800 (PST) X-Received: by 10.223.143.48 with SMTP id p45mr11530580wrb.33.1486432462144; Mon, 06 Feb 2017 17:54:22 -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 b7si10245179wmb.54.2017.02.06.17.54.21; Mon, 06 Feb 2017 17:54:22 -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; 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 507E6689212; Tue, 7 Feb 2017 03:54:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70BFC680A4D for ; Tue, 7 Feb 2017 03:54:10 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cauyy-0004nN-F6 for ffmpeg-devel@ffmpeg.org; Tue, 07 Feb 2017 02:54:12 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id hduB1u00J0S5wYM01duCxi; Tue, 07 Feb 2017 02:54:12 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 7 Feb 2017 02:54:10 +0100 Message-Id: <20170207015410.31260-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avcodec/internal: Expand the documentation for FF_CODEC_CAP_INIT_THREADSAFE 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavcodec/internal.h b/libavcodec/internal.h index c92dba472a..a72f8628db 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -36,6 +36,15 @@ /** * The codec does not modify any global variables in the init function, * allowing to call the init function without locking any global mutexes. + * If this is not set, the core code uses the lock manager registered with + * av_lockmgr_register() or the default fallback to protect codec init. + * + * Using a per codec lock is more efficient than using one for all codecs to + * provide thread saftey as the locking happens at finer granularity during + * one time initilization. + * + * @Note, with or without this flag the public codec init/decode/encode/... API is + * threadsafe. */ #define FF_CODEC_CAP_INIT_THREADSAFE (1 << 0) /**