History

avdevice: deprecate sdl outdev

J. Dekker committed 2 years ago

Commit 2b17a741 parent e4c0cdf3 files · +19 −1Browse files

Unified · Split

3 files
  1. doc/outdevs.texi +7 −1
  2. libavdevice/sdl2.c +10 −0
  3. libavdevice/version_major.h +2 −0
doc/outdevs.texi+7−1
@@ -408,7 +408,13 @@ ffmpeg -i INPUT -f pulse "stream name" · 407 unmodified lines
408408
409409 @section sdl
410410
411−SDL (Simple DirectMedia Layer) output device.
411+SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed.
412+
413+For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used:
414+
415+@example
416+ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
417+@end example
412418
413419 "sdl2" can be used as alias for "sdl".
414420
libavdevice/sdl2.c+10−0
@@ -51,6 +51,7 @@ typedef struct { · 50 unmodified lines
5151 SDL_Rect texture_rect;
5252
5353 int inited;
54+ int warned;
5455 } SDLContext;
5556
5657 static const struct sdl_texture_format_entry {
@@ -165,6 +166,15 @@ static int sdl2_write_header(AVFormatContext *s) · 108 unmodified lines
165166 int i, ret = 0;
166167 int flags = 0;
167168
169+ if (!sdl->warned) {
170+ av_log(sdl, AV_LOG_WARNING,
171+ "The sdl output device is deprecated due to being fundamentally incompatible with libavformat API. "
172+ "For monitoring purposes in ffmpeg you can output to a file or use pipes and a video player.\n"
173+ "Example: ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -\n"
174+ );
175+ sdl->warned = 1;
176+ }
177+
168178 if (!sdl->window_title)
169179 sdl->window_title = av_strdup(s->url);
170180
libavdevice/version_major.h+2−0
@@ -37,5 +37,7 @@ · 36 unmodified lines
3737 #define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
3838 // reminder to remove the opengl device on next major bump
3939 #define FF_API_OPENGL_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
40+// reminder to remove the sdl2 device on next major bump
41+#define FF_API_SDL2_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
4042
4143 #endif /* AVDEVICE_VERSION_MAJOR_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t