From patchwork Mon Mar 5 09:37:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Patagar, Ravindra" X-Patchwork-Id: 7811 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.181.170 with SMTP id m39csp2337176jaj; Mon, 5 Mar 2018 01:37:47 -0800 (PST) X-Google-Smtp-Source: AG47ELsIqLrkMVnOBF/fNiuZY8xK+qwfzU8YCzShBCHoj1sf/hYSjWoeDrdFB5nqPtGPdMP7MgGn X-Received: by 10.223.209.18 with SMTP id a18mr11972140wri.141.1520242667303; Mon, 05 Mar 2018 01:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520242667; cv=none; d=google.com; s=arc-20160816; b=skoTJu7yntx/8d2v1J0tohlpNrhs3qZDKjLDvN00jvOU2Mk9t4kUCQpJTb+ZVy0Cqc 5L/epNDMzRxbZL/gxllFXsq7ENYf0R9FxpZdYwHqTLl/ccdDuGCLf4uBHd+BU/i3zP4S 793JaAilvfL0zU9KeNQsCtQqdegPEDeKJd7UMPy5OtX8Tjl0WlaQSB4KeMppRNwOdwjw vfNPPnuFPXFLmf4a78Oljd8HxgUZ7ZqICXBlkzC6c6UzSgYWoj9+wEBFOn7t3FZlRnsP Bx098xTvjFkunQxYXQ4xJhpTeWq+pgps0MXE0KADJmt9IO1N6jieRI3VaTyLac91c00Y pgJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=8R180Fjc469kBYmrr9y3Am9iA6S2lXRo4XzNqiBwKwk=; b=WYMgY+Yj0e/oprHFApEBQflBY0AYVaMsc09Nss2yiVEmDFByPIr7jGy+M4X/wgBhac k2Gu4Cjbq2sSxuRQRgWylfw23iw8OX7noGB3PTJsi0CafnEj1cxGHdKddFB2tIZOYvVq BYiYUjgYpbYayOnVYBniu/jvZINHRh/PHaE99mfrZrmC2WEV2eMuJZmDmuJG84VdB6UI zvQb3bjGuPZoaKEZk9WJV6u//pa/PFjFKrYl+59THog0DPX4cC80167NhMGNMv7Xyq1Q u6jD2NestBAZt3ntXDZgQpQ5Lr4+cTYBVz8s1iIBMqmyCycGB4ntS1R4XOKXxLSJhfYY 1mWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=xiLWKT4F; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p2si4580798wmg.160.2018.03.05.01.37.46; Mon, 05 Mar 2018 01:37:47 -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=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=xiLWKT4F; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D0E1C68A342; Mon, 5 Mar 2018 11:37:37 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A818768837F for ; Mon, 5 Mar 2018 11:37:31 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1520243564; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=mLgmwmMQP40mHi4v8a9oHjHXjb+8JMLgIHOnXbgAQoc=; b=xiLWKT4F LarRfKC3zcQNqlqwFYKqtc38qBMiV2MSIC3K0uNRLgC8YSmMdvw1RxgJGwulHAiCcYneUof93lhHG wrcHOCOV90B+axyOFf74z1EHbTAZtfYTyiyxR0gq0fPkZiUzU+pKkYZ1uzHZGoWnyshhBTWcF06Hs Y9p7XaYZdHrkRW9BwSgpkURkeExWCc0uroeTTe7NcxEA0JJ4mpGv5rd8UZFGIGcpRcIc5RgOHFigc Euc3NX5AmdZx3q+NfvtFFVx78XyDco4wuZrVIwiKEG+9jAuZFQPx994vpn2t5W0mwmYwR3Id6KnwY SS0mTnyvnHFUVHQzLsgS8pnE4w==; From: rpatagar@akamai.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Mar 2018 15:07:26 +0530 Message-Id: <1520242646-30645-1-git-send-email-rpatagar@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20180302214255.GH23018@michaelspb> References: <20180302214255.GH23018@michaelspb> X-Smtpcorp-Track: 1-sXYnDIIcwFK1.nlBc-x2_- Feedback-ID: 337386m:337386asVRLGB:337386sQH6iTnMJk:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH v2 1/1] libavformat/dashenc: Option to set timeout for socket I/O operation 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: Ravindra MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Ravindra --- doc/muxers.texi | 2 ++ libavformat/dashenc.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/doc/muxers.texi b/doc/muxers.texi index 3a63da7..cb75c26 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -264,6 +264,8 @@ of the adaptation sets and a,b,c,d and e are the indices of the mapped streams. To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs. When no assignment is defined, this defaults to an AdaptationSet for each stream. +@item -timeout @var{timeout} +Set timeout for socket I/O operations. Applicable only for HTTP output. @end table @anchor{framecrc} diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 79d63e5..9feb4f1 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -117,6 +117,7 @@ typedef struct DASHContext { AVIOContext *mpd_out; AVIOContext *m3u8_out; int streaming; + int64_t timeout; } DASHContext; static struct codec_string { @@ -269,6 +270,8 @@ static void set_http_options(AVDictionary **options, DASHContext *c) av_dict_set(options, "user_agent", c->user_agent, 0); if (c->http_persistent) av_dict_set_int(options, "multiple_requests", 1, 0); + if (c->timeout >= 0) + av_dict_set_int(options, "timeout", c->timeout, 0); } static void get_hls_playlist_name(char *playlist_name, int string_size, @@ -1440,6 +1443,7 @@ static const AVOption options[] = { { "http_persistent", "Use persistent HTTP connections", OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E }, { "hls_playlist", "Generate HLS playlist files(master.m3u8, media_%d.m3u8)", OFFSET(hls_playlist), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, { "streaming", "Enable/Disable streaming mode of output. Each frame will be moof fragment", OFFSET(streaming), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "timeout", "set timeout for socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX, .flags = E }, { NULL }, };