summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2016-02-27 23:23:41 +0100
committerMichael Niedermayer <[email protected]>2016-06-05 17:04:29 +0200
commit134cba728bc6f4e3c5caec98b800faad244d8cfb (patch)
treef11ace95e1885c4572fbd761d4a6118d4bd886a0
parent2ccf9ae6ccc8888ce27b6867d87c30c5743e72ce (diff)
Seperate x264rgb encoder and only enable when its actually supported
This avoids enabling and building the x264rgb encoder when its actually not supported and thus would not work Signed-off-by: Michael Niedermayer <[email protected]>
-rwxr-xr-xconfigure3
-rw-r--r--libavcodec/libx264.c22
-rw-r--r--libavcodec/version.h2
3 files changed, 15 insertions, 12 deletions
diff --git a/configure b/configure
index cd67f055e0..7c463a5ccd 100755
--- a/configure
+++ b/configure
@@ -2768,7 +2768,7 @@ libwebp_encoder_deps="libwebp"
libwebp_anim_encoder_deps="libwebp"
libx262_encoder_deps="libx262"
libx264_encoder_deps="libx264"
-libx264rgb_encoder_deps="libx264"
+libx264rgb_encoder_deps="libx264 x264_csp_bgr"
libx264rgb_encoder_select="libx264_encoder"
libx265_encoder_deps="libx265"
libxavs_encoder_deps="libxavs"
@@ -5393,6 +5393,7 @@ check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwai
check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
+check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR"
case "$custom_allocator" in
jemalloc)
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 449d76dd38..4d14665361 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -442,7 +442,7 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P9:
case AV_PIX_FMT_YUV444P10: return X264_CSP_I444;
-#ifdef X264_CSP_BGR
+#if CONFIG_LIBX264RGB_ENCODER
case AV_PIX_FMT_BGR0:
return X264_CSP_BGRA;
case AV_PIX_FMT_BGR24:
@@ -896,14 +896,14 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
AV_PIX_FMT_NV20,
AV_PIX_FMT_NONE
};
+#if CONFIG_LIBX264RGB_ENCODER
static const enum AVPixelFormat pix_fmts_8bit_rgb[] = {
-#ifdef X264_CSP_BGR
AV_PIX_FMT_BGR0,
AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGB24,
-#endif
AV_PIX_FMT_NONE
};
+#endif
static av_cold void X264_init_static(AVCodec *codec)
{
@@ -1047,13 +1047,6 @@ static const AVClass x264_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-static const AVClass rgbclass = {
- .class_name = "libx264rgb",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
AVCodec ff_libx264_encoder = {
.name = "libx264",
.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
@@ -1070,6 +1063,15 @@ AVCodec ff_libx264_encoder = {
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP,
};
+#endif
+
+#if CONFIG_LIBX264RGB_ENCODER
+static const AVClass rgbclass = {
+ .class_name = "libx264rgb",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
AVCodec ff_libx264rgb_encoder = {
.name = "libx264rgb",
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b7de26a461..cf7f231f76 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 44
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \