From patchwork Sat Dec 21 18:02:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 16915 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id AEF00447F01 for ; Sat, 21 Dec 2019 20:09:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 869DC68A9FA; Sat, 21 Dec 2019 20:09:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E17AC68A9CC for ; Sat, 21 Dec 2019 20:09:44 +0200 (EET) Received: by mail-pf1-f195.google.com with SMTP id q10so7011496pfs.6 for ; Sat, 21 Dec 2019 10:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=zLIMUREZxYQeqgfepLoWpqG+rIR7vo+aMTgYm0EFluE=; b=dCNFCblnu5OgGMcKW7w8Hz3EfNiCR2yy3o5Fg/XKFqHIgelhdEJlOga/tqmFngLQD9 QWWEURRc0qB/qsGG24T7VyM5yNhj9pVW9mEdhlua8VeYK+X5E/NuwrwxWFnYQ339k551 xLC0+uMk9iI0aIXVx/xfuV1slRPrjTdQNksDQGaiO/P8Bi8UcHkqHCQscyH8fYU0XDHd gj+Hh8RUnowRo/kfqXXFZDecfqk2ian00nLo+Pxz8zCRX1fbBY1aQzGxGczwd9U4lCeg KhWQi1oi1/kMA7kikD4GsuImHxj2H3HuSrnWuY2SSmmkv7/TOb6y+7n1CqtmNJORtQuz FHFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zLIMUREZxYQeqgfepLoWpqG+rIR7vo+aMTgYm0EFluE=; b=TJpIGeQqnTIdoco6kaVlwXrGHUsxxS+a7Gx8urqvF9Q2osfrh/NjqKsG+ZSjb3oKTj qjcNiSwI8c20iClR7HEElJVCYxgPKMRZEgT6R1Q2NNwvd12OJ7qpMcsqoOmt2nphDbA4 ZAvy2pHqG7rHIthL76wS63SeIZy7X8C2pf5i5lZOX2ZwEeNJ+XEmJSTHZAHSSdL7elet sTe5+oOjgVMsZ+EfD0ygARefzz1sXbUtfuZ22dfiYtx9xkAHORt3NyGolUyM4sN1Gt+O ZTlw/7450pEekt8gAaDM8K4AmWSxmUfwKDDP3oNa134Kj4AIFf40hij1eJSd9OCHgDFl du2w== X-Gm-Message-State: APjAAAWgY2C0NDdOCvz7FjTIdem6qtON62xHFv7fwMI+iYvukFYXyBgl ABSaDkgMjy8EA9iDsZjIIy0Y/tl3 X-Google-Smtp-Source: APXvYqyGNOfTp8jfxBt0c5PzD5N3sqxcHlChuDSiRoYK1QzQHHw3Igb41hp04AUrdPSJzbJjI32qvw== X-Received: by 2002:a63:6c09:: with SMTP id h9mr21553990pgc.34.1576951423699; Sat, 21 Dec 2019 10:03:43 -0800 (PST) Received: from localhost.localdomain ([191.83.216.116]) by smtp.gmail.com with ESMTPSA id s196sm18223564pfs.136.2019.12.21.10.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2019 10:03:43 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 21 Dec 2019 15:02:50 -0300 Message-Id: <20191221180252.6091-13-jamrial@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191221180252.6091-1-jamrial@gmail.com> References: <20191221180252.6091-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/15] dashenc: support setting arbitrary HTTP protocol options 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Anton Khirnov Signed-off-by: James Almer --- libavformat/dashenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index a09652495d..18b5fe0b70 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -163,6 +163,7 @@ typedef struct DASHContext { const char *utc_timing_url; const char *method; const char *user_agent; + char *http_opts; int hls_playlist; int http_persistent; int master_playlist_created; @@ -471,6 +472,8 @@ static void set_http_options(AVDictionary **options, DASHContext *c) { if (c->method) av_dict_set(options, "method", c->method, 0); + if (c->http_opts) + av_dict_parse_string(options, c->http_opts, "=", ",", 0); if (c->user_agent) av_dict_set(options, "user_agent", c->user_agent, 0); if (c->http_persistent) @@ -2182,6 +2185,7 @@ static const AVOption options[] = { { "mpd_profile", "Set profiles. Elements and values used in the manifest may be constrained by them", OFFSET(profile), AV_OPT_TYPE_FLAGS, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, { "dash", "MPEG-DASH ISO Base media file format live profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, { "dvb_dash", "DVB-DASH profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DVB }, 0, UINT_MAX, E, "mpd_profile"}, + { "http_opts", "HTTP protocol options", OFFSET(http_opts), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, { NULL }, };