From patchwork Mon Apr 15 22:47:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tristan Matthews X-Patchwork-Id: 12760 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 7F15D4483BA for ; Tue, 16 Apr 2019 01:54:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63F8068A6A5; Tue, 16 Apr 2019 01:54:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B8D52689E21 for ; Tue, 16 Apr 2019 01:53:57 +0300 (EEST) Received: by mail-qt1-f195.google.com with SMTP id k2so21253129qtm.1 for ; Mon, 15 Apr 2019 15:53:57 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=f3YDNehz/97Ved8bNlz6Ud87NNWuMfyz/B952dFS+oA=; b=FHeI9MpdC5L4YSAg5+eEsF8VjLBteu7LtJJLzrcsCSB/p+dsE1nGTOE+qI9Euch1ID ZhWXfYt+zrhyd3NaSHgFgQsNpjgvHDTKf4eAeZO8LNw5Jix865dhZbDO39Hudds7iROU K2/s6hg/H2OgNrtQqKuKsB1qYbCTk/DrUc5kIlh0Z1D34h94zR2TYyqL5tMjxDTrQr9p g/7Ju8atfS3uSwyIWHb7JEOnqrO0a8i42f5yJr7vZOCoUxzj3Vh86CcJvJuExECmDkhP Jrf1svm32wNiKgAsTP8s+FnELMXdwEReUmMZQLgd0szHW6FWzQZHO4Gbzua88I3AGCO5 U52w== X-Gm-Message-State: APjAAAU4pENnmkvRjN1O6hadO2XB4VXYZ2+XH4j3XhMJDwB5/luZVg/4 GlEV2VJPRphjPeoeETvL06FKWK5En6g= X-Google-Smtp-Source: APXvYqyohLl/+pUHoImdMwjTInGXg0O0iOfyswWPGxk2v1Y/DbO2sNTuRaJcjMRKklxIKvjDGZsjKw== X-Received: by 2002:a0c:e2d4:: with SMTP id t20mr1891040qvl.102.1555368470393; Mon, 15 Apr 2019 15:47:50 -0700 (PDT) Received: from bellini.lan (192-222-144-238.qc.cable.ebox.net. [192.222.144.238]) by smtp.gmail.com with ESMTPSA id s50sm34832910qts.39.2019.04.15.15.47.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:47:49 -0700 (PDT) From: Tristan Matthews To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Apr 2019 18:47:37 -0400 Message-Id: <20190415224737.23759-1-tmatth@videolan.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] rtsp: add pkt_size option 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: =?UTF-8?q?Martin=20Storsj=C3=B6?= , Tristan Matthews Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This allows users to specify an upper limit on the size of outgoing packets when publishing via RTSP. Signed-off-by: Martin Storsjö --- libavformat/rtsp.c | 6 +++++- libavformat/rtsp.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 8349840c96..8a8ffdea4d 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -76,7 +76,9 @@ #define COMMON_OPTS() \ { "reorder_queue_size", "set number of packets to buffer for handling of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC }, \ - { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC } \ + { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \ + { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \ + { "pkt_size", "Underlying protocol send packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC } \ const AVOption ff_rtsp_options[] = { @@ -132,6 +134,8 @@ static AVDictionary *map_to_opts(RTSPState *rt) snprintf(buf, sizeof(buf), "%d", rt->buffer_size); av_dict_set(&opts, "buffer_size", buf, 0); + snprintf(buf, sizeof(buf), "%d", rt->pkt_size); + av_dict_set(&opts, "pkt_size", buf, 0); return opts; } diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h index b49278fc20..54a9a30c16 100644 --- a/libavformat/rtsp.h +++ b/libavformat/rtsp.h @@ -410,6 +410,7 @@ typedef struct RTSPState { char default_lang[4]; int buffer_size; + int pkt_size; } RTSPState; #define RTSP_FLAG_FILTER_SRC 0x1 /**< Filter incoming UDP packets -