From patchwork Thu Dec 22 09:06:36 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: 1885 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp541128vsb; Thu, 22 Dec 2016 01:12:26 -0800 (PST) X-Received: by 10.28.8.202 with SMTP id 193mr8252715wmi.101.1482397946797; Thu, 22 Dec 2016 01:12:26 -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 l193si27376021wmd.94.2016.12.22.01.12.26; Thu, 22 Dec 2016 01:12:26 -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 1B4F768A412; Thu, 22 Dec 2016 11:12:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB456689DD5 for ; Thu, 22 Dec 2016 11:12:16 +0200 (EET) Received: by mail-wm0-f67.google.com with SMTP id g23so34971289wme.1 for ; Thu, 22 Dec 2016 01:12:17 -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=vU1FNDpre1cKRwygz2CkMgy3TRxF+m0tUwJ7FU+6/64=; b=BKlIazIOs0PVReLmjAAjd0HgczIFPPooxgZZfWWuAjY/UQVFQ9p9DjJ8xazzK19Od2 eBdTpfA680x5cZg6vp1IWBiLCGwVDIsdIVh288lfYGvKFYkLuQ0xr5KF+XQukDT6yyN5 zrNCjCu/LxNXJZ4y5gV9J38/jfuaKqIqTit4IGTEho/eY92AKcUZvhAW07dQfifDYBiu MhBpxwSeL1x6U42qXHNvXTgISJKB4uj1SSPPItP5TxBElug4sEionUIJ44vwH5QJ+uSk lENdRK0dyHwM0iXCZ8MHsIWBvHO+bJmmKa8UGdOB4gD/I//qRA0Asp9Jd9Sxd8J/4kgq 8Mgg== 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=vU1FNDpre1cKRwygz2CkMgy3TRxF+m0tUwJ7FU+6/64=; b=Nk7UEG2XlopGbZR5llqnrbyx/tkxUwSdkdN7g6yT5e83rQ8+qbtYKB4vPpcSCRf+S2 xBjUm1sVw2Uiuhf34ID1LXudzbV1tfKM0iiRxIXHfSi6SRdtofZIfDcADBNbH3u9NypZ PrMERlTsAAdzqaYdR2iebG5KvODJbJkpbn9iF7MJ/Hh55+WZyyZ6VlOzB6eR6YKNpbc2 cdLB5oljn0lvmhSIRvQTjgwtfnyKbuq/MZPHlbmXc4HlNKCzu5+2RYqwnI0WG2Hcjt9p FqInGM9sP9KXhmynh/O4fAuQYc8Lfl965gTKvN/H0eaZOmIpV1ul/TwDdb9UFDJVeX/Y idCw== X-Gm-Message-State: AIkVDXIbrKBaTwwMQUvC1UkMkgNh1DC3ClK6uNlkOpWod4UBuO+ssg6yKhZTMIA4d1FLtQ== X-Received: by 10.28.20.70 with SMTP id 67mr8233812wmu.102.1482397611232; Thu, 22 Dec 2016 01:06:51 -0800 (PST) Received: from localhost.localdomain (cz9.datarail.eu. [195.146.7.21]) by smtp.gmail.com with ESMTPSA id f67sm31036959wmd.13.2016.12.22.01.06.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Dec 2016 01:06:50 -0800 (PST) From: sebechlebskyjan@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 22 Dec 2016 10:06:36 +0100 Message-Id: <1482397596-7571-3-git-send-email-sebechlebskyjan@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482397596-7571-1-git-send-email-sebechlebskyjan@gmail.com> References: <20161031155627.GB2052773@phare.normalesup.org> <1482397596-7571-1-git-send-email-sebechlebskyjan@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] libavformat/tee: Add possibility to pass fifo options by using fifo_ prefix 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 --- doc/muxers.texi | 9 +++++++++ libavformat/tee.c | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/doc/muxers.texi b/doc/muxers.texi index ced223e..139ced0 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -1603,6 +1603,11 @@ outputs and setup transparent recovery. By default this feature is turned off. @item fifo_options Options to pass to fifo pseudo-muxer instances. See @ref{fifo}. +@item fifo_[opt] +Option will be passed as [opt] to fifo pseudo-muxer instances. For example +fifo_queue_size will set queue_size option of fifo pseudo muxer. +This allows to specify fifo_options without need of extensive escaping. + @end table The slave outputs are specified in the file name given to the muxer, @@ -1633,6 +1638,10 @@ This allows to override tee muxer use_fifo option for individual slave muxer. This allows to override tee muxer fifo_options for individual slave muxer. See @ref{fifo}. +@item fifo_[opt] +This allows to override tee muxer fifo_options by setting [opt] for fifo of +individual slave muxer, without need of another level of escaping. + It is possible to specify to which streams a given bitstream filter applies, by appending a stream specifier to the option separated by @code{/}. @var{spec} must be a stream specifier (see @ref{Format diff --git a/libavformat/tee.c b/libavformat/tee.c index 99259a7..7001e38 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -156,6 +156,23 @@ static void close_slaves(AVFormatContext *avf) av_freep(&tee->slaves); } +static int steal_fifo_options(AVDictionary **src_options, AVDictionary **dst_options) +{ + int ret; + AVDictionaryEntry *entry; + + while((entry = av_dict_get(*src_options, "fifo_", NULL, AV_DICT_IGNORE_SUFFIX))) { + ret = av_dict_set(dst_options, entry->key + 5, /* 5 = strlen("fifo_") */ + entry->value, AV_DICT_DONT_STRDUP_VAL); + if (ret < 0) + return ret; + + entry->value = NULL; + ret = av_dict_set(src_options, entry->key, NULL, 0); + } + return 0; +} + static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave) { int i, ret; @@ -186,6 +203,9 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave) STEAL_OPTION("onfail", on_fail); STEAL_OPTION("use_fifo", use_fifo); STEAL_OPTION("fifo_options", fifo_options_str); + ret = steal_fifo_options(&options, &tee_slave->fifo_options); + if (ret < 0) + goto end; ret = parse_slave_failure_policy_option(on_fail, tee_slave); if (ret < 0) {