Skip to content

Commit

Permalink
Merge branch 'release/19.09.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Sep 22, 2019
2 parents e553fcd + 372f5ab commit 6d5d0f8
Show file tree
Hide file tree
Showing 75 changed files with 4,323 additions and 3,476 deletions.
100 changes: 0 additions & 100 deletions .circleci/config.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
Language: Cpp
BasedOnStyle: Chromium
ReflowComments: false
---
Language: ObjC
BasedOnStyle: Chromium
ReflowComments: false
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build-workflow
on: push

jobs:
build_raspbian-buster_armv6:
name: Build momo for raspbian-buster_armv6
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make raspbian-buster_armv6
working-directory: build
timeout-minutes: 120
build_raspbian-buster_armv7:
name: Build momo for raspbian-buster_armv7
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make raspbian-buster_armv7
working-directory: build
timeout-minutes: 120
41 changes: 41 additions & 0 deletions .github/workflows/daily_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: daily-build-workflow
on:
schedule:
# UTCで記述する事、この場合は日本時間 9 時にしたいので -9 して 0 にしてある
- cron: "0 0 * * *"
# 明示的な branch の指定はできず、デフォルト branch の latest commit に対して実行される
# https://help.github.com/en/articles/workflow-syntax-for-github-actions#onschedule

jobs:
build_ubuntu-18_04_armv8:
name: Build momo for build_ubuntu-18.04_armv8
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-18.04_armv8
working-directory: build
timeout-minutes: 120
build_ubuntu-18_04_armv8_jetson_nano:
name: Build momo for build_ubuntu-18.04_armv8_jetson_nano
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-18.04_armv8_jetson_nano
working-directory: build
timeout-minutes: 120
build_ubuntu-18_04_x86_64:
name: Build momo for build_ubuntu-18.04_x86_64
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- run: DOCKER_BUILDKIT=1 NOTTY=1 NOMOUNT=1 make ubuntu-18.04_x86_64
working-directory: build
timeout-minutes: 120
build_macos:
name: Build momo for macOS 10.14
runs-on: macos-10.14
steps:
- uses: actions/checkout@v1
- run: make macos
working-directory: build
timeout-minutes: 120
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ webrtc_logs_0
/build/package
/build/momo/
/build/momo.tar.gz

/src/hwenc_jetson/Nv*
19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@

## develop

## 19.09.1

- [ADD] Jetson Nano のハードウェアエンコーダを利用する機能を実装
- @tnoho
- [ADD] Jetson Nano のビルドを追加
- @melpon
- [ADD] CI を CircleCI から GitHub Actions へ切り替える
- macOS の時間制限が OSS の場合はないため Weekly build から Daily build のみにきりかえる
- @hakobera
- [ADD] .clang-format の追加
- @melpon
- [UPDATE] libwebrtc M78 コミットポジションを 3 にする
- libwebrtc のハッシュは 68c715dc01cd8cd0ad2726453e7376b5f353fcd1
- @voluntas
- [UPDATE] コマンドオプションをできるだけ共通化する
- @melpon
- [UPDATE] Raspberry Pi のビルド OS を Ubuntu 16.04 から 18.04 に上げる
- @melpon

## 19.09.0

- [ADD] --disable-echo-cancellation オプションを追加
Expand Down
106 changes: 92 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ include VERSION
# USE_ROS: ROS を使っているかどうか
# 有効な値は 0, 1
#
# USE_MMAL_ENCODER: ハードウェアエンコーダを利用するかどうか
# USE_MMAL_ENCODER: MMAL ハードウェアエンコーダを利用するかどうか
# 有効な値は 0, 1
#
# USE_JETSON_ENCODER: Jetson のハードウェアエンコーダを利用するかどうか
# 有効な値は 0, 1
#
# USE_H264: H264 を利用するかどうか
# 有効な値は 0, 1
#
# BOOST_ROOT: Boost のインストール先ディレクトリ
Expand Down Expand Up @@ -51,6 +57,8 @@ ifeq ($(PACKAGE_NAME),raspbian-buster_armv6)
TARGET_ARCH_ARM ?= armv6
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 1
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 1
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/raspbian-buster_armv6
Expand All @@ -62,6 +70,8 @@ else ifeq ($(PACKAGE_NAME),raspbian-buster_armv7)
TARGET_ARCH_ARM ?= armv7
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 1
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 1
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/raspbian-buster_armv7
Expand All @@ -73,6 +83,8 @@ else ifeq ($(PACKAGE_NAME),ubuntu-16.04_armv7_ros)
TARGET_ARCH_ARM ?= armv7
USE_ROS ?= 1
USE_MMAL_ENCODER ?= 1
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 1
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/ubuntu-16.04_armv7_ros
Expand All @@ -84,16 +96,33 @@ else ifeq ($(PACKAGE_NAME),ubuntu-18.04_armv8)
TARGET_ARCH_ARM ?= armv8
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 0
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 0
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/ubuntu-18.04_armv8
SYSROOT ?= /root/rootfs
else ifeq ($(PACKAGE_NAME),ubuntu-18.04_armv8_jetson_nano)
TARGET_OS ?= linux
TARGET_OS_LINUX ?= ubuntu-18.04
TARGET_ARCH ?= arm
TARGET_ARCH_ARM ?= armv8
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 0
USE_JETSON_ENCODER ?= 1
USE_H264 ?= 1
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/ubuntu-18.04_armv8_jetson_nano
SYSROOT ?= /root/rootfs
else ifeq ($(PACKAGE_NAME),ubuntu-16.04_x86_64_ros)
TARGET_OS ?= linux
TARGET_OS_LINUX ?= ubuntu-16.04
TARGET_ARCH ?= x86_64
USE_ROS ?= 1
USE_MMAL_ENCODER ?= 0
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 0
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/ubuntu-16.04_x86_64_ros
Expand All @@ -103,6 +132,8 @@ else ifeq ($(PACKAGE_NAME),ubuntu-18.04_x86_64)
TARGET_ARCH ?= x86_64
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 0
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 0
BOOST_ROOT ?= /root/boost-$(BOOST_VERSION)
WEBRTC_SRC_ROOT ?= /root/webrtc/src
WEBRTC_LIB_ROOT ?= /root/webrtc-build/ubuntu-18.04_x86_64
Expand All @@ -111,6 +142,8 @@ else ifeq ($(PACKAGE_NAME),macos)
TARGET_ARCH ?= x86_64
USE_ROS ?= 0
USE_MMAL_ENCODER ?= 0
USE_JETSON_ENCODER ?= 0
USE_H264 ?= 1
BOOST_ROOT ?= $(CURDIR)/build/macos/boost-$(BOOST_VERSION)
# CURDIR を付けると、ar に渡す時に引数が長すぎるって怒られたので、
# 相対パスで指定する。
Expand Down Expand Up @@ -157,6 +190,16 @@ else
HAS_ERROR = 1
endif

