diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Browse.VC.db b/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Browse.VC.db deleted file mode 100644 index 6db222f..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Browse.VC.db and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Solution.VC.db b/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Solution.VC.db deleted file mode 100644 index ca91f14..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/Solution.VC.db and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/74065238e48ba6b2/DSO.ipch b/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/74065238e48ba6b2/DSO.ipch deleted file mode 100644 index 66df5aa..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/74065238e48ba6b2/DSO.ipch and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/da400b0f5918ce79/APR_ESCAPE.ipch b/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/da400b0f5918ce79/APR_ESCAPE.ipch deleted file mode 100644 index 260b5ec..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/delayedloop/v15/ipch/AutoPCH/da400b0f5918ce79/APR_ESCAPE.ipch and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Browse.VC.db b/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Browse.VC.db deleted file mode 100644 index 79ede8c..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Browse.VC.db and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Solution.VC.db b/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Solution.VC.db deleted file mode 100644 index 620edb5..0000000 Binary files a/3rd/apache-log4cxx-0.10.0/projects/.vs/log4cxx/v15/Solution.VC.db and /dev/null differ diff --git a/3rd/apache-log4cxx-0.10.0/projects/UpgradeLog.htm b/3rd/apache-log4cxx-0.10.0/projects/UpgradeLog.htm index 3cf633d..ac01c26 100644 Binary files a/3rd/apache-log4cxx-0.10.0/projects/UpgradeLog.htm and b/3rd/apache-log4cxx-0.10.0/projects/UpgradeLog.htm differ diff --git a/3rd/apache-log4cxx-0.10.0/src/main/cpp/stringhelper.cpp b/3rd/apache-log4cxx-0.10.0/src/main/cpp/stringhelper.cpp index ca4b1ac..c96d5bb 100644 --- a/3rd/apache-log4cxx-0.10.0/src/main/cpp/stringhelper.cpp +++ b/3rd/apache-log4cxx-0.10.0/src/main/cpp/stringhelper.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #if !defined(LOG4CXX) diff --git a/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/log4cxx.h b/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/log4cxx.h index 670cd32..7a06b00 100644 --- a/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/log4cxx.h +++ b/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/log4cxx.h @@ -72,8 +72,6 @@ typedef unsigned int log4cxx_uint32_t; template class LOG4CXX_EXPORT log4cxx::helpers::ObjectPtrT; \ typedef log4cxx::helpers::ObjectPtrT T##Ptr #define LOG4CXX_LIST_DEF(N, T) \ -template class LOG4CXX_EXPORT std::allocator; \ -template class LOG4CXX_EXPORT std::vector; \ typedef std::vector N // // pointer and list definition macros when linking with DLL using VC diff --git a/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/private/log4cxx_private.h b/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/private/log4cxx_private.h index fb0b9f1..e7c8417 100644 --- a/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/private/log4cxx_private.h +++ b/3rd/apache-log4cxx-0.10.0/src/main/include/log4cxx/private/log4cxx_private.h @@ -18,39 +18,67 @@ #ifndef LOG4CXX_PRIVATE_LOG4CXX_H #define LOG4CXX_PRIVATE_LOG4CXX_H -/* GENERATED FILE WARNING! DO NOT EDIT log4cxx_private.h + +/* GENERATED FILE WARNING! DO NOT EDIT log4cxx.h + * + * You must modify log4cxx.hw instead. * - * You must modify log4cxx_private.h.in instead. * + * This is the Win32 specific version of log4cxx.h. */ #include #if !defined(LOG4CXX) && !defined(LOG4CXX_TEST) -#error "log4cxx/private/log4cxx_private.h should only be used within log4cxx implementation or tests" +#error "log4cxx/private/log4cxx.h should only be used within log4cxx and tests implementation" #endif + +#if !defined(__BORLANDC__) +#define LOG4CXX_RETURN_AFTER_THROW 1 +#else #define LOG4CXX_RETURN_AFTER_THROW 0 +#endif +#if defined(_WIN32_WCE) +#define LOG4CXX_HAS_STD_LOCALE 0 +#else #define LOG4CXX_HAS_STD_LOCALE 1 -#define LOG4CXX_FORCE_WIDE_CONSOLE 0 +#endif + +#define LOG4CXX_FORCE_WIDE_CONSOLE 1 #define LOG4CXX_FORCE_BYTE_CONSOLE 0 -#define LOG4CXX_MEMSET_IOS_BASE 0 -#define LOG4CXX_HAVE_ODBC 0 + + +#if defined(_MSC_VER) +#define LOG4CXX_MEMSET_IOS_BASE 1 +#endif + +#if !defined(_WIN32_WCE) +#define LOG4CXX_HAVE_ODBC 1 +#if defined(__BORLANDC__) +#define LOG4CXX_HAS_MBSRTOWCS 0 +#else #define LOG4CXX_HAS_MBSRTOWCS 1 -#define LOG4CXX_HAS_WCSTOMBS 1 +#endif +#else +#define LOG4CXX_HAVE_ODBC 0 +#define LOG4CXX_HAS_MBSRTOWCS 0 +#endif + #define LOG4CXX_HAS_FWIDE 1 +#define LOG4CXX_HAS_WCSTOMBS 1 #define LOG4CXX_CHARSET_UTF8 0 #define LOG4CXX_CHARSET_ISO88591 0 #define LOG4CXX_CHARSET_USASCII 0 #define LOG4CXX_CHARSET_EBCDIC 0 + #define LOG4CXX_HAVE_LIBESMTP 0 -#define LOG4CXX_HAVE_SYSLOG 1 +#define LOG4CXX_HAVE_SYSLOG 0 #define LOG4CXX_WIN32_THREAD_FMTSPEC "0x%.8x" #define LOG4CXX_APR_THREAD_FMTSPEC "0x%pt" - #endif diff --git a/3rd/apr-util/include/apr_ldap.hw b/3rd/apr-util/include/apr_ldap.hw index 7a4d67f..f00e40c 100644 --- a/3rd/apr-util/include/apr_ldap.hw +++ b/3rd/apr-util/include/apr_ldap.hw @@ -31,7 +31,7 @@ */ /* this will be defined if LDAP support was compiled into apr-util */ -#define APR_HAS_LDAP 1 +#define APR_HAS_LDAP 0 /* identify the LDAP toolkit used */ #define APR_HAS_NETSCAPE_LDAPSDK 0 diff --git a/3rd/apr-util/include/apu.hw b/3rd/apr-util/include/apu.hw index 494a8b7..c01e7ba 100644 --- a/3rd/apr-util/include/apu.hw +++ b/3rd/apr-util/include/apu.hw @@ -95,7 +95,7 @@ #endif -#define APU_HAVE_APR_ICONV 1 +#define APU_HAVE_APR_ICONV 0 #define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) diff --git a/3rd/apr/atomic/win32/apr_atomic.c b/3rd/apr/atomic/win32/apr_atomic.c index 9393fcb..9471fc0 100644 --- a/3rd/apr/atomic/win32/apr_atomic.c +++ b/3rd/apr/atomic/win32/apr_atomic.c @@ -17,6 +17,7 @@ #include "apr.h" #include "apr_atomic.h" #include "apr_thread_mutex.h" +#include APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { diff --git a/3rd/apr/network_io/unix/multicast.c b/3rd/apr/network_io/unix/multicast.c index df98b5a..012ddf8 100644 --- a/3rd/apr/network_io/unix/multicast.c +++ b/3rd/apr/network_io/unix/multicast.c @@ -25,6 +25,8 @@ #include #endif +#define NTDDI_VERSION NTDDI_WINXP + #ifdef HAVE_STRUCT_IPMREQ /* Only UDP and Raw Sockets can be used for Multicast */ static apr_status_t mcast_check_type(apr_socket_t *sock) @@ -133,7 +135,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, #if APR_HAVE_IPV6 struct ipv6_mreq mip6; #endif -#if MCAST_JOIN_SOURCE_GROUP +#if defined (group_source_req) struct group_source_req mip; int ip_proto; #endif @@ -145,7 +147,7 @@ static apr_status_t do_mcast(int type, apr_socket_t *sock, } if (source != NULL) { -#if MCAST_JOIN_SOURCE_GROUP +#if defined (group_source_req) if (sock_is_ipv4(sock)) { ip_proto = IPPROTO_IP; } diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e73fa6..c0b8c0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,66 @@ cmake_minimum_required(VERSION 3.5) -project(ffmpeg_sdl_test LANGUAGES CXX) +project(media_test LANGUAGES CXX) -SET(PROJECT_ROOT_PATH "${CMAKE_SOURCE_DIR}/build-ffmpeg_sdl_test-Desktop_Qt_5_12_10_clang_64bit-Debug") -MESSAGE( STATUS "this var key = ${PROJECT_ROOT_PATH}.") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) + +if (CMAKE_HOST_WIN32) + set(WINDOWS 1) + set(LIBSUFFIX .lib) + set(LIBPREFIX ) + set(LIBRARY_SEARCH_PATHS + C:/msys64/usr/src/src/third_party/ffmpeg/x64 + D:/workspace/leelen/source/freeswitch/x64/Debug + C:/msys64/usr/src/src/third_party/sdl/x64 + D:/workspace/opensource/SDL2/lib/x64 + D:/workspace/mycode/media_test/3rd/apache-log4cxx-0.10.0/projects/x64/Debug + src + ) + include_directories(C:/msys64/usr/local/ffmpeg/include) + include_directories(C:/msys64/usr/src/src/third_party/sdl/include) + include_directories(src) + include_directories(D:/workspace/mycode/media_test/3rd/apache-log4cxx-0.10.0/src/main/include) +elseif(CMAKE_HOST_APPLE) + set(MACOS 1) + set(LIBSUFFIX .dylib) + set(LIBPREFIX lib) + set(LIBRARY_SEARCH_PATHS + ../3rd/apr-1.7.0/.libs/ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/ + /usr/local/lib/ + ) + include_directories(/usr/local/include) +elseif(CMAKE_HOST_UNIX) + set(LINUX 1) + set(LIBSUFFIX .so) + set(LIBPREFIX lib) +endif() + +if(WINDOWS) + set(Qt5_DIR "C:/Qt/Qt5.14.0/5.14.0/msvc2017_64/lib/cmake/Qt5") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I C:/msys64/usr/local/ffmpeg/include -I D:/workspace/mycode/media_test/3rd/apache-log4cxx-0.10.0/src/main/include -IC:/msys64/usr/src/src/third_party/sdl/include -IC:/msys64/usr/src/ffmpeg-4.3.2") +elseif(LINUX) + +elseif(MACOS) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 ") + set(Qt5_DIR "/Users/yaoping.zheng/Qt5.12.10/5.12.10/clang_64/lib/cmake/Qt5") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -stdlib=libc++ -I/usr/local/include -L/usr/local/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/") +endif() + + +#SET(PROJECT_ROOT_PATH "${CMAKE_SOURCE_DIR}/build-ffmpeg_sdl_test-Desktop_Qt_5_12_10_clang_64bit-Debug") +#MESSAGE( STATUS "this var key = ${PROJECT_ROOT_PATH}.") add_subdirectory(src) -add_subdirectory(test) +#add_subdirectory(test) diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index ae6c4c7..d00ad20 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,10 +1,10 @@ - + EnvironmentId - {9239d242-049b-4f23-b7d6-82b388c08f11} + {9ba1182c-752c-4e6e-9b63-ddd2f8a859b9} ProjectExplorer.Project.ActiveTarget @@ -49,68 +49,42 @@ true true true - *.md, *.MD, Makefile false - true ProjectExplorer.Project.PluginSettings - - true - true - true - true - true - - - 0 - true - + + -fno-delayed-template-parsing + true - Builtin.Questionable - - true - Builtin.DefaultTidyAndClazy - 6 - - - - true - ProjectExplorer.Project.Target.0 - Desktop - Replacement for "Desktop Qt 5.14.2 clang 64bit" - Replacement for "Desktop Qt 5.14.2 clang 64bit" - qt.qt5.5142.clang_64_kit + Desktop Qt 5.14.0 MSVC2017 64bit + Desktop Qt 5.14.0 MSVC2017 64bit + qt.qt5.5140.win64_msvc2017_64_kit 0 0 0 - -GUnix Makefiles --DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} --DCMAKE_BUILD_TYPE:STRING=Debug --DCMAKE_CXX_COMPILER:STRING=/usr/bin/clang++ --DCMAKE_C_COMPILER:STRING=/usr/bin/clang --DCMAKE_PREFIX_PATH:STRING=/Users/yaoping.zheng/Qt5.12.10/5.12.10/clang_64 --DQT_QMAKE_EXECUTABLE:STRING=/Users/yaoping.zheng/Qt5.12.10/5.12.10/clang_64/bin/qmake - 2 - /Users/yaoping.zheng/Workspace/osx/ffmpeg_sdl_test/build-ffmpeg_sdl_test-Desktop_Qt_5_14_2_clang_64bit-Debug + + CMAKE_BUILD_TYPE:STRING=Debug + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_64bit-Debug all - true CMakeProjectManager.MakeStep @@ -125,7 +99,6 @@ clean - true CMakeProjectManager.MakeStep @@ -136,12 +109,140 @@ 2 false - Debug CMakeProjectManager.CMakeBuildConfiguration - 1 + + + CMAKE_BUILD_TYPE:STRING=Release + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_64bit-Release + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_64bit-RelWithDebInfo + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=MinSizeRel + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_64bit-MinSizeRel + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 0 @@ -150,8 +251,6 @@ ProjectExplorer.BuildSteps.Deploy 1 - - false ProjectExplorer.DefaultDeployConfiguration 1 @@ -214,7 +313,6 @@ 13 14 - 2 ffmpeg_sdl_test @@ -225,20 +323,685 @@ false true - false true false false true - /Users/yaoping.zheng/Workspace/osx/QT/my_qt_player/build-ffmpeg_sdl_test-Desktop_Qt_5_12_10_clang_64bit-Debug/bin + D:/bin 1 + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.0 MSVC2015 64bit + Desktop Qt 5.14.0 MSVC2015 64bit + qt.qt5.5140.win64_msvc2015_64_kit + 0 + 0 + 0 + + + CMAKE_BUILD_TYPE:STRING=Debug + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/media_test + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=Release + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2015_64bit-Release + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2015_64bit-RelWithDebInfo + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=MinSizeRel + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2015_64bit-MinSizeRel + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + ffmpeg_sdl_test + CMakeProjectManager.CMakeRunConfiguration.ffmpeg_sdl_test + ffmpeg_sdl_test + + false + + false + true + true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.2 + + Desktop Qt 5.14.0 MSVC2017 32bit + Desktop Qt 5.14.0 MSVC2017 32bit + qt.qt5.5140.win32_msvc2017_kit + 0 + 0 + -1 + + + CMAKE_BUILD_TYPE:STRING=Debug + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_32bit-Debug + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=Release + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_32bit-Release + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_32bit-RelWithDebInfo + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=MinSizeRel + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MSVC2017_32bit-MinSizeRel + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + 0 + + + + ProjectExplorer.Project.Target.3 + + Desktop Qt 5.14.0 MinGW 64-bit + Desktop Qt 5.14.0 MinGW 64-bit + qt.qt5.5140.win64_mingw73_kit + 0 + 0 + -1 + + + CMAKE_BUILD_TYPE:STRING=Debug + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MinGW_64_bit-Debug + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=Release + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MinGW_64_bit-Release + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MinGW_64_bit-RelWithDebInfo + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + + CMAKE_BUILD_TYPE:STRING=MinSizeRel + CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} + CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} + QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} + + D:/workspace/mycode/build-media_test-Desktop_Qt_5_14_0_MinGW_64_bit-MinSizeRel + + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + 0 + + ProjectExplorer.Project.TargetCount - 1 + 4 ProjectExplorer.Project.Updater.FileVersion diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1a7c946..e62785f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,36 +4,61 @@ project(ffmpeg_sdl_test LANGUAGES CXX) add_subdirectory(logging) -set(CMAKE_INCLUDE_CURRENT_DIR ON) +message(${LIBPREFIX}avcodec${LIBSUFFIX}) + +find_library(LIBAVCODEC + NAMES + ${LIBPREFIX}avcodec${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) + +message(${LIBAVCODEC}) + +find_library(LIBAVFORMAT + NAMES + ${LIBPREFIX}avformat${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) +find_library(LIBAVUTIL + NAMES + ${LIBPREFIX}avutil${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) +find_library(LIBSWSCALE + NAMES + ${LIBPREFIX}swscale${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) +find_library(ARP + NAMES + libaprutil${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) +find_library(LIBSDL2 + NAMES + SDL2${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) +find_library(LIBSDL2MAIN + NAMES + SDL2main${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) + + +find_library(LOG4CXX + NAMES + ${LIBPREFIX}log4cxx${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -stdlib=libc++ -I/usr/local/include -L/usr/local/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 ") - -set(Qt5_DIR "/Users/yaoping.zheng/Qt5.12.10/5.12.10/clang_64/lib/cmake/Qt5") - -find_library(LIBAVCODEC libavcodec.dylib) -find_library(LIBAVFORMAT libavformat.dylib) -find_library(LIBAVUTIL libavutil.dylib) -find_library(LIBSWSCALE libswscale.dylib) -find_library(LIBSDL2 libSDL2.dylib) -find_library(ARP libapr-1.dylib libaprutil-1.dylib "../3rd/apr-1.7.0/.libs/") -find_library(LOG4CXX liblog4cxx.dylib) find_package(Qt5 COMPONENTS Widgets REQUIRED) -include_directories(/usr/local/include) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_ROOT_PATH}/bin) MARK_AS_ADVANCED(LIBAVCODEC LIBAVUTIL LIBSWSCALE LIBAVFORMAT) -set(extra_libs ${LIBAVCODEC} ${LIBAVUTIL} ${LIBSWSCALE} ${LIBAVFORMAT} ${LIBSDL2} ${ARP} ${LOG4CXX} ) +set(extra_libs ${LIBAVCODEC} ${LIBAVUTIL} ${LIBSWSCALE} ${LIBAVFORMAT} ${LIBSDL2} ${LIBSDL2MAIN} ${ARP} ${LOG4CXX} ) #macro(ADD_FRAMEWORK appname fwname) #find_library(FRAMEWORK_${fwname} NAMES ${fwname} PATHS ${CMAKE_OSX_SYSROOT}/System/Library PATH_SUFFIXES Frameworks NO_DEFAULT_PATH) diff --git a/src/avcommon.cpp b/src/avcommon.cpp index 2804dbc..4dcfba4 100644 --- a/src/avcommon.cpp +++ b/src/avcommon.cpp @@ -10,12 +10,12 @@ static CommonLog commonLogger(logHandler,""); namespace AvLog { log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("com.foo")); -pthread_key_t Avcommon::key; +//pthread_key_t Avcommon::key; void Avcommon::init_ffmpeg_log(int level) { av_log_set_level(level); - pthread_key_create(&key,NULL); //创建线程私有数据, 暂时不考虑多线程并发的情况 + //pthread_key_create(&key,NULL); //创建线程私有数据, 暂时不考虑多线程并发的情况 av_log_set_callback(&Avcommon::FFMPEG_Callback); } @@ -23,15 +23,16 @@ void Avcommon::FFMPEG_Callback(void* ptr, int level, const char* fmt, va_list vl { static int buffersize = 10240; - char* buffer = (char*)pthread_getspecific(key); + char buffer[10240]; + /*(char*)pthread_getspecific(key); if (buffer) { } else { - buffer = new char [buffersize]; + buffer*/ buffer[0] = 0; buffer[buffersize - 1] = 0; - pthread_setspecific(key,buffer); - } + //pthread_setspecific(key,buffer); + //} int bufferLen = strlen(buffer); vsnprintf(buffer + bufferLen, 10240 - 2 - bufferLen, fmt, vl); @@ -54,7 +55,7 @@ void Avcommon::FFMPEG_Callback(void* ptr, int level, const char* fmt, va_list vl FFMPEG_LOG(WARN) << buffer; break; case AV_LOG_ERROR: - FFMPEG_LOG(ERROR) << buffer; + FFMPEG_LOG(ERR) << buffer; break; case AV_LOG_FATAL: case AV_LOG_PANIC: @@ -68,6 +69,7 @@ void Avcommon::FFMPEG_Callback(void* ptr, int level, const char* fmt, va_list vl } //std::cout << level << std::endl; + } } diff --git a/src/avcommon.h b/src/avcommon.h index 1b3565c..6252df8 100644 --- a/src/avcommon.h +++ b/src/avcommon.h @@ -5,18 +5,19 @@ #include #include -#include -#ifdef _WIN32 +#ifdef _WIN64 //Windows extern "C" { +#include #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libswscale/swscale.h" #include "libavutil/imgutils.h" #include "libavutil/log.h" -#include "SDL2/SDL.h" +#include +#include }; #else //Linux... @@ -47,7 +48,7 @@ class Avcommon { Avcommon(); Avcommon(const Avcommon &avcommon); Avcommon& operator = (const Avcommon &avcommon); - static pthread_key_t key; + //static pthread_key_t key; }; } diff --git a/src/logging/CMakeLists.txt b/src/logging/CMakeLists.txt index 8b830fe..9d5e4d3 100644 --- a/src/logging/CMakeLists.txt +++ b/src/logging/CMakeLists.txt @@ -4,8 +4,13 @@ project(logging LANGUAGES CXX) #ADD_SUBDIRECTORY(lib) -include_directories(/usr/local/include) -find_library(LOG4CXX liblog4cxx.dylib) +find_library(LOG4CXX + NAMES + ${LIBPREFIX}log4cxx${LIBSUFFIX} + PATHS + ${LIBRARY_SEARCH_PATHS}) + +message(${LOG4CXX}) set(LIBRARY_OUTPUT_PATH ${PROJECT_ROOT_PATH}/lib) diff --git a/src/logging/log.cc b/src/logging/log.cc index 60082e8..6ad2329 100644 --- a/src/logging/log.cc +++ b/src/logging/log.cc @@ -1,6 +1,7 @@ #include "log.h" #include #include +#include namespace sunhi { namespace common { namespace log { diff --git a/src/logging/log.h b/src/logging/log.h index a28b55c..bd4054e 100644 --- a/src/logging/log.h +++ b/src/logging/log.h @@ -21,11 +21,11 @@ class LogHandler {//interface log handler class CommonLog { public: enum { - FATAL = 0, - ERROR = 1, - WARN = 2, - INFO = 3, - DEBUG = 4, + FATAL, + ERR, + WARN, + INFO, + DEBUG }; class LogRecord { diff --git a/src/logging/loghandler.cc b/src/logging/loghandler.cc index e29aad3..ec25012 100644 --- a/src/logging/loghandler.cc +++ b/src/logging/loghandler.cc @@ -1,5 +1,6 @@ #include "loghandler.h" #include +#include namespace sunhi { namespace common { namespace log { @@ -32,7 +33,7 @@ void Log4cxxHandler::logMessage(int level, const char* module, const char* msg) LOG4CXX_INFO(this->logger, module_ << msg); } else if (level == CommonLog::WARN){ LOG4CXX_WARN(this->logger, module_ << msg); - } else if (level == CommonLog::ERROR) { + } else if (level == CommonLog::ERR) { LOG4CXX_ERROR(this->logger, module_ << msg); }else if (level == CommonLog::FATAL) { LOG4CXX_FATAL(this->logger, module_ << msg); diff --git a/src/main.cpp b/src/main.cpp index 69a9bcb..33e81d8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -39,6 +39,8 @@ #include #include +#define WEBRTC_WIN 1 + #include "logging/log.h" #include "logging/loghandler.h" #include "api/scoped_refptr.h" @@ -109,7 +111,11 @@ int main(int argc, char* argv[]) SDL_Event event; struct SwsContext *img_convert_ctx; - char filepath[]="/Users/yaoping.zheng/Documents/mediademo/kfc.mp4"; +#if _WINDOWS + char filepath[]="D:/bin/kfc.mp4"; +#else + char filepath[]="/Users/yaoping.zheng/Documents/mediademo/kfc.mp4"; +#endif MAIN_LOG(DEBUG) << "zyptest " << std::endl; @@ -135,7 +141,7 @@ int main(int argc, char* argv[]) videoindex=-1; audioindex = -1; for(i=0; inb_streams; i++) - if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){ + if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO && videoindex == -1){ videoindex=i; } else if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { audioindex = i;