pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/multimedia



Module Name:    pkgsrc
Committed By:   tnn
Date:           Sun Apr 24 10:57:28 UTC 2022

Modified Files:
        pkgsrc/multimedia: Makefile
Added Files:
        pkgsrc/multimedia/fxtv: DESCR Makefile PLIST distinfo
        pkgsrc/multimedia/fxtv/patches: patch-aa patch-ab patch-ac
            patch-actions_c patch-ad patch-ae patch-af patch-ag patch-ah
            patch-ai patch-aj patch-ak patch-al patch-am patch-an patch-annot_c
            patch-ao patch-ap patch-appear_dlg_c patch-aq patch-audiocnvt_c
            patch-audsav_dlg_c patch-ba patch-bb patch-bc patch-bd patch-be
            patch-bf patch-bg patch-ca patch-remotetrans_c patch-tvscreen_c
            patch-videolib_Makefile

Log Message:
revive fxtv, was told it can be used as a composite video viewer


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 pkgsrc/multimedia/Makefile
cvs rdiff -u -r0 -r1.3 pkgsrc/multimedia/fxtv/DESCR
cvs rdiff -u -r0 -r1.39 pkgsrc/multimedia/fxtv/Makefile
cvs rdiff -u -r0 -r1.5 pkgsrc/multimedia/fxtv/PLIST
cvs rdiff -u -r0 -r1.23 pkgsrc/multimedia/fxtv/distinfo
cvs rdiff -u -r0 -r1.13 pkgsrc/multimedia/fxtv/patches/patch-aa
cvs rdiff -u -r0 -r1.5 pkgsrc/multimedia/fxtv/patches/patch-ab \
    pkgsrc/multimedia/fxtv/patches/patch-ad \
    pkgsrc/multimedia/fxtv/patches/patch-ae \
    pkgsrc/multimedia/fxtv/patches/patch-af \
    pkgsrc/multimedia/fxtv/patches/patch-aj
cvs rdiff -u -r0 -r1.3 pkgsrc/multimedia/fxtv/patches/patch-ac \
    pkgsrc/multimedia/fxtv/patches/patch-actions_c \
    pkgsrc/multimedia/fxtv/patches/patch-annot_c \
    pkgsrc/multimedia/fxtv/patches/patch-appear_dlg_c \
    pkgsrc/multimedia/fxtv/patches/patch-audiocnvt_c \
    pkgsrc/multimedia/fxtv/patches/patch-audsav_dlg_c \
    pkgsrc/multimedia/fxtv/patches/patch-remotetrans_c \
    pkgsrc/multimedia/fxtv/patches/patch-tvscreen_c \
    pkgsrc/multimedia/fxtv/patches/patch-videolib_Makefile
cvs rdiff -u -r0 -r1.4 pkgsrc/multimedia/fxtv/patches/patch-ag \
    pkgsrc/multimedia/fxtv/patches/patch-ah \
    pkgsrc/multimedia/fxtv/patches/patch-ai \
    pkgsrc/multimedia/fxtv/patches/patch-ak \
    pkgsrc/multimedia/fxtv/patches/patch-al \
    pkgsrc/multimedia/fxtv/patches/patch-am \
    pkgsrc/multimedia/fxtv/patches/patch-an \
    pkgsrc/multimedia/fxtv/patches/patch-ao \
    pkgsrc/multimedia/fxtv/patches/patch-ap \
    pkgsrc/multimedia/fxtv/patches/patch-aq \
    pkgsrc/multimedia/fxtv/patches/patch-bb \
    pkgsrc/multimedia/fxtv/patches/patch-bc \
    pkgsrc/multimedia/fxtv/patches/patch-bd \
    pkgsrc/multimedia/fxtv/patches/patch-be \
    pkgsrc/multimedia/fxtv/patches/patch-bf \
    pkgsrc/multimedia/fxtv/patches/patch-bg \
    pkgsrc/multimedia/fxtv/patches/patch-ca
cvs rdiff -u -r0 -r1.6 pkgsrc/multimedia/fxtv/patches/patch-ba

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/multimedia/Makefile
diff -u pkgsrc/multimedia/Makefile:1.323 pkgsrc/multimedia/Makefile:1.324
--- pkgsrc/multimedia/Makefile:1.323    Sun Apr 24 08:33:04 2022
+++ pkgsrc/multimedia/Makefile  Sun Apr 24 10:57:28 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.323 2022/04/24 08:33:04 wiz Exp $
+# $NetBSD: Makefile,v 1.324 2022/04/24 10:57:28 tnn Exp $
 #
 
 COMMENT=       Multimedia utilities
@@ -40,6 +40,7 @@ SUBDIR+=      ffplay5
 SUBDIR+=       flashplayer
 SUBDIR+=       flvstreamer
 SUBDIR+=       frei0r
+SUBDIR+=       fxtv
 SUBDIR+=       gerbera
 SUBDIR+=       ggrab
 SUBDIR+=       gmencoder

Added files:

Index: pkgsrc/multimedia/fxtv/DESCR
diff -u /dev/null pkgsrc/multimedia/fxtv/DESCR:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/DESCR        Sun Apr 24 10:57:28 2022
@@ -0,0 +1,4 @@
+To use this application, you need a video capture/tuner card
+that's based on the Brooktree 848 capture chip, such as one of the
+Hauppauge Wincast/TV or Win/TV cards, the STV TV PCI card, or the
+Intel Smart Video Recorder III.

Index: pkgsrc/multimedia/fxtv/Makefile
diff -u /dev/null pkgsrc/multimedia/fxtv/Makefile:1.39
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/Makefile     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,43 @@
+# $NetBSD: Makefile,v 1.39 2022/04/24 10:57:28 tnn Exp $
+
+DISTNAME=      fxtv-1.03
+PKGREVISION=   23
+CATEGORIES=    multimedia
+MASTER_SITES=  ${HOMEPAGE:Q}
+EXTRACT_SUFX=  .tgz
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://people.freebsd.org/~rhh/fxtv/
+COMMENT=       TV display application for Brooktree 848 compatible TV cards
+
+USE_TOOLS+=    gmake
+
+INSTALLATION_DIRS=     ${PKGMANDIR}/man1
+
+SUBST_CLASSES+=                ossaudio
+SUBST_MESSAGE.ossaudio=        Fixing path to audio device.
+SUBST_STAGE.ossaudio=  pre-configure
+SUBST_FILES.ossaudio=  app_rsrc.h Fxtv README
+SUBST_SED.ossaudio=    -e 's|/dev/dsp|${DEVOSSAUDIO}|g'
+
+post-extract:
+       ${RM} -f ${WRKSRC}/videolib/videolib.o
+
+pre-configure:
+       set -e; if [ -r /usr/include/machine/mouse.h ] ; then \
+               ${ECHO} '#define HAVE_MOUSE_H 1' > ${WRKSRC}/netbsdconf.h; \
+       else \
+               ${ECHO} '#define HAVE_MOUSE_H 0' > ${WRKSRC}/netbsdconf.h; \
+       fi
+
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../x11/libXaw/buildlink3.mk"
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../x11/libXpm/buildlink3.mk"
+.include "../../x11/libXxf86dga/buildlink3.mk"
+.include "../../x11/libXxf86vm/buildlink3.mk"
+.include "../../x11/xorgproto/buildlink3.mk"
+.include "../../mk/oss.buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"

Index: pkgsrc/multimedia/fxtv/PLIST
diff -u /dev/null pkgsrc/multimedia/fxtv/PLIST:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/PLIST        Sun Apr 24 10:57:28 2022
@@ -0,0 +1,13 @@
+@comment $NetBSD: PLIST,v 1.5 2022/04/24 10:57:28 tnn Exp $
+bin/fxtv
+lib/X11/app-defaults/Fxtv
+lib/X11/fxtv/README
+lib/X11/fxtv/bitmaps/mini-camera.xpm
+lib/X11/fxtv/bitmaps/mini-down.xbm
+lib/X11/fxtv/bitmaps/mini-resize.xpm
+lib/X11/fxtv/bitmaps/mini-sound.xbm
+lib/X11/fxtv/bitmaps/mini-up.xbm
+lib/X11/fxtv/bitmaps/radio_off.xbm
+lib/X11/fxtv/bitmaps/radio_on.xbm
+lib/X11/fxtv/fxtv_cnvt.sh
+man/man1/fxtv.1

Index: pkgsrc/multimedia/fxtv/distinfo
diff -u /dev/null pkgsrc/multimedia/fxtv/distinfo:1.23
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/distinfo     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,38 @@
+$NetBSD: distinfo,v 1.23 2022/04/24 10:57:28 tnn Exp $
+
+BLAKE2s (fxtv-1.03.tgz) = 1800aa8e7a387ad88f6c902846096aceed7fed0957df191b9bd09c708e197e80
+SHA512 (fxtv-1.03.tgz) = 5aa0372227f7c8d5b7bdf4885fead20ce174fcd1102e77febcd5166ecc1a8123f15c9b23ca536b9486bd281ff1c872c96f32845a188d503564de9aebc0d26016
+Size (fxtv-1.03.tgz) = 198669 bytes
+SHA1 (patch-aa) = cddeabd154563b4ab84f004cd6dedf1665887227
+SHA1 (patch-ab) = 803ef888b8894617b4f3516fc6822784aba314ee
+SHA1 (patch-ac) = 27a825287c17d1cc957fb89ba2f665c01f998c15
+SHA1 (patch-actions_c) = 3b1c75de416c66a9f502d9096a31192363da4ac9
+SHA1 (patch-ad) = 1560755a8e504a80e89d66278517959e7bdea34d
+SHA1 (patch-ae) = 2a05aa4abb593a54aafb7122f76907c12c40e6a5
+SHA1 (patch-af) = 1ada82aa78cf357df1c697a64c4e4f20ebd36859
+SHA1 (patch-ag) = 6833a48904ac01f053d991de0fb96cb65aa33d52
+SHA1 (patch-ah) = eee3ac0314c45f392b3cc64c934d9191a9f172ba
+SHA1 (patch-ai) = 2ee8bdae28f8ad0a9a42c73c6a20a9433e65a2f3
+SHA1 (patch-aj) = fc4d08c6ddbd141227677e68377bb563b6eff2db
+SHA1 (patch-ak) = e57eacc2fe2a0c7e1ab56ae1867ed7275777b2a3
+SHA1 (patch-al) = 08dfc0ad859086ab758df349510fc27cc2c9b971
+SHA1 (patch-am) = 2166c83b8e5ef74c716fc22b70fa9b266968c30c
+SHA1 (patch-an) = 2b09f6e3e1ccd24a68e98881faa57d7b9ecc5e04
+SHA1 (patch-annot_c) = 9caaa139138a6a53edd294cb2a5d3ef47bec45f6
+SHA1 (patch-ao) = bf602e6ac5f4fd213cf135a466fd29a765573ef9
+SHA1 (patch-ap) = 16cfb290089e30e63fde8e5f3a9e6d51efa0a9f0
+SHA1 (patch-appear_dlg_c) = c55bb9882633454e147811381a6cc0e3f3932df4
+SHA1 (patch-aq) = e673486847f35b037870fba089b5d72eac5945f5
+SHA1 (patch-audiocnvt_c) = 1c2748c4d1499fb3083748df017935984d5c710e
+SHA1 (patch-audsav_dlg_c) = aebba653b89e06562e04381fec6c9fac5e122a0e
+SHA1 (patch-ba) = 11ebc91ce21a9132d116dffbefde58ef3f223e46
+SHA1 (patch-bb) = 861d7e52e7a1bbf3433b8b35dc0737e12ca2d82a
+SHA1 (patch-bc) = 97d02b5f725f15a9eb31aff9a93872315247da75
+SHA1 (patch-bd) = c11c09060d3f2b9512682078b035e93195e0e16e
+SHA1 (patch-be) = f93df2ce14cb83641d29031d541b5c822d5d1e63
+SHA1 (patch-bf) = a2c7b93ef9fb5eb28c2ac867d84d9b8e6f06dab8
+SHA1 (patch-bg) = 8078acbccbb34bb30251187f56cb2a28db579bf4
+SHA1 (patch-ca) = f80c76b57cd6b4be91a432d506141896d6630be5
+SHA1 (patch-remotetrans_c) = 87e8cc3ad428c082f89d76c018bcca76298d62cf
+SHA1 (patch-tvscreen_c) = 4e9d49674610e827a42ea02fc350698c435162cf
+SHA1 (patch-videolib_Makefile) = a15a33fb4e756d2b2ddfa2e72835b1ffcbcd8c60

