From 72b320db4225d37dc8381fcea912ae0e828d8c0c Mon Sep 17 00:00:00 2001 From: houzh Date: Wed, 7 Dec 2022 01:30:22 +0000 Subject: [PATCH] remove tvhal's static libs --- CMakeLists.txt | 20 --------- cmake/common_functions.cmake | 10 +++++ cmake/modules/FindUniBreak.cmake | 2 +- cmake/modules/FindZIP.cmake | 2 +- cmake/options.cmake | 49 ++++++++++------------ src/gui/CMakeLists.txt | 14 +++---- src/gui/core/graphdevice.cc | 8 ++-- src/gui/core/graphdevice.h | 1 - src/gui/widget/cdwindow.cc | 4 +- src/porting/CMakeLists.txt | 8 +--- src/porting/include/cdplayer.h | 34 +++++++++++++++ src/porting/include/ngl_mediaplayer.h | 31 -------------- src/porting/{x86 => x64}/CMakeLists.txt | 47 ++++++++++----------- src/porting/{x86 => x64}/Generic.kcm | 0 src/porting/{x86 => x64}/Generic.kl | 0 src/porting/{x86 => x64}/dmxreader.cc | 0 src/porting/{x86 => x64}/dmxreader.h | 0 src/porting/{x86 => x64}/gfxdrm.cc | 0 src/porting/{x86 => x64}/gfxdrm.h | 0 src/porting/{x86 => x64}/graph_drm.cc | 0 src/porting/{x86 => x64}/graph_fb.c | 0 src/porting/{x86 => x64}/graph_gtk.c | 0 src/porting/{x86 => x64}/graph_rfb.c | 0 src/porting/{x86 => x64}/graph_win32.c | 0 src/porting/{x86 => x64}/graph_xlib.c | 0 src/porting/{x86 => x64}/input_linux.cc | 0 src/porting/{x86 => x64}/ngl_disp.c | 0 src/porting/{x86 => x64}/ngl_dmx.cc | 0 src/porting/{x86 => x64}/ngl_dsc.c | 0 src/porting/{x86 => x64}/ngl_mediaplayer.c | 2 +- src/porting/{x86 => x64}/ngl_msgq.c | 0 src/porting/{x86 => x64}/ngl_nvm.c | 0 src/porting/{x86 => x64}/ngl_os.c | 0 src/porting/{x86 => x64}/ngl_panel.c | 0 src/porting/{x86 => x64}/ngl_pvr.c | 0 src/porting/{x86 => x64}/ngl_smc.c | 0 src/porting/{x86 => x64}/ngl_snd.c | 0 src/porting/{x86 => x64}/ngl_timer.c | 0 src/porting/{x86 => x64}/ngl_tuner.c | 0 src/porting/{x86 => x64}/ngl_video.c | 0 src/porting/{x86 => x64}/qwerty.kcm | 0 src/porting/{x86 => x64}/qwerty.kl | 0 tests/gui/CMakeLists.txt | 2 +- tests/gui/image_unittests.cc | 15 +++++-- x64build.sh | 19 +++++++++ x86build.sh | 27 ------------ 46 files changed, 135 insertions(+), 160 deletions(-) create mode 100644 src/porting/include/cdplayer.h delete mode 100644 src/porting/include/ngl_mediaplayer.h rename src/porting/{x86 => x64}/CMakeLists.txt (64%) rename src/porting/{x86 => x64}/Generic.kcm (100%) rename src/porting/{x86 => x64}/Generic.kl (100%) rename src/porting/{x86 => x64}/dmxreader.cc (100%) rename src/porting/{x86 => x64}/dmxreader.h (100%) rename src/porting/{x86 => x64}/gfxdrm.cc (100%) rename src/porting/{x86 => x64}/gfxdrm.h (100%) rename src/porting/{x86 => x64}/graph_drm.cc (100%) rename src/porting/{x86 => x64}/graph_fb.c (100%) rename src/porting/{x86 => x64}/graph_gtk.c (100%) rename src/porting/{x86 => x64}/graph_rfb.c (100%) rename src/porting/{x86 => x64}/graph_win32.c (100%) rename src/porting/{x86 => x64}/graph_xlib.c (100%) rename src/porting/{x86 => x64}/input_linux.cc (100%) rename src/porting/{x86 => x64}/ngl_disp.c (100%) rename src/porting/{x86 => x64}/ngl_dmx.cc (100%) rename src/porting/{x86 => x64}/ngl_dsc.c (100%) rename src/porting/{x86 => x64}/ngl_mediaplayer.c (97%) rename src/porting/{x86 => x64}/ngl_msgq.c (100%) rename src/porting/{x86 => x64}/ngl_nvm.c (100%) rename src/porting/{x86 => x64}/ngl_os.c (100%) rename src/porting/{x86 => x64}/ngl_panel.c (100%) rename src/porting/{x86 => x64}/ngl_pvr.c (100%) rename src/porting/{x86 => x64}/ngl_smc.c (100%) rename src/porting/{x86 => x64}/ngl_snd.c (100%) rename src/porting/{x86 => x64}/ngl_timer.c (100%) rename src/porting/{x86 => x64}/ngl_tuner.c (100%) rename src/porting/{x86 => x64}/ngl_video.c (100%) rename src/porting/{x86 => x64}/qwerty.kcm (100%) rename src/porting/{x86 => x64}/qwerty.kl (100%) create mode 100755 x64build.sh delete mode 100755 x86build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cef9daf..90adf085 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,6 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) include(cmake/common_functions.cmake) include(cmake/options.cmake) -message("====================================") set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) set(CMAKE_INSTALL_MANDIR ${CMAKE_PREFIX_PATH}/man) @@ -54,22 +53,3 @@ add_custom_target(appdevops COMMENT "Creating Application develop environment ..." ) -# Packaging -set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_NAME} Package.") - -set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) -set(CPACK_PACKAGE_VERSION "1.0")#${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") - -if (WIN32) - set(CPACK_GENERATOR ZIP) -else() - set(CPACK_GENERATOR TGZ) -endif() - -set(CPACK_STRIP_FILES TRUE) - -include(CPack) - diff --git a/cmake/common_functions.cmake b/cmake/common_functions.cmake index 9358f85c..063f7811 100755 --- a/cmake/common_functions.cmake +++ b/cmake/common_functions.cmake @@ -1,3 +1,13 @@ +# CMake does not automatically add --whole-archive when building shared objects from +# a list of convenience libraries. This can lead to missing symbols in the final output. +# We add --whole-archive to all libraries manually to prevent the linker from trimming +# symbols that we actually need later. +macro(ADD_WHOLE_ARCHIVE_TO_LIBRARIES _list_name) + foreach (library IN LISTS ${_list_name}) + list(APPEND ${_list_name}_TMP -Wl,--whole-archive ${library} -Wl,--no-whole-archive) + endforeach () + set(${_list_name} "${${_list_name}_TMP}") +endmacro() function(CreatePAK project ResourceDIR PakPath rhpath) add_custom_target(${project}_assets diff --git a/cmake/modules/FindUniBreak.cmake b/cmake/modules/FindUniBreak.cmake index 8020e95b..89afef33 100755 --- a/cmake/modules/FindUniBreak.cmake +++ b/cmake/modules/FindUniBreak.cmake @@ -13,7 +13,7 @@ find_library(UNIBREAK_LIBRARIES ${PC_ZLIB_LIBRARY_DIRS} ) -message("UNIBREAK_LIBRARIES=${UNIBREAK_LIBRARIES} UNIBREAK_INCLUDE_DIRS=${UNIBREAK_INCLUDE_DIRS} PC_UNIBREAK_VERSION=${PC_UNIBREAK_VERSION}") +#message("UNIBREAK_LIBRARIES=${UNIBREAK_LIBRARIES} UNIBREAK_INCLUDE_DIRS=${UNIBREAK_INCLUDE_DIRS} PC_UNIBREAK_VERSION=${PC_UNIBREAK_VERSION}") if(UNIBREAK_INCLUDE_DIRS AND UNIBREAK_LIBRARIES) set(UNIBREAK_FOUND TRUE) set(UNIBREAK_LIBRARY ${UNIBREAK_LIBRARIES}) diff --git a/cmake/modules/FindZIP.cmake b/cmake/modules/FindZIP.cmake index 2d07f279..b99e914f 100755 --- a/cmake/modules/FindZIP.cmake +++ b/cmake/modules/FindZIP.cmake @@ -13,7 +13,7 @@ find_library(ZIP_LIBRARIES ${PC_ZIP_LIBRARY_DIRS} ) -#message("ZIP_LIBRARIES=${ZIP_LIBRARIES} ZIP_INCLUDE_DIRS=${ZIP_INCLUDE_DIRS} PC_ZIP_VERSION=${PC_ZIP_VERSION}") +message("ZIP_LIBRARIES=${ZIP_LIBRARIES} ZIP_INCLUDE_DIRS=${ZIP_INCLUDE_DIRS} PC_ZIP_VERSION=${PC_ZIP_VERSION}") if(ZIP_INCLUDE_DIRS AND ZIP_LIBRARIES) set(ZIP_FOUND TRUE) set(ZIP_LIBRARY ${ZIP_LIBRARIES}) diff --git a/cmake/options.cmake b/cmake/options.cmake index 9eeafc74..d5d964f1 100755 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -6,11 +6,8 @@ option(BUILD_CDROID_TESTS "Build unit tests" ON) option(ENABLE_GIF "enable gif encode and decoder" OFF) option(ENABLE_CAIROSVG "enable svg decoder" OFF) option(ENABLE_MBEDTLS "enable mbedtls" ON) -option(ENABLE_UPNP "enable upnp/dlna" OFF) -option(ENABLE_GESTURE "enable gestrure" OFF) option(ENABLE_PLPLOT "Enable PLPLot" OFF) option(ENABLE_DTV "DTV modules support" OFF) -option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes ${CMAKE_PROJECT_NAME} backward-incompatible with libjpeg v6b)" ON) option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." ON) option(ENABLE_PINYIN2HZ "Chinese Pinyin to HZ support" OFF) @@ -25,11 +22,6 @@ endif() find_package(PNG REQUIRED) find_package(JPEG REQUIRED) -if(ENABLE_TURBOJPEG) - find_package(TurboJPEG REQUIRED) - list(APPEND CDROID_DEPLIBS ${TURBOJPEG_LIBRARIES}) -endif(ENABLE_TURBOJPEG) - find_package(ZLIB REQUIRED) find_package(JSONCPP REQUIRED) find_package(ZIP REQUIRED) @@ -43,28 +35,31 @@ find_package(Brotli REQUIRED) find_package(BZip2 REQUIRED) find_package(UniBreak REQUIRED) + +list(APPEND CDROID_DEPLIBS + ${PNG_LIBRARIES} + ${JPEG_LIBRARIES} + ${PIXMAN_LIBRARIES} + ${FONTCONFIG_LIBRARIES} + ${FREETYPE2_LIBRARIES} + ${CAIRO_LIBRARIES} + ${ZIP_LIBRARIES} + ${UNIBREAK_LIBRARIES} + ${EXPAT_LIBRARIES} + ${JSONCPP_LIBRARIES} + ${ZLIB_LIBRARIES} + ${BROTLIDEC_LIBRARIES} + ${BZIP2_LIBRARIES} +) +#string(REPLACE ";" " " CDROID_DEPLIBS ${CDROID_DEPLIBS}) if(ENABLE_FRIBIDI) find_package(Fribidi REQUIRED) list(APPEND CDROID_DEPLIBS ${FRIBIDI_LIBRARIES}) endif(ENABLE_FRIBIDI) - -list(APPEND CDROID_DEPLIBS - ${ZLIB_LIBRARIES} - ${BROTLIDEC_LIBRARIES} - ${BZIP2_LIBRARIES} - ${PNG_LIBRARIES} - ${JPEG_LIBRARIES} - ${ZIP_LIBRARIES} - ${UNIBREAK_LIBRARIES} - ${EXPAT_LIBRARIES} - ${PIXMAN_LIBRARIES} - #-Wl,--start-group - ${FONTCONFIG_LIBRARIES} - ${FREETYPE2_LIBRARIES} - ${CAIRO_LIBRARIES} - # -Wl,--end-group - ${JSONCPP_LIBRARIES} -) +if(ENABLE_TURBOJPEG) + find_package(TurboJPEG REQUIRED) + list(APPEND CDROID_DEPLIBS ${TURBOJPEG_LIBRARIES}) +endif(ENABLE_TURBOJPEG) list(APPEND CDROID_DEPINCLUDES ${PNG_INCLUDE_DIRS} @@ -79,7 +74,7 @@ list(APPEND CDROID_DEPINCLUDES ${FRIBIDI_INCLUDE_DIRS} ${TURBOJPEG_INCLUDE_DIRS} ) -#message("BROTLI_LIBRARIES +message("CDROID_DEPLIBS=${CDROID_DEPLIBS}") if(OPENSSL_FOUND) list(APPEND CDROID_DEPINCLUDES ${OPENSSL_INCLUDE_DIRS}) list(APPEND CDROID_DEPLIBS ${OPENSSL_LIBRARIES}) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 06fa23fe..7be32a1c 100755 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -46,15 +46,9 @@ set(SOURCES_GUI ${SRCS_GUICORE} ${SRCS_VIEWS} ${SRCS_APP} ${SRCS_DIALOG} ${SRCS_ANIMATION} widget/R.h) -message("FONTCONFIG_LIBRARIES=${FONTCONFIG_LIBRARIES} CDROID_LIBS=${CDROID_LIBS}") - -add_library(cdroid_objs OBJECT ${SOURCES_GUI}) -add_library(cdroid_static STATIC $) -add_library(cdroid SHARED $) +add_library(cdroid SHARED ${SOURCES_GUI}) CreatePAK(cdroid ${PROJECT_SOURCE_DIR}/res ${PROJECT_BINARY_DIR}/cdroid.pak ${PROJECT_SOURCE_DIR}/widget/R.h) -set_target_properties(cdroid_static PROPERTIES OUTPUT_NAME "cdroid") - file(GLOB_RECURSE allfiles RELATIVE "${PROJECT_SOURCE_DIR}/" "*.h") list(REMOVE_ITEM allfiles "private/*.h") foreach( each_file ${allfiles} ) @@ -67,13 +61,15 @@ foreach( each_file ${allfiles} ) install(FILES ${PROJECT_SOURCE_DIR}/${each_file} DESTINATION "${CMAKE_BINARY_DIR}/include/gui/${FILE_PATH}") endforeach(each_file) -target_link_libraries(cdroid ${CDROID_DEPLIBS} tvhal ) +ADD_WHOLE_ARCHIVE_TO_LIBRARIES(CDROID_DEPLIBS) +target_link_libraries(cdroid ${CDROID_DEPLIBS} tvhal) + configure_file( "cdroid.pc.in" "cdroid.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cdroid.pc" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") configure_file(cdroid.pc.in cdroid.pc @ONLY) install (TARGETS cdroid DESTINATION lib) install (DIRECTORY ${PROJECT_SOURCE_DIR} DESTINATION include/ FILES_MATCHING PATTERN "*.h" diff --git a/src/gui/core/graphdevice.cc b/src/gui/core/graphdevice.cc index 2cf334dd..9a7e5de5 100755 --- a/src/gui/core/graphdevice.cc +++ b/src/gui/core/graphdevice.cc @@ -46,8 +46,8 @@ GraphDevice::GraphDevice(int fmt){ mPrimaryContext = new Canvas(surf); mRectBanner.set(0,0,400,40); - mBannerContext = new Canvas(mRectBanner.width,mRectBanner.height); - mBannerSurface = mBannerContext->mHandle; + RefPtrbannerSurf=ImageSurface::create(Surface::Format::ARGB32,400,40); + mBannerContext = new Canvas(bannerSurf); mLastComposeTime = SystemClock::uptimeMillis(); @@ -223,8 +223,8 @@ void GraphDevice::composeSurfaces(){ LOGD("%d:(%d,%d,%d,%d)",i,r.x,r.y,r.width,r.height); } mInvalidateRgn->do_xor(mInvalidateRgn); - if(mPrimarySurface&&mBannerSurface){ - GFXBlit(mPrimarySurface,mScreenWidth-mRectBanner.width,mScreenHeight-mRectBanner.height,mBannerSurface,nullptr); + if(mPrimarySurface){ + //GFXBlit(mPrimarySurface,mScreenWidth-mRectBanner.width,mScreenHeight-mRectBanner.height,mBannerSurface,nullptr); } GFXFlip(mPrimarySurface); t2=SystemClock::uptimeMillis(); diff --git a/src/gui/core/graphdevice.h b/src/gui/core/graphdevice.h index 5451182d..9f979eaa 100755 --- a/src/gui/core/graphdevice.h +++ b/src/gui/core/graphdevice.h @@ -23,7 +23,6 @@ private: std::mutex mMutex; std::condition_variable mCV; HANDLE mPrimarySurface; - HANDLE mBannerSurface; class Canvas*mPrimaryContext; Canvas *mBannerContext; Cairo::RefPtrmInvalidateRgn; diff --git a/src/gui/widget/cdwindow.cc b/src/gui/widget/cdwindow.cc index 00502b84..20efe044 100755 --- a/src/gui/widget/cdwindow.cc +++ b/src/gui/widget/cdwindow.cc @@ -56,7 +56,9 @@ Window::Window(int x,int y,int width,int height,int type) #endif mContext=&App::getInstance(); mInLayout=false; - LOGV("%p Handler=%p visible=%d size=%dx%d",this,mUIEventHandler,hasFlag(VISIBLE),width,height); + if((width<1)||(height<1)) + GFXGetScreenSize((UINT*)&width,(UINT*)&height); + printf("%p Handler=%p visible=%d size=%dx%d\r\n",this,mUIEventHandler,hasFlag(VISIBLE),width,height); setFrame(x, y, width, height); setDescendantFocusability(FOCUS_AFTER_DESCENDANTS); setFocusable(true); diff --git a/src/porting/CMakeLists.txt b/src/porting/CMakeLists.txt index e3636361..72d2c99e 100644 --- a/src/porting/CMakeLists.txt +++ b/src/porting/CMakeLists.txt @@ -16,20 +16,16 @@ add_subdirectory(${CDROID_CHIPSET}) link_directories(${CMAKE_SOURCE_DIR}/deps/lib) add_library(tvhal SHARED ${SRCS_COMMON} ) -add_library(tvhal_static STATIC ${SRCS_COMMON} ) -target_link_libraries(tvhal PUBLIC ${CDROID_CHIPSET}) -target_link_libraries(tvhal_static PUBLIC ${CDROID_CHIPSET}) -set_target_properties(tvhal_static PROPERTIES OUTPUT_NAME "tvhal") +target_link_libraries(tvhal PUBLIC ${CDROID_CHIPSET} PRIVATE) file(GLOB HAL_HEADERS ${PROJECT_SOURCE_DIR}/include/*.h) file(GLOB KEYCMAPS ${PROJECT_SOURCE_DIR}/${CDROID_CHIPSET}/*.kcm) if( NOT(${CDROID_CHIPSET} MATCHES "x86") ) - file(GLOB KEYMAP ${PROJECT_SOURCE_DIR}/${CDROID_CHIPSET}/*.kl) + file(GLOB KEYMAP ${PROJECT_SOURCE_DIR}/${CDROID_CHIPSET}/*.kl) endif() install (TARGETS tvhal DESTINATION lib) -install (TARGETS tvhal_static DESTINATION lib) install (FILES ${HAL_HEADERS} DESTINATION include/porting/) file(COPY ${HAL_HEADERS} common/shared_queue.h DESTINATION ${CMAKE_BINARY_DIR}/include/porting) diff --git a/src/porting/include/cdplayer.h b/src/porting/include/cdplayer.h new file mode 100644 index 00000000..2aafa5c6 --- /dev/null +++ b/src/porting/include/cdplayer.h @@ -0,0 +1,34 @@ +#ifndef __CDMEDIA_PLAYER_H__ +#define __CDMEDIA_PLAYER_H__ +#include + +BEGIN_DECLS + +typedef enum{ + MP_PREPARED, + MP_STARTED, + MP_PAUSED, + MP_SEEKED, + MP_BUFFERING, + MP_ERROR, + MP_END +}MPMESSAGE; +typedef void(*MP_CALLBACK)(HANDLE,MPMESSAGE msg,LONG param,void*userdata); + +HANDLE MPOpen(const char*fname); +DWORD MPPlay(HANDLE handle); +DWORD MPStop(HANDLE handle); +DWORD MPClose(HANDLE handle); +DWORD MPResume(HANDLE handle); +DWORD MPPause(HANDLE handle); + +DWORD MPGetDuration(HANDLE handle,double*mediatime); +DWORD MPGetPosition(HANDLE handle,double*position); +DWORD MPSeek(HANDLE handle,double seektime); +DWORD MPSetCallback(HANDLE,MP_CALLBACK,void*userdata); +DWORD MPSetVolume(HANDLE,int colume); +DWORD MPSetWindow(HANDLE,int x,int y,int width,int height); +END_DECLS + +#endif + diff --git a/src/porting/include/ngl_mediaplayer.h b/src/porting/include/ngl_mediaplayer.h deleted file mode 100644 index 16ecaaf4..00000000 --- a/src/porting/include/ngl_mediaplayer.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __NGL_MEDIA_PLAYER_H__ -#define __NGL_MEDIA_PLAYER_H__ -#include - -BEGIN_DECLS - -typedef enum{ - MP_PREPARED, - MP_STARTED, - MP_PAUSED, - MP_SEEKED, - MP_BUFFERING, - MP_ERROR, - MP_END -}MPMESSAGE; -typedef void(*MP_CALLBACK)(HANDLE,MPMESSAGE msg,LONG param,void*userdata); - -HANDLE nglMPOpen(const char*fname); -DWORD nglMPPlay(HANDLE handle); -DWORD nglMPStop(HANDLE handle); -DWORD nglMPClose(HANDLE handle); -DWORD nglMPResume(HANDLE handle); -DWORD nglMPPause(HANDLE handle); - -DWORD nglMPGetTime(HANDLE handle,UINT*curtime,UINT*timems); -DWORD nglMPSeek(HANDLE handle,UINT timems); -DWORD nglMPSetCallback(HANDLE,MP_CALLBACK,void*userdata); -END_DECLS - -#endif - diff --git a/src/porting/x86/CMakeLists.txt b/src/porting/x64/CMakeLists.txt similarity index 64% rename from src/porting/x86/CMakeLists.txt rename to src/porting/x64/CMakeLists.txt index d8c307fe..ae59341b 100755 --- a/src/porting/x86/CMakeLists.txt +++ b/src/porting/x64/CMakeLists.txt @@ -1,13 +1,13 @@ project (x86 C CXX) -set(X86_SRCS +set(X64_SRCS ngl_panel.c ngl_mediaplayer.c input_linux.cc ) if (ENABLE_DTV) - list(APPEND X86_SRCS ngl_dsc.c ngl_smc.c ngl_tuner.c ngl_dmx.cc + list(APPEND X64_SRCS ngl_dsc.c ngl_smc.c ngl_tuner.c ngl_dmx.cc ngl_nvm.c ngl_pvr.c ngl_snd.c ngl_video.c dmxreader.cc ngl_disp.c ngl_os.c ) @@ -35,7 +35,7 @@ find_library(DRM_LIBRARY ) if(DRM_LIBRARY AND DRM_INCLUDE_DIR) - list(APPEND X86LIBS ${DRM_LIBRARY}) + list(APPEND X64LIBS ${DRM_LIBRARY}) endif() if(HAVE_POLL_H) @@ -54,8 +54,8 @@ endif() #sudo apt install libx11-dev if( ENABLE_RFB ) add_definitions(-DENABLE_RFB=1) - list(APPEND X86_SRCS ../common/rfbcommon.cc) - list(APPEND X86LIBS vncserver) + list(APPEND X64_SRCS ../common/rfbcommon.cc) + list(APPEND X64LIBS vncserver) find_package(ZLIB) endif() @@ -66,28 +66,28 @@ if ( SYSNAME_LOWER MATCHES "linux" OR SYSNAME_LOWER MATCHES "cygwin" ) pkg_check_modules(GTK3 gtk+-3.0) message("X11_INCLUDE_DIR=${X11_INCLUDE_DIR} ${X11_FOUND} ${GTK3_LIBRARIES} ${GTK3_FOUND} ${}") if (FALSE AND DRM_LIBRARY) - list(APPEND X86_SRCS gfxdrm.cc graph_drm.cc) - list(APPEND X86LIBS ${DRM_LIBRARY}) + list(APPEND X64_SRCS gfxdrm.cc graph_drm.cc) + list(APPEND X64LIBS ${DRM_LIBRARY}) elseif(FALSE) - list(APPEND X86_SRCS graph_fb.c) + list(APPEND X64_SRCS graph_fb.c) elseif( X11_FOUND ) - list(APPEND X86_SRCS graph_xlib.c) - list(APPEND X86LIBS ${X11_LIBRARIES}) + list(APPEND X64_SRCS graph_xlib.c) + list(APPEND X64LIBS ${X11_LIBRARIES}) elseif( GTK3_FOUND ) - list(APPEND X86_SRCS graph_gtk.c) - list(APPEND X86LIBS ${GTK3_LIBRARIES} ${DRM_LIBRARY}) + list(APPEND X64_SRCS graph_gtk.c) + list(APPEND X64LIBS ${GTK3_LIBRARIES} ${DRM_LIBRARY}) else() - list(APPEND X86_SRCS graph_rfb.c) - list(APPEND X86LIBS vncserver) + list(APPEND X64_SRCS graph_rfb.c) + list(APPEND X64LIBS vncserver) endif() elseif (WIN32) - list(APPEND X86_SRCS graph_win32.c) - list(APPEND X86LIBS win32.lib) + list(APPEND X64_SRCS graph_win32.c) + list(APPEND X64LIBS win32.lib) endif() -list(APPEND X86LIBS pthread) +list(APPEND X64LIBS pthread) find_package(ZLIB) -message("ZLIB_INCLUDE=${ZLIB_INCLUDE_DIR} X86LIBS=${X86LIBS}") +message("ZLIB_INCLUDE=${ZLIB_INCLUDE_DIR} X64LIBS=${X64LIBS}" CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}) include_directories(./ ../include ${DRM_INCLUDE_DIR} @@ -96,14 +96,9 @@ include_directories(./ ${X11_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/include - ${CMAKE_SOURCE_DIR}/src/3rdparty/libvncserver - ${CMAKE_BINARY_DIR}/src/3rdparty/libvncserver - ${CMAKE_SOURCE_DIR}/deps/include - ${CMAKE_SOURCE_DIR}/deps/include/gui #for eventcodes.h ) -add_library(x86 STATIC ${X86_SRCS} ) -target_link_libraries(x86 PRIVATE ${X86LIBS}) -#message(FATAL_ERROR "PC_DRM=${DRM_INCLUDE_DIR}-${DRM_LIBRARY} X86LIBS=${X86LIBS}") +add_library(x64 STATIC ${X64_SRCS} ) +target_link_libraries(x64 PRIVATE ${X64LIBS}) +#message(FATAL_ERROR "PC_DRM=${DRM_INCLUDE_DIR}-${DRM_LIBRARY} X64LIBS=${X64LIBS}") diff --git a/src/porting/x86/Generic.kcm b/src/porting/x64/Generic.kcm similarity index 100% rename from src/porting/x86/Generic.kcm rename to src/porting/x64/Generic.kcm diff --git a/src/porting/x86/Generic.kl b/src/porting/x64/Generic.kl similarity index 100% rename from src/porting/x86/Generic.kl rename to src/porting/x64/Generic.kl diff --git a/src/porting/x86/dmxreader.cc b/src/porting/x64/dmxreader.cc similarity index 100% rename from src/porting/x86/dmxreader.cc rename to src/porting/x64/dmxreader.cc diff --git a/src/porting/x86/dmxreader.h b/src/porting/x64/dmxreader.h similarity index 100% rename from src/porting/x86/dmxreader.h rename to src/porting/x64/dmxreader.h diff --git a/src/porting/x86/gfxdrm.cc b/src/porting/x64/gfxdrm.cc similarity index 100% rename from src/porting/x86/gfxdrm.cc rename to src/porting/x64/gfxdrm.cc diff --git a/src/porting/x86/gfxdrm.h b/src/porting/x64/gfxdrm.h similarity index 100% rename from src/porting/x86/gfxdrm.h rename to src/porting/x64/gfxdrm.h diff --git a/src/porting/x86/graph_drm.cc b/src/porting/x64/graph_drm.cc similarity index 100% rename from src/porting/x86/graph_drm.cc rename to src/porting/x64/graph_drm.cc diff --git a/src/porting/x86/graph_fb.c b/src/porting/x64/graph_fb.c similarity index 100% rename from src/porting/x86/graph_fb.c rename to src/porting/x64/graph_fb.c diff --git a/src/porting/x86/graph_gtk.c b/src/porting/x64/graph_gtk.c similarity index 100% rename from src/porting/x86/graph_gtk.c rename to src/porting/x64/graph_gtk.c diff --git a/src/porting/x86/graph_rfb.c b/src/porting/x64/graph_rfb.c similarity index 100% rename from src/porting/x86/graph_rfb.c rename to src/porting/x64/graph_rfb.c diff --git a/src/porting/x86/graph_win32.c b/src/porting/x64/graph_win32.c similarity index 100% rename from src/porting/x86/graph_win32.c rename to src/porting/x64/graph_win32.c diff --git a/src/porting/x86/graph_xlib.c b/src/porting/x64/graph_xlib.c similarity index 100% rename from src/porting/x86/graph_xlib.c rename to src/porting/x64/graph_xlib.c diff --git a/src/porting/x86/input_linux.cc b/src/porting/x64/input_linux.cc similarity index 100% rename from src/porting/x86/input_linux.cc rename to src/porting/x64/input_linux.cc diff --git a/src/porting/x86/ngl_disp.c b/src/porting/x64/ngl_disp.c similarity index 100% rename from src/porting/x86/ngl_disp.c rename to src/porting/x64/ngl_disp.c diff --git a/src/porting/x86/ngl_dmx.cc b/src/porting/x64/ngl_dmx.cc similarity index 100% rename from src/porting/x86/ngl_dmx.cc rename to src/porting/x64/ngl_dmx.cc diff --git a/src/porting/x86/ngl_dsc.c b/src/porting/x64/ngl_dsc.c similarity index 100% rename from src/porting/x86/ngl_dsc.c rename to src/porting/x64/ngl_dsc.c diff --git a/src/porting/x86/ngl_mediaplayer.c b/src/porting/x64/ngl_mediaplayer.c similarity index 97% rename from src/porting/x86/ngl_mediaplayer.c rename to src/porting/x64/ngl_mediaplayer.c index edb8ce39..be896447 100644 --- a/src/porting/x86/ngl_mediaplayer.c +++ b/src/porting/x64/ngl_mediaplayer.c @@ -1,6 +1,6 @@ #include -#include +#include #include #include #include diff --git a/src/porting/x86/ngl_msgq.c b/src/porting/x64/ngl_msgq.c similarity index 100% rename from src/porting/x86/ngl_msgq.c rename to src/porting/x64/ngl_msgq.c diff --git a/src/porting/x86/ngl_nvm.c b/src/porting/x64/ngl_nvm.c similarity index 100% rename from src/porting/x86/ngl_nvm.c rename to src/porting/x64/ngl_nvm.c diff --git a/src/porting/x86/ngl_os.c b/src/porting/x64/ngl_os.c similarity index 100% rename from src/porting/x86/ngl_os.c rename to src/porting/x64/ngl_os.c diff --git a/src/porting/x86/ngl_panel.c b/src/porting/x64/ngl_panel.c similarity index 100% rename from src/porting/x86/ngl_panel.c rename to src/porting/x64/ngl_panel.c diff --git a/src/porting/x86/ngl_pvr.c b/src/porting/x64/ngl_pvr.c similarity index 100% rename from src/porting/x86/ngl_pvr.c rename to src/porting/x64/ngl_pvr.c diff --git a/src/porting/x86/ngl_smc.c b/src/porting/x64/ngl_smc.c similarity index 100% rename from src/porting/x86/ngl_smc.c rename to src/porting/x64/ngl_smc.c diff --git a/src/porting/x86/ngl_snd.c b/src/porting/x64/ngl_snd.c similarity index 100% rename from src/porting/x86/ngl_snd.c rename to src/porting/x64/ngl_snd.c diff --git a/src/porting/x86/ngl_timer.c b/src/porting/x64/ngl_timer.c similarity index 100% rename from src/porting/x86/ngl_timer.c rename to src/porting/x64/ngl_timer.c diff --git a/src/porting/x86/ngl_tuner.c b/src/porting/x64/ngl_tuner.c similarity index 100% rename from src/porting/x86/ngl_tuner.c rename to src/porting/x64/ngl_tuner.c diff --git a/src/porting/x86/ngl_video.c b/src/porting/x64/ngl_video.c similarity index 100% rename from src/porting/x86/ngl_video.c rename to src/porting/x64/ngl_video.c diff --git a/src/porting/x86/qwerty.kcm b/src/porting/x64/qwerty.kcm similarity index 100% rename from src/porting/x86/qwerty.kcm rename to src/porting/x64/qwerty.kcm diff --git a/src/porting/x86/qwerty.kl b/src/porting/x64/qwerty.kl similarity index 100% rename from src/porting/x86/qwerty.kl rename to src/porting/x64/qwerty.kl diff --git a/tests/gui/CMakeLists.txt b/tests/gui/CMakeLists.txt index ce3e08ef..f6ca6c51 100755 --- a/tests/gui/CMakeLists.txt +++ b/tests/gui/CMakeLists.txt @@ -19,7 +19,7 @@ include_directories( link_directories(${DEPS_DIR}/lib) add_executable(gui_test ${SRCS_GUI_TESTS}) -target_link_libraries(gui_test PRIVATE ${CDROID_DEPLIBS} ${CDROID_LIBRARIES} ${GTEST_LIBRARIES} tvhal) +target_link_libraries(gui_test PRIVATE ${CDROID_DEPLIBS} ${GTEST_LIBRARIES} cdroid tvhal) install(TARGETS gui_test DESTINATION bin/tests) diff --git a/tests/gui/image_unittests.cc b/tests/gui/image_unittests.cc index 2855dc0f..e77aa246 100755 --- a/tests/gui/image_unittests.cc +++ b/tests/gui/image_unittests.cc @@ -70,7 +70,8 @@ public : size_t pt=path.rfind('.'); if(pt!= std::string::npos){ std::string ext=path.substr(pt+1); - if(filter.empty()||filter.compare(ext))images.push_back(path); + pt=path.find(filter); + if(filter.empty()||pt!= std::string::npos)images.push_back(path); } return ; } @@ -109,6 +110,7 @@ TEST_F(IMAGE,Bitmap){ } TEST_F(IMAGE,Image_PNG){ loadImages("./","png"); + printf("%d image loaded\r\n",images.size()); for(int i=0;irectangle(rect); ctx->fill(); tmstart(); - ctx->draw_image(img,rect,nullptr); + if(img){ + ctx->draw_image(img,rect,nullptr); + } + printf("image %s =%p size=%dx%d\r\n",images[i].c_str(),img.get(),(img?img->get_width():0),(img?img->get_height():0)); tmend("drawimage"); postCompose(); } @@ -128,15 +133,17 @@ TEST_F(IMAGE,Image_PNG){ TEST_F(IMAGE,Image_JPG){ loadImages("./","jpg"); + printf("%d img loaded\r\n",images.size()); for(int i=0;iimgj=ImageSurface::create_from_stream(fs); + RefPtrimg=ImageSurface::create_from_stream(fs); tmend("decodejpg"); RECT rect={0,0,800,600}; ctx->rectangle(rect);ctx->fill(); tmstart(); - ctx->draw_image(imgj,rect,nullptr); + printf("image %s =%p\r\n",images[i].c_str(),img.get()); + if(img)ctx->draw_image(img,rect,nullptr); tmend("drawimage"); postCompose(); SLEEP(1000); diff --git a/x64build.sh b/x64build.sh new file mode 100755 index 00000000..2e68cb70 --- /dev/null +++ b/x64build.sh @@ -0,0 +1,19 @@ +if [ $# -gt 0 ] +then + mkdir -p outx64r + pushd outx64r + TYPE=Release +else + mkdir -p outx64 + pushd outx64 + TYPE=Debug +fi +export PKG_CONFIG_PATH=$HOME/vcpkg/installed/x64-linux-dynamic/lib/pkgconfig +export PKG_CONFIG_LIBDIR=$HOME/vcpkg/installed/x64-linux-dynamic/lib/pkgconfig +cmake -DCDROID_CHIPSET=x64 -DENABLE_RFB=OFF \ + -DCMAKE_INSTALL_PREFIX=./ \ + -DCMAKE_BUILD_TYPE=${TYPE} \ + -DM_LIBRARY=m \ + .. +popd + diff --git a/x86build.sh b/x86build.sh deleted file mode 100755 index 060a50cc..00000000 --- a/x86build.sh +++ /dev/null @@ -1,27 +0,0 @@ -if [ $# -gt 0 ] -then - mkdir -p out-x86r - pushd out-x86r - TYPE=Release -else - mkdir -p out-x86 - pushd out-x86 - TYPE=Debug -fi - -cmake -DCDROID_CHIPSET=x86 -DENABLE_RFB=ON \ - -DCMAKE_INSTALL_PREFIX=./ \ - -DCMAKE_BUILD_TYPE=${TYPE} \ - -DM_LIBRARY=m \ - .. -popd - -if [ ! -d "src/gui" ]; then - pushd deps/lib - mv libcairo.a libcairo_static.a - mv libjrtp.a libjrtplib-static.a - mv libgui.a libgui_static.a - mv libdvbepg.a libdvbepg_static.a - mv libtvhal.a libtvhal_static.a - popd -fi