From 6677fba89c11723f2b50b3098a13d553db060b40 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Mon, 29 Nov 2021 19:24:50 +0900 Subject: [PATCH] WIP Fix includes and linking with libav/ffmpeg --- CMakeLists.txt | 3 ++- src/video.cc | 4 ++-- src/video.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f995bb5..1518449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(EN605.617.81.FA21_StephenSeo_DitheringProject) set(Project_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/image.cc + ${CMAKE_CURRENT_SOURCE_DIR}/src/video.cc ${CMAKE_CURRENT_SOURCE_DIR}/src/opencl_handle.cc ) @@ -25,7 +26,7 @@ find_package(OpenCL REQUIRED) find_package(PNG REQUIRED) find_package(PkgConfig REQUIRED) -pkg_check_modules(FFMPEG_LIBAVCODEC REQUIRED libavcodec) +pkg_check_modules(FFMPEG_LIBAVCODEC REQUIRED libavcodec libavformat libavutil) target_include_directories(DitheringProject PUBLIC ${OpenCL_INCLUDE_DIRS} diff --git a/src/video.cc b/src/video.cc index fcac248..ac86500 100644 --- a/src/video.cc +++ b/src/video.cc @@ -4,9 +4,9 @@ #include #include -#include -#include +extern "C" { #include +} Video::Video(const char *video_filename) : Video(std::string(video_filename)) {} diff --git a/src/video.h b/src/video.h index 7e0e283..ac0af82 100644 --- a/src/video.h +++ b/src/video.h @@ -1,7 +1,9 @@ #ifndef IGPUP_DITHERING_PROJECT_VIDEO_H_ #define IGPUP_DITHERING_PROJECT_VIDEO_H_ +extern "C" { #include +} #include "image.h"