├── debian ├── compat ├── source │ └── format ├── gbp.conf ├── rules ├── copyright └── ubuntu.sh ├── doc ├── NativePaintingInQWidget-zh_CN.md ├── MultiplePlayersSynchronization.md ├── UsingPipe.md ├── NativePaintingInQWidget.md └── UseQtAVinYourProjects-zh_CN.md ├── src ├── QtAV │ ├── QtAV │ ├── AudioResamplerTypes.h │ ├── VideoRendererTypes.h │ └── private │ │ ├── OpenGLRendererBase_p.h │ │ ├── MediaIO_p.h │ │ └── Frame_p.h ├── QtAV.ico ├── QtAV.icns ├── compat │ ├── msint.txt │ └── msvc │ │ └── changelog.txt ├── i18n │ └── QtAV_zh_CN.qm ├── io │ ├── tst_avinput.pro │ ├── tst_qiodevinput.pro │ └── tst_mediaio.cpp ├── QtAV.qrc ├── shaders │ ├── shaders.qrc │ ├── packed.f.glsl │ └── video.vert ├── QtAV.svg ├── vaapi │ └── vaapi_helper.cpp ├── codec │ └── video │ │ └── VideoDecoderTypes.cpp ├── ShaderManager.cpp ├── AudioResamplerFF.cpp ├── QtAV.rc ├── AudioResamplerLibav.cpp ├── subtitle │ ├── PlainText.h │ └── CharsetDetector.h ├── AudioResamplerTypes.cpp ├── AudioThread.h ├── utils │ ├── internal.h │ ├── CopyFrame_SSE4.cpp │ ├── DirectXHelper.h │ └── GPUMemCopy.h ├── cuda │ └── dllapi │ │ ├── nv_inc.h │ │ └── nvcuvid.cpp └── output │ └── video │ └── VideoOutputEventFilter.h ├── qtc_packaging ├── common │ ├── README │ ├── changelog │ └── copyright ├── debian_fremantle │ ├── compat │ └── control ├── debian_harmattan │ ├── compat │ └── control ├── ifw │ ├── packages │ │ ├── com.qtav.product.player │ │ │ ├── data │ │ │ │ ├── player.bat │ │ │ │ ├── bin │ │ │ │ │ ├── player.sh │ │ │ │ │ └── QMLPlayer.sh │ │ │ │ ├── uninstall.bat │ │ │ │ └── install.bat │ │ │ └── meta │ │ │ │ └── package.xml │ │ ├── com.qtav.product.examples │ │ │ └── meta │ │ │ │ └── package.xml │ │ ├── com.qtav.product.dev │ │ │ ├── meta │ │ │ │ └── package.xml │ │ │ └── data │ │ │ │ └── sdk_deploy.bat │ │ ├── com.qtav.product │ │ │ └── meta │ │ │ │ └── package.xml │ │ └── com.qtav.product.runtime │ │ │ └── meta │ │ │ └── package.xml │ └── config │ │ ├── config.xml │ │ └── control.js ├── windows │ ├── uninstall.bat │ └── install.bat └── debian_generic │ ├── control │ ├── player.desktop │ └── QMLPlayer.desktop ├── examples ├── common │ ├── theme │ │ ├── README │ │ ├── dark │ │ │ ├── play.svg │ │ │ ├── stop.svg │ │ │ ├── backward.svg │ │ │ ├── forward.svg │ │ │ ├── open.svg │ │ │ ├── capture.svg │ │ │ ├── sound.svg │ │ │ ├── help.svg │ │ │ ├── info.svg │ │ │ ├── pause.svg │ │ │ ├── menu.svg │ │ │ ├── fullscreen.svg │ │ │ └── close.svg │ │ ├── default │ │ │ ├── play.svg │ │ │ ├── stop.svg │ │ │ ├── open.svg │ │ │ ├── help.svg │ │ │ ├── backward.svg │ │ │ ├── forward.svg │ │ │ ├── info.svg │ │ │ ├── pause.svg │ │ │ ├── fullscreen.svg │ │ │ └── close.svg │ │ └── theme.qrc │ ├── common_export.h │ ├── ScreenSaver.h │ └── common.pro ├── audiopipeline │ ├── src.pri │ └── audiopipeline.pro ├── filters │ ├── qt-logo.png │ ├── res.qrc │ └── filters.pro ├── player │ ├── res │ │ ├── player_zh_CN.qm │ │ ├── tv.ini │ │ ├── player.qrc │ │ ├── help-zh_CN.html │ │ └── help.html │ ├── filters │ │ ├── AVFilterSubtitle.h │ │ └── OSD.h │ ├── ClickableMenu.h │ ├── ClickableMenu.cpp │ ├── playlist │ │ └── PlayListDelegate.h │ ├── TVView.h │ └── config │ │ ├── AVFormatConfigPage.h │ │ ├── ConfigPageBase.cpp │ │ ├── ConfigDialog.h │ │ ├── MiscPage.h │ │ └── AVFilterConfigPage.h ├── QMLPlayer │ ├── ControlPanel.qml │ ├── i18n │ │ └── QMLPlayer_zh_CN.qm │ ├── android │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── icon.png │ │ │ └── values │ │ │ │ └── libs.xml │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── src │ │ │ └── org │ │ │ │ └── qtav │ │ │ │ └── qmlplayer │ │ │ │ └── QMLPlayerActivity.java │ │ └── build.gradle │ ├── QMLPlayer_harmattan.desktop │ ├── qml │ │ └── QMLPlayer │ │ │ ├── PreviewPage.qml │ │ │ ├── DelegateItem.qml │ │ │ └── ConfigPanel.qml │ ├── qmlplayer.qrc │ └── qtquick2applicationviewer │ │ └── qtquick2applicationviewer.h ├── window │ └── window.pro ├── simpletranscode │ └── simpletranscode.pro ├── simpleplayer │ ├── simpleplayer.pro │ ├── main.cpp │ └── playerwindow.h ├── videocapture │ ├── videocapture.pro │ ├── main.cpp │ └── playerwindow.h ├── videowall │ └── videowall.pro ├── videogroup │ └── videogroup.pro ├── videographicsitem │ ├── videographicsitem.pro │ ├── main.cpp │ └── videoplayer.h ├── sharedoutput │ ├── sharedoutput.pro │ ├── main.cpp │ └── widget.h ├── examples.pro └── qml │ ├── simple.qml │ └── multiwindow.qml ├── tools ├── ci │ ├── linux │ │ ├── after_success.sh │ │ ├── script.sh │ │ └── install.sh │ ├── osx │ │ ├── script.sh │ │ ├── install.sh │ │ └── after_success.sh │ └── after_success.sh ├── tools.pro ├── install_sdk │ └── qt4 │ │ ├── av.prf │ │ └── avwidgets.prf └── patchelf.sh ├── widgets ├── QtAVWidgets │ ├── QtAVWidgets │ └── QtAVWidgets.h └── QtAVWidgets.rc ├── scripts ├── perftest.json ├── packff.sh ├── functions.sh ├── build_all_ff.sh ├── dll_osx.sh └── perftest.py ├── templates ├── err.txt ├── base.cpp ├── derived.cpp ├── derived_p.h ├── base_p.h ├── final.h ├── final.cpp ├── derived.h ├── base.h ├── COPYRIGHT.h └── mkclass.sh ├── contrib └── d2d1headers │ ├── README.INSTALL │ └── d2dbasetypes.h ├── config.tests ├── portaudio │ ├── main.cpp │ └── portaudio.pro ├── xv │ ├── xv.pro │ └── main.cpp ├── gl │ ├── gl.pro │ └── main.cpp ├── pulseaudio │ ├── main.cpp │ └── pulseaudio.pro ├── dxva │ ├── dxva.pro │ └── main.cpp ├── libcedarv │ ├── libcedardrv.pro │ └── main.cpp ├── gdiplus │ ├── gdiplus.pro │ └── main.cpp ├── xaudio2 │ ├── xaudio2.pro │ └── main.cpp ├── libass │ ├── libass.pro │ └── main.cpp ├── vaapi │ ├── vaapi.pro │ └── main.cpp ├── dsound │ ├── dsound.pro │ └── main.cpp ├── direct2d │ ├── direct2d.pro │ └── main.cpp ├── paths.pri ├── openal │ ├── openal.pro │ └── main.cpp ├── avutil │ ├── avutil.pro │ └── main.cpp ├── avcodec │ ├── avcodec.pro │ └── main.cpp ├── avdevice │ ├── avdevice.pro │ └── main.cpp ├── avfilter │ ├── avfilter.pro │ └── main.cpp ├── avformat │ ├── avformat.pro │ └── main.cpp ├── swscale │ ├── swscale.pro │ └── main.cpp ├── avresample │ ├── avresample.pro │ └── main.cpp ├── swresample │ ├── swresample.pro │ └── main.cpp ├── gentest.sh └── sse4_1 │ └── sse4_1.pro ├── qml ├── qmldir └── QmlAV │ ├── Export.h │ └── SGVideoNode.h ├── tests ├── qrc │ ├── media.qrc │ ├── qrc.pro │ └── main.cpp ├── ao │ └── ao.pro ├── tests.pro ├── transcode │ └── transcode.pro ├── decoder │ └── decoder.pro ├── extract │ └── extract.pro ├── subtitle │ └── subtitle.pro ├── playerthread │ ├── playerthread.pro │ └── main.cpp ├── qiodevice │ └── qiodevice.pro └── arch │ └── arch.pro ├── .gitmodules ├── .qmake.conf ├── .gitignore └── .travis.yml /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /doc/NativePaintingInQWidget-zh_CN.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/QtAV/QtAV: -------------------------------------------------------------------------------- 1 | #include "QtAV.h" 2 | -------------------------------------------------------------------------------- /qtc_packaging/common/README: -------------------------------------------------------------------------------- 1 | ../../README.md -------------------------------------------------------------------------------- /qtc_packaging/debian_fremantle/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /qtc_packaging/debian_harmattan/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /qtc_packaging/common/changelog: -------------------------------------------------------------------------------- 1 | ../../Changelog -------------------------------------------------------------------------------- /examples/common/theme/README: -------------------------------------------------------------------------------- 1 | Written by Wang Bin 2 | -------------------------------------------------------------------------------- /tools/ci/linux/after_success.sh: -------------------------------------------------------------------------------- 1 | ../after_success.sh -------------------------------------------------------------------------------- /widgets/QtAVWidgets/QtAVWidgets: -------------------------------------------------------------------------------- 1 | #include "QtAVWidgets.h" 2 | -------------------------------------------------------------------------------- /tools/tools.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = install_sdk 3 | -------------------------------------------------------------------------------- /debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [git-buildpackage] 2 | upstream-tag = v%(version)s 3 | -------------------------------------------------------------------------------- /src/QtAV.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/src/QtAV.ico -------------------------------------------------------------------------------- /src/QtAV.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/src/QtAV.icns -------------------------------------------------------------------------------- /tools/install_sdk/qt4/av.prf: -------------------------------------------------------------------------------- 1 | load(qt_functions.prf) 2 | qtAddLibrary(QtAV) 3 | -------------------------------------------------------------------------------- /scripts/perftest.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmd": "player.exe big_buck_bunny_720p_h264.mov" 3 | } -------------------------------------------------------------------------------- /src/compat/msint.txt: -------------------------------------------------------------------------------- 1 | http://www.cnblogs.com/zyl910/archive/2012/08/08/c99int.html -------------------------------------------------------------------------------- /templates/err.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/templates/err.txt -------------------------------------------------------------------------------- /contrib/d2d1headers/README.INSTALL: -------------------------------------------------------------------------------- 1 | Just copy these headers to /usr/win32/include/ 2 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/data/player.bat: -------------------------------------------------------------------------------- 1 | start bin\player.exe -vo gl -------------------------------------------------------------------------------- /src/i18n/QtAV_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/src/i18n/QtAV_zh_CN.qm -------------------------------------------------------------------------------- /examples/audiopipeline/src.pri: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | SOURCES += main.cpp 4 | -------------------------------------------------------------------------------- /config.tests/portaudio/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | return 0; 6 | } -------------------------------------------------------------------------------- /examples/filters/qt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/filters/qt-logo.png -------------------------------------------------------------------------------- /src/compat/msvc/changelog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/src/compat/msvc/changelog.txt -------------------------------------------------------------------------------- /config.tests/xv/xv.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lXv 7 | -------------------------------------------------------------------------------- /config.tests/gl/gl.pro: -------------------------------------------------------------------------------- 1 | CONFIG += qt release 2 | QT += opengl 3 | CONFIG += console 4 | 5 | SOURCES += main.cpp 6 | -------------------------------------------------------------------------------- /config.tests/pulseaudio/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /examples/player/res/player_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/player/res/player_zh_CN.qm -------------------------------------------------------------------------------- /tools/install_sdk/qt4/avwidgets.prf: -------------------------------------------------------------------------------- 1 | load(qt_functions.prf) 2 | qtAddLibrary(QtAV) 3 | qtAddLibrary(QtAVWidgets) 4 | -------------------------------------------------------------------------------- /config.tests/dxva/dxva.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | include(../paths.pri) 6 | -------------------------------------------------------------------------------- /config.tests/libcedarv/libcedardrv.pro: -------------------------------------------------------------------------------- 1 | SOURCES += main.cpp 2 | 3 | LIBS += -lvecore -lcedarv 4 | include(../paths.pri) 5 | -------------------------------------------------------------------------------- /examples/QMLPlayer/ControlPanel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | width: 100 5 | height: 62 6 | } 7 | -------------------------------------------------------------------------------- /qml/qmldir: -------------------------------------------------------------------------------- 1 | module QtAV 2 | plugin QmlAV 3 | classname QtAVQmlPlugin 4 | typeinfo plugins.qmltypes 5 | Video 1.3 Video.qml 6 | -------------------------------------------------------------------------------- /tests/qrc/media.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | test.mp4 4 | 5 | 6 | -------------------------------------------------------------------------------- /config.tests/pulseaudio/pulseaudio.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lpulse 7 | -------------------------------------------------------------------------------- /examples/QMLPlayer/i18n/QMLPlayer_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/QMLPlayer/i18n/QMLPlayer_zh_CN.qm -------------------------------------------------------------------------------- /config.tests/gdiplus/gdiplus.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lgdiplus -lGdi32 7 | -------------------------------------------------------------------------------- /config.tests/xaudio2/xaudio2.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt app_bundle 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | include(../paths.pri) 7 | -------------------------------------------------------------------------------- /examples/filters/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qt-logo.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/io/tst_avinput.pro: -------------------------------------------------------------------------------- 1 | QT += av testlib 2 | CONFIG -= app_bundle 3 | INCLUDEPATH += $$[QT_INSTALL_HEADERS] 4 | SOURCES = tst_mediaio.cpp 5 | -------------------------------------------------------------------------------- /config.tests/libass/libass.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lass 7 | include(../paths.pri) 8 | -------------------------------------------------------------------------------- /config.tests/vaapi/vaapi.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lva 7 | include(../paths.pri) 8 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/QMLPlayer/android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/QMLPlayer/android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/QMLPlayer/android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /config.tests/dsound/dsound.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt app_bundle 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -ldsound 7 | include(../paths.pri) 8 | -------------------------------------------------------------------------------- /src/QtAV.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | i18n/QtAV_zh_CN.qm 4 | QtAV.svg 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/QtAV/master/examples/QMLPlayer/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/audiopipeline/audiopipeline.pro: -------------------------------------------------------------------------------- 1 | PROJECTROOT = $$PWD/../.. 2 | include($$PROJECTROOT/src/libQtAV.pri) 3 | preparePaths($$OUT_PWD/../../out) 4 | 5 | include(src.pri) 6 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/data/bin/player.sh: -------------------------------------------------------------------------------- 1 | 2 | D=`readlink -f $0` 3 | D=${D%/*} 4 | export LD_LIBRARY_PATH=$D:$D/lib 5 | $D/player "$@" # name with spaces 6 | -------------------------------------------------------------------------------- /config.tests/direct2d/direct2d.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | !*msvc*:INCLUDEPATH += ../../contrib/d2d1headers 4 | SOURCES += main.cpp 5 | 6 | #dynamic load 7 | #LIBS += -ld2d1 8 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/data/bin/QMLPlayer.sh: -------------------------------------------------------------------------------- 1 | 2 | D=`readlink -f $0` 3 | D=${D%/*} 4 | export LD_LIBRARY_PATH=$D:$D/lib 5 | $D/QMLPlayer "$@" # name with spaces 6 | -------------------------------------------------------------------------------- /src/io/tst_qiodevinput.pro: -------------------------------------------------------------------------------- 1 | QT += av av-private 2 | CONFIG -= app_bundle 3 | DEFINES += TEST_QTAV_QIODEVICEINPUT 4 | INCLUDEPATH += $$[QT_INSTALL_HEADERS] 5 | SOURCES = QIODeviceInput.cpp 6 | -------------------------------------------------------------------------------- /examples/player/res/tv.ini: -------------------------------------------------------------------------------- 1 | #http://mraandtux.github.io/tv/ 2 | #m3u8: http://blog.csdn.net/perfect_promise/article/details/9713663 3 | #CUTV: http://5mu5.com/forum.php?mod=viewthread&tid=6565 4 | -------------------------------------------------------------------------------- /qtc_packaging/windows/uninstall.bat: -------------------------------------------------------------------------------- 1 | reg delete "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV" /f 2 | reg delete "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV QML" /f 3 | pause -------------------------------------------------------------------------------- /src/shaders/shaders.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | planar.f.glsl 4 | packed.f.glsl 5 | video.vert 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/ao/ao.pro: -------------------------------------------------------------------------------- 1 | QT += opengl 2 | CONFIG -= app_bundle 3 | 4 | PROJECTROOT = $$PWD/../.. 5 | include($$PROJECTROOT/src/libQtAV.pri) 6 | preparePaths($$OUT_PWD/../../out) 7 | 8 | SOURCES += \ 9 | main.cpp 10 | -------------------------------------------------------------------------------- /examples/window/window.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | QT = core gui 4 | PROJECTROOT = $$PWD/../.. 5 | include($$PROJECTROOT/src/libQtAV.pri) 6 | preparePaths($$OUT_PWD/../../out) 7 | 8 | SOURCES += main.cpp 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "contrib/libchardet"] 2 | path = contrib/libchardet 3 | url = https://github.com/wang-bin/libchardet.git 4 | [submodule "contrib/capi"] 5 | path = contrib/capi 6 | url = https://github.com/wang-bin/capi.git 7 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/data/uninstall.bat: -------------------------------------------------------------------------------- 1 | reg delete "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV" /f 2 | reg delete "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV QML" /f 3 | pause -------------------------------------------------------------------------------- /templates/base.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "QtAV/%CLASS%.h" 3 | #include "private/%CLASS%_p.h" 4 | 5 | namespace QtAV { 6 | 7 | %CLASS%::%CLASS%(%CLASS%Private &d): 8 | DPTR_INIT(&d) 9 | { 10 | } 11 | 12 | } //namespace QtAV 13 | -------------------------------------------------------------------------------- /tests/tests.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | ao \ 5 | decoder \ 6 | subtitle 7 | 8 | !no-widgets { 9 | SUBDIRS += \ 10 | extract \ 11 | qiodevice \ 12 | qrc \ 13 | playerthread 14 | } 15 | -------------------------------------------------------------------------------- /tests/transcode/transcode.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= app_bundle 2 | TEMPLATE = app 3 | TARGET = transcode 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | preparePaths($$OUT_PWD/../../out) 8 | 9 | SOURCES += main.cpp 10 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH) 4 | export QT_SELECT=qt5 5 | 6 | %: 7 | dh $@ --parallel 8 | 9 | override_dh_auto_configure: 10 | qmake "CONFIG+=no_rpath recheck" 11 | 12 | -------------------------------------------------------------------------------- /templates/derived.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "QtAV/%CLASS%.h" 3 | #include "private/%CLASS%_p.h" 4 | 5 | namespace QtAV { 6 | 7 | %CLASS%::%CLASS%(%CLASS%Private &d): 8 | %BASE%(d) 9 | { 10 | } 11 | 12 | %CLASS%::~%CLASS%() 13 | { 14 | } 15 | 16 | } //namespace QtAV 17 | -------------------------------------------------------------------------------- /config.tests/paths.pri: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib # can not create exe for some platforms (winrt, ios) 2 | # not static lib because sometimes we need to check link flags 3 | INCLUDEPATH += $$[QT_INSTALL_HEADERS] 4 | LIBS += -L$$[QT_INSTALL_LIBS] 5 | CONFIG -= qt app_bundle lib_bundle 6 | CONFIG += console 7 | -------------------------------------------------------------------------------- /tests/decoder/decoder.pro: -------------------------------------------------------------------------------- 1 | QT += opengl 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | TEMPLATE = app 5 | TARGET = decoder 6 | 7 | PROJECTROOT = $$PWD/../.. 8 | include($$PROJECTROOT/src/libQtAV.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += main.cpp 12 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip 7 | -------------------------------------------------------------------------------- /examples/player/res/player.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | player_zh_CN.qm 4 | 5 | 6 | tv.ini 7 | help.html 8 | help-zh_CN.html 9 | 10 | 11 | -------------------------------------------------------------------------------- /config.tests/openal/openal.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | win32: LIBS += -lOpenAL32 7 | unix:!mac:!blackberry: LIBS += -lopenal 8 | blackberry: LIBS += -lOpenAL 9 | mac: LIBS += -framework OpenAL 10 | mac: DEFINES += HEADER_OPENAL_PREFIX 11 | include(../paths.pri) 12 | -------------------------------------------------------------------------------- /config.tests/portaudio/portaudio.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | *msvc* { 4 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 5 | QMAKE_LFLAGS += /SAFESEH:NO 6 | INCLUDEPATH += ../../src/compat/msvc 7 | } 8 | SOURCES += main.cpp 9 | 10 | LIBS += -lportaudio 11 | include(../paths.pri) 12 | -------------------------------------------------------------------------------- /tests/extract/extract.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += opengl 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | CONFIG -= app_bundle 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += main.cpp 12 | -------------------------------------------------------------------------------- /config.tests/avutil/avutil.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavutil 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/avcodec/avcodec.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavcodec 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/avdevice/avdevice.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavdevice 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/avfilter/avfilter.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavfilter 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/avformat/avformat.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavformat 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/swscale/swscale.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lswscale 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /examples/common/theme/dark/play.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /templates/derived_p.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QTAV_%CLASS:u%_P_H 3 | #define QTAV_%CLASS:u%_P_H 4 | 5 | #include "private/%BASE%_p.h" 6 | 7 | namespace QtAV { 8 | 9 | class Q_AV_PRIVATE_EXPORT %CLASS%Private : public %BASE%Private 10 | { 11 | public: 12 | virtual ~%CLASS%Private() {} 13 | }; 14 | 15 | } //namespace QtAV 16 | 17 | #endif // QTAV_%CLASS%_P_H 18 | -------------------------------------------------------------------------------- /examples/simpletranscode/simpletranscode.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | QT += opengl 4 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += main.cpp 12 | 13 | -------------------------------------------------------------------------------- /config.tests/avresample/avresample.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lavresample 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /config.tests/swresample/swresample.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | DEFINES += __STDC_CONSTANT_MACROS 4 | *msvc* { 5 | #link FFmpeg and portaudio which are built by gcc need /SAFESEH:NO 6 | QMAKE_LFLAGS += /SAFESEH:NO 7 | INCLUDEPATH += ../../src/compat/msvc 8 | } 9 | SOURCES += main.cpp 10 | 11 | LIBS += -lswresample 12 | include(../paths.pri) 13 | -------------------------------------------------------------------------------- /examples/common/theme/dark/stop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/QMLPlayer/QMLPlayer_harmattan.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Version=1.0 4 | Type=Application 5 | Terminal=false 6 | Name=QMLPlayer 7 | Exec=/usr/bin/single-instance /opt/QMLPlayer/bin/QMLPlayer 8 | Icon=/usr/share/icons/hicolor/80x80/apps/QMLPlayer80.png 9 | X-Window-Icon= 10 | X-HildonDesk-ShowInToolbar=true 11 | X-Osso-Type=application/x-executable 12 | -------------------------------------------------------------------------------- /templates/base_p.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QTAV_%CLASS:u%_P_H 3 | #define QTAV_%CLASS:u%_P_H 4 | 5 | #include 6 | 7 | namespace QtAV { 8 | 9 | class %CLASS%; 10 | class Q_AV_PRIVATE_EXPORT %CLASS%Private : public DPtrPrivate<%CLASS%> 11 | { 12 | public: 13 | virtual ~%CLASS%Private() {} 14 | }; 15 | 16 | } //namespace QtAV 17 | 18 | #endif // QTAV_%CLASS%_P_H 19 | -------------------------------------------------------------------------------- /templates/final.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QTAV_%CLASS:u%_H 3 | #define QTAV_%CLASS:u%_H 4 | 5 | #include 6 | 7 | namespace QtAV { 8 | 9 | class %CLASS%Private; 10 | class Q_AV_EXPORT %CLASS% : public %BASE% 11 | { 12 | DPTR_DECLARE_PRIVATE(%CLASS%) 13 | public: 14 | %CLASS%(); 15 | virtual ~%CLASS%(); 16 | }; 17 | 18 | } //namespace QtAV 19 | 20 | #endif // QTAV_%CLASS:u%_H 21 | -------------------------------------------------------------------------------- /templates/final.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "QtAV/%CLASS%.h" 3 | #include "private/%BASE%_p.h" 4 | 5 | namespace QtAV { 6 | 7 | class %CLASS%Private : public %BASE%Private 8 | { 9 | public: 10 | %CLASS%Private() {} 11 | virtual ~%CLASS%Private() {} 12 | }; 13 | 14 | %CLASS%::%CLASS%(): 15 | %BASE%(*new %CLASS%Private()) 16 | { 17 | } 18 | 19 | %CLASS%::~%CLASS%() 20 | { 21 | } 22 | 23 | } //namespace QtAV 24 | -------------------------------------------------------------------------------- /examples/common/theme/dark/backward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/common/theme/dark/forward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/common/theme/dark/open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/simpleplayer/simpleplayer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | QT += opengl 4 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += main.cpp \ 12 | playerwindow.cpp 13 | 14 | HEADERS += \ 15 | playerwindow.h 16 | -------------------------------------------------------------------------------- /examples/videocapture/videocapture.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | QT += opengl 4 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += main.cpp \ 12 | playerwindow.cpp 13 | 14 | HEADERS += \ 15 | playerwindow.h 16 | -------------------------------------------------------------------------------- /examples/videowall/videowall.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += opengl 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | CONFIG -= app_bundle 5 | 6 | TARGET = videowall 7 | PROJECTROOT = $$PWD/../.. 8 | include($$PROJECTROOT/src/libQtAV.pri) 9 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 10 | preparePaths($$OUT_PWD/../../out) 11 | 12 | SOURCES += main.cpp VideoWall.cpp 13 | HEADERS += VideoWall.h 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/subtitle/subtitle.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-08-05T17:12:03 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += opengl 8 | 9 | TARGET = subtitle 10 | CONFIG -= app_bundle 11 | 12 | PROJECTROOT = $$PWD/../.. 13 | include($$PROJECTROOT/src/libQtAV.pri) 14 | preparePaths($$OUT_PWD/../../out) 15 | 16 | SOURCES += main.cpp 17 | -------------------------------------------------------------------------------- /tools/ci/osx/script.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | 3 | echo "$TRAVIS_BUILD_DIR" 4 | 5 | tail -n 27 /proc/cpuinfo 6 | uname -a 7 | cat /etc/issue 8 | 9 | echo "QtAV build script for travis-ci" 10 | 11 | jobs=`sysctl -n hw.ncpu` 12 | 13 | 14 | cd $QTAV_OUT 15 | 16 | rm -f build.log 17 | type -a moc 18 | qmake -r $TRAVIS_BUILD_DIR -spec linux-clang "CONFIG+=recheck" 19 | make -j$jobs 2>&1 |tee build.log 20 | 21 | cd $TRAVIS_BUILD_DIR 22 | -------------------------------------------------------------------------------- /examples/videogroup/videogroup.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += opengl 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | CONFIG -= app_bundle 5 | 6 | TARGET = videogroup 7 | PROJECTROOT = $$PWD/../.. 8 | include($$PROJECTROOT/src/libQtAV.pri) 9 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 10 | preparePaths($$OUT_PWD/../../out) 11 | 12 | SOURCES += main.cpp videogroup.cpp 13 | HEADERS += videogroup.h 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /templates/derived.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QTAV_%CLASS:u%_H 3 | #define QTAV_%CLASS:u%_H 4 | 5 | #include 6 | 7 | namespace QtAV { 8 | 9 | class %CLASS%Private; 10 | class Q_AV_EXPORT %CLASS% : public %BASE% 11 | { 12 | DPTR_DECLARE_PRIVATE(%CLASS%) 13 | public: 14 | virtual ~%CLASS%(); 15 | protected: 16 | %CLASS%(%CLASS%Private &d); 17 | }; 18 | 19 | } //namespace QtAV 20 | 21 | #endif // QTAV_%CLASS:u%_H 22 | -------------------------------------------------------------------------------- /examples/common/theme/dark/capture.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/common/theme/dark/sound.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.examples/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Examples 4 | Install QtAV examples. 5 | 1.7.0-0 6 | 2015-07-09 7 | com.qtav.product.examples 8 | script 9 | 10 | 11 | -------------------------------------------------------------------------------- /templates/base.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QTAV_%CLASS:u%_H 3 | #define QTAV_%CLASS:u%_H 4 | 5 | #include 6 | 7 | namespace QtAV { 8 | 9 | class %CLASS%Private; 10 | class Q_AV_EXPORT %CLASS% 11 | { 12 | DPTR_DECLARE_PRIVATE(%CLASS%) 13 | public: 14 | virtual ~%CLASS%() = 0; 15 | protected: 16 | %CLASS%(%CLASS%Private &d); 17 | DPTR_DECLARE(%CLASS%) 18 | }; 19 | 20 | } //namespace QtAV 21 | 22 | #endif // QTAV_%CLASS:u%_H 23 | -------------------------------------------------------------------------------- /tests/qrc/qrc.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += opengl 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | CONFIG -= app_bundle 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | SOURCES += main.cpp 11 | 12 | exists(test.mp4) { 13 | RESOURCES += media.qrc 14 | } else { 15 | warning("put test.mp4 in this directory!") 16 | } 17 | -------------------------------------------------------------------------------- /tools/ci/linux/script.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | 3 | echo "$TRAVIS_BUILD_DIR" 4 | 5 | tail -n 27 /proc/cpuinfo 6 | uname -a 7 | cat /etc/issue 8 | 9 | echo "QtAV build script for travis-ci" 10 | 11 | jobs=`cat /proc/cpuinfo |grep 'cpu cores' |wc -l` 12 | 13 | 14 | cd $QTAV_OUT 15 | 16 | rm -f build.log 17 | type -a moc 18 | qmake -r $TRAVIS_BUILD_DIR -spec linux-clang "CONFIG+=recheck" 19 | make -j$jobs 2>&1 |tee build.log 20 | 21 | cd $TRAVIS_BUILD_DIR 22 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.dev/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Development files 4 | Install QtAV headers and lib. 5 | 1.7.0-0 6 | 2015-07-09 7 | com.qtav.product.dev 8 | script 9 | 10 | 11 | -------------------------------------------------------------------------------- /qtc_packaging/debian_generic/control: -------------------------------------------------------------------------------- 1 | Package: QtAV 2 | Version: %version% 3 | Architecture: %arch% 4 | Maintainer: Wang Bin(Lucas Wang) 5 | Source: QtAV 6 | Section: video 7 | Priority: optional 8 | Homepage: http://www.qtav.org 9 | Depends: 10 | Description: A media playing framework based on Qt and FFmpeg 11 | QtAV is a media playing framework based on Qt and FFmpeg. It can help you to write a player with less effort than ever before. 12 | -------------------------------------------------------------------------------- /examples/common/theme/dark/help.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | ? 12 | 13 | -------------------------------------------------------------------------------- /examples/common/theme/dark/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | i 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/videographicsitem/videographicsitem.pro: -------------------------------------------------------------------------------- 1 | QT += opengl 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | 5 | TARGET = videographicsitem 6 | TEMPLATE = app 7 | PROJECTROOT = $$PWD/../.. 8 | include($$PROJECTROOT/src/libQtAV.pri) 9 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 10 | preparePaths($$OUT_PWD/../../out) 11 | 12 | 13 | SOURCES += main.cpp \ 14 | videoplayer.cpp 15 | 16 | HEADERS += videoplayer.h 17 | -------------------------------------------------------------------------------- /.qmake.conf: -------------------------------------------------------------------------------- 1 | QTAV_MAJOR_VERSION = 1 2 | QTAV_MINOR_VERSION = 7 3 | QTAV_PATCH_VERSION = 0 4 | 5 | QTAV_VERSION = $${QTAV_MAJOR_VERSION}.$${QTAV_MINOR_VERSION}.$${QTAV_PATCH_VERSION} 6 | #MODULE_VERSION = $$QTAV_VERSION 7 | 8 | # set runpath instead of rpath for gcc for elf targets. Qt>=5.5 9 | CONFIG *= enable_new_dtags 10 | # OSX10.6 is not supported in Qt5.4 11 | macx:isEqual(QT_MAJOR_VERSION,5):greaterThan(QT_MINOR_VERSION, 3): CONFIG *= c++11 12 | android: CONFIG*=c++11 13 | -------------------------------------------------------------------------------- /examples/common/theme/dark/pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/common/common_export.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_EXPORT_H 2 | #define COMMON_EXPORT_H 3 | 4 | #include 5 | 6 | #ifdef BUILD_COMMON_STATIC 7 | #define COMMON_EXPORT 8 | #else 9 | #if defined(BUILD_COMMON_LIB) 10 | # undef COMMON_EXPORT 11 | # define COMMON_EXPORT Q_DECL_EXPORT 12 | #else 13 | # undef COMMON_EXPORT 14 | # define COMMON_EXPORT //Q_DECL_IMPORT //only for vc? link to static lib error 15 | #endif 16 | #endif //BUILD_COMMON_STATIC 17 | #endif // COMMON_EXPORT_H 18 | -------------------------------------------------------------------------------- /examples/common/theme/default/play.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /qtc_packaging/debian_fremantle/control: -------------------------------------------------------------------------------- 1 | Source: qtav 2 | Section: user/hidden 3 | Priority: optional 4 | Maintainer: wbin 5 | Build-Depends: debhelper (>= 5), libqt4-dev 6 | Standards-Version: 3.7.3 7 | Homepage: 8 | 9 | Package: qtav 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: 13 | 14 | XB-Maemo-Display-Name: QtAV 15 | -------------------------------------------------------------------------------- /examples/common/theme/default/stop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/filters/filters.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | QT += opengl 4 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 5 | 6 | TARGET = filters 7 | PROJECTROOT = $$PWD/../.. 8 | include($$PROJECTROOT/src/libQtAV.pri) 9 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 10 | preparePaths($$OUT_PWD/../../out) 11 | 12 | SOURCES += \ 13 | main.cpp \ 14 | SimpleFilter.cpp 15 | 16 | HEADERS += \ 17 | SimpleFilter.h 18 | 19 | RESOURCES += \ 20 | res.qrc 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tools/ci/osx/install.sh: -------------------------------------------------------------------------------- 1 | FFVER=2.6.2 2 | test -f ffmpeg-${FFVER}-OSX.tar.xz || wget http://sourceforge.net/projects/qtav/files/depends/FFmpeg/OSX/ffmpeg-${FFVER}-OSX.tar.xz/download -O ffmpeg-${FFVER}-OSX.tar.xz 3 | tar Jxf ffmpeg-${FFVER}-OSX.tar.xz 4 | 5 | export FFMPEG_DIR=$PWD/ffmpeg-${FFVER}-OSX 6 | export CPATH=$FFMPEG_DIR/include 7 | export LIBRARY_PATH=$FFMPEG_DIR/lib/x64 8 | export LD_LIBRARY_PATH=$FFMPEG_DIR/lib/x64 9 | 10 | # TODO: download qt 11 | brew update 12 | brew install qt5 13 | 14 | #export QTDIR 15 | -------------------------------------------------------------------------------- /tests/playerthread/playerthread.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-01-28T10:24:19 4 | # 5 | #------------------------------------------------- 6 | 7 | TEMPLATE = app 8 | QT += opengl 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | CONFIG -= app_bundle 11 | 12 | PROJECTROOT = $$PWD/../.. 13 | include($$PROJECTROOT/src/libQtAV.pri) 14 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 15 | preparePaths($$OUT_PWD/../../out) 16 | 17 | SOURCES += main.cpp 18 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Player 4 | Default player. 5 | 1.7.0-0 6 | 2015-07-09 7 | com.qtav.product.player 8 | true 9 | true 10 | 7 11 | 12 | 13 | -------------------------------------------------------------------------------- /qtc_packaging/windows/install.bat: -------------------------------------------------------------------------------- 1 | :: reg add "HKEY_CLASSES_ROOT\*\shell\OpenWithQtAV\command" /ve /t REG_SZ /d """"%~dp0player.exe""" """%%1"""" /f 2 | reg add "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV\command" /ve /t REG_SZ /d """"%~dp0bin\player.exe""" """-vo""" """gl""" """-f""" """%%1"""" /f 3 | reg add "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV QML\command" /ve /t REG_SZ /d """"%~dp0bin\QMLPlayer.exe""" """-f""" """%%1"""" /f 4 | @echo Right click an video/music file, choose "Open with QtAV" to play 5 | pause 6 | -------------------------------------------------------------------------------- /tests/qiodevice/qiodevice.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-01-28T10:24:19 4 | # 5 | #------------------------------------------------- 6 | 7 | TEMPLATE = app 8 | QT += opengl 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | CONFIG -= app_bundle 11 | 12 | STATICLINK = 0 13 | PROJECTROOT = $$PWD/../.. 14 | include($$PROJECTROOT/src/libQtAV.pri) 15 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 16 | preparePaths($$OUT_PWD/../../out) 17 | 18 | SOURCES += main.cpp 19 | 20 | -------------------------------------------------------------------------------- /doc/MultiplePlayersSynchronization.md: -------------------------------------------------------------------------------- 1 | ## Hypothesis 2 | 3 | The players' playing states are not changed when syncing, e.g. speed, play or pause state. 4 | 5 | ## KEY 6 | 7 | Sending and Recieving the sync requests takes time. The delay must be computed 8 | 9 | ## Solution 10 | 11 | 12 | 13 | ### Players in 1 Process 14 | 15 | Use AVClock. It's easy. 16 | 17 | ### Players in Network 18 | 19 | Pass 2 value. One is aboslute time when sending the sync request. Another is the play time of the video. 20 | This method also works for players in 1 process -------------------------------------------------------------------------------- /examples/common/theme/dark/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/common/theme/default/open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/arch/arch.pro: -------------------------------------------------------------------------------- 1 | TARGET = arch 2 | SOURCES = arch.cpp 3 | CONFIG -= qt dylib release debug_and_release 4 | CONFIG += debug console warn_on 5 | 6 | win32-icc { 7 | QMAKE_CXXFLAGS *= -arch:SSE4.1 #AVX 8 | } *msvc* { 9 | 10 | } else { 11 | ## gcc like. can not add here otherwise other archs can not be detected 12 | # QMAKE_CXXFLAGS *= -msse4.1 13 | } 14 | 15 | arch_pp.target = preprocess 16 | arch_pp.commands = $$QMAKE_CXX \$< #for gnu make 17 | arch_pp.depends = $$PWD/arch.h #TODO: win path. shell_path()? 18 | 19 | QMAKE_EXTRA_TARGETS = arch_pp 20 | -------------------------------------------------------------------------------- /examples/common/theme/default/help.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 13 | ? 14 | 15 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/data/install.bat: -------------------------------------------------------------------------------- 1 | :: reg add "HKEY_CLASSES_ROOT\*\shell\OpenWithQtAV\command" /ve /t REG_SZ /d """"%~dp0player.exe""" """%%1"""" /f 2 | reg add "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV\command" /ve /t REG_SZ /d """"%~dp0bin\player.exe""" """-vo""" """gl""" """-f""" """%%1"""" /f 3 | reg add "HKEY_CURRENT_USER\SOFTWARE\Classes\*\shell\Open with QtAV QML\command" /ve /t REG_SZ /d """"%~dp0bin\QMLPlayer.exe""" """-f""" """%%1"""" /f 4 | @echo Right click an video/music file, choose "Open with QtAV" to play 5 | pause 6 | -------------------------------------------------------------------------------- /scripts/packff.sh: -------------------------------------------------------------------------------- 1 | VER=(0.9.4 0.10.14 0.11.5 1.0.9 1.1.12 1.2.7 2.0.5 2.1.5 2.2.5) 2 | time { 3 | for V in ${VER[@]}; do 4 | FFDIR=ffmpeg-${V}-linux-x86+x64 5 | echo $FFDIR 6 | rm -rf $FFDIR 7 | mkdir -p $FFDIR/{bin,lib}/x64 8 | cp -af ffmpeg-${V}/sdk-x86/* $FFDIR 9 | cp -af ffmpeg-${V}/sdk/bin/* $FFDIR/bin/x64 10 | cp -af ffmpeg-${V}/sdk/lib/* $FFDIR/lib/x64 11 | find $FFDIR/lib -type f -exec md5sum {} \; >$FFDIR/md5 12 | tar -I pxz -cf ${FFDIR}.tar.xz $FFDIR 13 | du -h ${FFDIR}.tar.xz 14 | done 15 | } 16 | -------------------------------------------------------------------------------- /examples/common/theme/default/backward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/common/theme/default/forward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/common/theme/default/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 13 | i 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/common/theme/default/pause.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtAV 4 | Install QtAV multimedia library 5 | 1.7.0-0 6 | 2015-07-09 7 | com.qtav.product 8 | 9 | 10 | 11 | 12 | zh_CN.qm 13 | 14 | true 15 | 16 | -------------------------------------------------------------------------------- /doc/UsingPipe.md: -------------------------------------------------------------------------------- 1 | FFmpeg supports playing media streams from pipe. Pipe is a protocol in FFmpeg. To use it, you just need to replace the file name with 'pipe:'. for example 2 | 3 | cat hello.avi |player pipe: 4 | 5 | It also supports streams from file number 6 | 7 | pipe:number 8 | 9 | 'number' can be 0, 1, 2, .... 0 is stdin, 1 is stdout and 2 is stderr. If 'number' is empty, it means stdin. 10 | 11 | Using pipe in AVPlayer class is almost the same. Just use "pipe:N" as file name. 12 | 13 | #### Named Pipe 14 | 15 | player \\.\pipe\name 16 | 17 | 18 | FFmpeg is powerful, do you think so? -------------------------------------------------------------------------------- /examples/sharedoutput/sharedoutput.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-01-20T13:10:48 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui opengl 8 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 9 | 10 | TARGET = sharedoutput 11 | TEMPLATE = app 12 | CONFIG -= app_bundle 13 | 14 | PROJECTROOT = $$PWD/../.. 15 | include($$PROJECTROOT/src/libQtAV.pri) 16 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 17 | preparePaths($$OUT_PWD/../../out) 18 | 19 | SOURCES += main.cpp \ 20 | widget.cpp 21 | 22 | HEADERS += widget.h 23 | -------------------------------------------------------------------------------- /src/QtAV.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 13 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.runtime/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Runtime library 4 | Install QtAV runtime library. 5 | 1.7.0-0 6 | 2015-07-09 7 | com.qtav.product.runtime 8 | 9 | zh_CN.qm 10 | 11 | true 12 | true 13 | true 14 | 8 15 | 16 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: QtAV 3 | Source: https://github.com/wang-bin/QtAV 4 | 5 | Files: * 6 | Copyright: 2012-2014 Wang Bin 7 | License: LGPL-2.1+ 8 | 9 | Files: examples/* 10 | Copyright: 2012-2014 Wang Bin 11 | License: GPL-3 12 | 13 | Files: debian/* 14 | Copyright: 2014 Sou Bunnbu 15 | License: LGPL-2.1+ 16 | 17 | License: LGPL-2.1+ 18 | See /usr/share/common-licenses/LGPL-2.1 for the full text of the LGPL-2.1+. 19 | 20 | License: GPL-3 21 | See /usr/share/common-licenses/GPL for the full text of the GPL. 22 | -------------------------------------------------------------------------------- /tools/ci/osx/after_success.sh: -------------------------------------------------------------------------------- 1 | cd tools 2 | git clone https://github.com/andreyvit/create-dmg.git 3 | 4 | ./deploy_osx.sh $QTAV_OUT 5 | 6 | 7 | PKG=QtAV-QMLPlayer-$TRAVIS_JOB_NUMBER.tar.xz 8 | mv QMLPlayer.dmg $PKG 9 | 10 | wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz 11 | tar zxf sshpass.tar.gz 12 | cd sshpass-1.05 13 | ./configure 14 | make 15 | sudo make install 16 | export PATH=$PWD:$PATH 17 | cd $TRAVIS_BUILD_DIR 18 | type -a sshpass 19 | # ignore known hosts: -o StrictHostKeyChecking=no 20 | sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci 21 | -------------------------------------------------------------------------------- /examples/common/theme/dark/fullscreen.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/common/theme/default/fullscreen.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/videographicsitem/main.cpp: -------------------------------------------------------------------------------- 1 | #include "videoplayer.h" 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | 11 | QTranslator ts; 12 | if (ts.load(qApp->applicationDirPath() + "/i18n/QtAV_" + QLocale::system().name())) 13 | a.installTranslator(&ts); 14 | QTranslator qtts; 15 | if (qtts.load("qt_" + QLocale::system().name())) 16 | a.installTranslator(&qtts); 17 | 18 | VideoPlayer w; 19 | w.show(); 20 | if (a.arguments().size() > 1) 21 | w.play(a.arguments().last()); 22 | 23 | return a.exec(); 24 | } 25 | -------------------------------------------------------------------------------- /qtc_packaging/debian_harmattan/control: -------------------------------------------------------------------------------- 1 | Source: qtav 2 | Section: user/other 3 | Priority: optional 4 | Maintainer: wbin 5 | Build-Depends: debhelper (>= 5), libqt4-dev 6 | Standards-Version: 3.7.3 7 | Homepage: 8 | 9 | Package: qtav 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: 13 | 14 | XSBC-Maemo-Display-Name: QtAV 15 | XB-Maemo-Flags: visible 16 | XB-MeeGo-Desktop-Entry-Filename: QtAV_harmattan 17 | XB-MeeGo-Desktop-Entry: 18 | [Desktop Entry] 19 | Type=Application 20 | Name=QtAV 21 | Icon=/usr/share/icons/hicolor/80x80/apps/QtAV80.png 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CVS 2 | .#* 3 | 4 | .hg 5 | .hgignore 6 | 7 | obj 8 | TestResults 9 | *.pbxuser 10 | *.perspectivev3 11 | .DS_Store 12 | 13 | *.old 14 | *.log 15 | *.out 16 | *.cache 17 | 18 | *.deb 19 | 20 | *.git.old* 21 | Makefile* 22 | *.*pro*.user* 23 | *.[oa] 24 | *.so* 25 | *.dll 26 | *.lib 27 | *.exp 28 | *.exe 29 | *.out 30 | 31 | #vc files 32 | *.def 33 | *.dep 34 | *.idb 35 | *.layout 36 | *.manifest 37 | *.ncb 38 | *.obj 39 | *.pdb 40 | *.suo 41 | *.user 42 | *.tlh 43 | *.tli 44 | 45 | 46 | #intel compiler 47 | *.ilk 48 | 49 | #dirs 50 | .moc 51 | .rcc 52 | .obj 53 | /bin* 54 | /lib* 55 | Debug 56 | Release 57 | *.Debug 58 | *.Release 59 | 60 | *.fuse* 61 | 62 | #qt 63 | *.prl 64 | *moc_* 65 | *.moc 66 | *qrc_res.cpp 67 | 68 | -------------------------------------------------------------------------------- /debian/ubuntu.sh: -------------------------------------------------------------------------------- 1 | CHANGELOG_BAK=/tmp/qtav_changelog 2 | mkchangelog() { 3 | cat >debian/changelog< $(LANG=C date -R) 9 | 10 | `cat $CHANGELOG_BAK` 11 | EOF 12 | } 13 | 14 | DISTRIBUTIONS=(trusty utopic vivid) 15 | DATE=`date -d @$(git log -n1 --format="%at") +%Y%m%d` 16 | for D in ${DISTRIBUTIONS[@]}; do 17 | git checkout -- debian/changelog 18 | cp -avf debian/changelog $CHANGELOG_BAK 19 | VER=1.7.0~`git log -1 --pretty=format:"git${DATE}.%h~${D}" 2> /dev/null` 20 | mkchangelog $VER $D 21 | debuild -S -sa 22 | dput -f ppa:wbsecg1/qtav ../qtav_${VER}_source.changes 23 | cp -avf $CHANGELOG_BAK debian/changelog 24 | done 25 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = common 4 | !android { 5 | SUBDIRS += audiopipeline 6 | !no-widgets { 7 | SUBDIRS += \ 8 | sharedoutput \ 9 | simpletranscode \ 10 | simpleplayer \ 11 | player \ 12 | filters \ 13 | videocapture \ 14 | videographicsitem \ 15 | videogroup \ 16 | videowall 17 | 18 | player.depends += common 19 | } 20 | } 21 | 22 | greaterThan(QT_MAJOR_VERSION, 4) { 23 | greaterThan(QT_MINOR_VERSION, 3) { 24 | !android: SUBDIRS += window 25 | } 26 | # qtHaveModule does not exist in Qt5.0 27 | isEqual(QT_MINOR_VERSION, 0)|qtHaveModule(quick) { 28 | SUBDIRS += QMLPlayer 29 | QMLPlayer.depends += common 30 | } 31 | } 32 | 33 | OTHER_FILES = qml/*.qml 34 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/config/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtAV 4 | 1.7.0 5 | QtAV-Multimedia playback framework 6 | WangBin wbsecg1@gmail.com 7 | http://www.qtav.org 8 | 9 | 10 | control.js 11 | 12 | true 13 | 14 | QtAV 15 | @rootDir@/QtAV 16 | @rootDir@/QtAV 17 | 18 | -------------------------------------------------------------------------------- /scripts/functions.sh: -------------------------------------------------------------------------------- 1 | 2 | cecho() { 3 | while [ $# -gt 1 ]; do 4 | case $1 in 5 | red) echo -ne "\033[49;31m";; 6 | green) echo -ne "\033[49;32m";; 7 | brown) echo -ne "\033[49;33m";; 8 | blue) echo -ne "\033[49;34m";; 9 | purple) echo -ne "\033[49;35m";; 10 | cyan) echo -ne "\033[49;36m";; 11 | white) echo -ne "\033[49;37m";; 12 | line) echo -ne "\033[4m";; 13 | bold) echo -ne "\033[1m";; 14 | *) echo $*; break;; 15 | esac 16 | shift 17 | done 18 | echo -ne "\033[0m" 19 | } 20 | 21 | die(){ 22 | cecho red bold "$@" >&2 23 | exit 1 24 | } 25 | 26 | print_copyright(){ 27 | cecho red bold "Author: wbsecg1@gmail.com" 28 | } 29 | 30 | #http://jarit.iteye.com/blog/1070117 31 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/values/libs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https://download.qt-project.org/ministro/android/qt5/qt-5.4 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/vaapi/vaapi_helper.cpp: -------------------------------------------------------------------------------- 1 | #include "vaapi_helper.h" 2 | #include "utils/Logger.h" 3 | 4 | namespace QtAV { 5 | namespace vaapi { 6 | 7 | dll_helper::dll_helper(const QString &soname, int version) 8 | { 9 | if (version >= 0) 10 | m_lib.setFileNameAndVersion(soname, version); 11 | else 12 | m_lib.setFileName(soname); 13 | if (m_lib.load()) { 14 | qDebug("%s loaded", m_lib.fileName().toUtf8().constData()); 15 | } else { 16 | if (version >= 0) { 17 | m_lib.setFileName(soname); 18 | m_lib.load(); 19 | } 20 | } 21 | if (!m_lib.isLoaded()) 22 | qDebug("can not load %s: %s", m_lib.fileName().toUtf8().constData(), m_lib.errorString().toUtf8().constData()); 23 | } 24 | 25 | } //namespace QtAV 26 | } //namespace vaapi 27 | 28 | -------------------------------------------------------------------------------- /examples/qml/simple.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.1 2 | import QtAV 1.4 3 | import QtQuick.Dialogs 1.0 4 | 5 | Rectangle { 6 | width: 800 7 | height: 500 8 | color: "black" 9 | Video { 10 | id: video 11 | autoPlay: true 12 | anchors.fill: parent 13 | subtitle.engines: ["FFmpeg"] 14 | } 15 | Text { 16 | color: "white" 17 | text: "Press key 'O' to open a file" 18 | } 19 | Item { 20 | anchors.fill: parent 21 | focus: true 22 | Keys.onPressed: { 23 | switch (event.key) { 24 | case Qt.Key_O: 25 | fileDialog.open() 26 | break 27 | } 28 | } 29 | } 30 | FileDialog { 31 | id: fileDialog 32 | onAccepted: video.source = fileUrl 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scripts/build_all_ff.sh: -------------------------------------------------------------------------------- 1 | QTAV=$PWD/../QtAV 2 | FFROOT=$PWD/.. 3 | FFVER=(0.11.5 1.0.9 1.1.12 1.2.7 2.0.5 2.1.5 2.2.5 2.3) 4 | #LIBAVVER=(0.8.8 9.7) 5 | BUILDROOT=$PWD 6 | buildqtav() { 7 | FF=$1 8 | VER=$2 9 | FFSDK=$FFROOT/$FF-$VER/sdk 10 | export CPATH=$FFSDK/include 11 | export LIBRARY_PATH=$FFSDK/lib 12 | export LD_LIBRARY_PATH=$FFSDK/lib 13 | echo $CPATH 14 | echo "building... with $FFSDK" 15 | OUT=qtav_$FF$VER 16 | mkdir -p $OUT 17 | cd $OUT 18 | rm -f build.log 19 | qmake -r $QTAV -config silent 20 | time make -j4 2>&1 |tee build.log 21 | ln -sf $FFSDK/lib/* bin 22 | cd $BUILDROOT 23 | } 24 | 25 | time ( 26 | for V in ${LIBAVVER[@]} 27 | do 28 | buildqtav libav $V 29 | done 30 | for V in ${FFVER[@]} 31 | do 32 | buildqtav ffmpeg $V 33 | done 34 | ) 35 | -------------------------------------------------------------------------------- /config.tests/gentest.sh: -------------------------------------------------------------------------------- 1 | SCRIPT_DIR=${0%/*} 2 | . $SCRIPT_DIR/../scripts/functions.sh 3 | 4 | help_post(){ 5 | echo "This will create a test for $1. You may change the default value: \"#include <$1.h>\" in $1/main.cpp and \"LIBS += -l$1\" in $1/$1.pro" 6 | } 7 | 8 | help(){ 9 | cecho red "Usage: $0 name" 10 | help_post name 11 | exit 0 12 | } 13 | [ $# -lt 1 ] && help 14 | 15 | NAME=$1 16 | help_post $NAME 17 | mkdir -p $NAME 18 | cat >$NAME/${NAME}.pro < $NAME/main.cpp 31 | cat >> $NAME/main.cpp < 33 | EOF 34 | 35 | echo "test for $NAME created" 36 | -------------------------------------------------------------------------------- /examples/QMLPlayer/qml/QMLPlayer/PreviewPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "utils.js" as Utils 3 | 4 | Page { 5 | title: qsTr("Preview") 6 | height: titleHeight + Utils.kItemHeight + detail.contentHeight 7 | 8 | Column { 9 | anchors.fill: content 10 | Button { 11 | text: qsTr("Enable") 12 | checkable: true 13 | checked: PlayerConfig.previewEnabled 14 | width: parent.width 15 | height: Utils.kItemHeight 16 | onCheckedChanged: PlayerConfig.previewEnabled = checked 17 | } 18 | Text { 19 | id: detail 20 | font.pointSize: Utils.kFontSize 21 | color: "white" 22 | width: parent.width 23 | horizontalAlignment: Text.AlignHCenter 24 | text: qsTr("Press on the preview item to seek") 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tools/patchelf.sh: -------------------------------------------------------------------------------- 1 | BINDIR=$1 2 | echo $BINDIR 3 | [ -d "$BINDIR" ] || BINDIR=$PWD 4 | plugins=(`find $BINDIR/plugins -name "*.so" -type f`) 5 | for plugin in ${plugins[@]}; do 6 | echo $plugin 7 | patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN/../..' $plugin 8 | done 9 | for qt in $BINDIR/libQt5*.so.5; do 10 | echo patching $qt 11 | patchelf --set-rpath '$ORIGIN' $qt 12 | done 13 | 14 | QMLAV=$BINDIR/QtAV/libQmlAV.so 15 | test -f $QMLAV && echo "$QMLAV" && patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN/..:$ORIGIN/../..' $QMLAV 16 | QMLAV=$BINDIR/qml/QtAV/libQmlAV.so 17 | test -f $QMLAV && echo "$QMLAV" && patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN/..:$ORIGIN/../..' $QMLAV 18 | 19 | EXE=(`find $BINDIR -maxdepth 1 -executable -type f |grep -v lib`) 20 | for exe in ${EXE[@]}; do 21 | echo "patching $exe..." 22 | patchelf --set-rpath '$ORIGIN:$ORIGIN/lib:$ORIGIN/../lib' $exe 23 | done 24 | -------------------------------------------------------------------------------- /src/codec/video/VideoDecoderTypes.cpp: -------------------------------------------------------------------------------- 1 | #include "QtAV/VideoDecoderTypes.h" 2 | #include "QtAV/FactoryDefine.h" 3 | #include "QtAV/private/mkid.h" 4 | 5 | namespace QtAV { 6 | 7 | VideoDecoderId VideoDecoderId_FFmpeg = mkid::id32base36_6<'F', 'F', 'm', 'p', 'e', 'g'>::value; 8 | VideoDecoderId VideoDecoderId_CUDA = mkid::id32base36_4<'C', 'U', 'D', 'A'>::value; 9 | VideoDecoderId VideoDecoderId_DXVA = mkid::id32base36_4<'D', 'X', 'V', 'A'>::value; 10 | VideoDecoderId VideoDecoderId_VAAPI = mkid::id32base36_5<'V', 'A', 'A', 'P', 'I'>::value; 11 | VideoDecoderId VideoDecoderId_Cedarv = mkid::id32base36_6<'C', 'e', 'd', 'a', 'r', 'V'>::value; 12 | VideoDecoderId VideoDecoderId_VDA = mkid::id32base36_3<'V', 'D', 'A'>::value; 13 | 14 | QVector GetRegistedVideoDecoderIds() 15 | { 16 | return QVector::fromStdVector(VideoDecoderFactory::registeredIds()); 17 | } 18 | 19 | } //namespace QtAV 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: 2 | - linux 3 | - osx 4 | # TODO: osx must manually request http://docs.travis-ci.com/user/multi-os/ 5 | language: cpp 6 | compiler: 7 | - clang 8 | cache: apt 9 | install: true 10 | env: 11 | global: 12 | - LANG="en_US.UTF-8" 13 | matrix: 14 | - QT=4.8.6 AV=ffmpeg-1.0.10 15 | - QT=5.0.2 AV=ffmpeg-1.2.10 16 | - QT=5.1.1 AV=ffmpeg-2.0.6 17 | - QT=5.2.1 AV=ffmpeg-2.2.11 18 | 19 | branches: 20 | only: 21 | - master 22 | - prelease 23 | - ci/travis 24 | - travis 25 | 26 | git: 27 | submodules: true 28 | 29 | install: . tools/ci/$TRAVIS_OS_NAME/install.sh 30 | 31 | script: 32 | - ./tools/ci/$TRAVIS_OS_NAME/script.sh 33 | 34 | after_success: ./tools/ci/$TRAVIS_OS_NAME/after_success.sh 35 | 36 | notifications: 37 | irc: 38 | channels: 39 | - "chat.freenode.net#qtav" 40 | email: 41 | recipients: 42 | - wbsecg1@gmail.com 43 | on_success: change 44 | on_failure: always 45 | -------------------------------------------------------------------------------- /tools/ci/after_success.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | 3 | # download ifw for linux, mingw 4 | 5 | # upload packages 6 | 7 | # TRAVIS_TAG 8 | echo TRAVIS_TAG=$TRAVIS_TAG 9 | 10 | PKG=$QTAV_OUT.tar.xz 11 | tar Jcvf $PKG $QTAV_OUT/{bin,lib*,build.log} 12 | 13 | wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz 14 | tar zxf sshpass.tar.gz 15 | cd sshpass-1.05 16 | ./configure 17 | make 18 | sudo make install 19 | export PATH=$PWD:$PATH 20 | cd $TRAVIS_BUILD_DIR 21 | type -a sshpass 22 | # ignore known hosts: -o StrictHostKeyChecking=no 23 | sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci 24 | #rsync --password-file=$PWF -avP -e ssh $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci/ 25 | #curl -H "Accept: application/json" -X PUT -d "default=linux&default=bsd&default=solaris" -d "api_key=$SF_API_KEY" https://sourceforge.net/projects/qtav/files/ci/$PKG 26 | -------------------------------------------------------------------------------- /tools/ci/linux/install.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | sudo apt-get update -qq 3 | sudo apt-get install -qq -y portaudio19-dev libpulse-dev libopenal-dev libva-dev libass-dev libxv-dev parallel 4 | # TODO: do not use apt, use the latest code instead 5 | 6 | wget http://sourceforge.net/projects/qtav/files/depends/FFmpeg/linux/${AV}-linux-x86+x64.tar.xz/download -O ${AV}-linux-x86+x64.tar.xz 7 | tar Jxf ${AV}-linux-x86+x64.tar.xz 8 | 9 | 10 | wget http://sourceforge.net/projects/buildqt/files/lite/Qt${QT}-Linux64.tar.xz/download -O Qt${QT}-Linux64.tar.xz 11 | tar -I xz -xf Qt${QT}-Linux64.tar.xz 12 | 13 | export FFMPEG_DIR=$PWD/${AV}-linux-x86+x64 14 | export PATH=$PWD/Qt${QT}-Linux64/bin:$PATH 15 | export CPATH=$FFMPEG_DIR/include 16 | export LIBRARY_PATH=$FFMPEG_DIR/lib/x64 17 | export LD_LIBRARY_PATH=$FFMPEG_DIR/lib/x64 18 | export QTAV_OUT=QtAV-Qt${QT}-${AV}-ubuntu1204-${TRAVIS_COMMIT:0:7} 19 | mkdir -p $QTAV_OUT 20 | 21 | #if [ "$TRAVIS_BRANCH" == "prelease" ]; then 22 | #linux 23 | -------------------------------------------------------------------------------- /examples/QMLPlayer/qmlplayer.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml/QMLPlayer/main.qml 4 | qml/QMLPlayer/Button.qml 5 | qml/QMLPlayer/ProgressBar.qml 6 | qml/QMLPlayer/Slider.qml 7 | qml/QMLPlayer/utils.js 8 | qml/QMLPlayer/ControlPanel.qml 9 | qml/QMLPlayer/VideoCodec.qml 10 | qml/QMLPlayer/ConfigPanel.qml 11 | qml/QMLPlayer/Page.qml 12 | qml/QMLPlayer/SubtitlePage.qml 13 | qml/QMLPlayer/AudioPage.qml 14 | qml/QMLPlayer/DelegateItem.qml 15 | qml/QMLPlayer/Menu.qml 16 | qml/QMLPlayer/MediaInfoPage.qml 17 | qml/QMLPlayer/About.qml 18 | i18n/QMLPlayer_zh_CN.qm 19 | qml/QMLPlayer/PreviewPage.qml 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/qml/multiwindow.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Window 2.0 3 | import QtAV 1.3 4 | 5 | Item { 6 | MediaPlayer { //or AVPlayer 7 | id: player 8 | source: "test.mov" 9 | autoPlay: true 10 | } 11 | MouseArea { 12 | anchors.fill: parent 13 | onClicked: player.play() 14 | } 15 | VideoOutput { 16 | anchors.fill: parent 17 | source: player 18 | width: 400 19 | height: 300 20 | } 21 | Window { 22 | x: 0; y: 100; width: 600; height: 400; visible: true 23 | VideoOutput { 24 | anchors.fill: parent 25 | source: player 26 | regionOfInterest: Qt.rect(0, 0, 0.5, 1); 27 | } 28 | } 29 | Window { 30 | x: 600; y: 100; width: 400; height: 300; visible: true 31 | VideoOutput { 32 | anchors.fill: parent 33 | source: player 34 | regionOfInterest: Qt.rect(0.5, 0, 0.5, 1); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/common/ScreenSaver.h: -------------------------------------------------------------------------------- 1 | #ifndef SCREENSAVER_H 2 | #define SCREENSAVER_H 3 | 4 | #include "common_export.h" 5 | #include 6 | 7 | // TODO: read QtSystemInfo.ScreenSaver 8 | 9 | class COMMON_EXPORT ScreenSaver : QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | static ScreenSaver& instance(); 14 | ScreenSaver(); 15 | ~ScreenSaver(); 16 | // enable: just restore the previous settings. settings changed during the object life will ignored 17 | bool enable(bool yes); 18 | public slots: 19 | void enable(); 20 | void disable(); 21 | protected: 22 | virtual void timerEvent(QTimerEvent *); 23 | private: 24 | //return false if already called 25 | bool retrieveState(); 26 | bool restoreState(); 27 | bool state_saved, modified; 28 | #ifdef Q_OS_LINUX 29 | bool isX11; 30 | int timeout; 31 | int interval; 32 | int preferBlanking; 33 | int allowExposures; 34 | #endif //Q_OS_LINUX 35 | int ssTimerId; //for mac 36 | }; 37 | 38 | #endif // SCREENSAVER_H 39 | -------------------------------------------------------------------------------- /src/ShaderManager.cpp: -------------------------------------------------------------------------------- 1 | #include "ShaderManager.h" 2 | #include "QtAV/VideoShader.h" 3 | 4 | namespace QtAV { 5 | 6 | ShaderManager::ShaderManager(QOpenGLContext *ctx) : 7 | #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 8 | QObject(ctx) 9 | #else 10 | QObject(0) 11 | #endif 12 | , m_ctx(ctx) 13 | { 14 | } 15 | 16 | ShaderManager::~ShaderManager() 17 | { 18 | invalidated(); 19 | } 20 | 21 | VideoShader* ShaderManager::prepareMaterial(VideoMaterial *material) 22 | { 23 | const char* type = material->type(); 24 | VideoShader *shader = shader_cache.value(type, 0); 25 | if (shader) 26 | return shader; 27 | qDebug("[ShaderManager] cache a new shader material type: %s", type); 28 | shader = material->createShader(); 29 | shader->initialize(); 30 | shader_cache[type] = shader; 31 | return shader; 32 | } 33 | 34 | void ShaderManager::invalidated() 35 | { 36 | // TODO: thread safe required? 37 | qDeleteAll(shader_cache.values()); 38 | shader_cache.clear(); 39 | } 40 | 41 | } //namespace QtAV 42 | -------------------------------------------------------------------------------- /examples/QMLPlayer/qtquick2applicationviewer/qtquick2applicationviewer.h: -------------------------------------------------------------------------------- 1 | // checksum 0xfde6 version 0x90005 2 | /* 3 | This file was generated by the Qt Quick 2 Application wizard of Qt Creator. 4 | QtQuick2ApplicationViewer is a convenience class containing mobile device specific 5 | code such as screen orientation handling. Also QML paths and debugging are 6 | handled here. 7 | It is recommended not to modify this file, since newer versions of Qt Creator 8 | may offer an updated version of it. 9 | */ 10 | 11 | #ifndef QTQUICK2APPLICATIONVIEWER_H 12 | #define QTQUICK2APPLICATIONVIEWER_H 13 | 14 | #include 15 | 16 | class QtQuick2ApplicationViewer : public QQuickView 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit QtQuick2ApplicationViewer(QWindow *parent = 0); 22 | virtual ~QtQuick2ApplicationViewer(); 23 | 24 | void setMainQmlFile(const QString &file); 25 | void addImportPath(const QString &path); 26 | 27 | void showExpanded(); 28 | 29 | private: 30 | class QtQuick2ApplicationViewerPrivate *d; 31 | }; 32 | 33 | #endif // QTQUICK2APPLICATIONVIEWER_H 34 | -------------------------------------------------------------------------------- /examples/common/theme/dark/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/common/theme/default/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /examples/common/theme/theme.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | default/backward.svg 4 | default/forward.svg 5 | default/help.svg 6 | default/info.svg 7 | default/open.svg 8 | default/pause.svg 9 | default/play.svg 10 | default/stop.svg 11 | default/fullscreen.svg 12 | default/close.svg 13 | 14 | dark/capture.svg 15 | dark/menu.svg 16 | dark/sound.svg 17 | dark/backward.svg 18 | dark/forward.svg 19 | dark/fullscreen.svg 20 | dark/help.svg 21 | dark/info.svg 22 | dark/open.svg 23 | dark/pause.svg 24 | dark/play.svg 25 | dark/stop.svg 26 | dark/fullscreen.svg 27 | dark/close.svg 28 | 29 | 30 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/config/control.js: -------------------------------------------------------------------------------- 1 | //https://doc.qt.io/qtinstallerframework/noninteractive.html 2 | //https://doc.qt.io/qtinstallerframework/scripting-installer.html 3 | function Controller() 4 | { 5 | //installer.installationFinished.connect(onInstalled) 6 | installer.uninstallationFinished.connect(function(){ 7 | console.log("uninstall done") 8 | if (installer.value("os") === "win") { 9 | var unreg = "delete;HKEY_CURRENT_USER\\SOFTWARE\\Classes\\*\\shell\\Open with QtAV;/f" 10 | var unreg2 = "delete;HKEY_CURRENT_USER\\SOFTWARE\\Classes\\*\\shell\\Open with QtAV QML;/f" 11 | installer.executeDetached("reg", unreg.split(";")) 12 | installer.executeDetached("reg", unreg2.split(";")) 13 | //QMessageBox.information("", "finish", "unreg: " + unreg2.split(";")) 14 | } 15 | }) 16 | } 17 | 18 | 19 | /* 20 | Controller.prototype.PerformInstallationPageCallback() { 21 | if (installer.isInstaller()) { 22 | } 23 | if (installer.isUninstaller()) { 24 | } 25 | var page = gui.currentPageWidget() 26 | if (!page) 27 | return 28 | } 29 | */ 30 | -------------------------------------------------------------------------------- /templates/COPYRIGHT.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) %YEAR% Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | -------------------------------------------------------------------------------- /examples/player/res/help-zh_CN.html: -------------------------------------------------------------------------------- 1 |

命令行

2 |

 3 | player [-ao null] [-vo qt|gl|d2d|gdi|xv] [-vd "dxva[;cuda[;vaapi[;vda[;ffmpeg]]]]"] [--ffmpeg-log] [-f url|path|pipe:]
 4 | 
5 |

关闭音频 -ao null

6 |

选择渲染引擎用 -vo 选项。选项值可为qt, gl(默认), d2d, gdi, xv

7 |

选择解码器使用 -vd选项。可以是 dxva, cuda, vaapi, ffmpeg, 多个解码器用 ; 分隔表示解码器优先级。比如: 8 |

player -vd "dxva;cuda;ffmpeg" filename
9 |

10 |

11 | 表示优先使用dxva解码,若无法解码则选择cuda硬解,再不行则使用ffmpeg软解。 12 |

13 |

快捷键

14 |
    15 |
  • 双击: 全屏切换
  • 16 |
  • Ctrl+O: 打开文件
  • 17 |
  • 空格: 暂停/播放
  • 18 |
  • A: 切换比例
  • 19 |
  • F: fullscreen on/off
  • 20 |
  • T: 窗口置顶切换
  • 21 |
  • N: 播放下一帧并暂停。按空格恢复持续播放
  • 22 |
  • O: OSD
  • 23 |
  • P: 重放
  • 24 |
  • Q/ESC: 退出
  • 25 |
  • S: 停止
  • 26 |
  • R: 旋转90度
  • 27 |
  • M: 切换静音
  • 28 |
  • Up / Down: 音量 + / -
  • 29 |
  • Ctrl+Up/Down: 速度 + / -
  • 30 |
  • -> / <-: 前进/后退
  • 31 |
  • Ctrl+滚轮: 缩放画面
  • 32 |
  • 可以拖动文件到播放器显示区进行播放
  • 33 |
