From patchwork Tue Aug 16 10:53:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sebechlebskyjan@gmail.com X-Patchwork-Id: 196 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.67 with SMTP id o64csp2050807vsd; Tue, 16 Aug 2016 03:54:19 -0700 (PDT) X-Received: by 10.28.22.70 with SMTP id 67mr22021038wmw.52.1471344859796; Tue, 16 Aug 2016 03:54:19 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v132si20150020wma.120.2016.08.16.03.54.19; Tue, 16 Aug 2016 03:54:19 -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; 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 BEEC1689AEE; Tue, 16 Aug 2016 13:54:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B61D689AFD for ; Tue, 16 Aug 2016 13:53:54 +0300 (EEST) Received: by mail-wm0-f65.google.com with SMTP id i5so15745577wmg.2 for ; Tue, 16 Aug 2016 03:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e9IKXuMULmhDXIpBZgtFl6KtrdIaYRfvPdb5yCGKfIs=; b=x8hi3bv4lnmTKCSGmdx97SVpFQJuPVGdvy6lDg1Is08gU/tkxaNjMCTarDJ5Gon/60 +of6k2IcBztkuOfwGmMKJPswgafGQH08o/Zl3zYqw9DMwWE/NUZCG4sTnSjQtdKYhE/j 6mTAVmZ3L1UBPjxl51IGET74AiyCrEUGEq2/o4uJ6rdHke+AJikZIl+fL0J5v0P6RSoq UTbyda7QQ8q6ieLizW8a2hRprkRrgXfN+lCW7VzihNRJgjFt1u58Yyvcd9wGqhWtbEVx dhf6TrRLG/u3+eL0TxbDxe0wEl2T0YsuVSPDluWVFWT1hyMjY3HMRmqf7x4DMxzb9k/L szjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e9IKXuMULmhDXIpBZgtFl6KtrdIaYRfvPdb5yCGKfIs=; b=eDBlZ7PrZA1OJt19xXlZm8TGq8C/OAvTDL+DlQcBWnjBT8RpOZ27R0dXNefgWDPVbx 3s8Qfw7mhvgZXS9R5C2y3HOmlsJk3klGCp3U9aE86pfdu9cvpLN1VBzP/bRwVkEX7nuk XmfQe8vAMpf7B4MwgOzXPW9Y2xIZmrKqdimY5Q3DfWIBGTYtXQhMCNN/x5ABGx04kYZS 3/r53+WFkFHlEQWHA+QLpfb65R1qLnMbvjcuzaI0Z4+oUE6Iiuj24MwqexSJzYXKTsLJ 6xKXE3HHFosnaMtx0eeG4bWYmexmT5+QGDaows+bCqPo+hsZIEbDA5KLjUVay8ekt1Uz 5nMw== X-Gm-Message-State: AEkooutO3WqCKqiRZevAO4lbRGWdFM+qUO4pPe+jAga0eOA2Qk5IgNtBuLzBVkH4n7OaAA== X-Received: by 10.28.12.76 with SMTP id 73mr5572771wmm.118.1471344836140; Tue, 16 Aug 2016 03:53:56 -0700 (PDT) Received: from localhost.localdomain (157.174.broadband3.iol.cz. [85.70.174.157]) by smtp.gmail.com with ESMTPSA id x6sm26125186wjk.26.2016.08.16.03.53.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 03:53:55 -0700 (PDT) From: sebechlebskyjan@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Aug 2016 12:53:46 +0200 Message-Id: <1471344826-25138-1-git-send-email-sebechlebskyjan@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20160815215037.GA1530047@phare.normalesup.org> References: <20160815215037.GA1530047@phare.normalesup.org> Subject: [FFmpeg-devel] [PATCH] avformat: Document thread-safety requirement for interrupt callback 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: Jan Sebechlebsky MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jan Sebechlebsky Muxing might be running in a separate thread if actual muxer is run inside of fifo pseudo-muxer. Callback should be therefore thread-safe. Signed-off-by: Jan Sebechlebsky --- libavformat/avformat.h | 2 +- libavformat/avio.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 79c2511..8550dca 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1564,7 +1564,7 @@ typedef struct AVFormatContext { * muxing: set by the user before avformat_write_header() * (mainly useful for AVFMT_NOFILE formats). The callback * should also be passed to avio_open2() if it's used to - * open the file. + * open the file. The callback must be thread-safe. */ AVIOInterruptCB interrupt_callback; diff --git a/libavformat/avio.h b/libavformat/avio.h index b1ce1d1..b5d1396 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -43,6 +43,8 @@ * opaque as parameter. If the callback returns 1, the * blocking operation will be aborted. * + * If the callback is used in muxing context, it has to be thread-safe. + * * No members can be added to this struct without a major bump, if * new elements have been added after this struct in AVFormatContext * or AVIOContext.