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
408 408
409@section sdl409@section sdl
410 410
411SDL (Simple DirectMedia Layer) output device.411SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed.
412
413For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used:
414
415@example
416ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
417@end example
412 418
413"sdl2" can be used as alias for "sdl".419"sdl2" can be used as alias for "sdl".
414 420
libavdevice/sdl2.c+10−0
@@ -51,6 +51,7 @@ typedef struct { · 50 unmodified lines
51 SDL_Rect texture_rect;51 SDL_Rect texture_rect;
52 52
53 int inited;53 int inited;
54 int warned;
54} SDLContext;55} SDLContext;
55 56
56static const struct sdl_texture_format_entry {57static const struct sdl_texture_format_entry {
@@ -165,6 +166,15 @@ static int sdl2_write_header(AVFormatContext *s) · 108 unmodified lines
165 int i, ret = 0;166 int i, ret = 0;
166 int flags = 0;167 int flags = 0;
167 168
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
168 if (!sdl->window_title)178 if (!sdl->window_title)
169 sdl->window_title = av_strdup(s->url);179 sdl->window_title = av_strdup(s->url);
170 180
libavdevice/version_major.h+2−0
@@ -37,5 +37,7 @@ · 36 unmodified lines
37#define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)37#define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
38// reminder to remove the opengl device on next major bump38// reminder to remove the opengl device on next major bump
39#define FF_API_OPENGL_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)39#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)
40 42
41#endif /* AVDEVICE_VERSION_MAJOR_H */43#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