34 | 35 |

更多信息请看wiki: https://github.com/wang-bin/QtAV/wiki/_pages

36 | -------------------------------------------------------------------------------- /src/AudioResamplerFF.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #define BUILD_SWR 23 | #include "AudioResamplerTemplate.cpp" 24 | -------------------------------------------------------------------------------- /config.tests/direct2d/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/dsound/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/gl/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/avutil/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/avcodec/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/avdevice/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/avformat/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/libcedarv/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/swscale/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/avresample/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /config.tests/swresample/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /src/QtAV.rc: -------------------------------------------------------------------------------- 1 | #include "winver.h" 2 | #include "QtAV/version.h" 3 | IDI_ICON1 ICON DISCARDABLE "QtAV.ico" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0 7 | PRODUCTVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0x0L 12 | #endif 13 | FILEFLAGSMASK 0x3fL 14 | FILEOS VOS_NT_WINDOWS32 15 | FILETYPE VFT_DLL 16 | FILESUBTYPE 0x0L 17 | BEGIN 18 | BLOCK "StringFileInfo" 19 | BEGIN 20 | BLOCK "000004b0" 21 | BEGIN 22 | VALUE "CompanyName", "Shanghai University->S3 Graphics->Deepin | wbsecg1@gmail.com" 23 | VALUE "FileDescription", "QtAV Multimedia playback framework. http://www.qtav.org" 24 | VALUE "FileVersion", QTAV_VERSION_STR ".0" 25 | VALUE "LegalCopyright", "Copyright (C) 2012-2015 WangBin, wbsecg1@gmail.com" 26 | VALUE "InternalName", "QtAV" 27 | VALUE "OriginalFilename", "QtAV.dll" 28 | VALUE "ProductName", "QtAV" 29 | VALUE "ProductVersion", QTAV_VERSION_STR ".0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | -------------------------------------------------------------------------------- /config.tests/gdiplus/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include //vc 22 | #include 23 | 24 | int main() 25 | { 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /src/AudioResamplerLibav.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | 23 | #define QTAV_HAVE_SWR_AVR_MAP 1 24 | #define BUILD_AVR 25 | #include "AudioResamplerTemplate.cpp" 26 | -------------------------------------------------------------------------------- /examples/sharedoutput/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Shared output: shared renderer test 3 | Copyright (C) 2012-2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #include "widget.h" 22 | #include 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | QApplication a(argc, argv); 27 | Widget w; 28 | w.show(); 29 | 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /widgets/QtAVWidgets.rc: -------------------------------------------------------------------------------- 1 | #include "winver.h" 2 | #include "QtAVWidgets/version.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0 6 | PRODUCTVERSION QTAV_MAJOR,QTAV_MINOR,QTAV_PATCH,0 7 | #ifdef _DEBUG 8 | FILEFLAGS VS_FF_DEBUG 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEFLAGSMASK 0x3fL 13 | FILEOS VOS_NT_WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE 0x0L 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "000004b0" 20 | BEGIN 21 | VALUE "CompanyName", "Shanghai University->S3 Graphics->Deepin | wbsecg1@gmail.com" 22 | VALUE "FileDescription", "QtAVWidgets module. QtAV Multimedia playback framework. http://www.qtav.org" 23 | VALUE "FileVersion", QTAVWIDGETS_VERSION_STR ".0" 24 | VALUE "LegalCopyright", "Copyright (C) 2012-2015 WangBin, wbsecg1@gmail.com" 25 | VALUE "InternalName", "QtAV Widgets" 26 | VALUE "OriginalFilename", "QtAVWidgets.dll" 27 | VALUE "ProductName", "QtAV Widgets" 28 | VALUE "ProductVersion", QTAVWIDGETS_VERSION_STR ".0" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x0, 1200 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /config.tests/avfilter/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | int main() 24 | { 25 | // avfilter_register_all(); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /config.tests/vaapi/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | #include 23 | 24 | int main() 25 | { 26 | vaErrorStr(0); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /config.tests/xv/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | #include 23 | #include 24 | 25 | int main() 26 | { 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /config.tests/libass/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | extern "C" { 22 | #include 23 | } 24 | int main() 25 | { 26 | ass_library_done(ass_library_init()); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /doc/NativePaintingInQWidget.md: -------------------------------------------------------------------------------- 1 | Sometimes, we may want paint in QWidget without QPainter, for example, using DirectX api. This document will tell you how to reach it. 2 | 3 | ###0. setAttribute(Qt::WA_PaintOnScreen, true) 4 | 5 | Document says that if you want to use native painting, the attribute should be true. Otherwise you will see the fuck flicker. 6 | 7 | ###1. Let paint engine be 0 8 | 9 | Thus QPainter is disabled. Otherwise you will see the fuck flicker again. 10 | This page is helpful: http://lists.trolltech.com/qt4-preview-feedback/2005-04/thread00609-0.html 11 | It seems that let paintEngine() return 0 is from here. 12 | 13 | ###2. Reimplement `paintEvent` 14 | 15 | Oberviously, you should do something here. You can begin the painting in paintEvent 16 | 17 | ###3. Reimplement `showEvent` 18 | 19 | This is important if you change the `WindowStaysOnTopHint` flag. As far as i know, some paint engines use the resource depend on the window. If window changes, resource must be recreated again. For example, render target in direct2d, device context in gdi+. If the window flag `WindowStaysOnTopHint` changes, the widget will hide then show again, maybe that's the reason. If you forget this step, then the widget will never update again after the `WindowStaysOnTopHint` changes. 20 | -------------------------------------------------------------------------------- /examples/QMLPlayer/qml/QMLPlayer/DelegateItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "utils.js" as Utils 3 | 4 | Rectangle { 5 | id: root 6 | width: Utils.kItemWidth 7 | height: Utils.kItemHeight 8 | property color selectedColor: "#66ddaadd" 9 | property alias text: itemText.text 10 | color: "#99000000" 11 | signal clicked 12 | Text { 13 | id: itemText 14 | color: "white" 15 | font.pixelSize: Utils.kFontSize 16 | anchors.centerIn: parent 17 | horizontalAlignment: Text.AlignHCenter 18 | verticalAlignment: Text.AlignVCenter 19 | } 20 | MouseArea { 21 | anchors.fill: parent 22 | onClicked: { 23 | root.state = "selected" 24 | root.clicked() 25 | } 26 | } 27 | states: [ 28 | State { 29 | name: "selected" 30 | PropertyChanges { 31 | target: delegateItem 32 | color: selectedColor 33 | } 34 | } 35 | ] 36 | transitions: [ 37 | Transition { 38 | from: "*"; to: "*" 39 | ColorAnimation { 40 | properties: "color" 41 | easing.type: Easing.OutQuart 42 | duration: 500 43 | } 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /examples/videocapture/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Simple Player: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | #include 21 | #include "playerwindow.h" 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | QApplication a(argc, argv); 26 | PlayerWindow player; 27 | player.show(); 28 | player.resize(800, 600); 29 | return a.exec(); 30 | } 31 | -------------------------------------------------------------------------------- /config.tests/openal/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #if defined(HEADER_OPENAL_PREFIX) 23 | #include 24 | #include 25 | #else 26 | #include 27 | #include 28 | #endif 29 | 30 | int main() 31 | { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /qtc_packaging/debian_generic/player.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=QtAV Player 4 | GenericName=QtAV player 5 | Comment=QtAV Multimedia Player 6 | Comment[zh]=多媒体播放器 7 | Icon=QtAV 8 | TryExec=/usr/bin/player 9 | Exec=player -f %U 10 | Terminal=false 11 | Categories=Qt;AudioVideo;Audio;Video;Player;TV; 12 | MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;audio/x-vorbis+ogg;video/x-ogm+ogg;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;video/mp2t;audio/flac; 13 | X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb 14 | -------------------------------------------------------------------------------- /examples/simpleplayer/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Simple Player: this file is part of QtAV examples 3 | Copyright (C) 2012-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | #include 21 | #include "playerwindow.h" 22 | #include 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | QtAV::Widgets::registerRenderers(); 27 | QApplication a(argc, argv); 28 | PlayerWindow player; 29 | player.show(); 30 | player.resize(800, 600); 31 | return a.exec(); 32 | } 33 | -------------------------------------------------------------------------------- /qtc_packaging/debian_generic/QMLPlayer.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=QtAV QML Player 4 | GenericName=QtAV QML player 5 | Comment=QtAV Multimedia Player 6 | Comment[zh]=多媒体播放器 7 | Icon=QtAV 8 | TryExec=/usr/bin/QMLPlayer 9 | Exec=QMLPlayer -f %U 10 | Terminal=false 11 | Categories=Qt;AudioVideo;Audio;Video;Player;TV; 12 | MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;audio/x-vorbis+ogg;video/x-ogm+ogg;audio/x-shorten;audio/x-ape;audio/x-wavpack;audio/x-tta;audio/AMR;audio/ac3;video/mp2t;audio/flac; 13 | X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb 14 | -------------------------------------------------------------------------------- /config.tests/sse4_1/sse4_1.pro: -------------------------------------------------------------------------------- 1 | SOURCES = sse4_1.cpp 2 | #SSE4_1_SOURCES = sse4_1.cpp 3 | CONFIG -= qt dylib release debug_and_release 4 | CONFIG += debug console sse4_1 5 | 6 | # for Qt4. we can only detect sse2 in Qt4 7 | #qt5 only has gcc, qcc, vc, linux icc. 8 | win32-icc { 9 | QMAKE_CFLAGS_SSE4_1 = -arch:SSE4.1 10 | } else:*-icc { #mac, linux 11 | QMAKE_CFLAGS_SSE4_1 = -xSSE4.1 12 | } else:*msvc* { 13 | QMAKE_CFLAGS_SSE4_1 = -arch:SSE2 14 | } else { 15 | QMAKE_CFLAGS_SSE4_1 = -msse4.1 16 | } 17 | 18 | sse4_1 { 19 | HEADERS += $$SSE4_1_HEADERS 20 | 21 | sse4_1_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) 22 | !contains(QT_CPU_FEATURES, sse4_1):sse4_1_compiler.commands += $$QMAKE_CFLAGS_SSE4_1 23 | sse4_1_compiler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} 24 | sse4_1_compiler.dependency_type = TYPE_C 25 | sse4_1_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} 26 | sse4_1_compiler.input = SSE4_1_SOURCES 27 | sse4_1_compiler.variable_out = OBJECTS 28 | sse4_1_compiler.name = compiling[sse4_1] ${QMAKE_FILE_IN} 29 | silent:sse4_1_compiler.commands = @echo compiling[sse4_1] ${QMAKE_FILE_IN} && $$sse4_1_compiler.commands 30 | QMAKE_EXTRA_COMPILERS += sse4_1_compiler 31 | } 32 | 33 | isEmpty(QMAKE_CFLAGS_SSE4_1):error("This compiler does not support SSE4.1") 34 | else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1 35 | -------------------------------------------------------------------------------- /config.tests/xaudio2/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #include 22 | 23 | #if(_WIN32_WINNT < _WIN32_WINNT_WIN8) 24 | #error "XAudio2 is not from Windows SDK. Use header from June 2010 DXSDK" 25 | #endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8) 26 | 27 | int main() 28 | { 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /scripts/dll_osx.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | function fix_qt_path() { 4 | local EXE=$1 5 | local QTEXE=`otool -L $EXE |grep Qt |grep -v ':'` 6 | for Q in $QTEXE 7 | do 8 | if [ -n "`echo $Q |grep framework`" ]; then 9 | echo Q=$Q 10 | OLD=`echo $Q |cut -d ' ' -f 1` 11 | echo OLD=$OLD 12 | REL=`echo $OLD |sed 's,.*\/\(.*\)\(\.framework\/.*\),\1\2,'` 13 | REL_DIR=${REL%/*} 14 | NEW="@rpath/Frameworks/$REL" 15 | #NEW="@rpath/Frameworks/$REL" 16 | install_name_tool -change $OLD $NEW $EXE #$REL 17 | echo install_name_tool -change $OLD $NEW $EXE 18 | 19 | fi 20 | done 21 | } 22 | 23 | function copy_qt() { 24 | local EXE=$1 25 | local QTEXE=`otool -L $EXE |grep Qt |grep -v ':'` 26 | for Q in $QTEXE 27 | do 28 | if [ -n "`echo $Q |grep framework`" ]; then 29 | echo Q=$Q 30 | OLD=`echo $Q |cut -d ' ' -f 1` 31 | echo OLD=$OLD 32 | REL=`echo $OLD |sed 's,.*\/\(.*\)\(\.framework\/.*\),\1\2,'` 33 | REL_DIR=${REL%/*} 34 | mkdir -p $REL_DIR 35 | 36 | if [ -f $REL ]; then 37 | echo "already exists. skip copy. $REL" 38 | else 39 | cp -L $Q $REL 40 | fi 41 | NEW="@rpath/Frameworks/$REL" 42 | install_name_tool -change $OLD $NEW $REL 43 | echo install_name_tool -change $OLD $NEW $EXE 44 | fi 45 | done 46 | } 47 | 48 | [ "$1" = "-c" ] && copy_qt $2 || fix_qt_path $1 49 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/src/org/qtav/qmlplayer/QMLPlayerActivity.java: -------------------------------------------------------------------------------- 1 | package org.qtav.qmlplayer; 2 | import org.qtproject.qt5.android.bindings.QtActivity; 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.app.PendingIntent; 6 | import android.util.Log; 7 | import android.os.Bundle; 8 | import android.view.WindowManager; 9 | 10 | public class QMLPlayerActivity extends QtActivity 11 | { 12 | private final static String TAG = "QMLPlayer"; 13 | private static String m_request_url; 14 | private static QMLPlayerActivity m_instance; 15 | public QMLPlayerActivity() { 16 | m_instance = this; 17 | } 18 | public static String getUrl() { 19 | return m_instance.m_request_url; 20 | } 21 | 22 | @Override 23 | public void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 26 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 27 | Intent intent = getIntent(); 28 | String action = intent.getAction(); 29 | 30 | Log.i("QMLPlayerActivity", "Action: " + action); 31 | Log.i("QMLPlayerActivity", "Data: " + intent.getDataString()); 32 | if (intent.ACTION_VIEW.equals(action)) { 33 | m_request_url = intent.getDataString(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/subtitle/PlainText.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_PLAINTEXT_H 23 | #define QTAV_PLAINTEXT_H 24 | 25 | #include 26 | 27 | namespace QtAV { 28 | namespace PlainText { 29 | 30 | QString fromAss(const char* ass); 31 | 32 | } //namespace PlainText 33 | 34 | } //namespace QtAV 35 | #endif // QTAV_PLAINTEXT_H 36 | -------------------------------------------------------------------------------- /examples/player/filters/AVFilterSubtitle.h: -------------------------------------------------------------------------------- 1 | #ifndef QTAV_AVFilterSubtitle_H 2 | #define QTAV_AVFilterSubtitle_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | using namespace QtAV; 9 | class AVFilterSubtitle : public LibAVFilterVideo 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY(bool autoLoad READ autoLoad WRITE setAutoLoad NOTIFY autoLoadChanged) 13 | Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged) 14 | public: 15 | explicit AVFilterSubtitle(QObject *parent = 0); 16 | void setPlayer(AVPlayer* player); 17 | QString setContent(const QString& doc); // return utf8 subtitle path 18 | bool setFile(const QString& filePath); 19 | QString file() const; 20 | bool autoLoad() const; 21 | 22 | signals: 23 | void loaded(); 24 | void loadError(); 25 | void fileChanged(const QString& path); 26 | void autoLoadChanged(bool value); 27 | public slots: 28 | // TODO: enable changed & autoload=> load 29 | void setAutoLoad(bool value); 30 | void findAndSetFile(const QString& path); 31 | void onPlayerStart(); 32 | private slots: 33 | void onStatusChanged(); 34 | private: 35 | bool m_auto; 36 | AVPlayer *m_player; 37 | QString m_file; 38 | // convert to utf8 to ensure ffmpeg can open it. 39 | QHash m_u8_files; 40 | }; 41 | 42 | #endif // QTAV_AVFilterSubtitle_H 43 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.dev/data/sdk_deploy.bat: -------------------------------------------------------------------------------- 1 | @echo QtAV SDK deployment tool for installer 2 | @echo off 3 | choice /c iu /m "Press 'I' to install QtAV SDK, 'U' to uninstall" 4 | set ACT=%errorlevel% 5 | @echo Input your absolute Qt folder contains bin, include, lib etc. 6 | @echo Or drag Qt folder here 7 | @echo Then press ENTER 8 | @echo example: C:\Qt5.4.1\5.4\mingw32_49 9 | 10 | set /p QTDIR= 11 | 12 | if "%ACT%" == "2" ( 13 | goto uninstall 14 | ) else ( 15 | goto install 16 | ) 17 | 18 | :install 19 | copy /y bin\Qt*AV*.dll %QTDIR%\bin 20 | copy /y bin\av*.dll %QTDIR%\bin 21 | copy /y bin\sw*.dll %QTDIR%\bin 22 | copy /y bin\*openal*.dll %QTDIR%\bin 23 | copy /y bin\*portaudio*.dll %QTDIR%\bin 24 | xcopy /syi include %QTDIR%\include 25 | copy /y lib\*Qt*AV*.lib %QTDIR%\lib 26 | copy /y lib\*Qt*AV*.a %QTDIR%\lib 27 | xcopy /syi qml\QtAV %QTDIR%\qml\QtAV 28 | xcopy /syi mkspecs %QTDIR%\mkspecs 29 | @echo QtAV SDK is installed 30 | goto END 31 | 32 | :uninstall 33 | del %QTDIR%\bin\Qt*AV*.dll 34 | del %QTDIR%\bin\av*.dll 35 | del %QTDIR%\bin\sw*.dll 36 | del %QTDIR%\bin\*openal*.dll 37 | del %QTDIR%\bin\*portaudio*.dll 38 | rd /s /q %QTDIR%\include\QtAV 39 | rd /s /q %QTDIR%\include\QtAVWidgets 40 | del %QTDIR%\lib\*Qt*AV* 41 | del %QTDIR%\mkspecs\modules\qt_lib_av*.pri 42 | del %QTDIR%\mkspecs\features\av*.prf 43 | rd /s /q %QTDIR%\qml\QtAV 44 | @echo QtAV SDK is uninstalled 45 | goto END 46 | 47 | :END 48 | pause 49 | @echo on 50 | -------------------------------------------------------------------------------- /contrib/d2d1headers/d2dbasetypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | d2dbasetypes.h - Header file for the Direct2D API 4 | 5 | No original Microsoft headers were used in the creation of this 6 | file. 7 | 8 | */ 9 | 10 | #ifndef _D2DBASETYPES_H 11 | #define _D2DBASETYPES_H 12 | #if __GNUC__ >=3 13 | #pragma GCC system_header 14 | #endif 15 | 16 | #include 17 | 18 | typedef D3DCOLORVALUE D2D_COLOR_F; 19 | 20 | struct D2D_MATRIX_3X2_F { 21 | FLOAT _11; 22 | FLOAT _12; 23 | FLOAT _21; 24 | FLOAT _22; 25 | FLOAT _31; 26 | FLOAT _32; 27 | }; 28 | 29 | struct D2D_POINT_2F { 30 | FLOAT x; 31 | FLOAT y; 32 | }; 33 | 34 | struct D2D_POINT_2U { 35 | UINT32 x; 36 | UINT32 y; 37 | }; 38 | 39 | struct D2D_RECT_F { 40 | FLOAT left; 41 | FLOAT top; 42 | FLOAT right; 43 | FLOAT bottom; 44 | }; 45 | 46 | struct D2D_RECT_U { 47 | UINT32 left; 48 | UINT32 top; 49 | UINT32 right; 50 | UINT32 bottom; 51 | }; 52 | 53 | struct D2D_SIZE_F { 54 | FLOAT width; 55 | FLOAT height; 56 | }; 57 | 58 | struct D2D_SIZE_U { 59 | UINT32 width; 60 | UINT32 height; 61 | }; 62 | 63 | typedef D2D_COLOR_F D2D1_COLOR_F; 64 | 65 | typedef struct D2D_POINT_2F D2D1_POINT_2F; 66 | 67 | typedef struct D2D_POINT_2U D2D1_POINT_2U; 68 | 69 | typedef struct D2D_RECT_F D2D1_RECT_F; 70 | 71 | typedef struct D2D_RECT_U D2D1_RECT_U; 72 | 73 | typedef struct D2D_SIZE_F D2D1_SIZE_F; 74 | 75 | typedef struct D2D_SIZE_U D2D1_SIZE_U; 76 | 77 | #endif /* _D2DBASETYPES_H */ 78 | -------------------------------------------------------------------------------- /src/AudioResamplerTypes.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | VideoRendererTypes: type id and manually id register function 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #include "QtAV/AudioResamplerTypes.h" 23 | #include "QtAV/private/mkid.h" 24 | 25 | namespace QtAV { 26 | 27 | AudioResamplerId AudioResamplerId_FF = mkid::id32base36_6<'F', 'F', 'm', 'p', 'e', 'g'>::value; 28 | AudioResamplerId AudioResamplerId_Libav = mkid::id32base36_5<'L', 'i', 'b', 'a', 'v'>::value; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /examples/player/ClickableMenu.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | 22 | #ifndef CLICKABLEMENU_H 23 | #define CLICKABLEMENU_H 24 | 25 | #include 26 | 27 | class ClickableMenu : public QMenu 28 | { 29 | Q_OBJECT 30 | public: 31 | explicit ClickableMenu(QWidget *parent = 0); 32 | explicit ClickableMenu(const QString& title, QWidget *parent = 0); 33 | 34 | protected: 35 | virtual void mouseReleaseEvent(QMouseEvent *); 36 | 37 | }; 38 | 39 | #endif // CLICKABLEMENU_H 40 | -------------------------------------------------------------------------------- /qml/QmlAV/Export.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_QML_EXPORT_H 23 | #define QTAV_QML_EXPORT_H 24 | 25 | #include 26 | 27 | #if defined(BUILD_QMLAV_LIB) 28 | # undef QMLAV_EXPORT 29 | # define QMLAV_EXPORT Q_DECL_EXPORT 30 | #else 31 | # undef QMLAV_EXPORT 32 | # define QMLAV_EXPORT Q_DECL_IMPORT //only for vc? 33 | #endif 34 | 35 | #endif // QTAV_QML_EXPORT_H 36 | -------------------------------------------------------------------------------- /examples/QMLPlayer/qml/QMLPlayer/ConfigPanel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "utils.js" as Utils 3 | 4 | Rectangle { 5 | id: root 6 | property string selected: "" 7 | property string selectedUrl 8 | property int selectedX: 0 9 | property int selectedY: 0 10 | color: "#80101010" 11 | 12 | signal clicked 13 | 14 | Menu { 15 | id: menu 16 | anchors.fill: parent 17 | anchors.topMargin: Utils.scaled(40) 18 | itemWidth: root.width - Utils.scaled(2) 19 | spacing: Utils.scaled(1) 20 | model: ListModel { 21 | id: contentModel 22 | // ListElement property value can not be script before Qt5.4. translate here(QT_TR_NOOP) and used in other qml fails 23 | } 24 | onClicked: { 25 | selectedX = x 26 | selectedY = y 27 | selectedUrl = model.get(index).url 28 | root.clicked() 29 | } 30 | } 31 | Component.onCompleted: { 32 | contentModel.append({name: qsTr("Media info"), url: "MediaInfoPage.qml" }) 33 | contentModel.append({name: qsTr("Video codec"), url: "VideoCodec.qml" }) 34 | contentModel.append({name: qsTr("Subtitle"), url: "SubtitlePage.qml" }) 35 | contentModel.append({name: qsTr("Audio"), url: "AudioPage.qml" }) 36 | contentModel.append({name: qsTr("Preview"), url: "PreviewPage.qml" }) 37 | contentModel.append({name: qsTr("About"), url: "About.qml" }) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/QtAV/AudioResamplerTypes.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | VideoRendererTypes: type id and manually id register function 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | #ifndef QTAV_AUDIORESAMPLERTYPES_H 22 | #define QTAV_AUDIORESAMPLERTYPES_H 23 | 24 | #include 25 | 26 | namespace QtAV { 27 | 28 | extern Q_AV_EXPORT AudioResamplerId AudioResamplerId_FF; 29 | extern Q_AV_EXPORT AudioResamplerId AudioResamplerId_Libav; 30 | 31 | } //namespace QtAV 32 | 33 | #endif // QTAV_AUDIORESAMPLERTYPES_H 34 | -------------------------------------------------------------------------------- /scripts/perftest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import json 5 | import subprocess 6 | import time 7 | import psutil 8 | 9 | def get_process_info(p): 10 | try: 11 | cpu = int(p.get_cpu_percent(interval=0)) #0: non-blocking 12 | rss, vms = p.get_memory_info() 13 | name = p.name 14 | pid = p.pid 15 | except psutil.error.NoSuchProcess, e: 16 | name = "Invalid process" 17 | pid = 0 18 | rss = 0 19 | vms = 0 20 | cpu = 0 21 | return {'cpu': cpu, 'rss': rss, 'vms': vms} 22 | 23 | def main(): 24 | conf_file = open('perftest.json') 25 | conf = json.load(conf_file) 26 | conf_file.close() 27 | cmd = conf['cmd'] 28 | # shell == True: process is shell process 29 | proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) 30 | p = psutil.Process(proc.pid) 31 | if not p.is_running(): 32 | return 33 | name = p.name 34 | pid = p.pid 35 | record = [] 36 | print 'recoding...' 37 | while True: 38 | if not p.is_running(): 39 | break 40 | record.append(get_process_info(p)) 41 | time.sleep(1) 42 | 43 | proc_history = { 'name': name, 'pid': pid, 'history': record } 44 | print proc_history 45 | with open('perftest_result.json', 'wb') as fp: 46 | json.dump(proc_history, fp) 47 | print 'result is saved in perftest_result.json' 48 | 49 | if __name__ == '__main__': 50 | main() 51 | -------------------------------------------------------------------------------- /qtc_packaging/common/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Wang Bin on 2 | Fri, 15 Mar 2013 10:06:55 +0800. 3 | 4 | It was downloaded from 5 | 6 | Upstream Author(s): 7 | 8 | Wang Bin(Lucas Wang) wbsecg1@gmail.com 9 | 10 | Copyright: 11 | 12 | Copyright (C) 2013 Wang Bin(Lucas Wang) 13 | 14 | License: 15 | 16 | This package is free software; you can redistribute it and/or 17 | modify it under the terms of the GNU Lesser General Public 18 | License as published by the Free Software Foundation; either 19 | version 2.1 of the License, or (at your option) any later version. 20 | 21 | This library is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 | Lesser General Public License for more details. 25 | 26 | You should have received a copy of the GNU Lesser General Public 27 | License along with this library; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 29 | 30 | On Debian systems, the complete text of the GNU Lesser General 31 | Public License can be found in `/usr/share/common-licenses/LGPL'. 32 | 33 | The Debian packaging is (C) 2013, Wang Bin and 34 | is licensed under the LGPL, see above. 35 | 36 | 37 | # Please also look if there are files or directories which have a 38 | # different copyright/license attached and list them here. 39 | -------------------------------------------------------------------------------- /tests/qrc/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Simple Player: this file is part of QtAV examples 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | QApplication a(argc, argv); 28 | QtAV::GLWidgetRenderer2 renderer; 29 | renderer.show(); 30 | renderer.setWindowTitle("Play video from qrc--QtAV " + QtAV_Version_String_Long() + " wbsecg1@gmail.com"); 31 | QtAV::AVPlayer player; 32 | player.setRenderer(&renderer); 33 | 34 | player.play("qrc:/test.mp4"); 35 | 36 | return a.exec(); 37 | } 38 | -------------------------------------------------------------------------------- /widgets/QtAVWidgets/QtAVWidgets.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAVWIDGETS_H 23 | #define QTAVWIDGETS_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | //#include 30 | #include 31 | #include 32 | 33 | #endif // QTAVWIDGETS_H 34 | -------------------------------------------------------------------------------- /src/io/tst_mediaio.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace QtAV; 5 | class tst_MediaIO : public QObject 6 | { 7 | Q_OBJECT 8 | private slots: 9 | void create(); 10 | void createForProtocol(); 11 | void read(); 12 | }; 13 | 14 | void tst_MediaIO::create() { 15 | MediaIO *in = MediaIO::create("QFile"); 16 | QVERIFY(in); 17 | delete in; 18 | in = MediaIO::create("Other"); 19 | QVERIFY(!in); 20 | delete in; 21 | } 22 | void tst_MediaIO::createForProtocol() { 23 | MediaIO *in = MediaIO::createForProtocol("qrc"); 24 | QVERIFY(in); 25 | delete in; 26 | in = MediaIO::createForProtocol(""); 27 | QVERIFY(in); 28 | QCOMPARE(in->name(), QString("QFile")); 29 | QVERIFY(in->protocols().contains("qrc")); 30 | delete in; 31 | in = MediaIO::createForProtocol("xyz"); 32 | QVERIFY(!in); 33 | delete in; 34 | } 35 | void tst_MediaIO::read() { 36 | const QString path(":/QtAV.svg"); 37 | MediaIO *in = MediaIO::createForProtocol(path.left(path.indexOf(QChar(':')))); 38 | QVERIFY(in); 39 | QVERIFY(in->isSeekable()); 40 | in->setUrl(path); 41 | QByteArray data(1024, 0); 42 | in->read(data.data(), data.size()); 43 | QFile f(path); 44 | f.open(QIODevice::ReadOnly); 45 | QByteArray data2(1024, 0); 46 | f.read(data2.data(), data2.size()); 47 | QCOMPARE(data, data2); 48 | QCOMPARE(in->size(), f.size()); 49 | delete in; 50 | } 51 | 52 | QTEST_MAIN(tst_MediaIO) 53 | #include "tst_avinput.moc" 54 | -------------------------------------------------------------------------------- /examples/player/ClickableMenu.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | 22 | #include "ClickableMenu.h" 23 | #include 24 | 25 | ClickableMenu::ClickableMenu(QWidget *parent) : 26 | QMenu(parent) 27 | { 28 | } 29 | 30 | ClickableMenu::ClickableMenu(const QString &title, QWidget *parent) : 31 | QMenu(title, parent) 32 | { 33 | } 34 | 35 | void ClickableMenu::mouseReleaseEvent(QMouseEvent *e) 36 | { 37 | QAction *action = actionAt(e->pos()); 38 | if (action) { 39 | action->activate(QAction::Trigger); 40 | return; 41 | } 42 | QMenu::mouseReleaseEvent(e); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/QtAV/VideoRendererTypes.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | VideoRendererTypes: type id and manually id register function 3 | Copyright (C) 2013-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_VIDEORENDERERTYPES_H 23 | #define QTAV_VIDEORENDERERTYPES_H 24 | 25 | #include 26 | 27 | namespace QtAV { 28 | 29 | //Q_AV_EXPORT(dllexport/import) is needed if used out of the library 30 | //TODO graphics item? 31 | extern Q_AV_EXPORT VideoRendererId VideoRendererId_OpenGLWindow; 32 | 33 | Q_AV_EXPORT void VideoRenderer_RegisterAll(); 34 | 35 | } //namespace QtAV 36 | 37 | #endif // QTAV_VIDEORENDERERTYPES_H 38 | -------------------------------------------------------------------------------- /examples/player/res/help.html: -------------------------------------------------------------------------------- 1 |

