From patchwork Thu Jun 9 22:24:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 36102 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp620050pzj; Thu, 9 Jun 2022 15:24:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXcGfRchUkuc2aimo1nOv+t+jA22uxIgPRmVXnHWmLfilLaDD+1ocPr5QhjmQCLe0Xn6tF X-Received: by 2002:a17:906:e19:b0:708:e523:5c24 with SMTP id l25-20020a1709060e1900b00708e5235c24mr37687487eji.706.1654813459755; Thu, 09 Jun 2022 15:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654813459; cv=none; d=google.com; s=arc-20160816; b=AXlx1WBYgUKLJ9ilBnfXx1QqipOGq1fQujzKA3Ak3fmO5lI9xxWrcCg+BTYyPPBQf0 EdKmlRRQbnI1o/zEFvtzVhHtLJ/ga+b+2u+4njQgtWPQwWIEqNXWo3G3KR+QK3IpLO1a D9t67Z1WE4vaW1BC7q5XlKnj0q9Zvpr3TFllyQM5M9xoFCPaT464G7blk7nxu1BMw7P+ hEE9/txm14N3H5AeTuIooSYYnVBOaeLqwaA6+PN69irgDCMQ1PHm+/OdZiBG28IOf26z Q2jaPdL0gwJZJ99352pr9Nxl1cL27qJSaJ2belOtC743kSTy2BS3bxA0qz3lUyiMzK8G t5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=hT1tmhBwdGRxcrlFG9G6p5xE3vmajeZQf4a0I7R1Cao=; b=Xwbvx2ub6red5CM18841vaPKJzttVpCthaZMHYwinqi+sBhHsDTy03Y5QO1D7TC2Fs OYUHNTMjo72D6dacQoJ+MaLnTFLkFBgCYHa8p46Qie8xTIIYEoBTDN3Wl7wTwiw0y1GE qfXncz3gSUnPCuAcIxeyZWx1ZQmXpknNy6/9pz59uagGJ9AreGCobwyLGehPQgqGr9XN 85QVjhywitn6DEQPPBOx7Gb/vW/e6tLd43kHGGcNqb1vC1w5KHWR4YnEAd3uSkaNwaCH 5soUmyMLmuuFTMZAibKro3OWc5gxVdG9Q1KzaC+1aTY17SczbDd+Eu+Nr/AM45DrJeuz suAw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qk38-20020a1709077fa600b00708198af7f2si6053743ejc.895.2022.06.09.15.24.18; Thu, 09 Jun 2022 15:24:19 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFD7E68B7E8; Fri, 10 Jun 2022 01:24:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 51E5F68B57F for ; Fri, 10 Jun 2022 01:24:09 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id BD582E73A7; Fri, 10 Jun 2022 00:24:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WWVo5_23dWc4; Fri, 10 Jun 2022 00:24:08 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2D977E736D; Fri, 10 Jun 2022 00:24:08 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Jun 2022 00:24:01 +0200 Message-Id: <20220609222401.28726-1-cus@passwd.hu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/librist: bump required version to 0.2.7 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dQM9k5rJGcNa This is the first version for which fifo size setting actually works. Signed-off-by: Marton Balint --- configure | 2 +- libavformat/librist.c | 32 -------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/configure b/configure index 5a167613a4..69d93090c6 100755 --- a/configure +++ b/configure @@ -6604,7 +6604,7 @@ enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192. enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection enabled librav1e && require_pkg_config librav1e "rav1e >= 0.4.0" rav1e.h rav1e_context_new -enabled librist && require_pkg_config librist "librist >= 0.2" librist/librist.h rist_receiver_create +enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++" diff --git a/libavformat/librist.c b/libavformat/librist.c index 58dfd7c44b..5f27cacd44 100644 --- a/libavformat/librist.c +++ b/libavformat/librist.c @@ -38,13 +38,6 @@ // RIST_MAX_PACKET_SIZE - 28 minimum protocol overhead #define MAX_PAYLOAD_SIZE (10000-28) - -#define FF_LIBRIST_MAKE_VERSION(major, minor, patch) \ - ((patch) + ((minor)* 0x100) + ((major) *0x10000)) -#define FF_LIBRIST_VERSION FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, LIBRIST_API_VERSION_MINOR, LIBRIST_API_VERSION_PATCH) -#define FF_LIBRIST_VERSION_41 FF_LIBRIST_MAKE_VERSION(4, 1, 0) -#define FF_LIBRIST_VERSION_42 FF_LIBRIST_MAKE_VERSION(4, 2, 0) - #define FIFO_SIZE_DEFAULT 8192 typedef struct RISTContext { @@ -160,24 +153,14 @@ static int librist_open(URLContext *h, const char *uri, int flags) if (ret < 0) goto err; -#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41 - ret = rist_parse_address(uri, (const struct rist_peer_config **)&peer_config); -#else ret = rist_parse_address2(uri, &peer_config); -#endif if (ret < 0) goto err; if (flags & AVIO_FLAG_READ) { -//Prior to 4.2.0 there was a bug in librist which made this call always fail. -#if FF_LIBRIST_VERSION >= FF_LIBRIST_VERSION_42 ret = rist_receiver_set_output_fifo_size(s->ctx, s->fifo_size); if (ret != 0) goto err; -#else - if (s->fifo_size != FIFO_SIZE_DEFAULT) - av_log(h, AV_LOG_ERROR, "librist prior to 0.2.7 has a bug which fails setting the fifo buffer size\n"); -#endif } if (((s->encryption == 128 || s->encryption == 256) && !s->secret) || @@ -219,13 +202,8 @@ static int librist_read(URLContext *h, uint8_t *buf, int size) RISTContext *s = h->priv_data; int ret; -#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41 - const struct rist_data_block *data_block; - ret = rist_receiver_data_read(s->ctx, &data_block, POLLING_TIME); -#else struct rist_data_block *data_block; ret = rist_receiver_data_read2(s->ctx, &data_block, POLLING_TIME); -#endif if (ret < 0) return risterr2ret(ret); @@ -234,15 +212,10 @@ static int librist_read(URLContext *h, uint8_t *buf, int size) return AVERROR(EAGAIN); if (data_block->payload_len > MAX_PAYLOAD_SIZE) { -#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41 - rist_receiver_data_block_free((struct rist_data_block**)&data_block); -#else rist_receiver_data_block_free2(&data_block); -#endif return AVERROR_EXTERNAL; } -#if FF_LIBRIST_VERSION >= FF_LIBRIST_VERSION_42 if (data_block->flags & RIST_DATA_FLAGS_OVERFLOW) { if (!s->overrun_nonfatal) { av_log(h, AV_LOG_ERROR, "Fifo buffer overrun. " @@ -252,16 +225,11 @@ static int librist_read(URLContext *h, uint8_t *buf, int size) goto out_free; } } -#endif size = data_block->payload_len; memcpy(buf, data_block->payload, size); out_free: -#if FF_LIBRIST_VERSION < FF_LIBRIST_VERSION_41 - rist_receiver_data_block_free((struct rist_data_block**)&data_block); -#else rist_receiver_data_block_free2(&data_block); -#endif return size; }