Skip to content

Commit

Permalink
Revert "Sync dfsg with icamerasrc_slim_api branch"
Browse files Browse the repository at this point in the history
This reverts commit e95a97a.

Signed-off-by: Hao Yao <hao.yao@intel.com>
  • Loading branch information
hao-yao committed Oct 21, 2024
1 parent e22578f commit 8c42261
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 1,146 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
cd "${GITHUB_WORKSPACE}/hal"
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_CAMHAL_ADAPTOR=ON -DBUILD_CAMHAL_PLUGIN=ON -DIPU_VERSIONS="ipu6;ipu6ep;ipu6epmtl" -DUSE_PG_LITE_PIPE=ON ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../src/hal/hal_adaptor
make -j$(nproc) install
- uses: actions/checkout@v3
Expand All @@ -77,6 +77,18 @@ jobs:
env:
CHROME_SLIM_CAMHAL: ON
run: |
case "${{ matrix.os }}" in
("ubuntu:24.04")
fortify_level=3
;;
("ubuntu:22.04"|"ubuntu:20.04")
fortify_level=2
;;
(*)
echo "${{ matrix.os }} is unsupported yet. Please find the default fortify_level in /usr/share/perl5/Dpkg/Vendor/Ubuntu.pm or /usr/share/perl5/Dpkg/Vendor/Debian.pm."
exit 1
;;
esac
cd "${GITHUB_WORKSPACE}/icamerasrc"
./autogen.sh && make -j$(nproc) install
CPPFLAGS="-D_FORTIFY_SOURCE=$fortify_level" ./autogen.sh && make -j$(nproc) install
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,23 @@ This repository supports MIPI cameras through the IPU6/IPU6EP/IPU6SE on Intel Ti

## Build instructions:
* Prerequisites: ipu6-camera-bins and ipu6-camera-hal installed
* Prerequisites: libdrm-dev libva-dev libgstreamer-plugins-bad1.0-dev
* Prerequisites: libdrm-dev

```sh
export CHROME_SLIM_CAMHAL=ON
# for libdrm.pc
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig"
# only for yocto
export PKG_CONFIG_PATH="/usr/lib/pkgconfig"
./autogen.sh
./configure --prefix=/usr
make
make -j8
# binary install
sudo make install
# build rpm package and then install
make rpm
rpm -ivh --force --nodeps icamerasrc-*.rpm
```

NOTE:
For gstreamer version > 1.22.0, add support for drm dma buffer.
It depends on libdrm, please install it when build icamerasrc
and add option "--enable-gstdrmformat=yes" to enable drm dma buffer.
```sh
sudo apt install libdrm-dev
./configure --prefix=/usr --enable-gstdrmformat=yes
```

## Pipeline examples
* Ensure `${GST_PLUGIN_PATH}` includes icamerasrc installation path
* Testpattern generator (no sensor)
Expand Down Expand Up @@ -70,5 +64,4 @@ sudo -E gst-launch-1.0 icamerasrc device-name=ov13858-uf af-mode=2 ! video/x-raw
* Sensor ar0234
```
sudo -E gst-launch-1.0 icamerasrc device-name=ar0234 ! video/x-raw,format=NV12,width=1280,height=960 ! videoconvert ! glimagesink
sudo -E gst-launch-1.0 icamerasrc device-name=ar0234 io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink
```
3 changes: 2 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ autoreconf --verbose --force --install --make || {
exit 1;
}

args="--prefix=/usr"
args="--prefix=/usr \
--libdir=/usr/lib"

./configure $args || {
echo 'configure failed';
Expand Down
66 changes: 1 addition & 65 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# GStreamer
# Copyright (C) 2015-2024 Intel Corporation
# Copyright (C) 2015-2023 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -94,15 +94,6 @@ AC_ARG_WITH([androidstubs],
[],
[with_androidstubs=no])

AC_ARG_WITH([haladaptor],
AC_HELP_STRING([--with-haladaptor], [Link hal adaptor library [default=no]]))

AC_ARG_ENABLE([gstdrmformat],
AC_HELP_STRING([--enable-gstdrmformat], [Enable DRM format [default=no]]))

AC_ARG_ENABLE([internalbuild],
AC_HELP_STRING([--enable-internalbuild], [Internal build [default=no]]))

AC_ARG_VAR([DEFAULT_CAMERA],
[the default camera ID])

