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" From patchwork Sat Jul 22 19:29:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42913 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019188pzb; Sat, 22 Jul 2023 12:30:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqzk7uELJSI4UM3VWcVPItt1RyIlydZj4K+g7fYbH60nom2HYIvPdWQvI7hLLIuZv1JtSc X-Received: by 2002:a17:906:292:b0:992:6064:f32b with SMTP id 18-20020a170906029200b009926064f32bmr5512961ejf.46.1690054218142; Sat, 22 Jul 2023 12:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054218; cv=none; d=google.com; s=arc-20160816; b=x4vXEJRNGKscYBwBhGWxqQPnAKsLKZu5UhoxQKeAam23PGiPkTOZgexxA4UC3AnAr1 TfZ9zs4JDO0znQ1j3nFCp8gHcQ7vhGb9zaHYNIO+Sin0sNblHsVop0qgIssgnSl3gtPs 5U8gnrJ1R0vowdnEqhpXf4AW3GxNPFPxBob6HeaIk5AWU3wGW2MY4ynuoLX/ptbLXxjb pUruQICL8XWf5Lcs00WB17BlUQmkSlnHiV/i7V5KhjjIgEtCzU0+7wKse/m6uFQiseJu 9DZVPwXKgoLDt0MAQmRchzzfxPGy/duxeb1QjxRLBbRYtbevOxFlcOJ/IBamoO/Ql3Rk H9JQ== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=ttgAJQzVCiFwNx5f33NR8b5JcsHsJ7vAq4B0nVBzbSA=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=EaFAFJo7JEbgzU8SZeiR49vjm87oFqE04pJtUrfMQMKWAmfWChz/vhPYYhmM/RIUz5 Z+U12bMUUirCRFSyH96c4bP2zjuy9p9VaZzgjjFpAL2h/YglHuDhYrMmVcEImTn7oLY6 hk1vMRjIKhYfiyrXuy4wDX9mQT7pY5UcT+DIXKBrBAA1tJUMdn6xMqAdySihVxH9V/Xc Il67z2Jii4i2C6dHgQz96GFrtrsCCMNOLD3Cz1o8HMi+rtvnIxyYTqzYN54+B2v4/qfD HpKwgwjyo966o7ZdJZFymGObCWaupA/pcsqUOYbx3O+HzBI01Xic7g1Fa0tinuHTwh2Y s70Q== 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 gy14-20020a170906f24e00b0098885a736easi3994790ejb.54.2023.07.22.12.30.16; Sat, 22 Jul 2023 12:30:18 -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 E5B3D68C627; Sat, 22 Jul 2023 22:30:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2277968C547 for ; Sat, 22 Jul 2023 22:30:00 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7DC5240004 for ; Sat, 22 Jul 2023 19:29:59 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:53 +0200 Message-Id: <20230722192957.703-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230722192957.703-1-michael@niedermayer.cc> References: <20230722192957.703-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/6] avutil/log: Add AV_CLASS_CATEGORY_RADIO_INPUT 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: teZgv3azCsLA This avoids keeping a diff for libavutil in the libavradio repository Signed-off-by: Michael Niedermayer --- libavutil/log.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/log.h b/libavutil/log.h index ab7ceabe22..245ad24988 100644 --- a/libavutil/log.h +++ b/libavutil/log.h @@ -43,6 +43,7 @@ typedef enum { AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, AV_CLASS_CATEGORY_DEVICE_OUTPUT, AV_CLASS_CATEGORY_DEVICE_INPUT, + AV_CLASS_CATEGORY_RADIO_INPUT, AV_CLASS_CATEGORY_NB ///< not part of ABI/API }AVClassCategory; From patchwork Sat Jul 22 19:29:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42914 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019256pzb; Sat, 22 Jul 2023 12:30:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlGtEvX4apQLEP6WYv0bd0aQCHR9EgOa0WwSxqxXPwKAnBE24DL7toAGgQaxO8nW3pkR9agv X-Received: by 2002:a05:6402:709:b0:51d:9ddf:f0f6 with SMTP id w9-20020a056402070900b0051d9ddff0f6mr5013579edx.36.1690054225202; Sat, 22 Jul 2023 12:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054225; cv=none; d=google.com; s=arc-20160816; b=V+yl4N84sx+DnNHspsmkTX+gwRymZzdKZg4nkO6UKzx2SQfm/ohYXo1vRftSJOO6Pl Mhcbejv7ZofPl6zlIlIDSEivdaMDvvMROSQQw4H18zjc7fYBddA+an05rOsfPf3sUlkY 5HP0sNLFKP09XXQHKe6X25uOnZSne3UmXRKor3jZQcMC0pQAYoRCqGFKaGilyn4oZos6 c4APi5VMYCpjoSlnP/Pmc1+PaO9B2aEFH/zX8Ih6m4nPqlEF0XD7Ic+ZUSx7gZ2ivh65 Wms08QDW70Q68MfkpjSH+z+DEL1+Zo/EllwFslntMVKbX5dzrZCrAqpAHakZx55TbcIa Te5g== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=igA759wwzFwV+ex+LljTfZ7fjdVpc6DAIiN2AB7xlak=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=b7zhYoIJGhL6hTjJTc+8YF+huegPwLyFmnKQIv+Zj2XBhB9tFsDyAeAMwb1XXCS948 8Kj+QvZHNhnoXhCnME0a7BT5GfPbsox+T05RySolo3tzJjdMVXAx9Mu+u7K5SJ7YAVH2 arw0Rkkn7wyanUtFhZeC3dX0fmMiUzVgzuhvQiY8QQtuGBnvTGz9PjR4E6WOsEhLA81M 3lQ7WoqXKK6A+bAxdaqYOBfRA1/jrQdkuYtfCqhpmbHCkbvn+yClso8HP4bEDT1EMyim 5LBiyoMuc4gndccTaHkD8LzSLGO97D8TQAxCyq9q18oWr/JOzgEoFxKBPMSX9hK9+LZV J9Hg== 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 q18-20020a056402033200b0051deabf148esi4269200edw.638.2023.07.22.12.30.24; Sat, 22 Jul 2023 12:30:25 -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 E360368C674; Sat, 22 Jul 2023 22:30:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C0A168C627 for ; Sat, 22 Jul 2023 22:30:01 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E80691C0004 for ; Sat, 22 Jul 2023 19:30:00 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:54 +0200 Message-Id: <20230722192957.703-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230722192957.703-1-michael@niedermayer.cc> References: <20230722192957.703-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/6] avformat: add support for demuxers/inputs from avradio 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: 73BGVMpqJxvb This avoids keeping diffs for libavformat in the libavradio repository Signed-off-by: Michael Niedermayer --- libavformat/allformats.c | 32 +++++++++++++++++++++++++------- libavformat/internal.h | 1 + 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 6324952bd2..27a32028dd 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -570,6 +570,7 @@ extern const AVInputFormat ff_vapoursynth_demuxer; static atomic_uintptr_t indev_list_intptr = ATOMIC_VAR_INIT(0); static atomic_uintptr_t outdev_list_intptr = ATOMIC_VAR_INIT(0); +static atomic_uintptr_t inradio_list_intptr= ATOMIC_VAR_INIT(0); const AVOutputFormat *av_muxer_iterate(void **opaque) { @@ -594,20 +595,32 @@ const AVOutputFormat *av_muxer_iterate(void **opaque) const AVInputFormat *av_demuxer_iterate(void **opaque) { - static const uintptr_t size = sizeof(demuxer_list)/sizeof(demuxer_list[0]) - 1; uintptr_t i = (uintptr_t)*opaque; const AVInputFormat *f = NULL; uintptr_t tmp; - if (i < size) { - f = demuxer_list[i]; - } else if (tmp = atomic_load_explicit(&indev_list_intptr, memory_order_relaxed)) { - const AVInputFormat *const *indev_list = (const AVInputFormat *const *)tmp; - f = indev_list[i - size]; + if (i % 4 == 0) { + f = demuxer_list[i/4]; + if (!f) + i = 1; + } + if (i % 4 == 1) { + if(tmp = atomic_load_explicit(&indev_list_intptr, memory_order_relaxed)) { + const AVInputFormat *const *indev_list = (const AVInputFormat *const *)tmp; + f = indev_list[i/4]; + } + if (!f) + i = 2; + } + if (i % 4 == 2) { + if(tmp = atomic_load_explicit(&inradio_list_intptr, memory_order_relaxed)) { + const AVInputFormat *const *indev_list = (const AVInputFormat *const *)tmp; + f = indev_list[i/4]; + } } if (f) - *opaque = (void*)(i + 1); + *opaque = (void*)(i + 4); return f; } @@ -616,3 +629,8 @@ void avpriv_register_devices(const FFOutputFormat * const o[], const AVInputForm atomic_store_explicit(&outdev_list_intptr, (uintptr_t)o, memory_order_relaxed); atomic_store_explicit(&indev_list_intptr, (uintptr_t)i, memory_order_relaxed); } + +void avpriv_register_radios(const FFOutputFormat * const o[], const AVInputFormat * const i[]) +{ + atomic_store_explicit(&inradio_list_intptr, (uintptr_t)i, memory_order_relaxed); +} diff --git a/libavformat/internal.h b/libavformat/internal.h index 9fc980601f..aa6b8b21a9 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -719,5 +719,6 @@ int ff_match_url_ext(const char *url, const char *extensions); struct FFOutputFormat; void avpriv_register_devices(const struct FFOutputFormat * const o[], const AVInputFormat * const i[]); +void avpriv_register_radios(const struct FFOutputFormat * const o[], const AVInputFormat * const i[]); #endif /* AVFORMAT_INTERNAL_H */ From patchwork Sat Jul 22 19:29:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42915 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019317pzb; Sat, 22 Jul 2023 12:30:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPuE6g3Ol9VIiYh5MUWCURJeXLmuQDpJxynnzEV1NU/M5ocqyRrUD05RBME0DGtl75Cx2B X-Received: by 2002:a17:906:30c5:b0:98d:696a:531c with SMTP id b5-20020a17090630c500b0098d696a531cmr4803162ejb.40.1690054233572; Sat, 22 Jul 2023 12:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054233; cv=none; d=google.com; s=arc-20160816; b=A5Dsw8xc4c7hZtoU80zgrfthcpqjs6rkBO0Xky+JPzRYfFINA6eV1j5StNViEioX1K MzomS/0ODSojBfwY5qpjVDd7yCwPRx5o5lkLTRK5ZNPl6naJBGHz+A5gKtYPjvmR6Iqp vI74K1UHzjKfpp59uzSCA5uadbwzf2x1x9yKp36++6ve1Jm/sMjxgsfN7hJwQ1Blhj7p I2atRNL0e2b1Jab0QKZb7YkWVIF+P4uEK/ctuiETz5X+ON3Aav+uGDPcU9mj4o7+2SN2 Qm8BjJiPQXvOkLYj1X+7YY45HuLKGzVG7Ftu9avxeWmxb+trRL9EQkRItPPZZEin3w55 gXjA== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=+MV9o7vb06HOYN1Vm0TE8H55ednwLZKZRKWE5gk7qZI=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=X10M92iZexUxnDkRDkihN04GNlxkY+BlC9/kv75l9j4Sd3TnDXa08huluzw5UnMMrg U7rNki5Kbl5Q+WzwonvB3k+W4oC+uSVlu5ASFpJBVsvVEeJObgQ6uhelUlnr5/bnxTHE 3FqtDb7RCz0rD7onQVbKmJgHjyg5G2khswdgzbqX4SfZFv3vIXrCFXHpthpM8ISbV5o7 xtoVk0T4snU31Q6WPqN7VpFTbDFpWJytChgZ1J5Yg9TwI2aqsvsmQDZEK23BpGo127zh /rc/rWnHt8f7xtkWzYfk8Rjnvtf2E05j/BYtgECV8RTDU30+k7WYT1/e575HykLuRun2 NY/Q== 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 ke3-20020a17090798e300b0098df1cbe2b1si3961320ejc.925.2023.07.22.12.30.33; Sat, 22 Jul 2023 12:30:33 -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 1C61468C67D; Sat, 22 Jul 2023 22:30:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2090B68C640 for ; Sat, 22 Jul 2023 22:30:03 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 470A160008 for ; Sat, 22 Jul 2023 19:30:01 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:55 +0200 Message-Id: <20230722192957.703-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230722192957.703-1-michael@niedermayer.cc> References: <20230722192957.703-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/6] avdevice/utils: add test for AV_CLASS_CATEGORY_RADIO_INPUT 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: N9ldasTjVKPa This avoids keeping diffs for libavdevice in the libavradio repository Signed-off-by: Michael Niedermayer --- libavdevice/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/utils.c b/libavdevice/utils.c index d9a52c53ab..faa24fa74d 100644 --- a/libavdevice/utils.c +++ b/libavdevice/utils.c @@ -33,7 +33,7 @@ int ff_alloc_input_device_context(AVFormatContext **avctx, const AVInputFormat * if (!iformat) iformat = av_find_input_format(format); - if (!iformat || !iformat->priv_class || !AV_IS_INPUT_DEVICE(iformat->priv_class->category)) { + if (!iformat || !iformat->priv_class || (!AV_IS_INPUT_DEVICE(iformat->priv_class->category) && iformat->priv_class->category != AV_CLASS_CATEGORY_RADIO_INPUT)) { ret = AVERROR(EINVAL); goto error; } From patchwork Sat Jul 22 19:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42916 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019371pzb; Sat, 22 Jul 2023 12:30:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlEs778FxcwmuEs9iSZYAlP17xguVv33gT2pJfDSx+5oguj0rQWzs3Ejp8tZcQGy9ij0ae/g X-Received: by 2002:aa7:d04a:0:b0:518:7cf5:7ff8 with SMTP id n10-20020aa7d04a000000b005187cf57ff8mr4697735edo.12.1690054242264; Sat, 22 Jul 2023 12:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054242; cv=none; d=google.com; s=arc-20160816; b=XHFTbvAGIWS0uzNjYYIA608hDjA/gsa+UFCXidfP2LabtrqX7iYO+CRFVJJGULn4n7 7OJ9wRpVognRxn4/J5lWwh6vGL4kgDAs6lDUNC92NrZdGyNcz5lWhG2qNezMA3sxgd9A tMNsS0zhoJGJZSqx2sZkM4JLH+giovXH7VK26y8jjMte+QU1Vri1wuAO2ojfbSShUXYy MdNOSGahwHJGu4ycQZk+Gu1MM23wf7NBxk/TLDJHRu3zuIlmcUEBhRyuLs0svT7h5bji D/Em1GrCi+v5OidYc3LQUoTVqbBYWJO+oDM0eYQ3RyWH1MQ4qcQDablksONfgWVzv5gr bmGQ== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=5iqUKefuihovzy/Iibvgfk2snWey5ND2FWmqk1clsH8=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=zRM/Xq4xe9A98XuNia7NTQMhzdJm33rKZxIqMGSkAFMAgh8RNuZtaIm0wW54USinIT TaXU7UYYu11RXoH2vL1FyZ6BXSUyF0CAUWvjAUOnlSxUb3wrpHMalLO0NY8msIogAPfr /Rb1yNTolfbRC+mKIkvWh/b5hj8k4sUZF6eISBeZa4bh3SRgS7lkKKNhu9PENsyIG7gk QvHMV0v7smaSkJZRM9DrZcChhTjFfuRGfifkn6hoDAb/SKkaAjuRqqujcsnojAgIF+Z8 RudyGWRC811v6+Lq1ra4lsAYHMbP2wx70E4xHYiNKMn0ItSW4XNaEuZr3K63cwAEjSXA pR3Q== 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 w22-20020aa7da56000000b005217c6c827dsi4288459eds.231.2023.07.22.12.30.41; Sat, 22 Jul 2023 12:30:42 -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 EDEC968C688; Sat, 22 Jul 2023 22:30:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2832368C675 for ; Sat, 22 Jul 2023 22:30:04 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 84A6B240003 for ; Sat, 22 Jul 2023 19:30:03 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:56 +0200 Message-Id: <20230722192957.703-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230722192957.703-1-michael@niedermayer.cc> References: <20230722192957.703-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/6] fftools: avradio 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: yBMFTh7fQ5Zl This avoids keeping diffs to fftools in the libavradio repository --- fftools/ffmpeg.c | 7 +++++ fftools/ffplay.c | 6 ++++ fftools/ffprobe.c | 6 ++++ fftools/opt_common.c | 66 ++++++++++++++++++++++++++++++++++++++++---- fftools/opt_common.h | 27 ++++++++++++++++++ 5 files changed, 107 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6130fd06fc..e9fbc8b636 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -95,6 +95,10 @@ #include "libavdevice/avdevice.h" +#if CONFIG_AVRADIO +#include "libavradio/avradio.h" +#endif + #include "libswresample/swresample.h" #include "libavfilter/avfilter.h" @@ -1331,6 +1335,9 @@ int main(int argc, char **argv) #if CONFIG_AVDEVICE avdevice_register_all(); +#endif +#if CONFIG_AVRADIO + avradio_register_all(); #endif avformat_network_init(); diff --git a/fftools/ffplay.c b/fftools/ffplay.c index 5212ad053e..f2e70b2de6 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -45,6 +45,9 @@ #include "libavutil/bprint.h" #include "libavformat/avformat.h" #include "libavdevice/avdevice.h" +#if CONFIG_AVRADIO +#include "libavradio/avradio.h" +#endif #include "libswscale/swscale.h" #include "libavutil/opt.h" #include "libavcodec/avfft.h" @@ -3651,6 +3654,9 @@ int main(int argc, char **argv) /* register all codecs, demux and protocols */ #if CONFIG_AVDEVICE avdevice_register_all(); +#endif +#if CONFIG_AVRADIO + avradio_register_all(); #endif avformat_network_init(); diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index a39185f6fe..51a0c2483b 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -56,6 +56,9 @@ #include "libavutil/timestamp.h" #include "libavdevice/avdevice.h" #include "libavdevice/version.h" +#if CONFIG_AVRADIO +#include "libavradio/avradio.h" +#endif #include "libswscale/swscale.h" #include "libswscale/version.h" #include "libswresample/swresample.h" @@ -4109,6 +4112,9 @@ int main(int argc, char **argv) #if CONFIG_AVDEVICE avdevice_register_all(); #endif +#if CONFIG_AVRADIO + avradio_register_all(); +#endif show_banner(argc, argv, options); ret = parse_options(NULL, argc, argv, options, opt_input_file); diff --git a/fftools/opt_common.c b/fftools/opt_common.c index 913932c914..f556d95afe 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -51,6 +51,11 @@ #include "libavdevice/avdevice.h" #include "libavdevice/version.h" +#if CONFIG_AVRADIO +#include "libavradio/avradio.h" +#include "libavradio/version.h" +#endif + #include "libavfilter/avfilter.h" #include "libavfilter/version.h" @@ -187,6 +192,9 @@ static void print_all_libs_info(int flags, int level) PRINT_LIB_INFO(avutil, AVUTIL, flags, level); PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); +#if CONFIG_AVRADIO + PRINT_LIB_INFO(avradio, AVRADIO, flags, level); +#endif PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); PRINT_LIB_INFO(swscale, SWSCALE, flags, level); @@ -844,6 +852,13 @@ static int is_device(const AVClass *avclass) return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category); } +static int is_radio(const AVClass *avclass) +{ + if (!avclass) + return 0; + return avclass->category == AV_CLASS_CATEGORY_RADIO_INPUT; +} + static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only, int muxdemuxers) { void *ifmt_opaque = NULL; @@ -851,12 +866,13 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, void *ofmt_opaque = NULL; const AVOutputFormat *ofmt = NULL; const char *last_name; - int is_dev; + int is_dev, is_rad; + const char *name[3] = {"File formats:", "Devices:", "Radios:"}; printf("%s\n" " D. = Demuxing supported\n" " .E = Muxing supported\n" - " --\n", device_only ? "Devices:" : "File formats:"); + " --\n", name[device_only]); last_name = "000"; for (;;) { int decode = 0; @@ -868,7 +884,9 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, ofmt_opaque = NULL; while ((ofmt = av_muxer_iterate(&ofmt_opaque))) { is_dev = is_device(ofmt->priv_class); - if (!is_dev && device_only) + if (!is_dev && device_only == 1) + continue; + if (device_only == 2) continue; if ((!name || strcmp(ofmt->name, name) < 0) && strcmp(ofmt->name, last_name) > 0) { @@ -882,7 +900,10 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg, ifmt_opaque = NULL; while ((ifmt = av_demuxer_iterate(&ifmt_opaque))) { is_dev = is_device(ifmt->priv_class); - if (!is_dev && device_only) + is_rad = is_radio(ifmt->priv_class); + if (!is_dev && device_only == 1) + continue; + if (!is_rad && device_only == 2) continue; if ((!name || strcmp(ifmt->name, name) < 0) && strcmp(ifmt->name, last_name) > 0) { @@ -927,6 +948,11 @@ int show_devices(void *optctx, const char *opt, const char *arg) return show_formats_devices(optctx, opt, arg, 1, SHOW_DEFAULT); } +int show_radios(void *optctx, const char *opt, const char *arg) +{ + return show_formats_devices(optctx, opt, arg, 2, SHOW_DEFAULT); +} + int show_protocols(void *optctx, const char *opt, const char *arg) { void *opaque = NULL; @@ -1335,7 +1361,7 @@ static int print_device_sources(const AVInputFormat *fmt, AVDictionary *opts) int ret; AVDeviceInfoList *device_list = NULL; - if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category)) + if (!fmt || !fmt->priv_class || (!AV_IS_INPUT_DEVICE(fmt->priv_class->category) && fmt->priv_class->category != AV_CLASS_CATEGORY_RADIO_INPUT)) return AVERROR(EINVAL); printf("Auto-detected sources for %s:\n", fmt->name); @@ -1468,3 +1494,33 @@ int show_sinks(void *optctx, const char *opt, const char *arg) return ret; } #endif /* CONFIG_AVDEVICE */ + +#if CONFIG_AVRADIO +int show_radio_sources(void *optctx, const char *opt, const char *arg) +{ + const AVInputFormat *fmt = NULL; + char *dev = NULL; + AVDictionary *opts = NULL; + int ret = 0; + int error_level = av_log_get_level(); + + av_log_set_level(AV_LOG_WARNING); + + if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0) + goto fail; + + do { + fmt = av_input_radio_next(fmt); + if (fmt) { + if (dev && !av_match_name(dev, fmt->name)) + continue; + print_device_sources(fmt, opts); + } + } while (fmt); + fail: + av_dict_free(&opts); + av_free(dev); + av_log_set_level(error_level); + return ret; +} +#endif /* CONFIG_AVRADIO */ diff --git a/fftools/opt_common.h b/fftools/opt_common.h index ea1d16e769..b64ab07e10 100644 --- a/fftools/opt_common.h +++ b/fftools/opt_common.h @@ -39,6 +39,15 @@ int show_sinks(void *optctx, const char *opt, const char *arg); int show_sources(void *optctx, const char *opt, const char *arg); #endif +#if CONFIG_AVRADIO +/** + * Print a listing containing autodetected sources of the input radio. + * Device name with options may be passed as an argument to limit results. + */ +int show_radio_sources(void *optctx, const char *opt, const char *arg); +#endif + + #if CONFIG_AVDEVICE #define CMDUTILS_COMMON_OPTIONS_AVDEVICE \ { "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources }, \ @@ -50,6 +59,15 @@ int show_sources(void *optctx, const char *opt, const char *arg); #define CMDUTILS_COMMON_OPTIONS_AVDEVICE #endif +#if CONFIG_AVRADIO +#define CMDUTILS_COMMON_OPTIONS_AVRADIO \ + { "radio_sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_radio_sources }, \ + "list sources of the input device", "device" }, \ + +#else +#define CMDUTILS_COMMON_OPTIONS_AVRADIO +#endif + /** * Print the license of the program to stdout. The license depends on * the license of the libraries compiled into the program. @@ -105,6 +123,13 @@ int show_demuxers(void *optctx, const char *opt, const char *arg); */ int show_devices(void *optctx, const char *opt, const char *arg); +/** + * Print a listing containing all the radios supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_radios(void *optctx, const char *opt, const char *arg); + /** * Print a listing containing all the codecs supported by the * program. @@ -208,6 +233,7 @@ int opt_cpucount(void *optctx, const char *opt, const char *arg); { "muxers", OPT_EXIT, { .func_arg = show_muxers }, "show available muxers" }, \ { "demuxers", OPT_EXIT, { .func_arg = show_demuxers }, "show available demuxers" }, \ { "devices", OPT_EXIT, { .func_arg = show_devices }, "show available devices" }, \ + { "radios", OPT_EXIT, { .func_arg = show_radios }, "show available radios" }, \ { "codecs", OPT_EXIT, { .func_arg = show_codecs }, "show available codecs" }, \ { "decoders", OPT_EXIT, { .func_arg = show_decoders }, "show available decoders" }, \ { "encoders", OPT_EXIT, { .func_arg = show_encoders }, "show available encoders" }, \ @@ -227,5 +253,6 @@ int opt_cpucount(void *optctx, const char *opt, const char *arg); { "cpucount", HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpucount }, "force specific cpu count", "count" }, \ { "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" }, \ CMDUTILS_COMMON_OPTIONS_AVDEVICE \ + CMDUTILS_COMMON_OPTIONS_AVRADIO \ #endif /* FFTOOLS_OPT_COMMON_H */ From patchwork Sat Jul 22 19:29:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42917 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1019437pzb; Sat, 22 Jul 2023 12:30:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWPGyJ1Kr82pBrjVNPPRv+Q0ahHVoRgrRq2VhAGgcRfcbAnhK52/Ss+4JKYXIgrGH4EyUL X-Received: by 2002:a17:906:648a:b0:997:eab5:f1c6 with SMTP id e10-20020a170906648a00b00997eab5f1c6mr5695681ejm.30.1690054251622; Sat, 22 Jul 2023 12:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690054251; cv=none; d=google.com; s=arc-20160816; b=E/xGdv5sk2fY0IoOxqarhHo5W9oQF91FFaJSyAXXPL+cEG/aorQfo1BU+inGWvDnv/ PDeUhSokaAlJ9h1UY+rXHlG5dmAlS+ynBEkSke9P05atCImO8jygwOVSr74mJCIz4ZQu 3O4++ixa0Ct2klpirF/LddUBywsg1SxYfph3ceLQYPaSSHOTRA0IK/SZH6g+eFsBR32m 2Iohty8V+eKJe1wS6Z5itCOPmSy+uDzf+IeAkiyWA/+tz2xj3gI8s02Q1kv8uS3U+XVQ MFdS9nw6u4cXxKIcYlg5Fif3TcTXs6HmXJ2kifntSIk/YeGO9hQkxnTr2AIvbbcl9OHV Q0Ug== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=GERlVh1oFLhWEbUzvOG4kysEydoXZq3h8TpBoXysaTc=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=DcqaOc13I6bAUerw3q2cw6el/ljaiNp5kMONyJsGd9IOwHJudQg1jeM5BcdcUCkLKV X3mlt+K4Z4wpG+AivAAIHkwnvAa3MUvVkI5MzbwPee3mq38Kr+LKXWxz//j2G+T7TubU RxCvkEB5/cldkgMqg0d2nKsn/j/eBUgHx23zgOrxxC6NBhVkmRhkxhB/hCuHtTS2qq9n LQ+OraGvcpxHx4ZBGZBdISNzAwtUls2FZnlp6UCYD16Bt4WxWZ7/Fx2pZXtvC29//Uz4 YWlnxY+EUIHfCJw+5sEy8QF7wXAuMD/HwAqodxAa2Sd6tPGBR6Hni9RAevxmRfqa9FVK KhDg== 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 n21-20020a170906119500b00992e21b04aasi4064666eja.720.2023.07.22.12.30.51; Sat, 22 Jul 2023 12:30:51 -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 090CE68C691; Sat, 22 Jul 2023 22:30:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86BA568C675 for ; Sat, 22 Jul 2023 22:30:05 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E2F26FF809 for ; Sat, 22 Jul 2023 19:30:04 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 21:29:57 +0200 Message-Id: <20230722192957.703-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230722192957.703-1-michael@niedermayer.cc> References: <20230722192957.703-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/6] tools/uncoded_frame: avradio 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: orNg+NRXcNyt This avoids keeping diffs to tools in the libavradio repository Signed-off-by: Michael Niedermayer --- tools/uncoded_frame.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c index edea2367c4..f856b02c77 100644 --- a/tools/uncoded_frame.c +++ b/tools/uncoded_frame.c @@ -1,8 +1,12 @@ #include #include #include +#include "config.h" #include "libavutil/avassert.h" #include "libavdevice/avdevice.h" +#if CONFIG_AVRADIO +#include "libavradio/avradio.h" +#endif #include "libavfilter/avfilter.h" #include "libavfilter/buffersink.h" #include "libavformat/avformat.h" @@ -64,6 +68,9 @@ int main(int argc, char **argv) nb_out_dev = argc - 2; avdevice_register_all(); +#if CONFIG_AVRADIO + avradio_register_all(); +#endif /* Create input graph */ if (!(in_graph = avfilter_graph_alloc())) {