From d8d933f3f0052c6954b910f18b25094b36da8cd7 Mon Sep 17 00:00:00 2001 From: litkinger Date: Mon, 21 Jun 2021 20:08:38 +0800 Subject: [PATCH] for main no defined --- CMakeLists.txt | 5 ++--- src/CMakeLists.txt | 23 +++++------------------ src/main.cpp | 10 ++++++---- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ac0b91..ba9c9e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,13 +19,12 @@ if (CMAKE_HOST_WIN32) set(WINDOWS 1) set(LIBSUFFIX .lib) set(LIBPREFIX ) - set(LIBRARY_SEARCH_PATHSf + 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 + D:/workspace/mycode/media_test/3rd/apr-util/LibD ) include_directories(C:/msys64/usr/local/ffmpeg/include) include_directories(C:/msys64/usr/src/src/third_party/sdl/include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e266945..da61b0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,8 +4,6 @@ project(ffmpeg_sdl_test LANGUAGES CXX) add_subdirectory(logging) -message(${LIBPREFIX}avcodec${LIBSUFFIX}) - find_library(LIBAVCODEC NAMES ${LIBPREFIX}avcodec${LIBSUFFIX} @@ -37,7 +35,7 @@ find_library(LIBSWRESAMPLE if(WINDOWS) find_library(ARP NAMES - libaprutil${LIBSUFFIX} + aprutil-1${LIBSUFFIX} PATHS ${LIBRARY_SEARCH_PATHS}) find_library(LIBSDL2 @@ -98,6 +96,8 @@ set(extra_libs ${LIBAVCODEC} ${LIBAVUTIL} ${LIBSWSCALE} ${LIBAVFORMAT} ${LIBSWRE # endif() #endif() +#aux_source_directory(. srcs) +FILE(GLOB SC_FILES "*.cpp" "*.h") #link_directories(${CMAKE_OSX_SYSROOT}/System/Library) @@ -112,21 +112,8 @@ set(extra_libs ${LIBAVCODEC} ${LIBAVUTIL} ${LIBSWSCALE} ${LIBAVFORMAT} ${LIBSWRE # avcommon.cpp # ) #else() - add_executable(ffmpeg_sdl_test - main.cpp - video.h - video.cpp - audio.cpp - audio.h - avcommon.h - avcommon.cpp - packetqueue.h - packetqueue.cpp - media.cpp - media.h - framequeue.cpp - framequeue.h - ) + +add_executable(ffmpeg_sdl_test ${SC_FILES}) #endif() #add_framework(ffmpeg_sdl_test VideoToolbox) diff --git a/src/main.cpp b/src/main.cpp index f3e162b..8ce7a47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,9 +37,10 @@ */ #include -#include +#include +#include -//#define WEBRTC_WIN 1 +#define WEBRTC_WIN 1 #include "logging/log.h" #include "logging/loghandler.h" @@ -90,6 +91,7 @@ static CommonLog commonLogger(logHandler,"main"); #define MAIN_LOG(level) COMMON_LOG(commonLogger, level) +#undef main int main(int argc, char* argv[]) { AVFormatContext *pFormatCtx; @@ -112,12 +114,12 @@ int main(int argc, char* argv[]) struct SwsContext *img_convert_ctx; #if _WINDOWS - char filepath[]="D:/bin/kfc.mp4"; + char filepath[]="kfc.mp4"; #else char filepath[]="/Users/yaoping.zheng/Documents/mediademo/kfc.mp4"; #endif - MAIN_LOG(DEBUG) << "zyptest " << std::endl; + MAIN_LOG(INFO) << "zyptest " << std::endl; MAIN_LOG(WARN) << "starting...." << (const char*)argv[0] << std::endl;