ifndef USE_JETSON_ENCODER
$(info - USE_JETSON_ENCODER が指定されていません)
HAS_ERROR = 1
endif

ifndef USE_H264
$(info - USE_H264 が指定されていません)
HAS_ERROR = 1
endif

ifndef BOOST_ROOT
$(info - BOOST_ROOT が指定されていません)
HAS_ERROR = 1
Expand Down Expand Up @@ -213,18 +256,7 @@ ifeq ($(USE_ROS),1)
endif
endif

# x86_64/armv8 の場合は H264 を使わない
ifeq ($(TARGET_OS),linux)
ifeq ($(TARGET_ARCH),x86_64)
CFLAGS += -DUSE_H264=0
else ifeq ($(TARGET_ARCH_ARM),armv8)
CFLAGS += -DUSE_H264=0
else
CFLAGS += -DUSE_H264=1
endif
else ifeq ($(TARGET_OS),macos)
CFLAGS += -DUSE_H264=1
endif
CFLAGS += -DUSE_H264=$(USE_H264)

ifeq ($(TARGET_OS),linux)
CFLAGS += -fpic
Expand All @@ -251,7 +283,41 @@ ifeq ($(TARGET_OS),linux)
LDFLAGS += -L$(SYSROOT)/usr/lib/$(ARCH_NAME)
endif

ifneq ($(TARGET_ARCH_ARM),armv8)
ifeq ($(TARGET_ARCH_ARM),armv8)
# Jetson の設定
ifeq ($(USE_JETSON_ENCODER),1)
CFLAGS += \
-DUSE_JETSON_ENCODER=1 \
-I$(SYSROOT)/include/libjpeg-8b
LDFLAGS += \
-lv4l2 \
-L$(SYSROOT)/usr/lib/aarch64-linux-gnu/tegra \
-Wl,-rpath-link=$(SYSROOT)/lib/aarch64-linux-gnu \
-Wl,-rpath-link=$(SYSROOT)/usr/lib/aarch64-linux-gnu \
-Wl,-rpath-link=$(SYSROOT)/usr/lib/aarch64-linux-gnu/tegra \
-lnvbuf_utils \
-lnvbuf_fdmap \
-lnvddk_vic \
-lnvddk_2d_v2 \
-lnvjpeg \
-lnvrm \
-lnvrm_graphics \
-lnvos
SOURCES += $(shell find src/v4l2_video_capturer -maxdepth 1 -name '*.cpp')
SOURCES += $(shell find src/hwenc_jetson -maxdepth 1 -name '*.cpp')
JETSON_ADDITIONAL_SOURCES += \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvBuffer.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvElement.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvElementProfiler.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvJpegDecoder.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvJpegEncoder.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvLogging.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvV4l2Element.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvVideoConverter.cpp \
$(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/samples/common/classes/NvVideoEncoder.cpp
endif
else
# armv6, armv7 用

CFLAGS += -mfloat-abi=hard
Expand Down Expand Up @@ -447,6 +513,18 @@ $(BUILD_ROOT)/libwebrtc.a: $(shell find $(WEBRTC_LIB_ROOT)/obj -name '*.o') | $(

endif

# Jetson Nano を利用する場合の追加ソースのコンパイル
ifeq ($(USE_JETSON_ENCODER),1)

$(BUILD_ROOT)/tegra_multimedia_api/%.o: $(SYSROOT)/usr/src/nvidia/tegra_multimedia_api/%.cpp | $(BUILD_ROOT)
@mkdir -p `dirname $@`
$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@

# OBJECTS にも追加する
OBJECTS += $(addprefix $(BUILD_ROOT)/,$(subst $(SYSROOT)/usr/src/nvidia/,,$(patsubst %.cpp,%.o,$(JETSON_ADDITIONAL_SOURCES))))

endif

# src 以下のソースのビルドルール
$(BUILD_ROOT)/src/%.o: src/%.cpp | $(BUILD_ROOT)
@mkdir -p `dirname $@`
Expand Down
Loading

0 comments on commit 6d5d0f8

Please sign in to comment.