From 7704254f68238f66d03295b159dd2e0a2c094ef5 Mon Sep 17 00:00:00 2001 From: shizhenghui Date: Wed, 10 Jul 2024 21:37:10 +0800 Subject: [PATCH] videoutils/openh264: fix CI error since no sys/sysctl.h Add sys/sysctl.h to apps/videoutils/openh264 Signed-off-by: shizhenghui --- videoutils/openh264/CMakeLists.txt | 17 ++----------- videoutils/openh264/Makefile | 4 +-- videoutils/openh264/include/sys/sysctl.h | 32 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 videoutils/openh264/include/sys/sysctl.h diff --git a/videoutils/openh264/CMakeLists.txt b/videoutils/openh264/CMakeLists.txt index 6c70545c6..c3c3186f5 100644 --- a/videoutils/openh264/CMakeLists.txt +++ b/videoutils/openh264/CMakeLists.txt @@ -91,7 +91,8 @@ if(CONFIG_VIDEOUTILS_OPENH264) # Include Directory # ############################################################################ - set(INCLUDES ${SRC_PATH}/codec/api/wels ${SRC_PATH}/codec/common/inc) + set(INCLUDES ${SRC_PATH}/codec/api/wels ${SRC_PATH}/codec/common/inc + ${CMAKE_CURRENT_LIST_DIR}/include) set(DECODER_INCLUDES ${SRC_PATH}/codec/decoder/core/inc ${SRC_PATH}/codec/decoder/plus/inc) set(PROCESSING_INCLUDES @@ -111,20 +112,6 @@ if(CONFIG_VIDEOUTILS_OPENH264) set(CXXFLAGS -Wno-format -Wno-unused-variable -Wno-shadow) - # cmake-format: off - set(SYSCTLBYNAME - [=[ - #ifndef HAVE_SYSCTLBYNAME - #define sysctlbyname(name, oldp, oldlenp, newp, newlen) (-1) - #endif - ]=]) - # cmake-format: on - - file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/def_sysctlbyname.h ${SYSCTLBYNAME}) - - list(APPEND CXXFLAGS - "SHELL:-include ${CMAKE_CURRENT_BINARY_DIR}/def_sysctlbyname.h") - # ############################################################################ # Library Configuration # ############################################################################ diff --git a/videoutils/openh264/Makefile b/videoutils/openh264/Makefile index f64ad26d0..c4f6bdf07 100644 --- a/videoutils/openh264/Makefile +++ b/videoutils/openh264/Makefile @@ -23,6 +23,7 @@ include $(APPDIR)/Make.defs SRC_PATH := openh264 INCLUDES += \ + -I$(CURDIR)/include \ -I$(SRC_PATH)/codec/api/wels \ -I$(SRC_PATH)/codec/common/inc \ -Icodec/common/inc @@ -102,9 +103,6 @@ DECODER_ASM_SRCS += \ CXXFLAGS += $(INCLUDES) $(DECODER_INCLUDES) CXXFLAGS += -Wno-unused-variable -Wno-shadow -lstdc++ -ifndef HAVE_SYSCTLBYNAME -CXXFLAGS += -D'sysctlbyname(name, oldp, oldlenp, newp, newlen)=-1' -endif CXXEXT = .cpp CXXSRCS += $(COMMON_CPP_SRCS) $(DECODER_CPP_SRCS) diff --git a/videoutils/openh264/include/sys/sysctl.h b/videoutils/openh264/include/sys/sysctl.h new file mode 100644 index 000000000..2f304e25a --- /dev/null +++ b/videoutils/openh264/include/sys/sysctl.h @@ -0,0 +1,32 @@ +/**************************************************************************** + * apps/videoutils/openh264/include/sys/sysctl.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_VIDEOUTILS_OPENH264_INCLUDE_SYS_SYSCTL_H +#define __APPS_VIDEOUTILS_OPENH264_INCLUDE_SYS_SYSCTL_H + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define sysctl(args) (-1) +#define sysctlbyname(name, oldp, oldlenp, newp, newlen) (-1) +#define sysctlnametomib(name, mibp, sizep) (-1) + +#endif /* __APPS_VIDEOUTILS_OPENH264_INCLUDE_SYS_SYSCTL_H */