summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorJ. Dekker <jdek@itanimul.li>2024-02-13 08:34:25 +0100
committerJ. Dekker <jdek@itanimul.li>2024-02-28 10:28:49 +0100
commite4c0cdf8df96047ee195cc594a2a93443e2aa25d (patch)
tree641dc598feefb7fb65f0dc54aa6c115559d465d6 /libavdevice
parent570052cd2a38200ae6aca52e817517513812ec56 (diff)
avdevice: deprecate opengl outdev
Signed-off-by: J. Dekker <jdek@itanimul.li>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/opengl_enc.c11
-rw-r--r--libavdevice/version_major.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index b2ac6eb16a..69de6fad03 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -224,6 +224,8 @@ typedef struct OpenGLContext {
int picture_height; ///< Rendered height
int window_width;
int window_height;
+
+ int warned;
} OpenGLContext;
static const struct OpenGLFormatDesc {
@@ -1060,6 +1062,15 @@ static av_cold int opengl_write_header(AVFormatContext *h)
AVStream *st;
int ret;
+ if (!opengl->warned) {
+ av_log(opengl, AV_LOG_WARNING,
+ "The opengl output device is deprecated due to being fundamentally incompatible with libavformat API. "
+ "For monitoring purposes in ffmpeg you can output to a file or use pipes and a video player.\n"
+ "Example: ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -\n"
+ );
+ opengl->warned = 1;
+ }
+
if (h->nb_streams != 1 ||
par->codec_type != AVMEDIA_TYPE_VIDEO ||
(par->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME && par->codec_id != AV_CODEC_ID_RAWVIDEO)) {
diff --git a/libavdevice/version_major.h b/libavdevice/version_major.h
index 9f7b79b2ee..da5854ed4c 100644
--- a/libavdevice/version_major.h
+++ b/libavdevice/version_major.h
@@ -35,5 +35,7 @@
// reminder to remove the bktr device on next major bump
#define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
+// reminder to remove the opengl device on next major bump
+#define FF_API_OPENGL_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
#endif /* AVDEVICE_VERSION_MAJOR_H */