diff mbox series

[FFmpeg-devel,2/2] avdevice: deprecate sdl outdev

Message ID 20240213073426.47433-2-jdek@itanimul.li
State New
Headers show
Series [FFmpeg-devel,1/2] avdevice: deprecate opengl outdev | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

J. Dekker Feb. 13, 2024, 7:34 a.m. UTC
Signed-off-by: J. Dekker <jdek@itanimul.li>
---
 libavdevice/sdl2.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index 342a253dc0..6a6751e40f 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -51,6 +51,7 @@  typedef struct {
     SDL_Rect texture_rect;
 
     int inited;
+    int warned;
 } SDLContext;
 
 static const struct sdl_texture_format_entry {
@@ -165,6 +166,14 @@  static int sdl2_write_header(AVFormatContext *s)
     int i, ret = 0;
     int flags  = 0;
 
+    if (!sdl->warned) {
+        av_log(sdl, AV_LOG_WARNING,
+            "The sdl output device is deprecated. For monitoring purposes in ffmpeg you can output to a file or use pipes and a video player.\n"
+            "Example: ffmpeg -i input.mkv -f nut - | ffplay \n"
+        );
+        sdl->warned = 1;
+    }
+
     if (!sdl->window_title)
         sdl->window_title = av_strdup(s->url);