Command Line

2 |

 3 | player [-ao null] [-vo qt|gl|d2d|gdi|xv] [-vd "dxva[;cuda[;vaapi[;vda[;ffmpeg]]]]"] [--ffmpeg-log] [-f url|path|pipe:]
 4 | 
5 |

To disable audio output, add -ao null

6 |

Choose a render engine with -vo option(default is OpenGL). For example, in windows that support Direct2D, you can run

7 |
player -vo d2d filename
8 |

To select decoder, use -vd option. Value can be dxva, cuda, vaapi and ffmpeg, or a list separated by ; in priority order. For example: 9 |

player -vd "dxva;cuda;ffmpeg" filename
10 |

11 |

12 | will use dxva if dxva can decode, use cuda if dxva failed to decode, and use ffmpeg if cuda can not decode. 13 |

14 |

Shortcuts

15 |
    16 |
  • Double click: fullscreen switch
  • 17 |
  • Ctrl+O: open a file
  • 18 |
  • Space: pause/continue
  • 19 |
  • A: aspect ratio
  • 20 |
  • F: fullscreen on/off
  • 21 |
  • T: stays on top on/off
  • 22 |
  • N: show next frame. Continue the playing by pressing "Space"
  • 23 |
  • O: OSD
  • 24 |
  • P: replay
  • 25 |
  • Q/ESC: quit
  • 26 |
  • S: stop
  • 27 |
  • R: rotate 90
  • 28 |
  • M: mute on/off
  • 29 |
  • Up / Down: volume + / -
  • 30 |
  • Ctrl+Up/Down: speed + / -
  • 31 |
  • -> / <-: seek forward / backward
  • 32 |
  • Ctrl+Wheel: zoom in/out
  • 33 |
  • Drag and drop a media file to player
  • 34 |
