Skip to content

Commit

Permalink
for main no defined
Browse files Browse the repository at this point in the history
  • Loading branch information
litkinger committed Jun 21, 2021
1 parent 83b0bd8 commit d8d933f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 5 additions & 18 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ project(ffmpeg_sdl_test LANGUAGES CXX)

add_subdirectory(logging)

message(${LIBPREFIX}avcodec${LIBSUFFIX})

find_library(LIBAVCODEC
NAMES
${LIBPREFIX}avcodec${LIBSUFFIX}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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)
Expand Down
10 changes: 6 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
*/

#include <stdio.h>
#include <QCoreApplication>
#include <iostream>
#include <QApplication>

//#define WEBRTC_WIN 1
#define WEBRTC_WIN 1

#include "logging/log.h"
#include "logging/loghandler.h"
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit d8d933f

Please sign in to comment.