[FFmpeg-devel] [PATCH] lavd: deprecate the bktr device

Anton Khirnov anton at khirnov.net
Sun Jan 28 11:00:42 EET 2024


It implements BSD-specific support for very old analog capture cards,
which are highly unlikely to be useful today. After being added in 2005,
there were never any commits to it beyond compilation fixes and generic
maintenance. There have also been zero trac tickets for this device, and
the only related web search result I found concludes that it does not
work.

The code also does some unacceptable things, like messing with signal
handlers and storing its state in global variables.
---
 doc/indevs.texi             | 3 ++-
 libavdevice/bktr.c          | 3 +++
 libavdevice/version_major.h | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index a0c684f545..d1b2bacf8b 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -222,7 +222,8 @@ $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
 
 @section bktr
 
-BSD video input device.
+BSD video input device. Deprecated and will be removed - please contact
+the developers if you are interested in maintaining it.
 
 @subsection Options
 
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index 196637852f..864726468f 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -264,6 +264,9 @@ static int grab_read_header(AVFormatContext *s1)
     AVRational framerate;
     int ret = 0;
 
+    av_log(s1, AV_LOG_WARNING, "bktr input is deprecated and will be removed. "
+           "Please contact the developers if you are interested in maintaining it.\n");
+
     if (!s->framerate)
         switch (s->standard) {
         case PAL:   s->framerate = av_strdup("pal");  break;
diff --git a/libavdevice/version_major.h b/libavdevice/version_major.h
index b884fd4224..9f7b79b2ee 100644
--- a/libavdevice/version_major.h
+++ b/libavdevice/version_major.h
@@ -33,4 +33,7 @@
  * the public API and may change, break or disappear at any time.
  */
 
+// reminder to remove the bktr device on next major bump
+#define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
+
 #endif /* AVDEVICE_VERSION_MAJOR_H */
-- 
2.42.0



More information about the ffmpeg-devel mailing list