From 8698c37ea3d49760f3fb0ebc075538b758094d77 Mon Sep 17 00:00:00 2001 From: Longquan Chen Date: Fri, 25 Aug 2017 14:26:37 -0400 Subject: [PATCH] EHN: Visual studio 2015 build error fixing 1. snprintf and vsnprinft definition removed from cmake file. 2. use av_always_inline, instead of attribute(always_inline) inline. 3. Functions that have declaration but without definition are filled with empty implemenation now. --- CMakeLists.txt | 16 ++++++++-------- libavcodec/frame_thread_encoder.h | 6 +++--- libavcodec/hevcdsp.c | 2 ++ libavcodec/videodsp.c | 6 ++++++ libavcodec/x86/hevc_sao_sse.c | 2 +- libavutil/x86/cpu.c | 5 +++++ 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ae010f..aeb747ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,14 +68,14 @@ if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l") ) endif() -if(WIN32) - add_definitions( - -Dsnprintf=avpriv_snprintf - -Dvsnprintf=avpriv_vsnprintf - -Dinline=__inline - -Drestrict=__restrict - ) -endif() +#if(WIN32) + #add_definitions( + #-Dsnprintf=avpriv_snprintf + #-Dvsnprintf=avpriv_vsnprintf + #-Dinline=__inline + #-Drestrict=__restrict + #) +#endif() #define asm sources if(NOT ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l") ) diff --git a/libavcodec/frame_thread_encoder.h b/libavcodec/frame_thread_encoder.h index 1da0ce18..a69aaa76 100644 --- a/libavcodec/frame_thread_encoder.h +++ b/libavcodec/frame_thread_encoder.h @@ -20,7 +20,7 @@ #include "avcodec.h" -int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options); -void ff_frame_thread_encoder_free(AVCodecContext *avctx); -int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr); +int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options) {}; +void ff_frame_thread_encoder_free(AVCodecContext *avctx) {}; +int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr) {}; diff --git a/libavcodec/hevcdsp.c b/libavcodec/hevcdsp.c index 1f8b37c4..2751b97a 100644 --- a/libavcodec/hevcdsp.c +++ b/libavcodec/hevcdsp.c @@ -1326,3 +1326,5 @@ int i = 0; if (ARCH_X86) ff_hevcdsp_init_x86(hevcdsp, bit_depth); if (ARCH_ARM) ff_hevcdsp_init_arm(hevcdsp, bit_depth); } + +void ff_hevcdsp_init_arm(HEVCDSPContext *c, const int bit_depth) {}; diff --git a/libavcodec/videodsp.c b/libavcodec/videodsp.c index 3877b024..9ea8abd2 100644 --- a/libavcodec/videodsp.c +++ b/libavcodec/videodsp.c @@ -57,3 +57,9 @@ av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc) if (ARCH_X86) ff_videodsp_init_x86(ctx, bpc); } + + +void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc) {}; +void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc) {}; +void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc) {}; +void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc) {}; diff --git a/libavcodec/x86/hevc_sao_sse.c b/libavcodec/x86/hevc_sao_sse.c index e934e6c7..8e1e4dc6 100644 --- a/libavcodec/x86/hevc_sao_sse.c +++ b/libavcodec/x86/hevc_sao_sse.c @@ -335,7 +335,7 @@ static av_always_inline void ff_hevc_sao_edge_filter_ ## D ##_sse( \ } //SAO_EDGE_FILTER( 8) -static __attribute__((always_inline)) inline void ff_hevc_sao_edge_filter_8_sse( +static av_always_inline void ff_hevc_sao_edge_filter_8_sse( uint8_t *_dst, uint8_t *_src, ptrdiff_t _stride_dst, ptrdiff_t _stride_src, struct SAOParams *sao, diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index 2b62e924..0577fed3 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -216,3 +216,8 @@ int ff_get_cpu_flags_x86(void) return rval; } + + +int ff_get_cpu_flags_aarch64(void) {}; +int ff_get_cpu_flags_arm(void) {}; +int ff_get_cpu_flags_ppc(void) {};