Skip to content

Commit 4798308

Browse files
DJI-MartinDJI-Martin
DJI-Martin
authored and
DJI-Martin
committed
NEW: Supports the DJI Dock2
FIX: Fixed an issue where network errors during media file retrieval could lead to unrecoverable operation block. ENH: Enhanced the recovery mechainism for stream transmission error. Improved the frame rate of target detection in the liveview sample.
1 parent 2f18a30 commit 4798308

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3166
-29682
lines changed

CMakeLists.txt

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
cmake_minimum_required(VERSION 3.9)
22
project(dji_edge_sdk_demo CXX)
33

4-
set(LIB_SAMPLE edge_sample)
4+
set(MODULE_SAMPLE_SRC "")
5+
set(SAMPLE_LIB edge_sample)
56
set(CMAKE_C_FLAGS "-pthread -std=gnu99")
67
set(CMAKE_EXE_LINKER_FLAGS "-pthread")
78
set(CMAKE_C_COMPILER "gcc")
89
set(CMAKE_CXX_COMPILER "g++")
9-
add_definitions(-D_GNU_SOURCE)
1010

1111
set(COMMON_CXX_FLAGS "-std=c++14 -pthread")
1212
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_CXX_FLAGS} -fprofile-arcs -ftest-coverage -Wno-deprecated-declarations")
1313
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
1414
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
1515

16-
include_directories(include)
17-
include_directories(examples/common)
16+
add_definitions(-D_GNU_SOURCE)
1817

1918
file(GLOB_RECURSE MODULE_SAMPLE_SRC
2019
examples/init/pre_init.cc
21-
examples/init/key_store_default.cc
22-
examples/liveview/sample_liveview.cc
23-
examples/liveview/stream_decoder.cc
24-
examples/liveview/ffmpeg_stream_decoder.cc
25-
examples/liveview/image_processor_thread.cc
26-
examples/liveview/stream_processor_thread.cc
27-
examples/common/image_processor_dnn.cc)
20+
examples/init/key_store_default.cc)
21+
22+
include_directories(include)
23+
include_directories(examples/common)
2824

2925
link_directories(${CMAKE_CURRENT_LIST_DIR}/lib/${CMAKE_HOST_SYSTEM_PROCESSOR})
3026
link_directories(${CMAKE_BINARY_DIR})
@@ -46,11 +42,11 @@ if (OpenCV_FOUND)
4642
add_definitions(-DOPEN_CV_VERSION_4)
4743
endif ()
4844
else ()
49-
message(STATUS "Did not find OpenCV in the system, image data is inside RecvContainer as raw data")
45+
message(STATUS "\nDID NOT FIND OPENCV IN THE SYSTEM, SOME EXECUTABLE FILES WILL NOT BE BUILT!!\n")
5046
endif ()
5147

5248
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
53-
find_package(FFMPEG REQUIRED)
49+
find_package(FFMPEG QUIET)
5450
if (FFMPEG_FOUND)
5551
message(STATUS "Found FFMPEG installed in the system")
5652
message(STATUS " - Includes: ${FFMPEG_INCLUDE_DIR}")
@@ -73,38 +69,46 @@ if (FFMPEG_FOUND)
7369
include_directories(${FFMPEG_INCLUDE_DIR})
7470
add_definitions(-DFFMPEG_INSTALLED)
7571
else ()
76-
message(STATUS "Cannot Find FFMPEG")
72+
message(STATUS "\nDID NOT FIND FFMPEG IN THE SYSTEM, SOME EXECUTABLE FILES WILL NOT BE BUILT!!\n")
7773
endif (FFMPEG_FOUND)
7874

79-
if (OpenCV_FOUND)
75+
if (OpenCV_FOUND AND FFMPEG_FOUND)
76+
file(GLOB_RECURSE MODULE_SAMPLE_SRC
77+
${MODULE_SAMPLE_SRC}
78+
examples/liveview/sample_liveview.cc
79+
examples/liveview/stream_decoder.cc
80+
examples/liveview/ffmpeg_stream_decoder.cc
81+
examples/liveview/image_processor_thread.cc
82+
examples/liveview/stream_processor_thread.cc
83+
examples/common/util_misc.cc
84+
examples/common/image_processor.cc
85+
examples/common/image_processor_yolovfastest.cc)
86+
8087
link_libraries(${OpenCV_LIBS})
81-
endif ()
82-
if (FFMPEG_FOUND)
8388
link_libraries(${FFMPEG_LIBRARIES})
84-
endif ()
89+
add_executable(sample_liveview examples/liveview/sample_liveview_main.cc)
90+
target_link_libraries(sample_liveview ${SAMPLE_LIB})
8591

86-
add_library(${LIB_SAMPLE} STATIC ${MODULE_SAMPLE_SRC})
92+
add_executable(test_liveview examples/liveview/test_liveview_main.cc)
93+
target_link_libraries(test_liveview ${SAMPLE_LIB})
8794

88-
add_executable(sample_liveview examples/liveview/sample_liveview_main.cc)
89-
target_link_libraries(sample_liveview edge_sample)
95+
add_executable(pressure_test examples/test/pressure_test.cc)
96+
target_link_libraries(pressure_test ${SAMPLE_LIB})
97+
endif ()
9098

91-
add_executable(test_liveview examples/liveview/test_liveview_main.cc)
92-
target_link_libraries(test_liveview edge_sample)
99+
add_library(${SAMPLE_LIB} STATIC ${MODULE_SAMPLE_SRC})
93100

94101
add_executable(sample_read_media_file examples/media_manager/sample_read_media_file.cc)
95-
target_link_libraries(sample_read_media_file edge_sample)
102+
target_link_libraries(sample_read_media_file ${SAMPLE_LIB})
96103

97104
add_executable(sample_media_file_list examples/media_manager/sample_media_file_list.cc)
98-
target_link_libraries(sample_media_file_list edge_sample)
105+
target_link_libraries(sample_media_file_list ${SAMPLE_LIB})
99106

100107
add_executable(sample_set_upload_cloud_strategy examples/media_manager/sample_set_upload_cloud_strategy.cc)
101-
target_link_libraries(sample_set_upload_cloud_strategy edge_sample)
108+
target_link_libraries(sample_set_upload_cloud_strategy ${SAMPLE_LIB})
102109

103110
add_executable(sample_cloud_api examples/cloud_api/sample_cloud_api.cc)
104-
target_link_libraries(sample_cloud_api edge_sample)
105-
106-
add_executable(pressure_test examples/test/pressure_test.cc)
107-
target_link_libraries(pressure_test edge_sample)
111+
target_link_libraries(sample_cloud_api ${SAMPLE_LIB})
108112

109113
if (NOT EXECUTABLE_OUTPUT_PATH)
110114
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DJI Edge SDK (ESDK)
22

3-
![](https://img.shields.io/badge/version-V1.0.0-yellow.svg)
3+
![](https://img.shields.io/badge/version-V1.1.0-yellow.svg)
44
![](https://img.shields.io/badge/platform-linux-green.svg)
55
![](https://img.shields.io/badge/license-MIT-blue.svg)
66

0 commit comments

Comments
 (0)