Expand Down Expand Up @@ -189,29 +180,6 @@ PKG_CHECK_MODULES(LIBDRM, [libdrm libdrm_intel], [
AC_MSG_ERROR([Cannot find libdrm pkgconfig])
])

AS_IF([test "x$enable_gstdrmformat" = "xyes"], [
PKG_CHECK_MODULES(GST_1_23, [gstreamer-1.0 >= 1.23], [ have_gstdrmformat=yes ], [
PKG_CHECK_MODULES(GST_1_22_6, [gstreamer-1.0 = 1.22.6], [ have_gstdrmformat=yes ], [ have_gstdrmformat=no ])
])
AS_IF([test "x$have_gstdrmformat" = "xyes"], [
PKG_CHECK_MODULES(DEP_GSTDRMFORMAT, [gstreamer-va-1.0 libva libva-drm], [
AC_SUBST(DEP_GSTDRMFORMAT_CFLAGS)
AC_SUBST(DEP_GSTDRMFORMAT_LIBS)
], [
have_gstdrmformat=no
AC_MSG_ERROR([Need gstreamer-va-1.0 libva libva-drm to enable GstVaDisplay])
])
], [
AC_MSG_ERROR([Need GStreamer >= 1.23 or == 1.22.6, and gstreamer-va-1.0 libva libva-drm to enable GstVaDisplay])
])
AS_IF([test "x$have_gstdrmformat" = "xyes"], [
AC_DEFINE([GST_DRM_FORMAT], [1], [GStreamer at least 1.23 or exactly 1.22.6 supports DRM format])
AC_MSG_NOTICE(Define GST_DRM_FORMAT)
])
], [])

dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
AC_MSG_CHECKING([to see if compiler understands -Wall])
save_CFLAGS="$CFLAGS"
Expand All @@ -222,38 +190,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"

AC_DEFUN([AC_CHECK_FORTIFY_SOURCE], [
AC_MSG_CHECKING([for _FORTIFY_SOURCE value with -O2])
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -O2"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
#ifndef _FORTIFY_SOURCE
#error
#endif
int main() { printf("%d\n", _FORTIFY_SOURCE); return 0; }
]])],
[
fortify_source_value=`./conftest$EXEEXT`
],
[
AC_MSG_RESULT([no])
fortify_source_value=0
],
[
AC_MSG_CHECKING([for cross-compiling _FORTIFY_SOURCE depends on toolchain])
AC_MSG_RESULT([no])
fortify_source_value=0
]
)
CFLAGS="$old_CFLAGS"
AC_SUBST([fortify_source_value])
])
AC_CHECK_FORTIFY_SOURCE
AM_CONDITIONAL([NO_FORTIFY_SOURCE], [test "x$fortify_source_value" = "x0"])

dnl set the plugindir where plugins should be installed (for src/Makefile.am)
if test "x${prefix}" = "x$HOME"; then
Expand Down
10 changes: 1 addition & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# GStreamer
# Copyright (C) 2015-2024 Intel Corporation
# Copyright (C) 2015-2023 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -73,7 +73,6 @@ libgsticamerasrc_la_CPPFLAGS = \
$(GST_CFLAGS) \
$(CAMHAL_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(DEP_GSTDRMFORMAT_CFLAGS) \
-std=c++11 \
-Werror \
$(LIBUTILS_CFLAGS) \
Expand All @@ -92,19 +91,12 @@ libgsticamerasrc_la_LIBADD = $(GST_LIBS) \
-lgstvideo-$(GST_API_VERSION) \
interfaces/libgsticamerainterface-$(GST_API_VERSION).la \
$(LIBDRM_LIBS) \
$(DEP_GSTDRMFORMAT_LIBS) \
$(CAMHAL_LIBS)

libgsticamerasrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# for hardening-check
libgsticamerasrc_la_LDFLAGS += -fPIE -fPIC -Wformat -Wformat-security -Wl,-z,relro -Wl,-z,now

# test default fortify level
if NO_FORTIFY_SOURCE
libgsticamerasrc_la_CPPFLAGS+= -D_FORTIFY_SOURCE=2
libgsticamerasrc_la_LDFLAGS+= -D_FORTIFY_SOURCE=2
endif

# headers we need but don't want installed
noinst_HEADERS = gstcamerasrc.h \
gstcameraformat.h \
Expand Down
Loading

0 comments on commit 8c42261

Please sign in to comment.