cherishman2005 / rtc_tools

rtc ffmpeg
3 stars 0 forks source link

error: ‘sws_getContext’ was not declared in this scope #27

Open cherishman2005 opened 2 years ago

cherishman2005 commented 2 years ago

https://www.cnblogs.com/yongdaimi/p/9829290.html

FFmpeg(10)-利用FFmpeg进行视频像素格式和尺寸的转换(sws_getCachedContext(), sws_scale()) 一.包含头文件和库文件

像素格式的相关函数包含在 libswscale.so 库中,CMakeLists需要做下列改动:

swscale

add_library(swscale SHARED IMPORTED) set_target_properties(swscale PROPERTIES IMPORTED_LOCATION ${FF}/libswscale.so) target_link_libraries

target_link_libraries( # Specifies the target library.
                       native-lib
                       avcodec
                       avformat
                       avutil
                       swscale

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )

同时在代码中包含头文件 #include <libswscale/swscale.h>

cherishman2005 commented 2 years ago

include "libswscale/swscale.h"