From patchwork Mon Apr 15 22:50:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tristan Matthews X-Patchwork-Id: 12759 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 22C3444753D for ; Tue, 16 Apr 2019 01:51:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F15C968A703; Tue, 16 Apr 2019 01:51:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AD160689C61 for ; Tue, 16 Apr 2019 01:50:58 +0300 (EEST) Received: by mail-qt1-f193.google.com with SMTP id v20so21157845qtv.12 for ; Mon, 15 Apr 2019 15:50:58 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hW0o8hIVyCvHkwOFdyzEEjeh5B9zmyC8ZfW+Kes/7P4=; b=HSJbaR7k/yutTxKclhKrUGDdABXMGhNsRzlaDZ2NiJ+fazalWTJsKtXV2hvjE2dxVY Y0AQd7BUCva8nLcNBQ/W1g5S6qOKyE7+nYL2ErCceLHNHHSa+W1KGdpXbdKZ80FpVtAe NCQ8Qe833PUOtuZiArIPkokQbLmCsXvkhGKPL0+FYHgkQ4dEGhKLEJgAVCGbSvtzxFtx rC9D3+hAxrJnBBB9mOIlzifywsAQWPn7CG7xZ9xfM/JOPo+SVIzg8PxfQs6B7i/qvOj+ dU3DjeZKSQbnT/2TuqbUFi7HDqARajj8YXiDTuMVwtD/prEclGez1EDZc3g1Q+EsCBcG wFvg== X-Gm-Message-State: APjAAAVIBIXvDRBVWZGZcDdab/O/qk2TPLRd+1ItLz5mxbEj1BkmnoGT ZsRV9BIoJiZ1UOXWPEn3IHumQ/JWgKg= X-Google-Smtp-Source: APXvYqxaDe0FRgPhBfAJGSDFkf+qGGBv854u/YtVspmwbUwl/pb5NaJlibLZKXslnDmgMWGUJnOkfw== X-Received: by 2002:a0c:81e2:: with SMTP id 31mr64349726qve.179.1555368657107; Mon, 15 Apr 2019 15:50:57 -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 u57sm35663778qta.12.2019.04.15.15.50.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Apr 2019 15:50:55 -0700 (PDT) From: Tristan Matthews To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Apr 2019 18:50:27 -0400 Message-Id: <20190415225027.2963-1-tmatth@videolan.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190415224737.23759-1-tmatth@videolan.org> References: <20190415224737.23759-1-tmatth@videolan.org> 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 | 5 ++++- libavformat/rtsp.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 8349840c96..c153cac88b 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -76,7 +76,8 @@ #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 }, \ + { "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 +133,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 -