Skip to content

Commit

Permalink
Merge pull request #123 from sundermann/nv12
Browse files Browse the repository at this point in the history
Add NV12 support
  • Loading branch information
sundermann authored Oct 28, 2024
2 parents cf1230f + b031a7a commit a27ad43
Show file tree
Hide file tree
Showing 95 changed files with 350 additions and 14,856 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
run: find .

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: hyperion_webos_${{ matrix.build-type }}
path: |
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ list(JOIN _cflags_list " " COMMON_FLAGS)

add_subdirectory(libyuv)
add_subdirectory(tv-native-apis)
add_subdirectory(flatccrt)
add_subdirectory(fbs)

add_compile_options(${_cflags_list} -Wall -Wextra -Wpedantic -Werror -DSECURITY_COMPATIBILITY)

Expand Down Expand Up @@ -63,8 +63,7 @@ set_target_properties(hyperion-webos PROPERTIES
# LINK_FLAGS "-Wl,-rpath,'$ORIGIN:$ORIGIN/lib' -Wl,-z,origin"
)
target_include_directories(hyperion-webos PRIVATE ${CMAKE_BINARY_DIR})
target_include_directories(hyperion-webos SYSTEM PUBLIC fbs)
target_link_libraries(hyperion-webos flatccrt pthread dl yuv rt ${GTHREAD2_LDFLAGS} ${PBNJSON_LDFLAGS} ${LS2_LDFLAGS} ${GLIB2_LDFLAGS} ${PMLOG_LDFLAGS})
target_link_libraries(hyperion-webos fbs flatccrt pthread dl yuv rt ${GTHREAD2_LDFLAGS} ${PBNJSON_LDFLAGS} ${LS2_LDFLAGS} ${GLIB2_LDFLAGS} ${PMLOG_LDFLAGS})
add_dependencies(hyperion-webos version gm_backend dile_vt_backend halgal_backend vtcapture_backend)
set_property(TARGET hyperion-webos PROPERTY ENABLE_EXPORTS 1)

Expand Down
81 changes: 81 additions & 0 deletions fbs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
include(ExternalProject)

if (CMAKE_BUILD_TYPE MATCHES "Debug")
SET(FLATCC_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/native/bin/flatcc_d)
else ()
SET(FLATCC_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/native/bin/flatcc)
endif ()

ExternalProject_Add(flatcc-native
URL https://github.com/dvidelabs/flatcc/archive/v0.6.1.tar.gz
URL_HASH SHA512=46ba5ca75facc7d3360dba797d24ae7bfe539a854a48831e1c7b96528cf9594d8bea22b267678fd7c6d742b6636d9e52930987119b4c6b2e38d4abe89b990cae
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/native
-DFLATCC_TEST=OFF
-DFLATCC_INSTALL=ON
BUILD_BYPRODUCTS ${FLATCC_EXECUTABLE}
)

SET(FLATCC_EXECUTABLE ${FLATCC_EXECUTABLE})
add_custom_command(
OUTPUT hyperion_reply_builder.h hyperion_reply_reader.h flatbuffers_common_builder.h flatbuffers_common_reader.h
COMMAND ${FLATCC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hyperion_reply.fbs -w --common_reader --common_builder
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hyperion_reply.fbs
)

add_custom_command(
OUTPUT hyperion_request_builder.h hyperion_request_reader.h
COMMAND ${FLATCC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/hyperion_request.fbs -w
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hyperion_request.fbs
)

add_custom_target(generate-fbs DEPENDS
flatbuffers_common_builder.h
flatbuffers_common_reader.h
hyperion_reply_builder.h
hyperion_reply_reader.h
hyperion_request_builder.h
hyperion_request_reader.h)
add_dependencies(generate-fbs flatcc-native)

add_library(fbs INTERFACE)
target_include_directories(fbs SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(fbs generate-fbs)


if (CMAKE_BUILD_TYPE MATCHES "Debug")
SET(FLATCC_LIB ${CMAKE_CURRENT_BINARY_DIR}/lib/libflatccrt_d.a)
else ()
SET(FLATCC_LIB ${CMAKE_CURRENT_BINARY_DIR}/lib/libflatccrt.a)
endif ()

ExternalProject_Add(flatcc-target
URL https://github.com/dvidelabs/flatcc/archive/v0.6.1.tar.gz
URL_HASH SHA512=46ba5ca75facc7d3360dba797d24ae7bfe539a854a48831e1c7b96528cf9594d8bea22b267678fd7c6d742b6636d9e52930987119b4c6b2e38d4abe89b990cae
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS=${COMMON_FLAGS}
-DCMAKE_CXX_FLAGS=${COMMON_FLAGS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}
-DFLATCC_TEST=OFF
-DFLATCC_RTONLY=ON
-DFLATCC_INSTALL=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
BUILD_BYPRODUCTS ${FLATCC_LIB}
)

add_library(flatccrt IMPORTED STATIC GLOBAL)
add_dependencies(flatccrt flatcc-target)
set(FLATCCRT_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include)
file(MAKE_DIRECTORY ${FLATCCRT_INCLUDE_DIRS})
set_target_properties(flatccrt PROPERTIES
IMPORTED_LOCATION ${FLATCC_LIB}
INTERFACE_INCLUDE_DIRECTORIES ${FLATCCRT_INCLUDE_DIRS}
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${FLATCCRT_INCLUDE_DIRS}
)
Loading

0 comments on commit a27ad43

Please sign in to comment.