35 | 36 |

read wiki for more information: https://github.com/wang-bin/QtAV/wiki/_pages

37 | -------------------------------------------------------------------------------- /src/AudioThread.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QAV_AUDIOTHREAD_H 23 | #define QAV_AUDIOTHREAD_H 24 | 25 | #include "AVThread.h" 26 | 27 | namespace QtAV { 28 | 29 | class AudioDecoder; 30 | class AudioFrame; 31 | class AudioThreadPrivate; 32 | class AudioThread : public AVThread 33 | { 34 | Q_OBJECT 35 | DPTR_DECLARE_PRIVATE(AudioThread) 36 | public: 37 | explicit AudioThread(QObject *parent = 0); 38 | 39 | protected: 40 | void applyFilters(AudioFrame& frame); 41 | virtual void run(); 42 | }; 43 | 44 | } //namespace QtAV 45 | #endif // QAV_AUDIOTHREAD_H 46 | -------------------------------------------------------------------------------- /src/subtitle/CharsetDetector.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_CHARSETDETECTOR_H 23 | #define QTAV_CHARSETDETECTOR_H 24 | 25 | #include 26 | 27 | class CharsetDetector 28 | { 29 | public: 30 | CharsetDetector(); 31 | ~CharsetDetector(); 32 | bool isAvailable() const; 33 | /*! 34 | * \brief detect 35 | * \param data text to parse 36 | * \return charset name 37 | */ 38 | QByteArray detect(const QByteArray& data); 39 | private: 40 | class Private; 41 | Private *priv; 42 | }; 43 | 44 | #endif // QTAV_CHARSETDETECTOR_H 45 | -------------------------------------------------------------------------------- /examples/sharedoutput/widget.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Shared output: shared renderer test 3 | Copyright (C) 2012-2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef WIDGET_H 22 | #define WIDGET_H 23 | 24 | #include 25 | #include 26 | 27 | namespace QtAV { 28 | class WidgetRenderer; 29 | class AVPlayer; 30 | } 31 | class Widget : public QWidget 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit Widget(QWidget *parent = 0); 37 | ~Widget(); 38 | 39 | public slots: 40 | void setVideo(); 41 | void playVideo(); 42 | void testRTSP(); 43 | 44 | private: 45 | class 46 | QtAV::WidgetRenderer *renderer; 47 | QtAV::AVPlayer *player[2]; 48 | QPushButton *play_btn[2]; 49 | QPushButton *file_btn[2]; 50 | }; 51 | 52 | #endif // WIDGET_H 53 | -------------------------------------------------------------------------------- /config.tests/dxva/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | extern "C" { 23 | #include //will include d3d9.h, dxva2api.h 24 | } 25 | #define VA_DXVA2_MAX_SURFACE_COUNT (64) 26 | 27 | #include 28 | #include 29 | 30 | #define MS_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 31 | static const GUID name = { l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}} 32 | #ifdef __MINGW32__ 33 | # include <_mingw.h> 34 | # if defined(__MINGW64_VERSION_MAJOR) 35 | # include 36 | # endif 37 | #endif /* __MINGW32__ */ 38 | 39 | int main() 40 | { 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /examples/player/playlist/PlayListDelegate.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | 22 | #ifndef PLAYLISTDELEGATE_H 23 | #define PLAYLISTDELEGATE_H 24 | 25 | #include 26 | 27 | class PlayListDelegate : public QStyledItemDelegate 28 | { 29 | Q_OBJECT 30 | public: 31 | explicit PlayListDelegate(QObject *parent = 0); 32 | 33 | virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex & index) const; 34 | virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const; 35 | 36 | private: 37 | mutable int mHighlightRow; 38 | mutable QList mSelectedRows; 39 | }; 40 | 41 | #endif // PLAYLISTDELEGATE_H 42 | -------------------------------------------------------------------------------- /examples/common/common.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-01-03T11:07:23 4 | # 5 | #------------------------------------------------- 6 | # Qt4 need QDesktopServices 7 | QT = core gui 8 | 9 | TARGET = common 10 | TEMPLATE = lib 11 | DEFINES += BUILD_QOPT_LIB 12 | 13 | CONFIG *= common-buildlib staticlib 14 | staticlib: DEFINES += BUILD_COMMON_STATIC 15 | #var with '_' can not pass to pri? 16 | PROJECTROOT = $$PWD/../.. 17 | !include(libcommon.pri): error("could not find libcommon.pri") 18 | preparePaths($$OUT_PWD/../../out) 19 | 20 | INCLUDEPATH += $$PROJECTROOT/src 21 | # android apk hack 22 | android { 23 | QT += svg 24 | LIBS += -L$$qtLongName($$BUILD_DIR/lib) 25 | isEqual(QT_MAJOR_VERSION, 5):isEqual(QT_MINOR_VERSION, 4):lessThan(QT_PATCH_VERSION, 2) { 26 | LIBS += -lQt5AV 27 | } else { 28 | LIBS += -lQtAV #QML app does not link to libQtAV but we need it. why no QmlAV plugin if remove this? 29 | } 30 | } else { 31 | #include($$PROJECTROOT/libQtAV.pri) 32 | } 33 | 34 | RESOURCES += \ 35 | theme/theme.qrc 36 | 37 | #QMAKE_LFLAGS += -u _link_hack 38 | 39 | #SystemParametersInfo 40 | *msvc*: LIBS += -lUser32 41 | 42 | HEADERS = common.h \ 43 | Config.h \ 44 | qoptions.h \ 45 | ScreenSaver.h \ 46 | common_export.h 47 | 48 | SOURCES = common.cpp \ 49 | Config.cpp \ 50 | qoptions.cpp 51 | 52 | !macx: SOURCES += ScreenSaver.cpp 53 | macx:!ios { 54 | #SOURCE is ok 55 | OBJECTIVE_SOURCES += ScreenSaver.cpp 56 | LIBS += -framework CoreServices #-framework ScreenSaver 57 | } 58 | 59 | include($$PROJECTROOT/deploy.pri) 60 | 61 | target.path = $$[QT_INSTALL_BINS] 62 | INSTALLS += target 63 | 64 | -------------------------------------------------------------------------------- /examples/simpleplayer/playerwindow.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Simple Player: this file is part of QtAV examples 3 | Copyright (C) 2012-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef PLAYERWINDOW_H 22 | #define PLAYERWINDOW_H 23 | 24 | #include 25 | #include 26 | 27 | class QSlider; 28 | class QPushButton; 29 | class PlayerWindow : public QWidget 30 | { 31 | Q_OBJECT 32 | public: 33 | explicit PlayerWindow(QWidget *parent = 0); 34 | public Q_SLOTS: 35 | void openMedia(); 36 | void seek(int); 37 | void playPause(); 38 | private Q_SLOTS: 39 | void updateSlider(); 40 | private: 41 | QtAV::VideoOutput *m_vo; 42 | QtAV::AVPlayer *m_player; 43 | QSlider *m_slider; 44 | QPushButton *m_openBtn; 45 | QPushButton *m_playBtn; 46 | QPushButton *m_stopBtn; 47 | }; 48 | 49 | #endif // PLAYERWINDOW_H 50 | -------------------------------------------------------------------------------- /src/utils/internal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_INTERNAL_H 23 | #define QTAV_INTERNAL_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include "QtAV/private/AVCompat.h" 29 | 30 | namespace QtAV { 31 | namespace Internal { 32 | 33 | QString optionsToString(void* obj); 34 | void setOptionsToFFmpegObj(const QVariant& opt, void* obj); 35 | void setOptionsToDict(const QVariant& opt, AVDictionary** dict); 36 | // set qobject meta properties 37 | void setOptionsForQObject(const QVariant& opt, QObject* obj); 38 | } //namespace Internal 39 | } //namespace QtAV 40 | #endif //QTAV_INTERNAL_H 41 | -------------------------------------------------------------------------------- /examples/player/TVView.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef TVVIEW_H 22 | #define TVVIEW_H 23 | 24 | #include 25 | 26 | 27 | class QTreeWidget; 28 | class QTreeWidgetItem; 29 | 30 | class TVView : public QWidget 31 | { 32 | Q_OBJECT 33 | public: 34 | explicit TVView(QWidget *parent = 0); 35 | 36 | signals: 37 | void clicked(const QString& key, const QString& value); 38 | 39 | private slots: 40 | void load(); 41 | void onItemDoubleClick( QTreeWidgetItem * item, int column); 42 | private: 43 | QTreeWidgetItem* createNodeWithItems(QTreeWidget* view, const QString& name, const QStringList& itemNames, QList* items = 0); 44 | 45 | QTreeWidget *mpView; 46 | 47 | }; 48 | 49 | #endif // TVVIEW_H 50 | -------------------------------------------------------------------------------- /examples/player/config/AVFormatConfigPage.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | #ifndef AVFORMATCONFIGPAGE_H 21 | #define AVFORMATCONFIGPAGE_H 22 | 23 | #include "ConfigPageBase.h" 24 | #include 25 | 26 | class QCheckBox; 27 | class QSpinBox; 28 | class QLineEdit; 29 | class AVFormatConfigPage : public ConfigPageBase 30 | { 31 | Q_OBJECT 32 | public: 33 | explicit AVFormatConfigPage(QWidget *parent = 0); 34 | virtual QString name() const; 35 | protected: 36 | virtual void applyToUi(); 37 | virtual void applyFromUi(); 38 | private: 39 | QCheckBox* m_on; 40 | QCheckBox *m_direct; 41 | QSpinBox *m_probeSize; 42 | QSpinBox *m_analyzeDuration; 43 | QLineEdit *m_extra; 44 | }; 45 | 46 | #endif // AVFORMATCONFIGPAGE_H 47 | -------------------------------------------------------------------------------- /src/QtAV/private/OpenGLRendererBase_p.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_OPENGLRENDERERBASE_P_H 23 | #define QTAV_OPENGLRENDERERBASE_P_H 24 | 25 | #include "private/VideoRenderer_p.h" 26 | #include "QtAV/OpenGLVideo.h" 27 | 28 | namespace QtAV { 29 | 30 | class Q_AV_PRIVATE_EXPORT OpenGLRendererBasePrivate : public VideoRendererPrivate 31 | { 32 | public: 33 | OpenGLRendererBasePrivate(QPaintDevice *pd); 34 | virtual ~OpenGLRendererBasePrivate(); 35 | void setupAspectRatio(); 36 | 37 | QPainter *painter; 38 | OpenGLVideo glv; 39 | QMatrix4x4 matrix; 40 | }; 41 | 42 | } //namespace QtAV 43 | 44 | #endif // QTAV_OpenGLRendererBase_P_H 45 | -------------------------------------------------------------------------------- /examples/player/config/ConfigPageBase.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #include "ConfigPageBase.h" 22 | 23 | ConfigPageBase::ConfigPageBase(QWidget *parent) : 24 | QWidget(parent) 25 | , mApplyOnUiChange(true) 26 | { 27 | } 28 | 29 | void ConfigPageBase::applyOnUiChange(bool a) 30 | { 31 | mApplyOnUiChange = a; 32 | } 33 | 34 | bool ConfigPageBase::applyOnUiChange() const 35 | { 36 | return mApplyOnUiChange; 37 | } 38 | 39 | void ConfigPageBase::apply() 40 | { 41 | applyFromUi(); 42 | } 43 | 44 | void ConfigPageBase::cancel() 45 | { 46 | applyToUi(); 47 | } 48 | 49 | void ConfigPageBase::reset() 50 | { 51 | // NOTE: make sure Config::instance().reset() is called before it. It is called i ConfigDialog.reset() 52 | applyToUi(); 53 | } 54 | -------------------------------------------------------------------------------- /examples/player/config/ConfigDialog.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef CONFIGDIALOG_H 22 | #define CONFIGDIALOG_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class ConfigPageBase; 30 | class ConfigDialog : public QDialog 31 | { 32 | Q_OBJECT 33 | public: 34 | static void display(); 35 | 36 | signals: 37 | 38 | private slots: 39 | void onButtonClicked(QAbstractButton* btn); 40 | void onApply(); 41 | void onCancel(); 42 | void onReset(); 43 | 44 | private: 45 | explicit ConfigDialog(QWidget *parent = 0); 46 | QTabWidget *mpContent; 47 | QDialogButtonBox *mpButtonBox; 48 | QList mPages; 49 | }; 50 | 51 | #endif // CONFIGDIALOG_H 52 | -------------------------------------------------------------------------------- /src/QtAV/private/MediaIO_p.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_MediaIO_P_H 23 | #define QTAV_MediaIO_P_H 24 | 25 | #include "QtAV/QtAV_Global.h" 26 | #include "QtAV/private/AVCompat.h" 27 | #include 28 | #include "QtAV/MediaIO.h" 29 | 30 | namespace QtAV { 31 | 32 | class MediaIO; 33 | class Q_AV_PRIVATE_EXPORT MediaIOPrivate : public DPtrPrivate 34 | { 35 | public: 36 | MediaIOPrivate() 37 | : ctx(0) 38 | , mode(MediaIO::Read) 39 | {} 40 | // TODO: how to manage ctx? 41 | AVIOContext *ctx; 42 | MediaIO::AccessMode mode; 43 | QString url; 44 | }; 45 | 46 | } //namespace QtAV 47 | #endif // QTAV_MediaIO_P_H 48 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:1.1.0' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | jcenter() 14 | } 15 | } 16 | 17 | apply plugin: 'com.android.application' 18 | 19 | dependencies { 20 | compile fileTree(dir: 'libs', include: ['*.jar']) 21 | } 22 | 23 | android { 24 | /******************************************************* 25 | * The following variables: 26 | * - androidBuildToolsVersion, 27 | * - androidCompileSdkVersion 28 | * - qt5AndroidDir - holds the path to qt android files 29 | * needed to build any Qt application 30 | * on Android. 31 | * 32 | * are defined in gradle.properties file. This file is 33 | * updated by QtCreator and androiddeployqt tools. 34 | * Changing them manually might break the compilation! 35 | *******************************************************/ 36 | 37 | compileSdkVersion androidCompileSdkVersion.toInteger() 38 | 39 | buildToolsVersion androidBuildToolsVersion 40 | 41 | sourceSets { 42 | main { 43 | manifest.srcFile 'AndroidManifest.xml' 44 | java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] 45 | aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] 46 | res.srcDirs = [qt5AndroidDir + '/res', 'res'] 47 | resources.srcDirs = ['src'] 48 | renderscript.srcDirs = ['src'] 49 | assets.srcDirs = ['assets'] 50 | jniLibs.srcDirs = ['libs'] 51 | } 52 | } 53 | 54 | lintOptions { 55 | abortOnError false 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/cuda/dllapi/nv_inc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef NV_INC_H 23 | #define NV_INC_H 24 | 25 | #undef NV_CONFIG 26 | #define NV_CONFIG(FEATURE) (defined QTAV_HAVE_##FEATURE && QTAV_HAVE_##FEATURE) 27 | 28 | #if NV_CONFIG(DLLAPI_CUDA) 29 | namespace dllapi { 30 | namespace cuda { 31 | #endif /*NV_CONFIG(DLLAPI_CUDA)*/ 32 | #if defined(__cplusplus) 33 | //extern "C" { 34 | #endif /* __cplusplus */ 35 | 36 | #include "cuda.h" 37 | #include "nvcuvid.h" 38 | 39 | #if defined(__cplusplus) 40 | //} 41 | #endif /* __cplusplus */ 42 | #if NV_CONFIG(DLLAPI_CUDA) 43 | } //namespace cuda 44 | } //namespace dllapi 45 | #endif /*NV_CONFIG(DLLAPI_CUDA)*/ 46 | 47 | #endif /* NV_INC_H*/ 48 | -------------------------------------------------------------------------------- /src/shaders/packed.f.glsl: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifdef GL_ES 23 | // Set default precision to medium 24 | precision mediump int; 25 | precision mediump float; 26 | #else 27 | #define highp 28 | #define mediump 29 | #define lowp 30 | #endif 31 | 32 | uniform sampler2D u_Texture0; 33 | varying vec2 v_TexCoords0; 34 | uniform mat4 u_colorMatrix; 35 | uniform float u_opacity; 36 | #ifdef PACKED_YUV 37 | uniform mat4 u_c; 38 | #endif //PACKED_YUV 39 | 40 | void main() { 41 | vec4 c = texture2D(u_Texture0, v_TexCoords0); 42 | #ifdef PACKED_YUV 43 | c = u_c * c; 44 | c.a = 1.0; 45 | #endif //PACKED_YUV 46 | gl_FragColor = clamp(u_colorMatrix * c, 0.0, 1.0) * u_opacity; 47 | } 48 | -------------------------------------------------------------------------------- /src/cuda/dllapi/nvcuvid.cpp: -------------------------------------------------------------------------------- 1 | #include "dllapi_p.h" 2 | #include "dllapi.h" 3 | 4 | // include nv_inc.h headers later to avoid build error. have not find out why it happens 5 | #define __CUVID_INTERNAL //avoid replaced bt 64 api 6 | #define __CUDA_API_VERSION_INTERNAL 7 | #include "nv_inc.h" 8 | 9 | using namespace dllapi; 10 | namespace dllapi { 11 | namespace cuda { 12 | 13 | namespace nvcuvid { //the macro define class dll. so a namespace wrapper is required 14 | //DEFINE_DLL_INSTANCE_N("nvcuvid", "nvcuvid", NULL) //now may crash for vc 15 | static char* cuvid_names[] = { "nvcuvid", NULL }; 16 | DEFINE_DLL_INSTANCE_V("nvcuvid", cuvid_names) 17 | } 18 | using namespace nvcuvid; 19 | 20 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidCreateVideoSource, CUvideosource *, const char *, CUVIDSOURCEPARAMS *) 21 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidCreateVideoSourceW, CUvideosource *, const int *, CUVIDSOURCEPARAMS *) 22 | DEFINE_DLLAPI_M_ARG(1, CUresult, CUDAAPI, cuvidDestroyVideoSource, CUvideosource) 23 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidSetVideoSourceState, CUvideosource, cudaVideoState) 24 | DEFINE_DLLAPI_M_ARG(1, cudaVideoState, CUDAAPI, cuvidGetVideoSourceState, CUvideosource) 25 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidGetSourceVideoFormat, CUvideosource, CUVIDEOFORMAT *, unsigned int) 26 | DEFINE_DLLAPI_M_ARG(3, CUresult, CUDAAPI, cuvidGetSourceAudioFormat, CUvideosource, CUAUDIOFORMAT *, unsigned int) 27 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidCreateVideoParser, CUvideoparser *, CUVIDPARSERPARAMS *) 28 | DEFINE_DLLAPI_M_ARG(2, CUresult, CUDAAPI, cuvidParseVideoData, CUvideoparser, CUVIDSOURCEDATAPACKET *) 29 | DEFINE_DLLAPI_M_ARG(1, CUresult, CUDAAPI, cuvidDestroyVideoParser, CUvideoparser) 30 | 31 | } //namespace cuvid 32 | } //namespace dllapi 33 | -------------------------------------------------------------------------------- /src/utils/CopyFrame_SSE4.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | // for mingw gcc 23 | #include //stream load 24 | #include //intptr_t 25 | #include 26 | #define STREAM_LOAD_SI128(x) _mm_stream_load_si128(x) 27 | namespace sse4 { //avoid name conflict 28 | #define INC_FROM_NAMESPACE 29 | #include "CopyFrame_SSE2.cpp" 30 | } //namespace sse4 31 | 32 | //QT_FUNCTION_TARGET("sse4.1") 33 | void CopyFrame_SSE4(void *pSrc, void *pDest, void *pCacheBlock, UINT width, UINT height, UINT pitch) 34 | { 35 | sse4::CopyFrame_SSE2(pSrc, pDest, pCacheBlock, width, height, pitch); 36 | } 37 | 38 | void *memcpy_sse4(void* dst, const void* src, size_t size) 39 | { 40 | return sse4::memcpy_sse2(dst, src, size); 41 | } 42 | -------------------------------------------------------------------------------- /src/QtAV/private/Frame_p.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_FRAME_P_H 23 | #define QTAV_FRAME_P_H 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace QtAV { 31 | 32 | class Frame; 33 | class FramePrivate : public QSharedData 34 | { 35 | Q_DISABLE_COPY(FramePrivate) 36 | public: 37 | FramePrivate() 38 | : timestamp(0) 39 | {} 40 | virtual ~FramePrivate() {} 41 | 42 | QVector planes; //slice 43 | QVector line_sizes; //stride 44 | QVariantMap metadata; 45 | QByteArray data; 46 | qreal timestamp; 47 | }; 48 | 49 | } //namespace QtAV 50 | 51 | #endif // QTAV_Frame_P_H 52 | -------------------------------------------------------------------------------- /src/shaders/video.vert: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | attribute vec4 a_Position; 23 | attribute vec2 a_TexCoords0; 24 | uniform mat4 u_MVP_matrix; 25 | varying vec2 v_TexCoords0; 26 | #ifdef MULTI_COORD 27 | attribute vec2 a_TexCoords1; 28 | attribute vec2 a_TexCoords2; 29 | varying vec2 v_TexCoords1; 30 | varying vec2 v_TexCoords2; 31 | #ifdef PLANE_4 32 | attribute vec2 a_TexCoords3; 33 | varying vec2 v_TexCoords3; 34 | #endif 35 | #endif //MULTI_COORD 36 | void main() { 37 | gl_Position = u_MVP_matrix * a_Position; 38 | v_TexCoords0 = a_TexCoords0; 39 | #ifdef MULTI_COORD 40 | v_TexCoords1 = a_TexCoords1; 41 | v_TexCoords2 = a_TexCoords2; 42 | #ifdef PLANE_4 43 | v_TexCoords3 = a_TexCoords3; 44 | #endif 45 | #endif //MULTI_COORD 46 | } 47 | -------------------------------------------------------------------------------- /examples/player/config/MiscPage.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef MISCPAGE_H 22 | #define MISCPAGE_H 23 | 24 | #include "ConfigPageBase.h" 25 | #include 26 | #include 27 | #include 28 | 29 | class MiscPage : public ConfigPageBase 30 | { 31 | Q_OBJECT 32 | public: 33 | MiscPage(); 34 | virtual QString name() const; 35 | protected: 36 | virtual void applyToUi(); 37 | virtual void applyFromUi(); 38 | private: 39 | QCheckBox *m_preview_on; 40 | QSpinBox *m_preview_w; 41 | QSpinBox *m_preview_h; 42 | QSpinBox *m_notify_interval; 43 | QDoubleSpinBox *m_fps; 44 | QSpinBox *m_buffer_value; 45 | QDoubleSpinBox *m_timeout; 46 | QCheckBox *m_timeout_abort; 47 | QComboBox *m_opengl; 48 | QComboBox *m_angle_platform; 49 | }; 50 | 51 | #endif // MISCPAGE_H 52 | -------------------------------------------------------------------------------- /src/utils/DirectXHelper.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_DIRECTXHELPER_H 23 | #define QTAV_DIRECTXHELPER_H 24 | 25 | namespace QtAV { 26 | 27 | #ifndef DX_LOG_COMPONENT 28 | #define DX_LOG_COMPONENT "DirectX" 29 | #endif //DX_LOG_COMPONENT 30 | #define DX_ENSURE_OK(f, ...) \ 31 | do { \ 32 | HRESULT hr = f; \ 33 | if (FAILED(hr)) { \ 34 | qWarning() << DX_LOG_COMPONENT " error@" << __LINE__ << ". " #f ": " << QString("(0x%1) ").arg(hr, 0, 16) << qt_error_string(hr); \ 35 | return __VA_ARGS__; \ 36 | } \ 37 | } while (0) 38 | 39 | 40 | template void SafeRelease(T **ppT) { 41 | if (*ppT) { 42 | (*ppT)->Release(); 43 | *ppT = NULL; 44 | } 45 | } 46 | 47 | } //namespace QtAV 48 | #endif //QTAV_DIRECTXHELPER_H 49 | -------------------------------------------------------------------------------- /doc/UseQtAVinYourProjects-zh_CN.md: -------------------------------------------------------------------------------- 1 | QtAV 1.3.4 之后可以很方便地使之作为一个Qt模块,就像其他Qt模块那样。首先要编译QtAV,编译好后在编译目录会生成安装为Qt模块的脚本 `sdk_install.sh` 和 `sdk_uninstall.sh`,windows为`sdk_install.bat` 和 `sdk_uninstall.bat`,运行`sdk_install.sh` 或`sdk_install.bat`进行安装。安装后要使用QtAV只要在你的qmake工程里加上 2 | 3 | CONFIG += av 4 | 5 | 就行。对于Qt5,也可以使用 6 | 7 | QT += av 8 | 9 | 在 C++ 文件中,加入 10 | 11 | #include 12 | 13 | 自 QtAV 1.5 基于 QWidget 的渲染器被移到了新模块 QtAVWidgets, 若需要使用这些渲染器比如 OpenGLWidgetRenderer,在工程文件加入 14 | 15 | QT += avwidgets 16 | 17 | C++ 代码中加入 18 | 19 | #include 20 | #include 21 | 22 | 请确保在使用渲染器前调用`QtAV::Widgets::registerRenderers()` 23 | 24 | ## QtAV < 1.3.4 25 | 26 | 在你的项目中包含 QtAV 非常容易. 因为 QtAV 的qmake工程是精心设计的. (可以参考: https://github.com/wang-bin/LibProjWizard4QtCreator) 27 | 28 | 你可以参考 QtAV 里的例子来了解如何使用 QtAV, 或者也可以使用以下步骤 29 | 30 | 31 | ###1. 新建一个 subdirs 类型的工程myproject及一个直接调用QtAV的player子工程 32 | 33 | myproject/myproject.pro 34 | 35 | TEMPLATE = subdirs 36 | SUBDIRS += libQtAV myplayer 37 | myplayer.depends += libQtAV 38 | libQtAV.file = QtAV/QtAV.pro 39 | include(QtAV/root.pri) 40 | 41 | ###2. 把 QtAV 放到myproject 42 | 43 | 可以在 myproject/ 目录下使用 `git clone git@github.com:wang-bin/QtAV.git`, 或者复制 QtAV 代码到 myproject/. 建议使用git,这样方便获取最新代码. 44 | 45 | 现在的目录变为 46 | 47 | > myproject/myproject.pro 48 | > myproject/myplayer/myplayer.pro 49 | > myproject/QtAV/QtAV.pro 50 | > myproject/QtAV/src/libQtAV.pro 51 | > myproject/QtAV/src/libQtAV.pri 52 | 53 | ###3. 在player工程中包含 libQtAV.pri 54 | 55 | 在 myproject/myplayer/myplayer.pro, add 56 | 57 | include(../QtAV/src/libQtAV.pri) 58 | 59 | ###4. 生成 Makefile 60 | 61 | qmake 62 | 63 | or 64 | 65 | qmake -r 66 | 67 | ###5. make 68 | player 会生成在编译目录下的bin目录. 在windows下, QtAV 的 dll文件也会在那里生成 69 | 70 | 注意:windows 下如果用`qmake`命令(命令行下。QtCreator 默认使用`qmake -r`),则可能需要运行`qmake`两次,否则 make 可能失败 -------------------------------------------------------------------------------- /examples/videocapture/playerwindow.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Simple Player: this file is part of QtAV examples 3 | Copyright (C) 2014-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef PLAYERWINDOW_H 22 | #define PLAYERWINDOW_H 23 | 24 | #include 25 | #include 26 | 27 | class QSlider; 28 | class QPushButton; 29 | class QLabel; 30 | class QCheckBox; 31 | class PlayerWindow : public QWidget 32 | { 33 | Q_OBJECT 34 | public: 35 | explicit PlayerWindow(QWidget *parent = 0); 36 | public Q_SLOTS: 37 | void openMedia(); 38 | void seek(int); 39 | void capture(); 40 | private Q_SLOTS: 41 | void updateSlider(); 42 | void updatePreview(const QImage& image); 43 | void onCaptureSaved(const QString& path); 44 | void onCaptureError(); 45 | private: 46 | QtAV::VideoOutput *m_vo; 47 | QtAV::AVPlayer *m_player; 48 | QSlider *m_slider; 49 | QPushButton *m_openBtn; 50 | QPushButton *m_captureBtn; 51 | QLabel *m_preview; 52 | }; 53 | 54 | #endif // PLAYERWINDOW_H 55 | -------------------------------------------------------------------------------- /examples/videographicsitem/videoplayer.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | this file is part of QtAV examples 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #ifndef QTAV_VIDEOPLAYER_H 22 | #define QTAV_VIDEOPLAYER_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | class QGraphicsView; 29 | class VideoPlayer : public QWidget 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | VideoPlayer(QWidget *parent = 0); 35 | ~VideoPlayer(); 36 | 37 | QSize sizeHint() const { return QSize(720, 640); } 38 | void play(const QString& file); 39 | 40 | public slots: 41 | void setOpenGL(bool o = true); 42 | 43 | private slots: 44 | void setOrientation(int value); 45 | void rotateVideo(int angle); 46 | void scaleVideo(int value); 47 | void open(); 48 | 49 | private: 50 | QtAV::AVPlayer mediaPlayer; 51 | QtAV::GraphicsItemRenderer *videoItem; 52 | QGraphicsView *view; 53 | }; 54 | 55 | #endif //QTAV_VIDEOPLAYER_H 56 | -------------------------------------------------------------------------------- /src/output/video/VideoOutputEventFilter.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_VIDEOOUTPUTEVENTFILTER_H 23 | #define QTAV_VIDEOOUTPUTEVENTFILTER_H 24 | 25 | #include 26 | #include 27 | #include "QtAV/QtAV_Global.h" 28 | 29 | namespace QtAV { 30 | 31 | class VideoRenderer; 32 | class VideoOutputEventFilter : public QObject 33 | { 34 | Q_OBJECT 35 | public: 36 | VideoOutputEventFilter(VideoRenderer *renderer = 0); 37 | virtual bool eventFilter(QObject *watched, QEvent *event); 38 | 39 | private slots: 40 | void stopFiltering(); 41 | private: 42 | void switchFullScreen(); 43 | bool mRendererIsQObj; 44 | VideoRenderer *mpRenderer; 45 | QPoint gMousePos, iMousePos; 46 | }; 47 | 48 | } //namespace QtAV 49 | 50 | #endif // QTAV_VIDEOOUTPUTEVENTFILTER_H 51 | -------------------------------------------------------------------------------- /examples/player/config/AVFilterConfigPage.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV Player Demo: this file is part of QtAV examples 3 | Copyright (C) 2012-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | #ifndef AVFILTERCONFIGPAGE_H 21 | #define AVFILTERCONFIGPAGE_H 22 | 23 | #include "ConfigPageBase.h" 24 | 25 | class QCheckBox; 26 | class QComboBox; 27 | class QLabel; 28 | class QTextEdit; 29 | class AVFilterConfigPage : public ConfigPageBase 30 | { 31 | Q_OBJECT 32 | public: 33 | AVFilterConfigPage(QWidget* parent = 0); 34 | virtual QString name() const; 35 | protected: 36 | virtual void applyToUi(); 37 | virtual void applyFromUi(); 38 | private Q_SLOTS: 39 | void audioFilterChanged(const QString& name); 40 | void videoFilterChanged(const QString& name); 41 | private: 42 | struct { 43 | QString type; 44 | QCheckBox *enable; 45 | QComboBox *name; 46 | QLabel *description; 47 | QTextEdit *options; 48 | } m_ui[2]; //0: video, 1: audio 49 | }; 50 | 51 | #endif // AVFILTERCONFIGPAGE_H 52 | -------------------------------------------------------------------------------- /tests/playerthread/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | VideoGroup: this file is part of QtAV examples 3 | Copyright (C) 2013-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | ******************************************************************************/ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | using namespace QtAV; 28 | class Thread : public QThread 29 | { 30 | public: 31 | Thread(AVPlayer *player): 32 | QThread(0) 33 | , mpPlayer(player) 34 | {} 35 | protected: 36 | virtual void run() { 37 | //mpPlayer->play(); 38 | exec(); 39 | } 40 | AVPlayer *mpPlayer; 41 | }; 42 | 43 | int main(int argc, char *argv[]) 44 | { 45 | QApplication a(argc, argv); 46 | 47 | AVPlayer player; 48 | WidgetRenderer renderer; 49 | renderer.show(); 50 | player.addVideoRenderer(&renderer); 51 | player.setFile(a.arguments().last()); 52 | Thread thread(&player); 53 | player.moveToThread(&thread); 54 | thread.start(); 55 | player.play(); 56 | 57 | return a.exec(); 58 | } 59 | -------------------------------------------------------------------------------- /templates/mkclass.sh: -------------------------------------------------------------------------------- 1 | . ../scripts/functions.sh 2 | 3 | #TODO: auto add virtual functions 4 | 5 | help(){ 6 | cecho green "Usage: $0 [-class Class] [-base Base] [-template Template]" 7 | cecho green "Or $0 [--class=Class] [--base=Base] [--template=Template]" 8 | exit 0 9 | } 10 | 11 | while [ $# -gt 0 ]; do 12 | VAR= 13 | case "$1" in 14 | --*=*) 15 | PAIR=${1##--} 16 | VAR=${PAIRE%=*} 17 | VAL=${PAIR##*=} 18 | ;; 19 | -*) 20 | VAR=${1##-} 21 | shift 22 | VAL=$1 23 | ;; 24 | *) 25 | break 26 | ;; 27 | esac 28 | if [ -n "VAR" ]; then 29 | VAR_U=`echo $VAR | tr "[:lower:]" "[:upper:]"` 30 | echo "$VAR_U" 31 | eval $VAR_U=$VAL 32 | fi 33 | shift 34 | done 35 | 36 | echo "class: $CLASS, template: $TEMPLATE" 37 | COPY=COPYRIGHT.h 38 | [ -n "$CLASS" -a -n "$TEMPLATE" ] || help 39 | [ -f $COPY ] || die 'NO copyright template found!' 40 | 41 | CLASS_U=`echo $CLASS | tr "[:lower:]" "[:upper:]"` 42 | YEAR=`date +%Y` 43 | 44 | #TODO: author info 45 | echo "generating ${CLASS}.h..." 46 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}.h 47 | cat ${TEMPLATE}.h |sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}.h 48 | [ -n "$BASE" ] && cat ${CLASS}.h |sed "s/%BASE%/$BASE/g" >${CLASS}_.h && mv ${CLASS}_.h ${CLASS}.h 49 | 50 | echo "generating ${CLASS}.cpp..." 51 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}.cpp 52 | cat ${TEMPLATE}.cpp | sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}.cpp 53 | [ -n "$BASE" ] && cat ${CLASS}.cpp |sed "s/%BASE%/$BASE/g" >${CLASS}_.cpp && mv ${CLASS}_.cpp ${CLASS}.cpp 54 | 55 | if [ -f ${TEMPLATE}_p.h ]; then 56 | echo "generating ${CLASS}_p.h..." 57 | cat $COPY | sed "s/%YEAR%/$YEAR/g" > ${CLASS}_p.h 58 | cat ${TEMPLATE}_p.h |sed "s/%CLASS%/$CLASS/g" | sed "s/%CLASS:u%/$CLASS_U/g" >>${CLASS}_p.h 59 | [ -n "$BASE" ] && cat ${CLASS}_p.h |sed "s/%BASE%/$BASE/g" >${CLASS}_p_.h && mv ${CLASS}_p_.h ${CLASS}_p.h 60 | fi 61 | -------------------------------------------------------------------------------- /examples/player/filters/OSD.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2013 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_OSD_H 23 | #define QTAV_OSD_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace QtAV { 30 | 31 | class Statistics; 32 | class OSD 33 | { 34 | public: 35 | enum ShowType { 36 | ShowCurrentTime = 1, 37 | ShowCurrentAndTotalTime = 1<<1, 38 | ShowRemainTime = 1<<2, 39 | ShowPercent = 1<<3, 40 | ShowNone 41 | }; 42 | 43 | OSD(); 44 | virtual ~OSD(); 45 | void setShowType(ShowType type); 46 | ShowType showType() const; 47 | void useNextShowType(); 48 | bool hasShowType(ShowType t) const; 49 | QString text(Statistics* statistics); 50 | protected: 51 | ShowType mShowType; 52 | int mSecsTotal; 53 | }; 54 | 55 | }//namespace QtAV 56 | #endif // QTAV_OSD_H 57 | -------------------------------------------------------------------------------- /qml/QmlAV/SGVideoNode.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2014-2015 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef QTAV_SGVIDEONODE_H 23 | #define QTAV_SGVIDEONODE_H 24 | 25 | #include 26 | #include 27 | 28 | namespace QtAV { 29 | 30 | class SGVideoMaterial; 31 | class SGVideoNode : public QSGGeometryNode 32 | { 33 | public: 34 | SGVideoNode(); 35 | ~SGVideoNode(); 36 | virtual void setCurrentFrame(const VideoFrame &frame); 37 | /* Update the vertices and texture coordinates. Orientation must be in {0,90,180,270} */ 38 | void setTexturedRectGeometry(const QRectF &boundingRect, const QRectF &textureRect, int orientation); 39 | private: 40 | SGVideoMaterial *m_material; 41 | QRectF m_rect; 42 | QRectF m_textureRect; 43 | int m_orientation; 44 | qreal m_validWidth; 45 | }; 46 | 47 | } //namespace QtAV 48 | #endif // QTAV_SGVIDEONODE_H 49 | -------------------------------------------------------------------------------- /src/utils/GPUMemCopy.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-2014 Wang Bin 4 | 5 | * This file is part of QtAV 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | ******************************************************************************/ 21 | 22 | #ifndef GPUMemCopy_H 23 | #define GPUMemCopy_H 24 | 25 | #include 26 | 27 | namespace QtAV { 28 | 29 | class GPUMemCopy 30 | { 31 | public: 32 | static bool isAvailable(); 33 | GPUMemCopy(); 34 | ~GPUMemCopy(); 35 | // available and initialized 36 | bool isReady() const; 37 | bool initCache(unsigned int width); 38 | void cleanCache(); 39 | void copyFrame(void *pSrc, void *pDest, unsigned int width, unsigned int height, unsigned int pitch); 40 | //memcpy 41 | private: 42 | bool mInitialized; 43 | typedef struct { 44 | unsigned char* buffer; 45 | size_t size; 46 | } cache_t; 47 | cache_t mCache; 48 | }; 49 | 50 | void* gpu_memcpy(void* dst, const void* src, size_t size); 51 | 52 | } //namespace QtAV 53 | 54 | #endif // GPUMemCopy_H 55 | --------------------------------------------------------------------------------