[FFmpeg-cvslog] kmsgrab: Fix build failure with old libdrm

Jun Zhao git at videolan.org
Fri Sep 15 01:09:44 EEST 2017


ffmpeg | branch: master | Jun Zhao <jun.zhao at intel.com> | Wed Sep 13 20:21:38 2017 -0400| [462568185b0af4d651441ae397cc83bdb7e573ed] | committer: Mark Thompson

kmsgrab: Fix build failure with old libdrm

DRM_FORMAT_R8 was added in libdrm 2.4.68.
DRM_FORMAT_R16 was added in libdrm 2.4.82.

Signed-off-by: Jun Zhao <jun.zhao at intel.com>
Signed-off-by: Mark Thompson <sw at jkqxz.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=462568185b0af4d651441ae397cc83bdb7e573ed
---

 libavdevice/kmsgrab.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/kmsgrab.c b/libavdevice/kmsgrab.c
index d222abfd60..67a83ef84a 100644
--- a/libavdevice/kmsgrab.c
+++ b/libavdevice/kmsgrab.c
@@ -202,8 +202,12 @@ static const struct {
     enum AVPixelFormat pixfmt;
     uint32_t drm_format;
 } kmsgrab_formats[] = {
+#ifdef DRM_FORMAT_R8
     { AV_PIX_FMT_GRAY8,    DRM_FORMAT_R8       },
+#endif
+#ifdef DRM_FORMAT_R16
     { AV_PIX_FMT_GRAY16LE, DRM_FORMAT_R16      },
+#endif
     { AV_PIX_FMT_RGB24,    DRM_FORMAT_RGB888   },
     { AV_PIX_FMT_BGR24,    DRM_FORMAT_BGR888   },
     { AV_PIX_FMT_0RGB,     DRM_FORMAT_XRGB8888 },



More information about the ffmpeg-cvslog mailing list