[libav-devel] [RELEASE9/PATCH] h264/mpegvideo: do not provide pixel formats for hwaccels that are not compiled in

Anton Khirnov anton at khirnov.net
Fri Nov 29 20:09:39 CET 2013


---
This has already been done in master, but over the course of several commits, so
it's easier to write it anew than backport
---
 libavcodec/h264.c      |    6 ++++++
 libavcodec/mpegvideo.c |    6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8625b0f..29c8196 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -60,9 +60,15 @@ static const uint8_t div6[QP_MAX_NUM + 1] = {
 };
 
 static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
     AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
     AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
     AV_PIX_FMT_VDA_VLD,
+#endif
     AV_PIX_FMT_YUVJ420P,
     AV_PIX_FMT_NONE
 };
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 0274f01..2f65779 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -131,9 +131,15 @@ const enum AVPixelFormat ff_pixfmt_list_420[] = {
 };
 
 const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[] = {
+#if CONFIG_H264_DXVA2_HWACCEL
     AV_PIX_FMT_DXVA2_VLD,
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
     AV_PIX_FMT_VAAPI_VLD,
+#endif
+#if CONFIG_H264_VDA_HWACCEL
     AV_PIX_FMT_VDA_VLD,
+#endif
     AV_PIX_FMT_YUV420P,
     AV_PIX_FMT_NONE
 };
-- 
1.7.10.4



More information about the libav-devel mailing list