更新代码

This commit is contained in:
feiyangqingyun
2020-10-29 08:44:09 +08:00
parent bd33a53808
commit 85a577fe90
9 changed files with 110 additions and 12 deletions

View File

@@ -3,7 +3,7 @@ HEADERS += $$PWD/ffmpeg.h
SOURCES += $$PWD/ffmpeg.cpp
#如果用的是ffmpeg4内核请将ffmpeg3改成ffmpeg4,两种内核不兼容,头文件也不一样
DEFINES += ffmpeg3
DEFINES += ffmpeg4
#ffmpeg4则使用ffmpeg4的目录
contains(DEFINES, ffmpeg4) {
@@ -28,13 +28,29 @@ contains(QT_ARCH, arm) {
strInclude = include
}
!android {
INCLUDEPATH += $$PWD/$$strPath/$$strInclude
}
win32 {
LIBS += -L$$PWD/$$strPath/$$strLib/ -lavcodec -lavfilter -lavformat -lswscale -lavutil -lswresample -lavdevice
}
#请自行替换
unix {
!android {
unix:!macx {
LIBS += -L$$PWD/linuxlib/ -lavfilter -lavformat -lavdevice -lavcodec -lswscale -lavutil -lswresample -lavdevice -lpthread -lm -lz -lrt -ldl
}}
#android系统
android {
INCLUDEPATH += $$PWD/androidlib/include
LIBS += -L$$PWD/androidlib/ -lavcodec -lavfilter -lavformat -lswscale -lavutil -lswresample
#将动态库文件一起打包
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libavcodec.so
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libavfilter.so
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libavformat.so
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libavutil.so
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libswresample.so
ANDROID_EXTRA_LIBS += $$PWD/androidlib/libswscale.so
}

View File

@@ -1,6 +1,7 @@
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
android {QT += androidextras}
TARGET = ffmpegdemo
TEMPLATE = app

View File

@@ -7,6 +7,9 @@
int main(int argc, char *argv[])
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication a(argc, argv);
QFont font;