From patchwork Sat Jul 22 19:29:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42912 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019115pzb; Sat, 22 Jul 2023 12:30:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKH627YM4MZvUsp2Th2DKJ4r0FUOXgakL/9vdId+5PPBr9Q/3bsFY4lbH5kWy+LdR2vi0y X-Received: by 2002:aa7:da0a:0:b0:51e:36b8:34fa with SMTP id r10-20020aa7da0a000000b0051e36b834famr4874270eds.4.1690054209202; Sat, 22 Jul 2023 12:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054209; cv=none; d=google.com; s=arc-20160816; b=soDf/wY1JKfJG/P3mjSiaTTXghAcwz0jbH2iZJf7MoVgftJftO9HQE8vDn+Fw0Q9Cl nFR+CxS1/2V39ShXK39hvfLfUtvWjVxdJxFvUYC9osXN/jMvxwqG2OHL/a5wmtZmrTCM eIZdCxwBfMZKXXcis5c15JA0UkeffzR96fiYMa/Gjt/aXI2SBziZVPKtMS3XrTPiA+0A v8gmhioqz/b4hj1/M/SS0yh+QdJ7FLvav8oNKtOaPcGKZho92wZvyQ3QYplF1xtr/ok5 5odyWGJPnpC1Pv0+GM5MRT4G8SZORmKqrGvygQYnE3ZjvFaV+If6Ai+HxSLFIomgmAx2 NAWQ== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=9bVsZ83rqYvtBrq93fBw5vuogZcpnnlwZLLdxu+stQw=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=M0J3bDjYeyA8rvrLSYabLQjEwvYXNw58uER2l8HIJGsYpN9+Dqedpvxh4w+IdrLg7z u0XkuabFDnJv8qC7GsH++aZGg/3JsSxEcId/0ZxWed+XXd2QWGUPvbZHu7Dql9/MwrZq YyJUTEIfdR+HzQu5GNWkLIsAFER2NRcTn3KpkCT7cRRm6UJ/MFCg6BK20FsJRO+zG5T0 /A2Xll1V+3khsqZdnR2jtI7ZuduLX8GyVux6nKKkAE60JlnB2OIcPF3IJWf2iUv1T0T6 M4nO3aJfpU+GoO1a6RlKWgrq5vxgqH5CSXkxl2li9fsW7O92+O14YpqOI+zWkXoAGbUd 35fA== 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 g4-20020aa7c844000000b0051de49abbd2si4078070edt.483.2023.07.22.12.30.08; Sat, 22 Jul 2023 12:30:09 -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 F1DF568C643; Sat, 22 Jul 2023 22:30:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0870368C547 for ; Sat, 22 Jul 2023 22:29:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 38A2DE0002 for ; Sat, 22 Jul 2023 19:29:57 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:52 +0200 Message-Id: <20230722192957.703-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/6] configure: libavradio support 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: exLqX/ZYK37k Autodetected based on existence of libavradio/version.h Signed-off-by: Michael Niedermayer --- Makefile | 5 +++-- configure | 46 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bf1b69f96b..d5689231c3 100644 --- a/Makefile +++ b/Makefile @@ -19,13 +19,14 @@ vpath %/fate_config.sh.template $(SRC_PATH) TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options -ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample +ALLFFLIBS = avcodec avdevice avfilter avformat avradio avutil postproc swscale swresample # $(FFLIBS-yes) needs to be in linking order FFLIBS-$(CONFIG_AVDEVICE) += avdevice FFLIBS-$(CONFIG_AVFILTER) += avfilter FFLIBS-$(CONFIG_AVFORMAT) += avformat FFLIBS-$(CONFIG_AVCODEC) += avcodec +FFLIBS-$(CONFIG_AVRADIO) += avradio FFLIBS-$(CONFIG_POSTPROC) += postproc FFLIBS-$(CONFIG_SWRESAMPLE) += swresample FFLIBS-$(CONFIG_SWSCALE) += swscale @@ -171,7 +172,7 @@ distclean:: clean libavcodec/bsf_list.c libavformat/protocol_list.c \ libavcodec/codec_list.c libavcodec/parser_list.c \ libavfilter/filter_list.c libavdevice/indev_list.c libavdevice/outdev_list.c \ - libavformat/muxer_list.c libavformat/demuxer_list.c + libavformat/muxer_list.c libavformat/demuxer_list.c libavradio/inradio_list.c ifeq ($(SRC_LINK),src) $(RM) src endif diff --git a/configure b/configure index eb2fe392b4..363dc8632e 100755 --- a/configure +++ b/configure @@ -75,6 +75,7 @@ Help options: --list-indevs show all available input devices --list-outdevs show all available output devices --list-filters show all available filters + --list-inradios show all available input radios Standard options: --logfile=FILE log tests and output to FILE [ffbuild/config.log] @@ -128,6 +129,7 @@ Component options: --disable-avdevice disable libavdevice build --disable-avcodec disable libavcodec build --disable-avformat disable libavformat build + --disable-avradio disable libavradio build --disable-swresample disable libswresample build --disable-swscale disable libswscale build --disable-postproc disable libpostproc build @@ -182,6 +184,10 @@ Individual component options: --enable-filter=NAME enable filter NAME --disable-filter=NAME disable filter NAME --disable-filters disable all filters + --enable-inradios=NAME enable input radio NAME + --disable-inradio=NAME disable input radio NAME + --disable-inradios disable input radios + --disable-radios disable all radios External library support: @@ -270,6 +276,7 @@ External library support: --enable-libshine enable fixed-point MP3 encoding via libshine [no] --enable-libsmbclient enable Samba protocol via libsmbclient [no] --enable-libsnappy enable Snappy compression, needed for hap encoding [no] + --enable-libsoapysdr enable SoapySDR, needed for connecting to SDR HW [no] --enable-libsoxr enable Include libsoxr resampling [no] --enable-libspeex enable Speex de/encoding via libspeex [no] --enable-libsrt enable Haivision SRT protocol via libsrt [no] @@ -1743,11 +1750,16 @@ AVFORMAT_COMPONENTS=" protocols " +AVRADIO_COMPONENTS=" + inradios +" + COMPONENT_LIST=" $AVCODEC_COMPONENTS $AVDEVICE_COMPONENTS $AVFILTER_COMPONENTS $AVFORMAT_COMPONENTS + $AVRADIO_COMPONENTS " EXAMPLE_LIST=" @@ -1890,6 +1902,7 @@ EXTERNAL_LIBRARY_LIST=" libshine libsmbclient libsnappy + libsoapysdr libsoxr libspeex libsrt @@ -1982,6 +1995,7 @@ FEATURE_LIST=" # this list should be kept in linking order LIBRARY_LIST=" avdevice + avradio avfilter swscale postproc @@ -2228,6 +2242,7 @@ HEADERS_LIST=" ES2_gl_h gsm_h io_h + libavradio_version_h linux_dma_buf_h linux_perf_event_h machine_ioctl_bt848_h @@ -3622,6 +3637,9 @@ xcbgrab_indev_deps="libxcb" xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes" xv_outdev_deps="xlib_xv xlib_x11 xlib_xext" +# inradios +sdr_inradio_deps="libsoapysdr" + # protocols async_protocol_deps="threads" bluray_protocol_deps="libbluray" @@ -3886,6 +3904,8 @@ avcodec_deps="avutil" avcodec_suggest="libm stdatomic" avdevice_deps="avformat avcodec avutil" avdevice_suggest="libm stdatomic" +avradio_deps="avformat avcodec avutil libavradio_version_h" +avradio_suggest="libm stdatomic" avfilter_deps="avutil" avfilter_suggest="libm stdatomic" avformat_deps="avcodec avutil" @@ -4079,7 +4099,7 @@ find_things_extern(){ pattern=$2 file=$source_path/$3 out=${4:-$thing} - sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file" + test -f "$file" && sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file" } find_filters_extern(){ @@ -4090,6 +4110,7 @@ find_filters_extern(){ FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c) OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev) INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev) +INRADIO_LIST=$(find_things_extern demuxer AVInputFormat libavradio/allradios.c inradio) MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c) DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c) ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c) @@ -4126,11 +4147,16 @@ AVFORMAT_COMPONENTS_LIST=" $PROTOCOL_LIST " +AVRADIO_COMPONENTS_LIST=" + $INRADIO_LIST +" + ALL_COMPONENTS=" $AVCODEC_COMPONENTS_LIST $AVDEVICE_COMPONENTS_LIST $AVFILTER_COMPONENTS_LIST $AVFORMAT_COMPONENTS_LIST + $AVRADIO_COMPONENTS_LIST " for n in $COMPONENT_LIST; do @@ -4217,6 +4243,9 @@ for opt do --disable-devices) disable $INDEV_LIST $OUTDEV_LIST ;; + --disable-radios) + disable $INRADIO_LIST + ;; --enable-debug=*) debuglevel="$optval" ;; @@ -6306,6 +6335,10 @@ check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)" check_ldflags -Wl,--as-needed check_ldflags -Wl,-z,noexecstack +if ! disabled avradio; then + test -f $source_path/libavradio/version.h && enable libavradio_version_h +fi + if ! disabled network; then check_func getaddrinfo $network_extralibs check_func inet_aton $network_extralibs @@ -6787,6 +6820,7 @@ enabled libshine && require_pkg_config libshine shine shine/layer3.h sh enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || require libsmbclient libsmbclient.h smbc_init -lsmbclient; } enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ +enabled libsoapysdr && require libsoapysdr SoapySDR/Device.h SoapySDRDevice_enumerate -lSoapySDR enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init @@ -7248,7 +7282,7 @@ EOF # add some linker flags check_ldflags -Wl,--warn-common -check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil +check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavradio:libavformat:libavcodec:libavutil enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic @@ -7653,6 +7687,7 @@ expand_deps(){ #we have to remove gpl from the deps here as some code assumes all lib deps are libs postproc_deps="$(filter_out 'gpl' $postproc_deps)" +avradio_deps="$(filter_out 'libavradio_version_h' $avradio_deps)" map 'expand_deps $v' $LIBRARY_LIST @@ -7770,7 +7805,7 @@ echo "Programs:" print_enabled '' $PROGRAM_LIST | print_in_columns echo -for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do +for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev inradio; do echo "Enabled ${type}s:" eval list=\$$(toupper $type)_LIST print_enabled '_*' $list | print_in_columns @@ -8076,6 +8111,9 @@ print_enabled_components(){ outdev_list) c=${c%_outdev}_muxer ;; + inradio_list) + c=${c%_inradio}_demuxer + ;; esac printf " &ff_%s,\n" $c >> $TMPH fi @@ -8097,6 +8135,7 @@ print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $ print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST +print_enabled_components libavradio/inradio_list.c AVInputFormat inradio_list $INRADIO_LIST print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST # Settings for pkg-config files @@ -8115,6 +8154,7 @@ LIBSUF=${LIBSUF} extralibs_avutil="$avutil_extralibs" extralibs_avcodec="$avcodec_extralibs" extralibs_avformat="$avformat_extralibs" +extralibs_avradio="$avradio_extralibs" extralibs_avdevice="$avdevice_extralibs" extralibs_avfilter="$avfilter_extralibs" extralibs_postproc="$postproc_extralibs"