videoutils/x264: clone from github if no x264 source

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
This commit is contained in:
shizhenghui 2024-07-16 11:28:41 +08:00 committed by Alan Carvalho de Assis
parent 7704254f68
commit 836aecb10d
2 changed files with 53 additions and 2 deletions

@ -48,7 +48,9 @@ else
endif
# suppress -Wundef -Wno-format
CFLAGS += -Wno-undef -Wno-format -fno-var-tracking-assignments -Wno-unused-but-set-variable -Wno-cpp
CFLAGS += -Wno-undef -Wno-format -fno-var-tracking-assignments \
-Wno-unused-but-set-variable -Wno-cpp \
-Wno-dangling-pointer -Wno-array-bounds
SRCS = common/osdep.c common/base.c common/cpu.c common/tables.c \
encoder/api.c
@ -239,7 +241,7 @@ ifneq ($(CONFIG_UTILS_X264),)
CSRCS += $(addprefix $(SRCPATH)$(DELIM), $(SRCCLI) $(SRCCLI_X))
endif
$(DST_PATH)/config.mak:
$(DST_PATH)/config.mak: x264
$(Q)echo "X264 configure... $(CONFIG_ARCH)"
$(Q)cd $(DST_PATH) && $(X264_CONFIG_SCRIPT) --disable-cli --enable-static \
--disable-bashcompletion --disable-opencl \
@ -262,5 +264,16 @@ distclean::
$(DST_PATH)/config.log $(DST_PATH)/x264.pc $(DST_PATH)/x264.def \
$(DST_PATH)/config.h
# Download x264 if no x264/.git found
x264:
$(Q)git clone https://github.com/mirror/x264.git x264
$(Q)cd x264 && git apply ../patch/0001-x264-fix-UNUSED-redefined.patch
ifeq ($(wildcard x264/.git),)
context:: x264
distclean::
$(call DELDIR, x264)
endif
include $(APPDIR)/Application.mk

@ -0,0 +1,38 @@
From 2a966aab25b6a20176b0f87f1eb8010432edc655 Mon Sep 17 00:00:00 2001
From: zhangchendong1 <zhangchendong1@xiaomi.com>
Date: Wed, 6 Sep 2023 12:37:19 +0800
Subject: [PATCH] x264: fix "UNUSED" redefined
CC: x264/common/frame.c In file included from x264/common/base.h:43,
from x264/common/common.h:30,
from x264/common/dct.c:28:
x264/common/osdep.h:347: warning: "UNUSED" redefined
347 | #define UNUSED __attribute__((unused))
|
In file included from /ssd1t/nuttx-github/nuttx/include/sys/types.h:29,
from /ssd1t/nuttx-github/nuttx/include/stdio.h:30,
from x264/common/osdep.h:33:
/ssd1t/nuttx-github/nuttx/include/nuttx/compiler.h:481: note: this is the location of the previous definition
481 | # define UNUSED(a) ((void)(1 || &(a)))
Signed-off-by: zhangchendong1 <zhangchendong1@xiaomi.com>
Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
---
common/osdep.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/osdep.h b/common/osdep.h
index 22301212..db5855d2 100644
--- a/common/osdep.h
+++ b/common/osdep.h
@@ -343,6 +343,7 @@ static inline int x264_is_regular_file( FILE *filehandle )
#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
+#undef UNUSED
#define UNUSED __attribute__((unused))
#define ALWAYS_INLINE __attribute__((always_inline)) inline
#define NOINLINE __attribute__((noinline))
--
2.43.0