From f1fc83dc548dc2859b28d5ee22b9957c6e07ba8e Mon Sep 17 00:00:00 2001 From: simon987 Date: Wed, 5 May 2021 14:11:43 -0400 Subject: [PATCH] Fix build --- CMakeLists.txt | 6 ++---- libscan/media/media.h | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac09c74..3929040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,6 @@ add_library( set_target_properties(scan PROPERTIES LINKER_LANGUAGE C) set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib .so) -target_link_directories(scan PUBLIC /usr/share/vcpkg/installed/x64-linux/lib/) find_package(LibArchive REQUIRED) find_package(BZip2 REQUIRED) @@ -42,8 +41,6 @@ find_package(Tesseract CONFIG REQUIRED) find_package(OpenJPEG CONFIG REQUIRED) find_package(JPEG REQUIRED) find_package(LibXml2 REQUIRED) -find_package(FFMPEG REQUIRED) -#find_package(OpenSSL REQUIRED) find_package(LibLZMA REQUIRED) find_package(ZLIB REQUIRED) @@ -58,7 +55,7 @@ find_library(MUPDF_LIB NAMES liblibmupdf.a) find_library(CMS_LIB NAMES lcms) find_library(JAS_LIB NAMES jasper) find_library(GUMBO_LIB NAMES gumbo) -find_library(GOMP_LIB NAMES libgomp.a gomp PATHS /usr/lib/gcc/x86_64-linux-gnu/5/ /usr/lib/gcc/x86_64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/10/ /usr/lib/gcc/aarch64-linux-gnu/7/) +find_library(GOMP_LIB NAMES libgomp.a gomp PATHS /usr/lib/gcc/x86_64-linux-gnu/5/ /usr/lib/gcc/x86_64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/10/ /usr/lib/gcc/aarch64-linux-gnu/7/ /usr/lib/gcc/x86_64-linux-gnu/7/) target_compile_options( @@ -112,6 +109,7 @@ ExternalProject_Add( ) SET(FFMPEG_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/ext_ffmpeg/src/ffmpeg) +SET(FFMPEG_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/ext_ffmpeg/src/ffmpeg) add_dependencies( scan diff --git a/libscan/media/media.h b/libscan/media/media.h index d76ce50..4ca1946 100644 --- a/libscan/media/media.h +++ b/libscan/media/media.h @@ -18,12 +18,13 @@ typedef struct { int tn_size; float tn_qscale; long max_media_buffer; + int read_subtitles; } scan_media_ctx_t; __always_inline static AVCodecContext *alloc_jpeg_encoder(int w, int h, float qscale) { - AVCodec *jpeg_codec = avcodec_find_encoder(AV_CODEC_ID_MJPEG); + const AVCodec *jpeg_codec = avcodec_find_encoder(AV_CODEC_ID_MJPEG); AVCodecContext *jpeg = avcodec_alloc_context3(jpeg_codec); jpeg->width = w; jpeg->height = h; @@ -43,8 +44,9 @@ static AVCodecContext *alloc_jpeg_encoder(int w, int h, float qscale) { void parse_media(scan_media_ctx_t *ctx, vfile_t *f, document_t *doc); + void init_media(); -int store_image_thumbnail(scan_media_ctx_t *ctx, void* buf, size_t buf_len, document_t *doc, const char *url); +int store_image_thumbnail(scan_media_ctx_t *ctx, void *buf, size_t buf_len, document_t *doc, const char *url); #endif