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 <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-02-27 23:23:41 +01:00
parent 2ccf9ae6cc
commit 134cba728b
3 changed files with 15 additions and 12 deletions

3
configure vendored
View File

@ -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)

View File

@ -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",

View File

@ -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, \