Index: pkgsrc/multimedia/fxtv/patches/patch-aa
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-aa:1.13
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-aa     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,118 @@
+$NetBSD: patch-aa,v 1.13 2022/04/24 10:57:28 tnn Exp $
+
+Config for pkgsrc.
+
+--- Makefile.orig      2001-02-12 22:08:59.000000000 +0000
++++ Makefile
+@@ -4,13 +4,10 @@
+ 
+ HAVE_XFREE86 = YES
+ 
+-ifneq ($(X11PREFIX),)                      # NetBSD
+-X11BASE      ?= $(X11PREFIX)
+-else
+ X11BASE      ?= /usr/X11R6
+-endif
++X11BASEINST  ?= $(PREFIX)
+ 
+-X11BASEINST  ?= $(X11BASE)
++PREFIX       ?= /usr/local
+ LOCALBASE    ?= /usr/local
+ DEBUG        = NO
+ OS           = $(shell uname -s)
+@@ -24,15 +21,6 @@ override LIBDIRS           = $(X11BASE)/
+ override SHELL             = /bin/sh
+ 
+ #
+-# NetBSD stuff
+-#
+-ifeq ($(OS),NetBSD)
+-  override INC            += -I/usr/pkg/include
+-  override LIBDIRS        += /usr/pkg/lib
+-  override LD_INC         += -lossaudio -lz
+-endif
+-
+-#
+ # OpenBSD stuff
+ #
+ ifeq ($(OS),OpenBSD)
+@@ -50,19 +38,22 @@ endif
+ ifeq ($(OS),NetBSD)
+   override RPATH_FLAG      = -R
+ endif
++ifeq ($(OS),DragonFly)
++  override RPATH_FLAG      = -R
++endif
+ 
+-override LD_INC            = $(foreach dir,$(LIBDIRS),-Wl,-L,$(dir))
++override LD_INC            = $(foreach dir,$(LIBDIRS),-Wl,-L$(dir))
+ ifneq ($(RPATH_FLAG),)
+-  override LD_INC         += $(foreach dir,$(LIBDIRS),-Wl,$(RPATH_FLAG),$(dir))
++  override LD_INC         += $(foreach dir,$(LIBDIRS),-Wl,$(RPATH_FLAG)$(dir))
+ endif
+ 
+ #
+ # CFLAGS
+ #
+ ifneq ($(DEBUG),NO)
+-  override CFLAGS          = -DDEBUG -g
++  override CFLAGS          += -DDEBUG -g
+ else
+-  override CFLAGS          = -DNDEBUG -O2
++  override CFLAGS          += -DNDEBUG
+ endif
+ C_WARN_FLAG                = -Wall
+ override CFLAGS           += $(C_WARN_FLAG) $(INC) $(CF_VERS)
+@@ -72,6 +63,15 @@ endif
+ 
+ override CFLAGS           += $(C_WARN_FLAG) -DX11BASE=\"$(X11BASEINST)\"
+ 
++#
++# NetBSD stuff
++#
++ifeq ($(OS),NetBSD)
++  override INC            += -I$(LOCALBASE)/include
++  override LIBDIRS        += $(LOCALBASE)/lib
++  override LD_INC         += $(LIBOSSAUDIO) -lz
++endif
++
+ ifeq ($(OS), linux)
+ override CFLAGS            = $(CFLAGS) -DOLD_TUNER_IFACE
+ endif
+@@ -79,9 +79,9 @@ endif
+ #
+ # LDFLAGS,LIBS
+ #
+-override LDFLAGS           = $(LD_INC) 
++override LDFLAGS           += $(LD_INC) 
+ override VIDEOLIB_LIB      = $(VIDEOLIB_DIR)/libvideo.a
+-override LIBS              = -ltiff -ljpeg -lXaw3d -lXmu -lXt -lXpm \
++override LIBS              = -lpng -ltiff -ljpeg -lXaw -lXmu -lXt -lXpm \
+                              -lSM -lICE -lXext -lX11 -lm
+ ifeq ($(HAVE_XFREE86),YES)
+   override LIBS           += -lXxf86dga -lXxf86vm
+@@ -116,15 +116,15 @@ $(VIDEOLIB_LIB) :
+ tv.o : tv.c app_rsrc.h
+ 
+ install : fxtv
+-      mkdir -p $(FXTV_LIBDIR)/bitmaps
+-      install -c -m 444 -o root $(PIXMAPS) $(FXTV_LIBDIR)/bitmaps
+-      install -c -m 444 -o root README $(FXTV_LIBDIR)
+-      mkdir -p $(X11BASEINST)/lib/X11/app-defaults
+-      install -c -m 444 -o root Fxtv $(X11BASEINST)/lib/X11/app-defaults
+-      mkdir -p $(X11BASEINST)/bin
+-      install -c -m 444 -o root fxtv.1 $(X11BASEINST)/man/man1/fxtv.1
+-      install -c -m 555 -o root fxtv $(X11BASEINST)/bin
+-      install -c -m 555 -o root fxtv_cnvt.sh $(FXTV_LIBDIR)
++      mkdir -p ${DESTDIR}$(FXTV_LIBDIR)/bitmaps
++      ${BSD_INSTALL_DATA} $(PIXMAPS) ${DESTDIR}$(FXTV_LIBDIR)/bitmaps
++      ${BSD_INSTALL_DATA} README ${DESTDIR}$(FXTV_LIBDIR)
++      ${BSD_INSTALL_DATA_DIR} ${DESTDIR}$(X11BASEINST)/lib/X11/app-defaults
++      ${BSD_INSTALL_DATA} Fxtv ${DESTDIR}$(X11BASEINST)/lib/X11/app-defaults
++      ${BSD_INSTALL_PROGRAM_DIR} ${DESTDIR}$(X11BASEINST)/bin
++      ${BSD_INSTALL_MAN} fxtv.1 ${DESTDIR}$(X11BASEINST)/$(PKGMANDIR)/man1/fxtv.1
++      ${BSD_INSTALL_PROGRAM} fxtv ${DESTDIR}$(X11BASEINST)/bin
++      ${BSD_INSTALL_SCRIPT} fxtv_cnvt.sh ${DESTDIR}$(FXTV_LIBDIR)
+ 
+ clean:
+       rm -f *.o fxtv *.core *~

Index: pkgsrc/multimedia/fxtv/patches/patch-ab
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ab:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ab     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,25 @@
+$NetBSD: patch-ab,v 1.5 2022/04/24 10:57:28 tnn Exp $
+
+Needs sys/ioctl.h.
+Dragonfly support.
+
+--- pixelview_remote.c.orig    2000-05-21 15:10:09.000000000 +0000
++++ pixelview_remote.c
+@@ -32,6 +32,7 @@
+  *
+  */
+ 
++#include <sys/ioctl.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -39,6 +40,9 @@
+ #include <sys/fcntl.h>
+ #ifdef __NetBSD__
+ # include <dev/ic/bt8xx.h>
++#elif defined(__DragonFly__)
++# include <dev/video/meteor/ioctl_meteor.h>
++# include <dev/video/bktr/ioctl_bt848.h>
+ #else
+ # include <machine/ioctl_meteor.h>
+ # include <machine/ioctl_bt848.h>
Index: pkgsrc/multimedia/fxtv/patches/patch-ad
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ad:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ad     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,256 @@
+$NetBSD: patch-ad,v 1.5 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Handle png.
+Fix illegal C.
+
+--- app_rsrc.h.orig    2001-02-12 22:17:53.000000000 +0100
++++ app_rsrc.h
+@@ -80,6 +80,8 @@ typedef struct _AppResources {
+     int      Bpp_24bit;
+     int      Bpp_32bit;
+ 
++    Boolean  aot_mode;
++
+     Boolean  afc_mode;
+     Boolean  disable_direct_v;
+     String   remote_type;             /*  Type of Remote Control attached  */
+@@ -191,6 +193,8 @@ extern AppResources     App_res;
+ 
+ #define RNafc               "afc"
+ #define RCafc               "Afc"
++#define RNalwaysOnTop       "alwaysOnTop"
++#define RCalwaysOnTop       "AlwaysOnTop"
+ 
+ #define RNdisableDirectV    "disableDirectV"
+ #define RCdisableDirectV    "DisableDirectV"
+@@ -284,6 +288,7 @@ static XrmOptionDescRec Cmd_line_options
+    { "-Bpp24bit"           , RNBpp24bit       , XrmoptionSepArg, NULL        },
+    { "-Bpp32bit"           , RNBpp32bit       , XrmoptionSepArg, NULL        },
+                                                                              
++   { "-noalwaysOnTop"      , RNalwaysOnTop    , XrmoptionNoArg , pFALSE      },
+    { "-noafc"              , RNafc            , XrmoptionNoArg , pFALSE      },
+    { "-disableDirectV"     , RNdisableDirectV , XrmoptionNoArg , pTRUE       },
+    { "-remoteType"         , RNremoteType     , XrmoptionSepArg, NULL        },
+@@ -434,6 +439,10 @@ static XtResource Resources[] = {
+         XtOffsetOf(AppResources, Bpp_32bit), XtRString,
+         "-1" /*  0 = Guess */ },   
+ 
++    { RNalwaysOnTop, RCalwaysOnTop, XtRBoolean, sizeof(Boolean),
++        XtOffsetOf(AppResources, aot_mode), XtRImmediate,
++        (XtPointer) True },
++
+     { RNafc, RCafc, XtRBoolean, sizeof(Boolean),
+         XtOffsetOf(AppResources, afc_mode), XtRImmediate,
+         (XtPointer) True },
+@@ -525,96 +534,96 @@ static XtResource Resources[] = {
+ };
+ 
+ 
+-#define OPTION_HELP_STR "\
+-                      BSD X TV (fxtv), Version " VERS_STR ".  
+-                         Written by Randall Hopper
+-
+-Please mail Fxtv and Bt848 driver-related comments and help requests to the
+-multimedia%freebsd.org@localhost list.  Feel free to subscribe and contribute 
+-(listserv: majordomo%freebsd.org@localhost).
+-
+-Available options:
+-
+--driverDefaults             - Use appearance parms from driver on startup
+--colorbars                  - Turn on colorbar display (for testing)
+--hue [-90...90]             - Initial Hue           ; def=0
+--brightness [-50..50]       - Initial Brightness (%); def=0
+--contrast [0..200]          - Initial Contrast   (%); def=100
+--satU [0..200]              - U Saturation       (%); def=100
+--satV [0..284]              - V Saturation       (%); def=100
+--aspectlock                 - Enable 4:3 aspect lock on video window
+-
+--deviceNumber <#>           - bktr/tuner device numbers; def=0      
+--inputFormat <fmt>          - Tuner signal input format (ntsc,ntscm,ntscj,
+-                                 palbdghi,pal,palm,paln,secam,palncomb,rsvd)
+-
+--tunerMode [cable|antenna]  - Tuner Mode
+--defaultInput <input>       - Startup tuner signal input 
+-                                 [tuner|video|svideo|csvideo|dev3]
+--defaultAudioInput <input>  - Startup TV card audio input 
+-                                 [tuner|external|internal|auto]
+--defaultChannel <#>         - Startup Channel Number
+--cableStationList   <...>   - List of cable station presets (see rsrc file)
+--antennaStationList <...>   - List of antenna station presets
+--cableFreqSet   <freqset>   - Freq set for cable   (def = cableirc)
+-                              [nabcst|cableirc|cablehrc|weurope|jpnbcst|
+-                               jpncable|xussr|australia|france]
+--antennaFreqSet <freqset>   - Freq set for antenna (def = nabcst)
+-
+--noAudio                    - Suppress playing audio through soundcard
+--dspDevice                  - Override default DSP device   (def=/dev/dsp)
+--mixerDevice                - Override default mixer device (def=/dev/mixer)
+--mixerChannel               - Audio mixer (line,line1/2/3,cd,mic,video)
+-
+--stationInWinTitle          - Display station text in window title
+--stationInWinIcon           - Display station text in window icon
+-
+--stationAnnotFont <fontpat> - Font pattern for station annot (see rsrc file)
+--stationAnnotColor <color>  - Color for station annot
+--stationAnnotDelay <msec>   - How long to display (0 = never; -1 = always)
+--stationAnnotIDOnly         - Display station ID alone (when available)
+-
+--tunerModeAnnot{Font,Color,Delay}
+--inputDevAnnot{Font,Color,Delay}
+--volumeDevAnnot{Font,Color,Delay}
+--muteDevAnnot{Font,Color,Delay}
+-                            - Other annotation options (see stationAnnot)
+-
+--remoteType                 - Type of attached remote control 
+-                              [None|X10|Hauppauge|PixelView]
+-
+--recCmdMpeg2                - MPEG-2 Audio record command 
+--recCmdMpeg3                - MPEG-3 Audio record command
+--playCmdMpeg2               - MPEG-2 Audio play   command
+--playCmdMpeg3               - MPEG-3 Audio play   command
+-
+--videoCnvtScript            - Video conversion workhorse script for vid encod.
+-
+--bswap2Bpp                  - Byte/word swap options for direct video
+--nobswap2Bpp                  (used to match driver's pixel format with
+--bswap3Bpp                    the video card's)
+--nobswap3Bpp
+--bswap4Bpp                        2Bpp - 15/16-bpp modes
+--nobswap4Bpp                      3Bpp - packed 24bpp modes
+--bwwap4Bpp                        4Bpp - unpacked 24bpp modes
+--nowswap4Bpp
+-
+--Bpp24bit [3|4]             - Set frame buffer Bytes-per-pixel for 24bpp mode
+--Bpp32bit [3|4]             - Set frame buffer Bytes-per-pixel for 32bpp mode
+-
+--videoCapFile[1-4]          - Optional paths (0-4) to scratch file paths to 
+-                              use for video capture; spreads load across disks
+-
+--noafc                      - Disable AFC
+--disableDirectV             - Disable DMA transfers straight to video card
+--debug <area>               - Debug Msgs 
+-                              {startup,driver,subproc,events,video,frame}
+--help                       - Display program options
+-
+-NOTE:  All command line options are accessible as X resources as well.
+-       The X resources have the same names as the command-line options.
+-       See the sample Fxtv class resource file for details.
+-"
++#define OPTION_HELP_STR \
++"                      BSD X TV (fxtv), Version " VERS_STR ".\n" \
++"                         Written by Randall Hopper\n" \
++"\n" \
++"Please mail Fxtv and Bt848 driver-related comments and help requests to the\n" \
++"multimedia%freebsd.org@localhost list.  Feel free to subscribe and contribute\n" \
++"(listserv: majordomo%freebsd.org@localhost).\n" \
++"\n" \
++"Available options:\n" \
++"\n" \
++"-driverDefaults             - Use appearance parms from driver on startup\n" \
++"-colorbars                  - Turn on colorbar display (for testing)\n" \
++"-hue [-90...90]             - Initial Hue           ; def=0\n" \
++"-brightness [-50..50]       - Initial Brightness (%); def=0\n" \
++"-contrast [0..200]          - Initial Contrast   (%); def=100\n" \
++"-satU [0..200]              - U Saturation       (%); def=100\n" \
++"-satV [0..284]              - V Saturation       (%); def=100\n" \
++"-aspectlock                 - Enable 4:3 aspect lock on video window\n" \
++"-noalwaysOnTop              - Disable always on top\n" \
++"\n" \
++"-deviceNumber <#>           - bktr/tuner device numbers; def=0\n" \
++"-inputFormat <fmt>          - Tuner signal input format (ntsc,ntscm,ntscj,\n" \
++"                                 palbdghi,pal,palm,paln,secam,palncomb,rsvd)\n" \
++"\n" \
++"-tunerMode [cable|antenna]  - Tuner Mode\n" \
++"-defaultInput <input>       - Startup tuner signal input\n" \
++"                                 [tuner|video|svideo|csvideo|dev3]\n" \
++"-defaultAudioInput <input>  - Startup TV card audio input\n" \
++"                                 [tuner|external|internal|auto]\n" \
++"-defaultChannel <#>         - Startup Channel Number\n" \
++"-cableStationList   <...>   - List of cable station presets (see rsrc file)\n" \
++"-antennaStationList <...>   - List of antenna station presets\n" \
++"-cableFreqSet   <freqset>   - Freq set for cable   (def = cableirc)\n" \
++"                              [nabcst|cableirc|cablehrc|weurope|jpnbcst|\n" \
++"                               jpncable|xussr|australia|france]\n" \
++"-antennaFreqSet <freqset>   - Freq set for antenna (def = nabcst)\n" \
++"\n" \
++"-noAudio                    - Suppress playing audio through soundcard\n" \
++"-dspDevice                  - Override default DSP device   (def=/dev/audio)\n" \
++"-mixerDevice                - Override default mixer device (def=/dev/mixer)\n" \
++"-mixerChannel               - Audio mixer (line,line1/2/3,cd,mic,video)\n" \
++"\n" \
++"-stationInWinTitle          - Display station text in window title\n" \
++"-stationInWinIcon           - Display station text in window icon\n" \
++"\n" \
++"-stationAnnotFont <fontpat> - Font pattern for station annot (see rsrc file)\n" \
++"-stationAnnotColor <color>  - Color for station annot\n" \
++"-stationAnnotDelay <msec>   - How long to display (0 = never; -1 = always)\n" \
++"-stationAnnotIDOnly         - Display station ID alone (when available)\n" \
++"\n" \
++"-tunerModeAnnot{Font,Color,Delay}\n" \
++"-inputDevAnnot{Font,Color,Delay}\n" \
++"-volumeDevAnnot{Font,Color,Delay}\n" \
++"-muteDevAnnot{Font,Color,Delay}\n" \
++"                            - Other annotation options (see stationAnnot)\n" \
++"\n" \
++"-remoteType                 - Type of attached remote control\n" \
++"                              [None|X10|Hauppauge|PixelView]\n" \
++"\n" \
++"-recCmdMpeg2                - MPEG-2 Audio record command\n" \
++"-recCmdMpeg3                - MPEG-3 Audio record command\n" \
++"-playCmdMpeg2               - MPEG-2 Audio play   command\n" \
++"-playCmdMpeg3               - MPEG-3 Audio play   command\n" \
++"\n" \
++"-videoCnvtScript            - Video conversion workhorse script for vid encod.\n" \
++"\n" \
++"-bswap2Bpp                  - Byte/word swap options for direct video\n" \
++"-nobswap2Bpp                  (used to match driver's pixel format with\n" \
++"-bswap3Bpp                    the video card's)\n" \
++"-nobswap3Bpp\n" \
++"-bswap4Bpp                        2Bpp - 15/16-bpp modes\n" \
++"-nobswap4Bpp                      3Bpp - packed 24bpp modes\n" \
++"-bwwap4Bpp                        4Bpp - unpacked 24bpp modes\n" \
++"-nowswap4Bpp\n" \
++"\n" \
++"-Bpp24bit [3|4]             - Set frame buffer Bytes-per-pixel for 24bpp mode\n" \
++"-Bpp32bit [3|4]             - Set frame buffer Bytes-per-pixel for 32bpp mode\n" \
++"\n" \
++"-videoCapFile[1-4]          - Optional paths (0-4) to scratch file paths to\n" \
++"                              use for video capture; spreads load across disks\n" \
++"\n" \
++"-noafc                      - Disable AFC\n" \
++"-disableDirectV             - Disable DMA transfers straight to video card\n" \
++"-debug <area>               - Debug Msgs\n" \
++"                              {startup,driver,subproc,events,video,frame}\n" \
++"-help                       - Display program options\n" \
++"\n" \
++"NOTE:  All command line options are accessible as X resources as well.\n" \
++"       The X resources have the same names as the command-line options.\n" \
++"       See the sample Fxtv class resource file for details.\n"
+ 
+ static String fallback_resources[] = { 
+  /*"Fxtv.geometry: +10+10",*/
+@@ -681,6 +690,7 @@ static String fallback_resources[] = { 
+    "*menuBox*optionsMenu*captureToCmd.label:  Capture To...",
+    "*menuBox*optionsMenu*saveOptionsCmd.label:Save Options",
+    "*menuBox*optionsMenu*setAfcCmd.label:     AFC",
++   "*menuBox*optionsMenu*setAotCmd.label:     Always on top",
+ 
+    "*menuBox*helpMenu.label:                  Help",
+    "*menuBox*helpMenu.menu.label:             Help",
+@@ -789,6 +799,7 @@ static String fallback_resources[] = { 
+    "*imageSaveDialog*suffixLabel.label:            Append Img # Suffix",
+    "*imageSaveDialog*formatLabel.label:            Format:",
+    "*imageSaveDialog*formatMenuBox*tiffCmd.label:  TIFF",
++   "*imageSaveDialog*formatMenuBox*pngCmd.label:   PNG",
+    "*imageSaveDialog*formatMenuBox*ppmCmd.label:   PPM",
+    "*imageSaveDialog*okCmd.label:                  OK",
+ 
+@@ -902,6 +913,7 @@ static String fallback_resources[] = { 
+    "*videoSaveDialog*imageEncLabel.label:           IMAGE ENCODE",
+    "*videoSaveDialog*iFileFmtLabel.label:           Format:",
+    "*videoSaveDialog*iFileFmtMenuBox*tiffCmd.label: TIFF",
++   "*videoSaveDialog*iFileFmtMenuBox*pngCmd.label:  PNG",
+    "*videoSaveDialog*iFileFmtMenuBox*ppmCmd.label:  PPM",
+    "*videoSaveDialog*iFileFmtMenuBox*yuvCmd.label:  YUV",
+ 
Index: pkgsrc/multimedia/fxtv/patches/patch-ae
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ae:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ae     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,167 @@
+$NetBSD: patch-ae,v 1.5 2022/04/24 10:57:28 tnn Exp $
+
+Support png screenshots.
+Fix LP64 problems.
+
+--- imgsav.c.orig      1999-09-26 14:35:06.000000000 +0000
++++ imgsav.c
+@@ -29,6 +29,8 @@
+ 
+ /*      ******************** Include Files                ************** */
+ 
++#include <png.h>
++#include <zlib.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -137,7 +139,7 @@ static void TVIMGSAVFmtScanline24bpp( 
+                      break;
+             default:
+                 fprintf( stderr, 
+-                         "TVIMGSAVFmtScanline24bpp: Unsupported Bpp %ld\n",
++                         "TVIMGSAVFmtScanline24bpp: Unsupported Bpp %d\n",
+                          img->pix_geom.Bpp );
+                 exit(1);
+         }
+@@ -146,7 +148,7 @@ static void TVIMGSAVFmtScanline24bpp( 
+         if (( !img->pix_geom.swap_shorts ) &&
+             ( img->pix_geom.Bpp == 4 ))
+             pix = (pix >> 16) | (pix << 16);
+-        if ( !img->pix_geom.swap_bytes ) 
++        if ( !img->pix_geom.swap_bytes ) {
+             if ( img->pix_geom.Bpp == 3 )
+                 pix = ((pix & 0x00FF0000) >> 16) |
+                       ((pix & 0x000000FF) << 16);
+@@ -155,6 +157,7 @@ static void TVIMGSAVFmtScanline24bpp( 
+                       ((pix & 0x00FF0000) << 8) |
+                       ((pix & 0x0000FF00) >> 8) |
+                       ((pix & 0x000000FF) << 8);
++      }
+ 
+         pix       = SHIFT_AND_MASK( pix, shf[0], msk[0] ) |
+                     SHIFT_AND_MASK( pix, shf[1], msk[1] ) |
+@@ -216,7 +219,7 @@ void TVIMGSAVDoSaveTIFF( char filename[]
+ #endif
+ 
+     if ( TIFFScanlineSize(out) != linebytes ) {
+-        fprintf( stderr, "Linebytes mismatch: TIFF says %ld, we say %ld\n",
++        fprintf( stderr, "Linebytes mismatch: TIFF says %d, we say %d\n",
+                  TIFFScanlineSize(out), linebytes );
+         exit(1);
+     }
+@@ -254,6 +257,96 @@ void TVIMGSAVDoSaveTIFF( char filename[]
+ }
+ 
+ 
++void TVIMGSAVDoSavePNG( char filename[], TV_IMAGE *img )
++{
++    char       errmsg[160];
++    png_structp png_ptr;
++    png_infop  info_ptr;
++    FILE      *out;
++    TV_INT32   linebytes,
++               y,
++               pass,
++               compon;
++    TV_UINT8  *buf;
++
++    buf = NULL;
++    if ( img->pix_geom.type != TV_PIXELTYPE_RGB ) {
++        fprintf( stderr, "Attempt to save non-RGB data as TIFF\n" );
++        exit(1);
++    }
++
++    /*  Open output file  */
++    if ( (out = fopen( filename, "wb" )) == NULL ) {
++        sprintf( errmsg, "Can't open output file '%s'", filename );
++        XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK );
++        return;
++    }
++
++    /*  Create PNG data structures and initialize  */
++    png_ptr = png_create_write_struct
++      (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
++    if (!png_ptr) {
++        sprintf( errmsg, "Can't create PNG write structure" );
++        XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK );
++      return;
++    }
++    info_ptr = png_create_info_struct(png_ptr);
++    if (!info_ptr) {
++      png_destroy_write_struct(&png_ptr, NULL);
++        sprintf( errmsg, "Can't create PNG info structure" );
++        XUTILDialogPause( TVTOPLEVEL, "Error", errmsg, TV_DIALOG_TYPE_OK );
++      return;
++    }
++
++    if (setjmp(png_jmpbuf(png_ptr))) {
++      fprintf( stderr, "PNG write error\n" );
++      XBell( TVDISPLAY, 100 );
++      png_destroy_write_struct( &png_ptr, &info_ptr );
++      free( buf );
++      fclose( out );
++      unlink( filename );
++      return;
++    }
++    png_init_io(png_ptr, out);
++    /*  fast compression  */
++    png_set_compression_level(png_ptr, Z_BEST_SPEED);
++
++    /*  Setup image format info (chunks)  */
++    png_set_IHDR(png_ptr, info_ptr, img->geom.w, img->geom.h,
++               TV_BITS_PER_COMP, PNG_COLOR_TYPE_RGB /* XXX: ? */,
++               PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
++               PNG_FILTER_TYPE_DEFAULT);
++    /*  and write it  */
++    png_write_info(png_ptr, info_ptr);
++    /*  flush image out every 50 rows */
++    png_set_flush(png_ptr, 50);
++
++    linebytes = img->geom.w * TV_BYTES_PER_PIX;
++
++    if ( (buf = malloc( linebytes )) == NULL )
++        TVUTILOutOfMemory();
++
++    /*  Convert & write the image data  */
++    for ( pass = 0; pass < 1; pass++ ) {
++        compon = DoRed | DoGreen | DoBlue;
++        for ( y = 0; y < img->geom.h; y++ ) {
++
++            /*  Format scanline  */
++            TVIMGSAVFmtScanline24bpp( img, y, compon, buf );
++
++            /*  And write it in PNG  */
++          png_write_row(png_ptr, buf);
++        }
++    }
++
++    /*  All done.  Close up shop and go home  */
++    png_write_end(png_ptr, NULL);
++    png_destroy_write_struct(&png_ptr, &info_ptr);
++    fclose(out);
++    free( buf );
++}
++
++
+ void TVIMGSAVDoSavePPM( char filename[], TV_IMAGE *img )
+ {
+     static char     *S_fp_buf   = NULL;
+@@ -288,7 +381,7 @@ void TVIMGSAVDoSavePPM( char filename[],
+         out = stdout;
+ 
+     /*  Write binary PPM header  */
+-    fprintf( out, "P6\n%ld %ld\n%d\n", img->geom.w, img->geom.h, 
++    fprintf( out, "P6\n%d %d\n%d\n", img->geom.w, img->geom.h, 
+                                      (1 << TV_BITS_PER_COMP) - 1 );
+ 
+     linebytes = img->geom.w * TV_BYTES_PER_PIX;
+@@ -408,6 +501,9 @@ void TVIMGSAVDoSave( char filename[], TV
+             }
+             TVIMGSAVDoSaveTIFF( filename, img );  break;
+ 
++        case TV_STILL_FMT_PNG :
++            TVIMGSAVDoSavePNG ( filename, img );  break;
++
+         case TV_STILL_FMT_PPM :
+             TVIMGSAVDoSavePPM ( filename, img );  break;
+ 
Index: pkgsrc/multimedia/fxtv/patches/patch-af
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-af:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-af     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,85 @@
+$NetBSD: patch-af,v 1.5 2022/04/24 10:57:28 tnn Exp $
+
+Dragonfly support.
+Use correct sysctl mibs on NetBSD.
+Fix LP64 problems.
+Fix illegal C.
+
+--- tvutil.c.orig      2000-10-23 02:43:46.000000000 +0000
++++ tvutil.c
+@@ -35,7 +35,7 @@
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <sys/types.h>
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ #  include <sys/sysctl.h>
+ #elif defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #  include <sys/param.h>
+@@ -105,14 +105,14 @@ void CleanupChildFileDesc()
+ {
+     static int Max_files_per_proc = -1;
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+     int    mib[2] = { CTL_KERN, KERN_MAXFILESPERPROC };
+ #elif defined(linux)
+     int    mib[2] = { CTL_KERN, FOPEN_MAX };
+ #elif defined(__bsdi__)
+     int    mib[2] = { CTL_KERN, KERN_MAXFILES };
+ #elif defined(__NetBSD__)
+-    int    mib[2] = { CTL_KERN, OPEN_MAX };
++    int    mib[2] = { CTL_KERN, KERN_MAXFILES };
+ #elif defined(__OpenBSD__)
+     int    mib[2] = { CTL_KERN, OPEN_MAX };
+ #endif
+@@ -184,14 +184,14 @@ void TVUTILCmdStrToArgList(
+     *argbuf = NULL;
+ 
+     while ( *s != '\0' ) {                      /*  For all args    */
+-        while ( isspace( *s ) )                 /*    Skip spaces   */
++        while ( isspace( (unsigned char)*s ) )                 /*    Skip spaces   */
+             s++;
+         if ( *s == '\0' )
+             continue;
+ 
+         in_quote = FALSE;                       /*    Extract an arg  */
+         p        = arg;
+-        while ( (in_quote || !isspace(*s)) && (*s != '\0') ) {
++        while ( (in_quote || !isspace((unsigned char)*s)) && (*s != '\0') ) {
+             ignore = FALSE;
+ 
+             if (( *s == '\'' ) || ( *s == '\"' ))
+@@ -450,7 +450,7 @@ void TVUTILPipeCleanup( pid_t           
+          (( end[2].fd >= 0 ) && end[2].is_pipe &&
+           ( close( end[2].fd ) < 0 )) ||
+ 
+-         ( waitpid( child_pid, &status, NULL ) < 0 )  ||
++         ( waitpid( child_pid, &status, 0 ) < 0 )  ||
+ 
+          (( end[0].fd >= 0 ) && end[1].is_pipe &&
+           ((  dup2( end[0].fd_saved, end[0].fd ) < 0 )   ||
+@@ -475,15 +475,19 @@ void TVUTILPipeCleanup( pid_t           
+ /*  TVUTILstrupr - Convert a string to upper case  */
+ void TVUTILstrupr( char *str )
+ {
+-    while ( *str != '\0' )
+-        *(str++) = toupper( *str );
++    while ( *str != '\0' ) {
++        *str = toupper( (unsigned char)*str );
++      str++;
++    }
+ }
+ 
+ /*  TVUTILstrlwr - Convert a string to lower case  */
+ void TVUTILstrlwr( char *str )
+ {
+-    while ( *str != '\0' )
+-        *(str++) = tolower( *str );
++    while ( *str != '\0' ) {
++        *str = tolower( (unsigned char)*str );
++      str++;
++    }
+ }
+ 
+ /*  TVUTILStrStrip - Strip selected characters out of a string  */
Index: pkgsrc/multimedia/fxtv/patches/patch-aj
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-aj:1.5
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-aj     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,32 @@
+$NetBSD: patch-aj,v 1.5 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Handle png.
+
+--- Fxtv.orig  2003-09-28 17:38:29.000000000 +0200
++++ Fxtv       2003-09-28 17:38:29.000000000 +0200
+@@ -11,6 +11,8 @@
+                                         ! tuner, video, svideo, csvideo, dev3
+ !Fxtv*defaultAudioInput: tuner           
+                                         ! tuner, external, internal, auto
++Fxtv*alwaysOnTop:     True
++                                        ! Always On Top
+ Fxtv*afc:                     False
+                                         ! Automatic Frequency Control
+ !Fxtv*remoteType:     Hauppauge
+@@ -320,6 +322,7 @@
+ *imageSaveDialog*suffixLabel.label:            Append Img # Suffix
+ *imageSaveDialog*formatLabel.label:            Format:
+ *imageSaveDialog*formatMenuBox*tiffCmd.label:  TIFF
++*imageSaveDialog*formatMenuBox*pngCmd.label:   PNG
+ *imageSaveDialog*formatMenuBox*ppmCmd.label:   PPM
+ *imageSaveDialog*okCmd.label:                  OK
+ 
+@@ -432,6 +435,7 @@
+ *videoSaveDialog*imageEncLabel.label:           IMAGE ENCODE
+ *videoSaveDialog*iFileFmtLabel.label:           Format:
+ *videoSaveDialog*iFileFmtMenuBox*tiffCmd.label: TIFF
++*videoSaveDialog*iFileFmtMenuBox*pngCmd.label:  PNG
+ *videoSaveDialog*iFileFmtMenuBox*ppmCmd.label:  PPM
+ *videoSaveDialog*iFileFmtMenuBox*yuvCmd.label:  YUV
+ 

Index: pkgsrc/multimedia/fxtv/patches/patch-ac
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ac:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ac     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-ac,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+--- tvaudio.c.orig     Mon Feb 12 15:56:29 2001
++++ tvaudio.c
+@@ -107,7 +107,11 @@
+ #ifdef SOUND_MIXER_VIDEO
+     else if ( STREQ( buf, "VIDEO" ) ) {
+        Mixer_dev_id   = SOUND_MIXER_VIDEO;
++#ifndef SOUND_MASK_VIDEO
++       Mixer_dev_mask = 1 << SOUND_MIXER_VIDEO;
++#else
+        Mixer_dev_mask = SOUND_MASK_VIDEO;
++#endif
+        Mixer_dev_name = "VIDEO";
+     }
+ #endif
Index: pkgsrc/multimedia/fxtv/patches/patch-actions_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-actions_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-actions_c      Sun Apr 24 10:57:28 2022
@@ -0,0 +1,127 @@
+$NetBSD: patch-actions_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+Fix illegal C.
+
+--- actions.c~ 2001-02-12 19:26:23.000000000 +0000
++++ actions.c
+@@ -238,7 +238,7 @@ static void TVACTIONKeyStationEntryHdlr(
+         S_chan_entry_active = TRUE;
+         S_entry_freq   = do_freq;
+         if ( isa_digit )
+-            sprintf( S_chan_str, "%ld", digit );
++            sprintf( S_chan_str, "%d", digit );
+         else if ( do_freq )
+             strcpy( S_chan_str, "f" );
+         else 
+@@ -549,7 +549,7 @@ static void TVActionSetStationAction(
+ 
+         /*  Are we incrementally changing the channel or frequency?  */
+         if (( str[0] == '+' ) || ( str[0] == '-' )) {
+-            if ( toupper( str[1] ) == 'F' )
++            if ( toupper( (unsigned char)str[1] ) == 'F' )
+                 freq_inc = ( str[0] == '-' ? -1 : +1 );
+             else {
+                 chan_inc = atoi( str );
+@@ -609,7 +609,7 @@ static void TVActionSetStationAction(
+             if (( sscanf( str, "f%f", &chan_freq ) == 1 ) ||
+                 ( sscanf( str, "F%f", &chan_freq ) == 1 )) 
+                 chan_num  = -1;
+-            else if (( sscanf( str, "%ld", &chan_num ) == 1 ) &&
++            else if (( sscanf( str, "%d", &chan_num ) == 1 ) &&
+                      ( chan_num >= TV_CHAN_MIN ))
+                 chan_freq = 0.0;
+             else {
+@@ -729,8 +729,10 @@ static void TVActionToggleZoomAction(
+ 
+         arg[0] = '\0';
+         strncat( arg, params[0], sizeof(arg)-1 );
+-        while ( *p != '\0' )
+-            *(p++) = tolower( *p );
++        while ( *p != '\0' ) {
++            *p = tolower( (unsigned char)*p );
++          p++;
++      }
+         if ( strncmp( arg, "win", strlen("win") ) == 0 )
+             fullscreen = False;
+         else if ( strncmp( arg, "full", strlen("full") ) == 0 )
+@@ -925,8 +927,10 @@ static void TVActionSetCaptureInputActio
+ 
+             arg[0] = '\0';
+             strncat( arg, str, sizeof(arg)-1 );
+-            while ( *p != '\0' )
+-                *(p++) = tolower( *p );
++            while ( *p != '\0' ) {
++                *p = tolower( (unsigned char)*p );
++              p++;
++          }
+ 
+             if ( strncmp( str, "tuner", strlen("tuner") ) == 0 )
+                 dev = TV_DEVICE_TUNER;
+@@ -1032,8 +1036,10 @@ static void TVActionSetTunerModeAction(
+ 
+             arg[0] = '\0';
+             strncat( arg, str, sizeof(arg)-1 );
+-            while ( *p != '\0' )
+-                *(p++) = tolower( *p );
++            while ( *p != '\0' ) {
++                *p = tolower( (unsigned char)*p );
++              p++;
++          }
+ 
+             if ( strncmp( str, "ant", strlen("ant") ) == 0 )
+                 mode = TV_TUNER_MODE_ANTENNA;
+@@ -1151,7 +1157,7 @@ static void TVActionSaveImageAction(
+         else
+             len = p - dsk->fn_freeze_base;
+ 
+-        sprintf( fname, "%.*s%.3ld%s", (int)len, dsk->fn_freeze_base, 
++        sprintf( fname, "%.*s%.3d%s", (int)len, dsk->fn_freeze_base, 
+                         dsk->freeze_next_suffix, (p ? p : "") );
+     }
+     else
+@@ -1306,7 +1312,7 @@ static void TVActionVideoRecordStartActi
+     }
+ 
+     if (( *num_params == 1 ) && params[0] ) {
+-        if (( sscanf( params[0], "%ldx%ld", &w, &h ) != 2 ) ||
++        if (( sscanf( params[0], "%dx%d", &w, &h ) != 2 ) ||
+             ( w <= 0 ) || ( h <= 0 )) {
+             fprintf( stderr, 
+                 "TVActionVideoRecordStartAction:  Bad resolution.\n" );
+@@ -1426,7 +1432,7 @@ void TVActionSetVolume( TV_INT32 vol )
+     String   param[1] = { str };
+     Cardinal num_param = 1;
+ 
+-    sprintf( str, "%ld", vol );
++    sprintf( str, "%d", vol );
+     TVActionSetVolumeAction( NULL, NULL, param, &num_param );
+ }
+ 
+@@ -1436,7 +1442,7 @@ void TVActionSetVolumeRel( TV_INT32 vol_
+     String   param[1] = { str };
+     Cardinal num_param = 1;
+ 
+-    sprintf( str, "%+ld", vol_delta );
++    sprintf( str, "%+d", vol_delta );
+     TVActionSetVolumeAction( NULL, NULL, param, &num_param );
+ }
+ 
+@@ -1467,7 +1473,7 @@ void TVActionSetCaptureInputRel( TV_INT3
+     String   param[1] = { str };
+     Cardinal num_param = 1;
+ 
+-    sprintf( str, "%+ld", dev_delta );
++    sprintf( str, "%+d", dev_delta );
+     TVActionSetCaptureInputAction( NULL, NULL, param, &num_param );
+ }
+ 
+@@ -1528,7 +1534,7 @@ static void TVActionFlipStationAction(
+     }
+ 
+     if ( p->last_chan >= TV_CHAN_MIN )
+-      sprintf( chan_str, "%ld" , p->last_chan );
++      sprintf( chan_str, "%d" , p->last_chan );
+     else
+       sprintf( chan_str, "f%f", p->last_freq );
+     TVActionSetStation( chan_str );
Index: pkgsrc/multimedia/fxtv/patches/patch-annot_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-annot_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-annot_c        Sun Apr 24 10:57:28 2022
@@ -0,0 +1,33 @@
+$NetBSD: patch-annot_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+
+--- annot.c~   1999-09-05 18:42:16.000000000 +0000
++++ annot.c
+@@ -57,7 +57,7 @@
+ 
+ #define AUTOMODE_TIMER_MS 8
+ 
+-#define VOLUME_FMT "Volume: %ld%%"
++#define VOLUME_FMT "Volume: %d%%"
+ #define MUTE_STR   "MUTE"
+ 
+ /*#define FNPRINTF(x) printf x*/
+@@ -444,7 +444,7 @@ static void TVANNOTVolumePropSetDrawable
+     }
+ 
+     /*  Determine new location  */
+-    sprintf( str, VOLUME_FMT, 100L );
++    sprintf( str, VOLUME_FMT, 100 );
+     str_width = XmbTextEscapement( p->fontset, str, strlen(str) );
+     extents    = XExtentsOfFontSet( p->fontset );
+ 
+@@ -607,7 +607,7 @@ static TV_BOOL TVANNOTStationPropUpdate(
+                                                     station->freq );
+     }
+     else if ( state.tuner_chan_active )
+-        sprintf( chan_str, "%ld", state.tuner_chan );
++        sprintf( chan_str, "%d", state.tuner_chan );
+     else
+         sprintf( chan_str, "%.2f MHz", state.tuner_freq );
+ 
Index: pkgsrc/multimedia/fxtv/patches/patch-appear_dlg_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-appear_dlg_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-appear_dlg_c   Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-appear_dlg_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 warning.
+
+--- appear_dlg.c~      1999-09-04 18:10:26.000000000 +0000
++++ appear_dlg.c
+@@ -159,7 +159,7 @@ static void ControlSliderScrollCB( Widge
+     TV_CAPTURE        *c       = &G_glob.capture;
+     TV_APPEAR_CTL_DEF *r       = (TV_APPEAR_CTL_DEF *) cl_data;
+     float              percent;
+-    int                pos     = (int)cb_data;
++    int                pos     = (intptr_t)cb_data;
+     Dimension          length;
+     double             lim[2],
+                        val;
Index: pkgsrc/multimedia/fxtv/patches/patch-audiocnvt_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-audiocnvt_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-audiocnvt_c    Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-audiocnvt_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+
+--- audiocnvt.c~       1999-09-04 18:27:13.000000000 +0000
++++ audiocnvt.c
+@@ -166,7 +166,7 @@ void TVAUDIOCNVTBuildSoundFmtSoxArgs(
+ 
+     if ( fmt->file_fmt == TV_AUDIO_FILE_FMT_RAW ) {
+         srec = GetSampleFmtDef( fmt->samp_fmt );
+-        sprintf( args, "%s -c %d -r %ld",
++        sprintf( args, "%s -c %d -r %d",
+                  srec->sox_opt, fmt->stereo ? 2 : 1, fmt->samp_rate );
+     }
+     else {
Index: pkgsrc/multimedia/fxtv/patches/patch-audsav_dlg_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-audsav_dlg_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-audsav_dlg_c   Sun Apr 24 10:57:28 2022
@@ -0,0 +1,51 @@
+$NetBSD: patch-audsav_dlg_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+
+--- audsav_dlg.c~      1999-09-04 18:09:01.000000000 +0000
++++ audsav_dlg.c
+@@ -154,7 +154,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= XtNumber( Ffmt_item_def ) ) {
+             fprintf( stderr, 
+-                     "TVAUDSAVDIALOGSetSel: Unsupported filefmt %ld\n", 
++                     "TVAUDSAVDIALOGSetSel: Unsupported filefmt %d\n", 
+                      choice );
+             exit(1);
+         }
+@@ -171,7 +171,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= XtNumber( Sfmt_item_def ) ) {
+             fprintf( stderr, 
+-                     "TVAUDSAVDIALOGSetSel: Unsupported sampfmt %ld\n", 
++                     "TVAUDSAVDIALOGSetSel: Unsupported sampfmt %d\n", 
+                      choice );
+             exit(1);
+         }
+@@ -187,7 +187,7 @@ static void SetMenuSelection( Widget men
+                 break;
+             }
+         if ( i >= XtNumber( Chan_item_def ) ) {
+-            fprintf( stderr, "TVAUDSAVDIALOGSetSel: Unsupported #chan %ld\n", 
++            fprintf( stderr, "TVAUDSAVDIALOGSetSel: Unsupported #chan %d\n", 
+                              choice );
+             exit(1);
+         }
+@@ -203,7 +203,7 @@ static void SetMenuSelection( Widget men
+                 break;
+             }
+         if ( i >= XtNumber( Rate_item_def ) ) {
+-            fprintf( stderr, "TVAUDSAVDIALOGSetSel: Unsupported rate %ld\n", 
++            fprintf( stderr, "TVAUDSAVDIALOGSetSel: Unsupported rate %d\n", 
+                              choice );
+             exit(1);
+         }
+@@ -698,7 +698,7 @@ static void PlaybackCmdCB( Widget w, XtP
+                 break;
+ 
+         /*  Build Cmd: "sox %s - %s -c %d -r %d -"  */
+-        sprintf( shell_cmd, "sox %s - %s -c %d -r %ld -",
++        sprintf( shell_cmd, "sox %s - %s -c %d -r %d -",
+                  Ffmt_item_def[j].sox_opt, Sfmt_item_def[i].sox_opt,
+                  Sel_stereo ? 2 : 1, Sel_rate );
+     }
Index: pkgsrc/multimedia/fxtv/patches/patch-remotetrans_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-remotetrans_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-remotetrans_c  Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-remotetrans_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+
+--- remotetrans.c~     1999-09-05 16:36:35.000000000 +0000
++++ remotetrans.c
+@@ -152,7 +152,7 @@ void TVREMOTETRANSParse( Display *displa
+     }
+     Rem_trans_len = i;
+ 
+-    RMPRINTF(( "\nTVREMOTE:  Parsed %ld user translations:\n",
++    RMPRINTF(( "\nTVREMOTE:  Parsed %d user translations:\n",
+                Rem_trans_len ));
+     for ( i = 0; i < Rem_trans_len; i++ ) {
+         RMPRINTF(( "   <Remote>%-10s : %s(",
Index: pkgsrc/multimedia/fxtv/patches/patch-tvscreen_c
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-tvscreen_c:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-tvscreen_c     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,116 @@
+$NetBSD: patch-tvscreen_c,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+Fix LP64 problems.
+
+--- tvscreen.c~        2000-05-21 13:49:47.000000000 +0000
++++ tvscreen.c
+@@ -517,8 +517,8 @@ void TVSCREENInit( TV_XSCREEN *s,
+                                (int *) &s->ram_size );
+             s->ram_size *= 1024;
+             
+-            SUPRINTF(( "   BaseAddr = 0x%lx, Pitch = %ld, "
+-                          "BankSize/RamSize = %ld/%ld\n",
++            SUPRINTF(( "   BaseAddr = 0x%x, Pitch = %d, "
++                          "BankSize/RamSize = %d/%d\n",
+                        s->base_addr, s->pitch, s->bank_size, s->ram_size ));
+         }
+     }
+@@ -611,7 +611,7 @@ void TVSCREENInit( TV_XSCREEN *s,
+ 
+         /*  FIXME:  Handle byte swapping  */
+         SUPRINTF(( 
+-           "   %3ld     %-11s   %2d  %1ld,%1ld  %.8lx, %.8lx, %.8lx   "
++           "   %3d     %-11s   %2d  %1d,%1d  %.8lx, %.8lx, %.8lx   "
+            "--      %-3s\n",
+            rank, visual_classes[ v->class ], v->depth, Bpp_pixmap, Bpp_fbuffer,
+            v->red_mask, v->green_mask, v->blue_mask, 
+@@ -1003,11 +1003,12 @@ static void TVSCREENGetCapturePixGeom( T
+ 
+             /*  Prefer 2Bpp byte swapped over the rest (since its the  */
+             /*    thing NewFrameHdlr currently byte swaps well).       */
+-            else if (( best_pg.Bpp != 2 ) || !best_pg.swap_bytes )
++            else if (( best_pg.Bpp != 2 ) || !best_pg.swap_bytes ) {
+                 if  (( pg.Bpp      == 2 ) &&  pg.swap_bytes      )
+                     take_it = True;
+                 else if ( pg.Bpp == 2 )
+                     take_it = True;
++          }
+ 
+             if ( take_it ) {
+                 best_i          = i;
+@@ -1628,7 +1629,7 @@ void TVSCREENVideoWinEventHdlr(
+     }
+ 
+     S_call_level++;
+-    EVPRINTF(( "%2ld: VideoWin EVENT: %s\n", S_call_level, 
++    EVPRINTF(( "%2d: VideoWin EVENT: %s\n", S_call_level, 
+                                          event_names[ ev->type ] ));
+ 
+     /*  Always keep recorded visibility state current  */
+@@ -1939,7 +1940,7 @@ void TVSCREENSetVideoWinGeom(
+                                  XtNy, g.y,
+                                  NULL );
+ #endif
+-    EVPRINTF(( "Resetting video widget geometry: %ldx%ld\n", g.w, g.h ));
++    EVPRINTF(( "Resetting video widget geometry: %dx%d\n", g.w, g.h ));
+ #ifdef OLD
+     XawPanedSetRefigureMode( XtParent( d->video_wgt ), False );
+     XtVaSetValues( d->video_wgt, XtNwidth , g.w,
+@@ -2390,8 +2391,8 @@ void TVSCREENSetScreenUpdateEnabled( 
+     char              *cfg_fail_msg;
+ 
+     if ( enabled == d->enabled ) {
+-        fprintf( stderr, "TVSCREENSetScreenUpdateEnabled: new/was=%ld\n",
+-                 enabled );
++        fprintf( stderr, "TVSCREENSetScreenUpdateEnabled: new/was=%d\n",
++                 (int)enabled );
+         return;
+     }
+ 
+@@ -2479,7 +2480,7 @@ static void TVSCREENPrepXImage( TV_DISPL
+         d->ximage_use_for_expose = FALSE;
+ 
+         /*  Free the old  */
+-        if ( image->ximg )
++        if ( image->ximg ) {
+             if ( image->is_shm ) {
+                 if ( !XShmDetach   ( TVDISPLAY, &image->shm_info ) ) {
+                     fprintf( stderr, "XShmDetach() failed\n" );
+@@ -2503,6 +2504,7 @@ static void TVSCREENPrepXImage( TV_DISPL
+                 XDestroyImage( image->ximg );
+                 image->ximg = NULL;
+             }
++      }
+ 
+         /*  Create desired new  */
+         if ( c->xfer_mode == TV_TRANSFER_SHMEM_IMAGE ) {
+@@ -2587,7 +2589,7 @@ static void TVSCREENPrepXImage( TV_DISPL
+ static void TVSCREENAllocColorCube( TV_DISPLAY   *d,
+                                     VL_COLORMAP **cmap )
+ {
+-    static Color_cubes[][3] = 
++    static int Color_cubes[][3] = 
+       { {7,7,5},{6,6,6},{6,6,5},{6,6,4},{5,5,5},{5,5,4},{5,5,3},
+         {4,4,4},{3,3,3},{2,2,2} };
+ 
+@@ -2646,17 +2648,17 @@ static void TVSCREENAllocColorCube( TV_D
+         if ( i >= num_col ) 
+             break;
+ 
+-        SUPRINTF(( "Failed to alloc %ldx%ldx%ld color cube\n", 
++        SUPRINTF(( "Failed to alloc %dx%dx%d color cube\n", 
+                    r_dim, g_dim, b_dim ));
+         for ( i--; i >= 0; i-- )
+             XFreeColors( TVDISPLAY, colormap, &col[i].pixel, 1, 0 );
+     }
+     if ( r_dim < 2 ) {
+-        fprintf( stderr, "Can't even get a %ldx%ldx%ld colormap..."
++        fprintf( stderr, "Can't even get a %dx%dx%d colormap..."
+                  "bailing out\n", r_dim, g_dim, b_dim );
+         exit(1);
+     }
+-    SUPRINTF(( "%ldx%ldx%ld Color Cube Allocated\n",r_dim,g_dim,b_dim ));
++    SUPRINTF(( "%dx%dx%d Color Cube Allocated\n",r_dim,g_dim,b_dim ));
+ 
+     /*  Done.  Now allocate and fill in the VideoLib colormap definition  */
+     *cmap = VIDEOLIBNewColormap( num_col );
Index: pkgsrc/multimedia/fxtv/patches/patch-videolib_Makefile
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-videolib_Makefile:1.3
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-videolib_Makefile      Sun Apr 24 10:57:28 2022
@@ -0,0 +1,16 @@
+$NetBSD: patch-videolib_Makefile,v 1.3 2022/04/24 10:57:28 tnn Exp $
+
+--- videolib/Makefile.orig     2001-02-12 19:04:45.000000000 +0000
++++ videolib/Makefile
+@@ -13,9 +13,9 @@ override INC               = 
+ # CFLAGS
+ #
+ ifneq ($(DEBUG),NO)
+-  override CFLAGS          = -DDEBUG -g
++  override CFLAGS          += -DDEBUG -g
+ else
+-  override CFLAGS          = -DNDEBUG -O2
++  override CFLAGS          += -DNDEBUG -O2
+ endif
+ C_WARN_FLAG                = -Wall
+ override CFLAGS           += $(C_WARN_FLAG) $(INC)

Index: pkgsrc/multimedia/fxtv/patches/patch-ag
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ag:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ag     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,62 @@
+$NetBSD: patch-ag,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle png.
+Use raw instead of AIFF for ... (unclear what) ...
+
+--- fxtv_cnvt.sh.orig  Mon Feb 12 22:18:40 2001
++++ fxtv_cnvt.sh
+@@ -32,7 +32,7 @@
+ #VIDEO_TARGET_FPS="30"
+ #VIDEO_STREAM="YES"
+ #
+-#IMAGE_TARGET_FMT="YUV"                 # TIFF|PPM|YUV
++#IMAGE_TARGET_FMT="YUV"                 # TIFF|PNG|PPM|YUV
+ #
+ #CLEANUP_TEMP_FILES="YES"
+ 
+@@ -73,6 +73,10 @@ MPEG_ENC_PARAM_STR_TIFF=\
+ 'BASE_FILE_FORMAT  PPM
+ INPUT_CONVERT     tifftopnm *'
+ 
++MPEG_ENC_PARAM_STR_PNG=\
++'BASE_FILE_FORMAT  PPM
++INPUT_CONVERT     pngtopnm *'
++
+ MPEG_ENC_PARAM_STR_PPM=\
+ 'BASE_FILE_FORMAT  PPM         
+ INPUT_CONVERT     *'
+@@ -181,8 +185,8 @@ GenAudioPipe() {
+ 
+    # Do we need an intermediate file?
+    if [ $mpeg_enc = YES ]; then
+-      out_soxfn="$out_fnbase.aiff"
+-      out_soxfmt="AIFF"
++      out_soxfn="$out_fnbase.raw"
++      out_soxfmt="RAW"
+    else
+       out_soxfn="$GAout_fn"
+       out_soxfmt="$out_fmt"
+@@ -258,6 +262,7 @@ WriteMPEGEncodeParamFile() {
+     # Write the frame-format specific part 
+     case $frame_fmt in
+        TIFF)  str="$MPEG_ENC_PARAM_STR_TIFF";;
++       PNG)   str="$MPEG_ENC_PARAM_STR_PNG";;
+        PPM)   str="$MPEG_ENC_PARAM_STR_PPM" ;;
+        YUV)   str="$MPEG_ENC_PARAM_STR_IYUV";;
+     esac
+@@ -277,6 +282,7 @@ WriteMPEGEncodeParamFile() {
+        base=`basename $out_fnbase`
+        case $frame_fmt in
+           TIFF)  ext="tif";;
++          PNG)   ext="png";;
+           PPM)   ext="ppm";;
+           YUV)   ext="yuv";;
+        esac
+@@ -321,6 +327,7 @@ CountFrameFiles() {
+ 
+     case $frame_fmt in
+        TIFF)  ext="tif";;
++       PNG)   ext="png";;
+        PPM)   ext="ppm";;
+        YUV)   ext="yuv";;
+     esac
Index: pkgsrc/multimedia/fxtv/patches/patch-ah
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ah:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ah     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,14 @@
+$NetBSD: patch-ah,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle png.
+
+--- imgsav_dlg.c.orig  Mon Sep  6 15:07:29 1999
++++ imgsav_dlg.c
+@@ -69,6 +69,7 @@ static Pixmap Select_pixmap   = None,
+ 
+ static TV_IFILEFMT_ITEM_DEF Fmtitem_def[] = {
+     { TV_STILL_FMT_TIFF   ,  "tiff", "tiffCmd" },
++    { TV_STILL_FMT_PNG    ,  "png",  "pngCmd" },
+     { TV_STILL_FMT_PPM    ,  "ppm" , "ppmCmd"  }
+ };
+ 
Index: pkgsrc/multimedia/fxtv/patches/patch-ai
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ai:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ai     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,60 @@
+$NetBSD: patch-ai,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Support png.
+Fix LP64 problems.
+
+--- batch_mode.c.orig  1999-10-23 13:50:35.000000000 +0000
++++ batch_mode.c
+@@ -154,6 +154,8 @@ static void DoStreamVideo( TV_BATCH_PARM
+ 
+     if ( STREQ( parm->frame_fmt, "TIFF" ) )
+         fmt = TV_STILL_FMT_TIFF;
++    else if ( STREQ( parm->frame_fmt, "PNG" ) )
++        fmt = TV_STILL_FMT_PNG;
+     else if ( STREQ( parm->frame_fmt, "PPM" ) )
+         fmt = TV_STILL_FMT_PPM;
+     else if ( STREQ( parm->frame_fmt, "YUV" ) )
+@@ -175,6 +177,7 @@ static void DoStreamVideo( TV_BATCH_PARM
+     if ( parm->video_target && !video2stdout )
+         switch ( fmt ) {
+             case TV_STILL_FMT_TIFF : frame_ext = "tif";  break;
++            case TV_STILL_FMT_PNG  : frame_ext = "png";  break;
+             case TV_STILL_FMT_PPM  : frame_ext = "ppm";  break;
+             case TV_STILL_FMT_YUV  : frame_ext = "yuv";  break;
+             default: abort();
+@@ -187,7 +190,7 @@ static void DoStreamVideo( TV_BATCH_PARM
+     }
+ 
+     /*  Prepare the audio output filedesc  */
+-    if ( parm->audio_target )
++    if ( parm->audio_target ) {
+         if ( audio2stdout )
+             aud_fd = 1;
+         else
+@@ -197,6 +200,7 @@ static void DoStreamVideo( TV_BATCH_PARM
+                          parm->audio_target );
+                 exit(1);
+             }
++    }
+ 
+     /*  Read header  */
+     if ( !TVRAWVIDEOHeaderRead( rf, &img, &snd, &eof ) ) {
+@@ -209,7 +213,8 @@ static void DoStreamVideo( TV_BATCH_PARM
+         return;
+ 
+     /*  Sanity check raw data with save type  */
+-    if ( ((( fmt == TV_STILL_FMT_TIFF ) || ( fmt == TV_STILL_FMT_PPM )) &&
++    if ( ((( fmt == TV_STILL_FMT_TIFF ) || ( fmt == TV_STILL_FMT_PNG )
++         || ( fmt == TV_STILL_FMT_PPM )) &&
+           ( img.pix_geom.type != TV_PIXELTYPE_RGB )) ||
+          (( fmt == TV_STILL_FMT_YUV ) &&
+           ( img.pix_geom.type != TV_PIXELTYPE_YUV )) ) {
+@@ -288,7 +293,7 @@ static void DoStreamVideo( TV_BATCH_PARM
+                 else {
+                     char suffix[80];
+ 
+-                    sprintf( suffix, ".%.5ld.%s", frame_no++, frame_ext );
++                    sprintf( suffix, ".%.5d.%s", frame_no++, frame_ext );
+ 
+                     sprintf( img_fname, parm->video_target, suffix );
+                     if ( i == 0 ) {
Index: pkgsrc/multimedia/fxtv/patches/patch-ak
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ak:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ak     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-ak,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Handle png.
+
+--- glob.h.orig        2001-02-12 20:24:44.000000000 +0100
++++ glob.h
+@@ -54,6 +54,7 @@ typedef enum {
+ 
+ typedef enum {
+             TV_STILL_FMT_TIFF,
++            TV_STILL_FMT_PNG,
+             TV_STILL_FMT_PPM,
+             TV_STILL_FMT_YUV,
+             TV_NUM_STILL_FMTS
+@@ -133,6 +134,8 @@ typedef struct {
+     TV_TUNER_MODE tuner_mode;
+     TV_BOOL       afc_mode;
+ 
++    TV_BOOL       aot_mode;
++
+     TV_BOOL       last_station_is_chan;
+     TV_INT32      last_chan;
+     double        last_freq;
Index: pkgsrc/multimedia/fxtv/patches/patch-al
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-al:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-al     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,170 @@
+$NetBSD: patch-al,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Support png.
+Fix LP64 problems.
+
+--- vidsav_dlg.c.orig  2001-02-12 21:20:10.000000000 +0000
++++ vidsav_dlg.c
+@@ -235,6 +235,7 @@ static TV_ICAPFMT_ITEM_DEF     Icap_fmt_
+ 
+ static TV_IFILEFMT_ITEM_DEF    Ifile_fmt_item_def[] = {
+     { TV_STILL_FMT_TIFF   ,  "tiff", "tiffCmd" },
++    { TV_STILL_FMT_PNG    ,  "png",  "pngCmd" },
+     { TV_STILL_FMT_PPM    ,  "ppm" , "ppmCmd"  },
+     { TV_STILL_FMT_YUV    ,  "yuv" , "yuvCmd"  }
+ };
+@@ -270,7 +271,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Icap_fmt_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -287,7 +288,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Ifile_fmt_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -304,7 +305,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Ffmt_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -321,7 +322,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Sfmt_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported sampfmt %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported sampfmt %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -338,7 +339,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Chan_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported #chan %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported #chan %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -355,7 +356,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= Rate_item_def_size ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported rate %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported rate %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -372,7 +373,7 @@ static void SetMenuSelection( Widget men
+             }
+         if ( i >= XtNumber( Vtrg_item_def ) ) {
+             fprintf( stderr, 
+-                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %lu\n", 
++                     "TVVIDSAVDIALOGSetSel: Unsupported filefmt %u\n", 
+                      choice );
+             exit(1);
+         }
+@@ -507,7 +508,7 @@ static TV_BOOL PrepareForVideo( TV_BOOL 
+                              NULL );
+     if ( str == NULL )
+         str = "";
+-    if (( sscanf( str, "%ldx%ld", &g.w, &g.h ) != 2 ) ||
++    if (( sscanf( str, "%dx%d", &g.w, &g.h ) != 2 ) ||
+         !TVCAPTUREValidRegionGeom( c, &g )) {
+         XUTILDialogPause( TVTOPLEVEL, "Error", "Invalid size.",
+                           TV_DIALOG_TYPE_OK );
+@@ -521,7 +522,7 @@ static TV_BOOL PrepareForVideo( TV_BOOL 
+                                  NULL );
+         if ( str == NULL )
+             str = "";
+-        if (( sscanf( str, "%ld", &fps ) != 1 ) ||
++        if (( sscanf( str, "%d", &fps ) != 1 ) ||
+             ( fps < 1 ) || ( fps > c->fps_max )) {
+             XUTILDialogPause( TVTOPLEVEL, "Error", "Invalid speed.",
+                               TV_DIALOG_TYPE_OK );
+@@ -840,7 +841,7 @@ static TV_BOOL WriteVidConvertShScript( 
+     }
+     fprintf( fp, "AUDIO_CAP_FMT_SAMPLE='%s'\n", str );
+     fprintf( fp, "AUDIO_CAP_FMT_CHAN='%d'\n", p->snd_fmt.stereo ? 2 : 1 );
+-    fprintf( fp, "AUDIO_CAP_FMT_FREQ='%ld'\n", p->snd_fmt.samp_rate );
++    fprintf( fp, "AUDIO_CAP_FMT_FREQ='%d'\n", p->snd_fmt.samp_rate );
+ 
+     switch ( p->snd_fmt.file_fmt ) {
+         case TV_AUDIO_FILE_FMT_RAW    : str = "RAW"  ;  break;
+@@ -855,8 +856,8 @@ static TV_BOOL WriteVidConvertShScript( 
+         
+     fprintf( fp, "AUDIO_TARGET_FMT='%s'\n\n", str );
+ 
+-    fprintf( fp, "VIDEO_RES_X='%ld'\n", p->geom.w );
+-    fprintf( fp, "VIDEO_RES_Y='%ld'\n", p->geom.h );
++    fprintf( fp, "VIDEO_RES_X='%d'\n", p->geom.w );
++    fprintf( fp, "VIDEO_RES_Y='%d'\n", p->geom.h );
+    
+     switch ( p->img_cap_fmt ) {
+         case TV_ICAP_FMT_RGB16 : str = "RGB16";  break;
+@@ -867,11 +868,12 @@ static TV_BOOL WriteVidConvertShScript( 
+     }
+ 
+     fprintf( fp, "VIDEO_CAP_FMT='%s'\n", str );
+-    fprintf( fp, "VIDEO_TARGET_FPS='%ld'\n", p->fps );
++    fprintf( fp, "VIDEO_TARGET_FPS='%d'\n", p->fps );
+     fprintf( fp, "VIDEO_STREAM='%s'\n\n", ( p->streaming ? "YES" : "NO" ) );
+ 
+     switch ( p->img_sav_fmt ) {
+         case TV_STILL_FMT_TIFF : str = "TIFF";  break;
++        case TV_STILL_FMT_PNG  : str = "PNG";  break;
+         case TV_STILL_FMT_PPM  : str = "PPM" ;  break;
+         case TV_STILL_FMT_YUV  : str = "YUV" ;  break;
+         default                : str = ""    ;  break;
+@@ -1202,7 +1204,7 @@ static void RecordCmdCB( Widget w, XtPoi
+ 
+         /*  This is a cheesy first-cut  */
+         fps = Vid_stats.frames*1000000L/Vid_stats.time_us;
+-        sprintf( str, "%ld", fps );
++        sprintf( str, "%d", fps );
+         TextValUpdate( FPS_text, str );
+     }
+ 
+@@ -1926,10 +1928,10 @@ void TVVIDSAVDIALOGResync()
+     /*  Set text fields to current settings  */
+     TextValUpdate( Fname_text, d->fn_video_base );
+ 
+-    sprintf( str, "%ldx%ld", d->video.geom.w, d->video.geom.h );
++    sprintf( str, "%dx%d", d->video.geom.w, d->video.geom.h );
+     TextValUpdate( Res_text, str );
+ 
+-    sprintf( str, "%ld", d->video.fps );
++    sprintf( str, "%d", d->video.fps );
+     TextValUpdate( FPS_text, str );
+ 
+     /*  Set selections based on active format  */
+@@ -2048,7 +2050,7 @@ void TVVIDSAVDIALOGNewFrameHdlr( TV_IMAG
+             else
+                 in_a_row = 0;
+ 
+-            VDPRINTF(("%4ld: Delay = %7ld us (Avg = %7ld ms, FPS = %2ld)%s\n", 
++            VDPRINTF(("%4d: Delay = %7ld us (Avg = %7d ms, FPS = %2ld)%s\n", 
+                        Vid_stats.frames, diff, 
+                        Vid_stats.time_us/Vid_stats.frames/1000, 
+                        Vid_stats.frames*1000000L/Vid_stats.time_us,
+@@ -2158,7 +2160,7 @@ void TVVIDSAVDIALOGRecordStart( TV_INT32
+         d->video.geom.w = w;
+         d->video.geom.h = h;
+         if ( Res_text ) {
+-            sprintf( res_str, "%ldx%ld", w,h );
++            sprintf( res_str, "%dx%d", w,h );
+             TextValUpdate( Res_text, res_str );
+         }
+     }
Index: pkgsrc/multimedia/fxtv/patches/patch-am
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-am:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-am     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-am,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Dragonfly support.
+
+--- tvcapture.h.orig   2006-01-03 14:45:01.000000000 +0000
++++ tvcapture.h
+@@ -34,6 +34,8 @@
+ #include <X11/Intrinsic.h>
+ #ifdef __NetBSD__
+ # include <dev/ic/bt8xx.h>
++#elif defined(__DragonFly__)
++# include <dev/video/meteor/ioctl_meteor.h>
+ #else
+ # include <machine/ioctl_meteor.h>
+ #endif
Index: pkgsrc/multimedia/fxtv/patches/patch-an
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-an:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-an     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-an,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Dragonfly support.
+
+--- voxware.h.orig     2006-01-03 14:46:08.000000000 +0000
++++ voxware.h
+@@ -32,7 +32,7 @@
+ 
+ #if defined(__FreeBSD__)
+ #  include <machine/soundcard.h>
+-#elif defined(linux) || defined(__bsdi__)
++#elif defined(linux) || defined(__bsdi__) || defined(__DragonFly__)
+ #  include <sys/soundcard.h>
+ #elif defined(__NetBSD__) || defined(__OpenBSD__)
+ #  include <soundcard.h>
Index: pkgsrc/multimedia/fxtv/patches/patch-ao
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ao:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ao     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,25 @@
+$NetBSD: patch-ao,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Needs sys/ioctl.h.
+Dragonfly support.
+
+--- haup_remote.c.orig 2000-05-21 15:10:04.000000000 +0000
++++ haup_remote.c
+@@ -31,6 +31,7 @@
+  *
+  */
+ 
++#include <sys/ioctl.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -38,6 +39,9 @@
+ #include <sys/fcntl.h>
+ #ifdef __NetBSD__
+ # include <dev/ic/bt8xx.h>
++#elif defined(__DragonFly__)
++# include <dev/video/meteor/ioctl_meteor.h>
++# include <dev/video/bktr/ioctl_bt848.h>
+ #else
+ # include <machine/ioctl_meteor.h>
+ # include <machine/ioctl_bt848.h>
Index: pkgsrc/multimedia/fxtv/patches/patch-ap
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ap:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ap     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,45 @@
+$NetBSD: patch-ap,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Fix illegal C.
+
+--- videolib/videolib.c.orig   1999-11-03 02:22:04.000000000 +0000
++++ videolib/videolib.c        2006-06-30 19:10:23.000000000 +0100
+@@ -479,9 +479,9 @@
+             *(p++) = (*src16 >> 8) | (*src16 << 8);
+             src16++;
+           }
+-          for ( i = dst_line_pad; i > 0; i-- )
+-            *(((VL_UINT8 *)p)++) = 0x00;
+-          (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
++          (void)memset(p, 0, dst_line_pad);
++          dst_line = (VL_UINT16 *)((VL_UINT8 *)dst_line +
++                                   dst->geom.bytes_per_line);
+         }
+ 
+         src16 = dst_line = (VL_UINT16 *) dst->buf;
+@@ -513,9 +513,9 @@
+         if ( src_padded ) 
+           src16 = (VL_UINT16 *)( (VL_UINT8 *)src16 + dst_line_pad );
+         else
+-          for ( i = dst_line_pad; i > 0; i-- )
+-            *(((VL_UINT8 *)dst)++) = 0x00;
+-        (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
++          (void)memset(p, 0, dst_line_pad);
++        dst_line = (VL_UINT16 *)((VL_UINT8 *)dst_line +
++                                 dst->geom.bytes_per_line);
+       }
+ 
+       if ( !dst_swap_b ) {                       /*  More ugliness  */
+@@ -527,8 +527,10 @@
+             *(p++) = (*src16 >> 8) | (*src16 << 8);
+             src16++;
+           }
+-          (VL_UINT8 *)dst_line += dst->geom.bytes_per_line;
+-          (VL_UINT8 *)src16    += dst->geom.bytes_per_line;
++          dst_line = (VL_UINT16 *)((VL_UINT8 *)dst_line +
++                                   dst->geom.bytes_per_line);
++          src16 = (VL_UINT16 *)((VL_UINT8 *)src16 +
++                                dst->geom.bytes_per_line);
+         }
+       }
+     }
Index: pkgsrc/multimedia/fxtv/patches/patch-aq
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-aq:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-aq     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,105 @@
+$NetBSD: patch-aq,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Support Dragonfly.
+Fix LP64 problems.
+
+--- tvcapture.c.orig   2001-02-12 18:59:22.000000000 +0000
++++ tvcapture.c
+@@ -37,6 +37,8 @@
+ #include <sys/mman.h>
+ #ifdef __NetBSD__
+ # include <dev/ic/bt8xx.h>
++#elif defined(__DragonFly__)
++# include <dev/video/bktr/ioctl_bt848.h>
+ #else
+ # include <machine/ioctl_bt848.h>
+ #endif
+@@ -238,7 +240,7 @@ TV_BOOL TVCAPTUREGetPendingFrame( TV_IMA
+             return FALSE;
+ 
+         if ( S_frame_done_count-- > 0 )
+-            DRVPRINTF(( "%ld frames behind\n", S_frame_done_count ));
++            DRVPRINTF(( "%d frames behind\n", S_frame_done_count ));
+ 
+         image.buf = c->drv_buf;
+         memcpy( &image.geom, &c->geom, sizeof( image.geom ) );
+@@ -815,7 +817,7 @@ TV_BOOL TVCAPTUREQueryDriverState( TV_CA
+         case METEOR_INPUT_DEV3       : s->input_dev = TV_DEVICE_DEV3   ; break;
+ #endif
+         default :
+-             fprintf( stderr, "TVCAPTUREQueryDriverState(): Bad INPUT %ld\n",
++             fprintf( stderr, "TVCAPTUREQueryDriverState(): Bad INPUT %d\n",
+                       larg );
+              return False;
+     }
+@@ -835,7 +837,7 @@ TV_BOOL TVCAPTUREQueryDriverState( TV_CA
+         case BT848_IFORM_F_SECAM   : s->input_fmt = TV_INPUT_SECAM   ;  break;
+         case BT848_IFORM_F_RSVD    : s->input_fmt = TV_INPUT_PALNCOMB;  break;
+         default :
+-             fprintf( stderr, "TVCAPTUREQueryDriverState(): Bad FMT %ld\n",
++             fprintf( stderr, "TVCAPTUREQueryDriverState(): Bad FMT %d\n",
+                       larg );
+              return False;
+     }
+@@ -1289,7 +1291,7 @@ void TVCAPTUREPrintPixelFormats( TV_CAPT
+         }
+ 
+         SUPRINTF(( 
+-            "    %2ld  %2ld   %.8lx, %.8lx, %.8lx  %s\n",
++            "    %2d  %2d   %.8x, %.8x, %.8x  %s\n",
+             bpp, pg->Bpp, pg->mask[0], pg->mask[1], pg->mask[2], 
+             swap_chars ));
+     }
+@@ -1306,7 +1308,7 @@ void TVCAPTUREPrintPixelFormats( TV_CAPT
+             continue;
+         
+         SUPRINTF(( 
+-          "    %ld,%ld,%ld   %ld,%ld,%ld  %ld,%ld,%ld  %-7s %-10s  "
++          "    %d,%d,%d   %d,%d,%d  %d,%d,%d  %-7s %-10s  "
+           "%-5s %-6s %s\n",
+           pg->samp_size [0], pg->samp_size [1], pg->samp_size [2],
+           pg->samp_int_h[0], pg->samp_int_h[1], pg->samp_int_h[2],
+@@ -1535,7 +1537,7 @@ void TVCAPTUREInit( TV_CAPTURE *c )
+     c->contrast      =  70.0; /* % */
+     c->sat_u         =  100.0; /* % */
+     c->sat_v         =  100.0; /* % */
+-    c->addr          = NULL;
++    c->addr          = 0;
+     /*  geom -- see below */
+ 
+     c->frame_done_cb    = NULL;
+@@ -1565,7 +1567,7 @@ void TVCAPTUREInit( TV_CAPTURE *c )
+         default                :
+         case TV_INPUT_AUTO     :
+             fprintf( stderr, 
+-             "TVCAPTUREInit: Unsupported input format %ld\n", 
++             "TVCAPTUREInit: Unsupported input format %d\n", 
+              c->input_format );
+             exit(1);
+     }
+@@ -1729,7 +1731,7 @@ TV_BOOL TVCAPTUREConfigure( TV_CAPTURE  
+         goto RETURN;
+     }
+ 
+-    if ( c->xfer_mode == TV_TRANSFER_DIRECT )
++    if ( c->xfer_mode == TV_TRANSFER_DIRECT ) {
+         if ( !( x->visual_modes[ x->active_visual ] & TV_TRANSFER_DIRECT )) {
+             strcpy( S_err_msg, "Active visual does not support direct video");
+             goto RETURN;
+@@ -1738,6 +1740,7 @@ TV_BOOL TVCAPTUREConfigure( TV_CAPTURE  
+             strcpy( S_err_msg, "Direct transfer only supported for video" );
+             goto RETURN;
+         }
++    }
+ 
+     /*  Get capture geometry  */
+     if ( c->xfer_mode == TV_TRANSFER_DIRECT ) {
+@@ -1752,7 +1755,7 @@ TV_BOOL TVCAPTUREConfigure( TV_CAPTURE  
+     /*  Verify res limits and precision (all modes)  */
+     if (( g.w != g.w / c->width_res  * c->width_res  ) ||
+         ( g.h != g.h / c->height_res * c->height_res )) {
+-        sprintf( S_err_msg, "Capture geometry must be a multiple of %ldx%ld",
++        sprintf( S_err_msg, "Capture geometry must be a multiple of %dx%d",
+                  c->width_res, c->height_res );
+         goto RETURN;
+     }
Index: pkgsrc/multimedia/fxtv/patches/patch-bb
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-bb:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-bb     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,14 @@
+$NetBSD: patch-bb,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+
+--- glob.c.orig        2001-02-12 19:26:16.000000000 +0100
++++ glob.c
+@@ -131,6 +131,7 @@ void TVGLOBInitPrefs( TV_PREFS *p )
+     p->cable_freq_set  = 1;
+     p->tuner_mode      = TV_TUNER_MODE_ANTENNA;
+     p->afc_mode        = TRUE;
++    p->aot_mode        = TRUE;
+ 
+     p->last_chan       = 3;               /*  -1 = use last_freq  */
+     p->last_freq       = 0.0;
Index: pkgsrc/multimedia/fxtv/patches/patch-bc
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-bc:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-bc     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,87 @@
+$NetBSD: patch-bc,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Fix LP64 problems.
+
+--- tvmenu.c.orig      2001-02-12 21:19:33.000000000 +0000
++++ tvmenu.c
+@@ -103,7 +103,7 @@ typedef void XT_CB( Widget w, XtPointer 
+ 
+ /*      ******************** Forward declarations         ************** */
+ 
+-static XT_CB QuitCB, FreezeCB, MuteCB, ZoomCB, InputCB, AfcCB, TModeCB, 
++static XT_CB QuitCB, FreezeCB, MuteCB, ZoomCB, InputCB, AfcCB, AotCB, TModeCB, 
+              ChanUpDnCB, AppearCB, AspectCB, AboutCB, ImgSavCB, ImgSavAsCB, 
+              AudSavAsCB, VidSavAsCB, FormatCB, AudInpCB, StationPopupCB;
+ 
+@@ -160,6 +160,7 @@ static TV_MENUITEM_DEF Menuitem_def[] = 
+    { TVMI( FORMAT,FORMAT_PALNCOMB   ), "palncombFmt"   , WC_mcmd , FormatCB  },
+    { TVMI( OPTIONS,OPTIONS_ASPECT   ), "aspectLockCmd" , WC_mcmd , AspectCB  },
+    { TVMI( OPTIONS,OPTIONS_AFC      ), "setAfcCmd",      WC_mcmd , AfcCB     },
++   { TVMI( OPTIONS,OPTIONS_AOT      ), "setAotCmd",      WC_mcmd , AotCB     },
+    { TV_MENU_OPTIONS, -1             , "line"          , WC_mline, NULL      },
+ /*
+    { TVMI( OPTIONS,OPTIONS_SAVE     ), "saveOptionsCmd", WC_mcmd , NULL      },
+@@ -396,6 +397,16 @@ static void AfcCB( Widget w, XtPointer c
+     TVMENUSetSelectedAfcMode( p->afc_mode );
+ }
+ 
++/*   AotCB - Change the always on top mode */
++static void AotCB( Widget w, XtPointer cl, XtPointer cb )
++{
++    TV_PREFS        *p = &G_glob.prefs;
++
++    p->aot_mode = !p->aot_mode;
++    XUTILSetAlwaysOnTop( p->aot_mode );
++    TVMENUSetSelectedAotMode( p->aot_mode );
++}
++
+ void TVMENUSetSelectedInputFormat( TV_INPUT_FORMAT fmt )
+ {
+     TV_MENUITEM_DEF *mi;
+@@ -896,7 +907,7 @@ void TVTOOLSSetToggleState( TV_TOOLITEM_
+             break;
+ 
+     if ( i >= XtNumber( Toolitem_def ) ) {
+-        fprintf( stderr, "TVTOOLSETSetToggleState: Bad key %ld\n", i );
++        fprintf( stderr, "TVTOOLSETSetToggleState: Bad key %d\n", i );
+         exit(1);
+     }
+ 
+@@ -1008,6 +1019,19 @@ void TVMENUSetSelectedAfcMode( TV_BOOL a
+                                 NULL);
+ }
+ 
++void TVMENUSetSelectedAotMode( TV_BOOL aot )
++{
++    TV_MENUITEM_DEF *item = LookupMenuItemByKey( TV_MENUITEM_OPTIONS_AOT );
++    Pixmap           pix;
++
++    if ( Select_pixmap == None )
++        TVMENULoadRadioPixmaps();
++
++    pix = aot ? Select_pixmap : Unselect_pixmap;
++    XtVaSetValues( item->wgt  , XtNleftBitmap, pix,
++                                NULL);
++}
++
+ void TVMENUSetSelectedAspectLock( TV_BOOL aspect_lock )
+ {
+     TV_MENUITEM_DEF *item = LookupMenuItemByKey( TV_MENUITEM_OPTIONS_ASPECT );
+@@ -1043,6 +1067,7 @@ void TVMENUResync()
+     TVMENUSetSelectedAudioInputDevice( aud_input     );
+     TVMENUSetSelectedTunerMode       ( p->tuner_mode );
+     TVMENUSetSelectedAfcMode         ( p->afc_mode   );
++    TVMENUSetSelectedAotMode         ( p->aot_mode   );
+ }
+ 
+ /*  TVTOOLSSetStationText  -  Sets the channel text to the specified      */
+@@ -1134,7 +1159,7 @@ void TVTOOLSResync()
+         strncat( chan_str, station->id, sizeof(chan_str)-1 );
+     }
+     else if ( s.tuner_chan_active )
+-        sprintf( chan_str, "%ld", s.tuner_chan );
++        sprintf( chan_str, "%d", s.tuner_chan );
+     else
+         sprintf( chan_str, "f%.2f", s.tuner_freq );
+ 
Index: pkgsrc/multimedia/fxtv/patches/patch-bd
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-bd:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-bd     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,23 @@
+$NetBSD: patch-bd,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+
+--- tvmenu.h.orig      2001-02-12 20:00:59.000000000 +0100
++++ tvmenu.h
+@@ -63,6 +63,7 @@ typedef enum {
+     TV_MENUITEM_FORMAT_PALNCOMB,
+     TV_MENUITEM_OPTIONS_ASPECT,
+     TV_MENUITEM_OPTIONS_AFC,
++    TV_MENUITEM_OPTIONS_AOT,
+     TV_MENUITEM_OPTIONS_SAVE,
+     TV_MENUITEM_HELP_ABOUT,
+        TV_NUM_MENUITEMS
+@@ -101,6 +102,8 @@ void TVMENUSetSelectedAudioInputDevice( 
+ 
+ void TVMENUSetSelectedAfcMode( TV_BOOL afc );
+ 
++void TVMENUSetSelectedAotMode( TV_BOOL aot );
++
+ void TVMENUSetSelectedAspectLock( TV_BOOL aspect_lock );
+ 
+ void TVMENUSetSelectedTunerMode( TV_TUNER_MODE mode );
Index: pkgsrc/multimedia/fxtv/patches/patch-be
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-be:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-be     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-be,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+
+--- xutil.h.orig       2003-09-28 17:18:28.000000000 +0200
++++ xutil.h    2003-09-28 17:18:28.000000000 +0200
+@@ -137,6 +137,8 @@
+                                       int           screen,
+                                       XVisualInfo **fb_visual );
+ 
++void XUTILSetAlwaysOnTop( TV_BOOL status );
++
+ #ifdef __cplusplus
+ }  /* Close 'extern "C"' */
+ #endif
Index: pkgsrc/multimedia/fxtv/patches/patch-bf
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-bf:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-bf     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,96 @@
+$NetBSD: patch-bf,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Fix LP64 problems.
+
+--- xutil.c.orig       1999-11-05 00:38:54.000000000 +0000
++++ xutil.c
+@@ -44,6 +44,7 @@
+ #include <X11/Shell.h>
+ #include <X11/Xaw/Dialog.h>
+ #include <X11/xpm.h>
++#include "glob.h"
+ #include "tvdefines.h"
+ #include "xutil.h"
+ #include "app_rsrc.h"
+@@ -63,6 +64,10 @@ void XawScrollbarSetThumb( Widget w, flo
+ 
+ #define WM_BORDER_PAD 40
+ 
++#define _NET_WM_STATE_REMOVE  0
++#define _NET_WM_STATE_ADD     1
++#define _NET_WM_STATE_TOGGLE  2
++
+ typedef struct {
+     pid_t                  cmd_pid;
+     TVUTIL_PIPE_END        end[3];
+@@ -371,7 +376,7 @@ TV_BOOL XUTILPixmapLoad( char    *pixmap
+         XFreePixmap( XtDisplay( wgt ), pixmap_depth1 );
+         XFreeGC    ( XtDisplay( wgt ), gc );
+         if ( pixmap_mask != NULL )
+-            *pixmap_mask = NULL;
++            *pixmap_mask = 0;
+     }
+     else {
+ 
+@@ -406,11 +411,12 @@ TV_BOOL XUTILPixmapLoad( char    *pixmap
+         }
+ 
+         *pixmap = pix_returned;
+-        if ( pix_mask_returned )
++        if ( pix_mask_returned ) {
+             if ( pixmap_mask != NULL )
+                 *pixmap_mask = pix_mask_returned;
+             else
+                 XFreePixmap( XtDisplay( wgt ), pix_mask_returned );
++      }
+     }
+ 
+     if ( pixmap_path != NULL )
+@@ -1543,3 +1549,46 @@ void XUTILDetermineFrameBufferVisual( Di
+         }
+     }
+ }
++
++static void
++change_state (Display *d, Screen * screen, Window xwindow, int add,
++              Atom state1, Atom state2)
++{
++    XEvent xev;
++
++    xev.xclient.type = ClientMessage;
++    xev.xclient.serial = 0;
++    xev.xclient.send_event = True;
++    xev.xclient.display = d;
++    xev.xclient.window = xwindow;
++    xev.xclient.message_type = XInternAtom (d, "_NET_WM_STATE", FALSE);
++    xev.xclient.format = 32;
++    xev.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
++    xev.xclient.data.l[1] = state1;
++    xev.xclient.data.l[2] = state2;
++
++    XSendEvent (d, RootWindowOfScreen (screen), False,
++                SubstructureRedirectMask | SubstructureNotifyMask, &xev);
++}
++
++void XUTILSetAlwaysOnTop(TV_BOOL status)
++{
++    Display  *d       = TVDISPLAY;
++    Screen   *screen  = XtScreen ( TVTOPLEVEL );
++    Window   win      = XtWindow ( TVTOPLEVEL );
++    static Atom xa_ABOVE = 0;
++    static Atom xa_BELOW = 0;
++        
++    if (!xa_ABOVE)
++    {
++        xa_ABOVE = XInternAtom (d, "_NET_WM_STATE_ABOVE", FALSE);
++        xa_BELOW = XInternAtom (d, "_NET_WM_STATE_BELOW", FALSE);
++    }
++
++    if (status) {
++        change_state (d, screen, win, FALSE, xa_ABOVE, xa_BELOW);
++        change_state (d, screen, win, TRUE,  xa_ABOVE, None);
++    } else {
++        change_state (d, screen, win, FALSE, xa_ABOVE, xa_BELOW);
++    }
++}
Index: pkgsrc/multimedia/fxtv/patches/patch-bg
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-bg:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-bg     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,52 @@
+$NetBSD: patch-bg,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Handle always-on-top.
+Fix LP64 problems.
+
+--- tv.c.orig  2001-02-12 19:03:09.000000000 +0000
++++ tv.c
+@@ -285,7 +285,7 @@ static void TVStationListStrToList(
+             TVUTILOutOfMemory();
+ 
+         for ( i = 0; i < TV_MAX_CHANNELS; i++ ) {
+-            sprintf( (*station)[i].id, "%ld", i+TV_CHAN_MIN );
++            sprintf( (*station)[i].id, "%d", i+TV_CHAN_MIN );
+             (*station)[i].set_via_channel = TRUE;
+             (*station)[i].channel         = i+TV_CHAN_MIN;
+         }
+@@ -328,13 +328,13 @@ static void TVStationListStrToList(
+             if (( sscanf( tok, "%[^()](f%f)", new.id, &new.freq ) == 2 ) ||
+                 ( sscanf( tok, "%[^()](F%f)", new.id, &new.freq ) == 2 ))
+                 new.set_via_channel = FALSE;
+-            else if ( sscanf( tok, "%[^()](%ld)", new.id, &tmp_int ) == 2 ) {
++            else if ( sscanf( tok, "%[^()](%d)", new.id, &tmp_int ) == 2 ) {
+                 new.set_via_channel = TRUE;
+                 new.channel         = tmp_int;
+             }
+-            else if ( sscanf( tok, "%ld-%ld", &chan1, &chan2 ) == 2 )
++            else if ( sscanf( tok, "%d-%d", &chan1, &chan2 ) == 2 )
+                 chan_range = TRUE;
+-            else if ( sscanf( tok, "%ld", &tmp_int ) == 1 ) {
++            else if ( sscanf( tok, "%d", &tmp_int ) == 1 ) {
+                 new.set_via_channel = TRUE;
+                 new.channel         = tmp_int;
+                 sprintf( new.id, "%d", new.channel );
+@@ -371,7 +371,7 @@ static void TVStationListStrToList(
+                 memcpy( &(*station)[i++], &new, sizeof(new) );
+             else 
+                 for ( ; chan1 <= chan2; chan1++ ) {
+-                    sprintf( new.id, "%ld", chan1 );
++                    sprintf( new.id, "%d", chan1 );
+                     new.set_via_channel = TRUE;
+                     new.channel         = chan1;
+                     new.freq            = 0.0;
+@@ -873,6 +873,9 @@ int main( int argc, char *argv[] )
+     S_wm_delete_window = XInternAtom( TVDISPLAY, "WM_DELETE_WINDOW", False );
+     XSetWMProtocols( TVDISPLAY, XtWindow( top_level ), &S_wm_delete_window, 1);
+     
++    p->aot_mode = (App_res.aot_mode != FALSE);
++    XUTILSetAlwaysOnTop( p->aot_mode );
++
+     TVSCREENUpdateShellRsrcs( top_level, d->video_wgt );
+ 
+     TVMENUResync();
Index: pkgsrc/multimedia/fxtv/patches/patch-ca
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ca:1.4
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ca     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,25 @@
+$NetBSD: patch-ca,v 1.4 2022/04/24 10:57:28 tnn Exp $
+
+Use correct sized types.
+
+--- tvtypes.h.orig     2008-01-15 18:31:30.000000000 -0500
++++ tvtypes.h  2008-01-15 18:32:33.000000000 -0500
+@@ -34,12 +34,12 @@
+ #include <math.h>
+ #include <string.h>
+ 
+-typedef unsigned char  TV_UINT8;
+-typedef signed   char  TV_INT8;
+-typedef unsigned short TV_UINT16;
+-typedef short          TV_INT16;
+-typedef unsigned long  TV_UINT32;
+-typedef long           TV_INT32;
++typedef uint8_t        TV_UINT8;
++typedef int8_t         TV_INT8;
++typedef uint16_t       TV_UINT16;
++typedef int16_t        TV_INT16;
++typedef uint32_t       TV_UINT32;
++typedef int32_t        TV_INT32;
+ 
+ typedef TV_INT32       TV_BOOL;
+ 

Index: pkgsrc/multimedia/fxtv/patches/patch-ba
diff -u /dev/null pkgsrc/multimedia/fxtv/patches/patch-ba:1.6
--- /dev/null   Sun Apr 24 10:57:28 2022
+++ pkgsrc/multimedia/fxtv/patches/patch-ba     Sun Apr 24 10:57:28 2022
@@ -0,0 +1,64 @@
+$NetBSD: patch-ba,v 1.6 2022/04/24 10:57:28 tnn Exp $
+
+Deal with mouse headers.
+Fix illegal C.
+Dragonfly support.
+
+--- remote.c.orig      2001-02-12 21:05:08.000000000 +0000
++++ remote.c
+@@ -33,6 +33,8 @@
+ 
+ /*      ******************** Include Files                ************** */
+ 
++#include "netbsdconf.h"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+@@ -52,9 +54,13 @@
+ # else
+ #  include <machine/mouse.h>
+ # endif
++#elif defined(__DragonFly__)
++# include <sys/mouse.h>
+ #else
++#if HAVE_MOUSE_H
+ # include <machine/mouse.h>
+ #endif
++#endif
+ #include <X11/Intrinsic.h>
+ #include "tvdebug.h"
+ #include "tvutil.h"
+@@ -62,10 +68,12 @@
+ #include "haup_remote.h"
+ #include "pixelview_remote.h"
+ 
++#if HAVE_MOUSE_H
++
+ /*      ******************** Local defines                ************** */
+ 
+ /*  FIXME: Remove this old code someday  */
+-#ifdef 0
++#if 0
+ #  define OLD_DEV_SYSMOUSE_STUFF
+ #endif
+ 
+@@ -847,3 +855,18 @@ void TVREMOTEFlush( void )
+     case REMOTE_TYPE_PIXELVIEW :  TVPIXELVIEWREMOTEFlush(); break;
+   }
+ }
++
++#else /* HAVE_MOUSE_H */
++void
++TVREMOTEOpen( XtAppContext       app_ctx, 
++      char               rem_type[], 
++      TVREMOTE_CB_FUNCT *cb )
++      {
++      }
++
++void
++TVREMOTEFlush( void )
++      {
++      }
++
++#endif /* HAVE_MOUSE_H */



Home | Main Index | Thread Index | Old Index