├── 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 ├── examples ├── QMLPlayer │ ├── fonts │ │ └── default.ttf │ ├── 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 │ ├── qmlplayer.qrc │ ├── qtquick2applicationviewer │ │ └── qtquick2applicationviewer.h │ └── qml │ │ └── QMLPlayer │ │ ├── DelegateItem.qml │ │ └── ConfigPanel.qml ├── 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 │ │ │ ├── volume.svg │ │ │ ├── play.svg │ │ │ ├── stop.svg │ │ │ ├── open.svg │ │ │ ├── help.svg │ │ │ ├── backward.svg │ │ │ ├── forward.svg │ │ │ ├── info.svg │ │ │ ├── pause.svg │ │ │ ├── mute.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 │ │ ├── OSDFilter.cpp │ │ └── OSDFilter.h │ ├── ClickableMenu.h │ ├── src.pri │ ├── ClickableMenu.cpp │ ├── player.pro │ ├── playlist │ │ └── PlayListDelegate.h │ ├── TVView.h │ └── config │ │ ├── AVFormatConfigPage.h │ │ ├── ConfigPageBase.cpp │ │ ├── ConfigDialog.h │ │ ├── MiscPage.h │ │ └── AVFilterConfigPage.h ├── simpleplayer │ ├── src.pri │ ├── simpleplayer.pro │ ├── simpleplayer_sdk.pro │ ├── main.cpp │ └── playerwindow.h ├── window │ └── window.pro ├── simpletranscode │ └── simpletranscode.pro ├── 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 ├── qml │ ├── simple.qml │ └── multiwindow.qml └── examples.pro ├── src ├── QtAV │ ├── QtAV │ ├── AudioResamplerTypes.h │ ├── private │ │ ├── OpenGLRendererBase_p.h │ │ ├── MediaIO_p.h │ │ └── Frame_p.h │ └── VideoDecoderTypes.h ├── QtAV.icns ├── QtAV.ico ├── 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 │ └── video.vert ├── QtAV.svg ├── ShaderManager.cpp ├── AudioResamplerFF.cpp ├── QtAV.rc ├── AudioResamplerLibav.cpp ├── subtitle │ ├── PlainText.h │ └── CharsetDetector.h ├── AudioResamplerTypes.cpp ├── AudioThread.h ├── cuda │ └── dllapi │ │ ├── nv_inc.h │ │ └── nvcuvid.cpp ├── utils │ └── CopyFrame_SSE4.cpp ├── output │ └── video │ │ └── VideoOutputEventFilter.h └── codec │ └── video │ └── VideoDecoderTypes.cpp ├── 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 ├── tools ├── ci │ ├── linux │ │ ├── after_success.sh │ │ ├── script.sh │ │ └── install.sh │ ├── osx │ │ ├── script.sh │ │ ├── install.sh │ │ └── after_success.sh │ ├── win │ │ ├── build.bat │ │ └── install_dep.bat │ └── after_success.sh ├── tools.pro ├── 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 ├── install_sdk │ └── qt4 │ │ ├── avwidgets.prf │ │ └── av.prf ├── patchelf.sh └── dll_osx.sh ├── widgets ├── QtAVWidgets │ ├── QtAVWidgets │ └── QtAVWidgets.h └── QtAVWidgets.rc ├── 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 ├── x11 │ ├── x11.pro │ └── main.cpp ├── gdiplus │ ├── gdiplus.pro │ └── main.cpp ├── uchardet │ ├── uchardet.pro │ └── main.cpp ├── xaudio2 │ ├── xaudio2.pro │ └── main.cpp ├── vaapi │ ├── vaapi.pro │ └── main.cpp ├── videotoolbox │ ├── videotoolbox.pro │ └── main.cpp ├── dsound │ ├── dsound.pro │ └── main.cpp ├── direct2d │ ├── direct2d.pro │ └── main.cpp ├── libass │ ├── libass.pro │ └── main.cpp ├── openal │ ├── openal.pro │ └── main.cpp ├── paths.pri ├── 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 ├── tests ├── qrc │ ├── media.qrc │ ├── qrc.pro │ └── main.cpp ├── ao │ └── ao.pro ├── transcode │ └── transcode.pro ├── tests.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 | -------------------------------------------------------------------------------- /examples/QMLPlayer/fonts/default.ttf: -------------------------------------------------------------------------------- 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.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/src/QtAV.icns -------------------------------------------------------------------------------- /src/QtAV.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/src/QtAV.ico -------------------------------------------------------------------------------- /src/compat/msint.txt: -------------------------------------------------------------------------------- 1 | http://www.cnblogs.com/zyl910/archive/2012/08/08/c99int.html -------------------------------------------------------------------------------- /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/RDFS/QtAV/master/src/i18n/QtAV_zh_CN.qm -------------------------------------------------------------------------------- /tools/templates/err.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/tools/templates/err.txt -------------------------------------------------------------------------------- /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/RDFS/QtAV/master/examples/filters/qt-logo.png -------------------------------------------------------------------------------- /src/compat/msvc/changelog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/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/RDFS/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 | -------------------------------------------------------------------------------- /config.tests/x11/x11.pro: -------------------------------------------------------------------------------- 1 | include(../paths.pri) 2 | 3 | TARGET = x11_test 4 | SOURCES += main.cpp 5 | LIBS += -lX11 6 | -------------------------------------------------------------------------------- /examples/QMLPlayer/ControlPanel.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | width: 100 5 | height: 62 6 | } 7 | -------------------------------------------------------------------------------- /examples/simpleplayer/src.pri: -------------------------------------------------------------------------------- 1 | SOURCES += main.cpp \ 2 | playerwindow.cpp 3 | 4 | HEADERS += \ 5 | playerwindow.h 6 | -------------------------------------------------------------------------------- /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/RDFS/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/uchardet/uchardet.pro: -------------------------------------------------------------------------------- 1 | include(../paths.pri) 2 | 3 | TARGET = uchardet_test 4 | SOURCES += main.cpp 5 | LIBS += -luchardet 6 | -------------------------------------------------------------------------------- /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/vaapi/vaapi.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | LIBS += -lva 7 | include(../paths.pri) 8 | -------------------------------------------------------------------------------- /config.tests/videotoolbox/videotoolbox.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= qt app_bundle 2 | CONFIG += console 3 | 4 | SOURCES += main.cpp 5 | 6 | include(../paths.pri) 7 | -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/examples/QMLPlayer/android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/examples/QMLPlayer/android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /examples/QMLPlayer/android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/QtAV/master/examples/QMLPlayer/android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /tools/install_sdk/qt4/av.prf: -------------------------------------------------------------------------------- 1 | QTAV_MAJOR_VERSION=1 2 | QTAV_MINOR_VERSION=9 3 | QTAV_PATCH_VERSION=0 4 | load(qt_functions.prf) 5 | qtAddLibrary(QtAV) 6 | -------------------------------------------------------------------------------- /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/RDFS/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 | -------------------------------------------------------------------------------- /tests/ao/ao.pro: -------------------------------------------------------------------------------- 1 | CONFIG -= app_bundle 2 | 3 | PROJECTROOT = $$PWD/../.. 4 | include($$PROJECTROOT/src/libQtAV.pri) 5 | preparePaths($$OUT_PWD/../../out) 6 | 7 | SOURCES += \ 8 | main.cpp 9 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /config.tests/libass/libass.pro: -------------------------------------------------------------------------------- 1 | include(../paths.pri) 2 | 3 | SOURCES += main.cpp 4 | 5 | exists(../../contrib/capi/capi.pri) { 6 | CONFIG = staticlib 7 | } else { 8 | LIBS += -lass 9 | } 10 | -------------------------------------------------------------------------------- /src/shaders/shaders.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | planar.f.glsl 4 | packed.f.glsl 5 | video.vert 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /tools/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/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 | -------------------------------------------------------------------------------- /tests/tests.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | ao \ 5 | decoder \ 6 | subtitle \ 7 | transcode 8 | 9 | !no-widgets { 10 | SUBDIRS += \ 11 | extract \ 12 | qiodevice \ 13 | qrc \ 14 | playerthread 15 | } 16 | -------------------------------------------------------------------------------- /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 config_libass_link" 11 | 12 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /tests/decoder/decoder.pro: -------------------------------------------------------------------------------- 1 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 2 | CONFIG -= app_bundle 3 | TEMPLATE = app 4 | TARGET = decoder 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | 10 | SOURCES += main.cpp 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/extract/extract.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | 10 | SOURCES += main.cpp 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config.tests/paths.pri: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib # can not create exe for some platforms (winrt, ios). If check header only, staticlib is fine 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 | -------------------------------------------------------------------------------- /examples/simpleplayer/simpleplayer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | 10 | include(src.pri) 11 | -------------------------------------------------------------------------------- /tools/ci/osx/script.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | 3 | echo "$TRAVIS_BUILD_DIR" 4 | 5 | sysctl -b machdep.cpu 6 | sysctl -n hw.ncpu 7 | uname -a 8 | 9 | jobs=`sysctl -n hw.ncpu` 10 | 11 | cd $QTAV_OUT 12 | 13 | rm -f build.log 14 | type -a moc 15 | qmake -r $TRAVIS_BUILD_DIR "CONFIG+=recheck" 16 | make -j$jobs 17 | 18 | cd $TRAVIS_BUILD_DIR 19 | -------------------------------------------------------------------------------- /examples/simpletranscode/simpletranscode.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | 10 | SOURCES += main.cpp 11 | 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "contrib/capi"] 2 | path = contrib/capi 3 | url = https://github.com/wang-bin/capi.git 4 | [submodule "tools/build_ffmpeg"] 5 | path = tools/build_ffmpeg 6 | url = https://github.com/wang-bin/build_ffmpeg.git 7 | [submodule "contrib/uchardet"] 8 | path = contrib/uchardet 9 | url = https://github.com/BYVoid/uchardet.git 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /examples/common/theme/default/volume.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /examples/videocapture/videocapture.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | 10 | SOURCES += main.cpp \ 11 | playerwindow.cpp 12 | 13 | HEADERS += \ 14 | playerwindow.h 15 | -------------------------------------------------------------------------------- /examples/videowall/videowall.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | 5 | TARGET = videowall 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 VideoWall.cpp 12 | HEADERS += VideoWall.h 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/subtitle/subtitle.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-08-05T17:12:03 4 | # 5 | #------------------------------------------------- 6 | 7 | 8 | TARGET = subtitle 9 | CONFIG -= app_bundle 10 | 11 | PROJECTROOT = $$PWD/../.. 12 | include($$PROJECTROOT/src/libQtAV.pri) 13 | preparePaths($$OUT_PWD/../../out) 14 | 15 | SOURCES += main.cpp 16 | -------------------------------------------------------------------------------- /examples/videogroup/videogroup.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | 5 | TARGET = videogroup 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 videogroup.cpp 12 | HEADERS += videogroup.h 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /tests/qrc/qrc.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | CONFIG -= app_bundle 4 | 5 | PROJECTROOT = $$PWD/../.. 6 | include($$PROJECTROOT/src/libQtAV.pri) 7 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 8 | preparePaths($$OUT_PWD/../../out) 9 | SOURCES += main.cpp 10 | 11 | exists(test.mp4) { 12 | RESOURCES += media.qrc 13 | } else { 14 | warning("put test.mp4 in this directory!") 15 | } 16 | -------------------------------------------------------------------------------- /examples/common/theme/dark/capture.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tools/ci/osx/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | brew update 4 | brew install ffmpeg qt5 uchardet 5 | 6 | ls /usr/local/bin 7 | export QTAV_OUT=QtAV-OSX-${TRAVIS_COMMIT:0:7} 8 | mkdir -p $QTAV_OUT 9 | export PATH=/usr/local/opt/qt5/bin:$PATH 10 | ## /usr/local/include is fine too 11 | export CPATH=/usr/local/opt/ffmpeg/include:/usr/local/opt/libass/include 12 | export LIBRARY_PATH=/usr/local/opt/ffmpeg/lib:/usr/local/opt/libass/lib 13 | -------------------------------------------------------------------------------- /tools/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/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.9.0-0 6 | 2015-12-19 7 | com.qtav.product.examples 8 | script 9 | 10 | 11 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.dev/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Development files 4 | Install QtAV headers and lib. 5 | 1.9.0-0 6 | 2015-12-19 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 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.qmake.conf: -------------------------------------------------------------------------------- 1 | QTAV_MAJOR_VERSION = 1 2 | QTAV_MINOR_VERSION = 9 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/videographicsitem/videographicsitem.pro: -------------------------------------------------------------------------------- 1 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 2 | contains(QT_CONFIG, opengl): QT += opengl 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/filters/filters.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | CONFIG -= app_bundle 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | TARGET = filters 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | preparePaths($$OUT_PWD/../../out) 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | SimpleFilter.cpp 14 | 15 | HEADERS += \ 16 | SimpleFilter.h 17 | 18 | RESOURCES += \ 19 | res.qrc 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/ci/win/build.bat: -------------------------------------------------------------------------------- 1 | echo cc=%cc% 2 | where qbs 3 | if "%cc%" == "MinGW" ( 4 | qmake %APPVEYOR_BUILD_FOLDER% "CONFIG+=%mode%" 5 | mingw32-make -j%NUMBER_OF_PROCESSORS% 6 | ) else ( 7 | if "%mode%" == "debug" ( 8 | qmake %APPVEYOR_BUILD_FOLDER% -r -tp vc "CONFIG+=debug" 9 | msbuild /m /p:Configuration=DEBUG 10 | ) else ( 11 | qmake %APPVEYOR_BUILD_FOLDER% 12 | where jom 13 | if %ERRORLEVEL% == 0 ( 14 | jom 15 | ) else ( 16 | nmake 17 | ) 18 | ) 19 | ) 20 | -------------------------------------------------------------------------------- /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 | cd $QTAV_OUT 13 | 14 | rm -f build.log 15 | type -a moc 16 | SPEC=linux-clang 17 | test -n "$CC" && test "${CC/gcc/}" != "$CC" && SPEC=linux-g++ 18 | qmake -r $TRAVIS_BUILD_DIR -spec $SPEC "CONFIG+=recheck" 19 | make -j$((jobs+1)) 20 | 21 | cd $TRAVIS_BUILD_DIR 22 | -------------------------------------------------------------------------------- /tests/playerthread/playerthread.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-01-28T10:24:19 4 | # 5 | #------------------------------------------------- 6 | 7 | TEMPLATE = app 8 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 9 | CONFIG -= app_bundle 10 | 11 | PROJECTROOT = $$PWD/../.. 12 | include($$PROJECTROOT/src/libQtAV.pri) 13 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 14 | preparePaths($$OUT_PWD/../../out) 15 | 16 | SOURCES += main.cpp 17 | -------------------------------------------------------------------------------- /examples/common/theme/default/stop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/qiodevice/qiodevice.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2014-01-28T10:24:19 4 | # 5 | #------------------------------------------------- 6 | 7 | TEMPLATE = app 8 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 9 | CONFIG -= app_bundle 10 | 11 | STATICLINK = 0 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 | 19 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.player/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Player 4 | Default player. 5 | 1.9.0-0 6 | 2015-12-19 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.9.0-0 6 | 2015-12-19 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/common/theme/default/mute.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/sharedoutput/sharedoutput.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2013-01-20T13:10:48 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 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 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/packages/com.qtav.product.runtime/meta/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Runtime library 4 | Install QtAV runtime library. 5 | 1.9.0-0 6 | 2015-12-19 7 | com.qtav.product.runtime 8 | 9 | zh_CN.qm 10 | 11 | true 12 | true 13 | true 14 | 8 15 | 16 | -------------------------------------------------------------------------------- /examples/simpleplayer/simpleplayer_sdk.pro: -------------------------------------------------------------------------------- 1 | ########## template for QtAV app project BEGIN ################ 2 | greaterThan(QT_MAJOR_VERSION, 4) { 3 | QT += avwidgets 4 | } else { 5 | CONFIG += avwidgets 6 | } 7 | #rpath for osx qt4 8 | mac { 9 | RPATHDIR *= @loader_path/../Frameworks @executable_path/../Frameworks 10 | QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/ 11 | isEmpty(QMAKE_LFLAGS_RPATH): QMAKE_LFLAGS_RPATH=-Wl,-rpath, 12 | for(R,RPATHDIR) { 13 | QMAKE_LFLAGS *= \'$${QMAKE_LFLAGS_RPATH}$$R\' 14 | } 15 | } 16 | ########## template for QtAV app project END ################ 17 | ################# Add your own code below ################### 18 | include(src.pri) 19 | -------------------------------------------------------------------------------- /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: 2015 Wang Bin , 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/ci/osx/after_success.sh: -------------------------------------------------------------------------------- 1 | exit 0 2 | cd tools 3 | git clone https://github.com/andreyvit/create-dmg.git 4 | 5 | ./deploy_osx.sh $TRAVIS_BUILD_DIR/$QTAV_OUT 6 | 7 | 8 | PKG=$TRAVIS_BUILD_DIR/${QTAV_OUT}-QMLPlayer.dmg 9 | mv QtAV-QMLPlayer.dmg $PKG 10 | 11 | wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz 12 | tar zxf sshpass.tar.gz 13 | cd sshpass-1.05 14 | ./configure 15 | make 16 | sudo make install 17 | export PATH=$PWD:$PATH 18 | cd $TRAVIS_BUILD_DIR 19 | type -a sshpass 20 | # ignore known hosts: -o StrictHostKeyChecking=no 21 | sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER,qtav@frs.sourceforge.net:/home/frs/project/q/qt/qtav/ci/ 22 | -------------------------------------------------------------------------------- /qtc_packaging/ifw/config/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | QtAV 4 | 1.9.0 5 | QtAV Multimedia framework 6 | WangBin wbsecg1@gmail.com 7 | http://qtav.org 8 | 9 | 10 | control.js 11 | 12 | true 13 | 14 | QtAV 15 | @rootDir@/QtAV 16 | @rootDir@/QtAV 17 | 18 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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().append(QLatin1String("/i18n/QtAV_")).append(QLocale::system().name()))) 13 | a.installTranslator(&ts); 14 | QTranslator qtts; 15 | if (qtts.load(QString::fromLatin1("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 | -------------------------------------------------------------------------------- /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 wily) 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.9.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 | -------------------------------------------------------------------------------- /config.tests/gentest.sh: -------------------------------------------------------------------------------- 1 | SCRIPT_DIR=${0%/*} 2 | 3 | help_post(){ 4 | 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" 5 | } 6 | 7 | help(){ 8 | cecho red "Usage: $0 name" 9 | help_post name 10 | exit 0 11 | } 12 | [ $# -lt 1 ] && help 13 | 14 | NAME=$1 15 | help_post $NAME 16 | mkdir -p $NAME 17 | cat >$NAME/${NAME}.pro < $NAME/main.cpp 28 | cat >> $NAME/main.cpp < 30 | 31 | void test() { 32 | } 33 | EOF 34 | 35 | echo "test for $NAME created" 36 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/ci/linux/install.sh: -------------------------------------------------------------------------------- 1 | set -ev 2 | sudo apt-get update -qq 3 | sudo apt-get install -qq -y libegl1-mesa-dev 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 | -------------------------------------------------------------------------------- /tools/ci/win/install_dep.bat: -------------------------------------------------------------------------------- 1 | if "%QTDIR:~0,6%" == "C:\Qt\" goto getdep 2 | 3 | echo downloading qt "http://sourceforge.net/projects/buildqt/files/release/%qt%/Qt%qt%-%cc%%arch%%suffix%.7z/download" 4 | appveyor DownloadFile "http://sourceforge.net/projects/buildqt/files/release/%qt%/Qt%qt%-%cc%%arch%%suffix%.7z/download" -FileName qt.7z 5 | 7z x qt.7z > NUL 6 | move Qt%qt%-* %QTDIR% 7 | 8 | :getdep 9 | echo downloading qtav dep "http://sourceforge.net/projects/qtav/files/depends/QtAV-depends-windows-x86+x64.7z/download" 10 | appveyor DownloadFile "http://sourceforge.net/projects/qtav/files/depends/QtAV-depends-windows-x86+x64.7z/download" -FileName av.7z 11 | 7z x av.7z > NUL 12 | move QtAV-depends* AV 13 | xcopy /syi AV\include %QTDIR%\include > NUL 14 | if "%arch%" == "x64" ( 15 | xcopy /syi AV\lib\x64 %QTDIR%\lib > NUL 16 | copy /y AV\bin\x64\*.dll %QTDIR%\bin > NUL 17 | ) else ( 18 | xcopy /syi AV\lib %QTDIR%\lib > NUL 19 | copy /y AV\bin\*.dll %QTDIR%\bin > NUL 20 | ) 21 | 22 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = common 4 | !android:!ios:!winrt { 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 | sdk_build { 21 | SUBDIRS *= \ 22 | simpleplayer/simpleplayer_sdk.pro \ 23 | player/player_sdk.pro 24 | } 25 | } 26 | } 27 | 28 | greaterThan(QT_MAJOR_VERSION, 4) { 29 | greaterThan(QT_MINOR_VERSION, 3) { 30 | contains(QT_CONFIG, opengl):!winrt:!ios:!android: SUBDIRS += window 31 | } 32 | # qtHaveModule does not exist in Qt5.0 33 | isEqual(QT_MINOR_VERSION, 0)|qtHaveModule(quick) { 34 | SUBDIRS += QMLPlayer 35 | QMLPlayer.depends += common 36 | sdk_build: SUBDIRS *= QMLPlayer/QMLPlayer_sdk.pro 37 | } 38 | } 39 | 40 | OTHER_FILES = qml/*.qml 41 | -------------------------------------------------------------------------------- /tools/ci/after_success.sh: -------------------------------------------------------------------------------- 1 | exit 0 2 | set -ev 3 | 4 | # download ifw for linux, mingw 5 | 6 | # upload packages 7 | 8 | # TRAVIS_TAG 9 | echo TRAVIS_TAG=$TRAVIS_TAG 10 | 11 | PKG=$TRAVIS_BUILD_DIR/$QTAV_OUT.tar.xz 12 | tar Jcvf $PKG $QTAV_OUT/{bin,lib*,build.log} 13 | 14 | wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz 15 | tar zxf sshpass.tar.gz 16 | cd sshpass-1.05 17 | ./configure 18 | make 19 | sudo make install 20 | export PATH=$PWD:$PATH 21 | cd $TRAVIS_BUILD_DIR 22 | type -a sshpass 23 | # ignore known hosts: -o StrictHostKeyChecking=no 24 | sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER,qtav@frs.sourceforge.net:/home/frs/project/q/qt/qtav/ci/ 25 | #rsync --password-file=$PWF -avP -e ssh $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci/ 26 | #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 27 | -------------------------------------------------------------------------------- /src/QtAV.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 19 | 25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /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/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 | fonts/default.ttf 20 | qml/QMLPlayer/MiscPage.qml 21 | 22 | 23 | -------------------------------------------------------------------------------- /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 qint64 type = material->type(); 24 | VideoShader *shader = shader_cache.value(type, 0); 25 | if (shader) 26 | return shader; 27 | qDebug() << QString("[ShaderManager] cache a new shader material type(%1): %2").arg(type).arg(VideoMaterial::typeName(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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/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 | -------------------------------------------------------------------------------- /config.tests/videotoolbox/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 | -------------------------------------------------------------------------------- /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 | dark/capture.svg 14 | dark/menu.svg 15 | dark/sound.svg 16 | dark/backward.svg 17 | dark/forward.svg 18 | dark/fullscreen.svg 19 | dark/help.svg 20 | dark/info.svg 21 | dark/open.svg 22 | dark/pause.svg 23 | dark/play.svg 24 | dark/stop.svg 25 | dark/fullscreen.svg 26 | dark/close.svg 27 | default/volume.svg 28 | default/mute.svg 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/AudioResamplerFF.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-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 | #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/uchardet/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 | void test() { 24 | uchardet_new(); 25 | } 26 | -------------------------------------------------------------------------------- /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 framework. http://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 | -------------------------------------------------------------------------------- /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 framework. http://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/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 | -------------------------------------------------------------------------------- /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 | 25 | void test() { 26 | ass_library_init(); 27 | } 28 | -------------------------------------------------------------------------------- /config.tests/x11/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 | void test() { 24 | XPutImage(NULL, 0, NULL, NULL, 0, 0, 0, 0, 0, 0); 25 | } 26 | -------------------------------------------------------------------------------- /src/AudioResamplerLibav.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-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 | 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | #TODO: mingw cross build 3 | language: cpp 4 | cache: apt 5 | 6 | matrix: 7 | include: 8 | - os: osx 9 | compiler: clang 10 | env: 11 | - QT=brew 12 | - AV=ffmpeg-brew 13 | - os: linux 14 | compiler: gcc 15 | env: 16 | - QT=4.8.6 17 | - AV=ffmpeg-1.0.10 18 | - CC=gcc 19 | - os: linux 20 | compiler: clang 21 | env: 22 | - QT=5.0.2 23 | - AV=ffmpeg-1.2.10 24 | - os: linux 25 | compiler: clang 26 | env: 27 | - QT=5.1.1 28 | - AV=ffmpeg-2.0.6 29 | - os: linux 30 | compiler: clang 31 | env: 32 | - QT=5.2.1 33 | - AV=ffmpeg-2.2.11 34 | 35 | branches: 36 | only: 37 | - master 38 | - prelease 39 | - ci/travis 40 | - /^travis.*$/ 41 | - dev 42 | 43 | git: 44 | submodules: true 45 | 46 | install: . tools/ci/$TRAVIS_OS_NAME/install.sh 47 | 48 | script: 49 | - ./tools/ci/$TRAVIS_OS_NAME/script.sh 50 | 51 | after_success: ./tools/ci/$TRAVIS_OS_NAME/after_success.sh 52 | 53 | notifications: 54 | irc: 55 | channels: 56 | - "chat.freenode.net#qtav" 57 | email: 58 | recipients: 59 | - wbsecg1@gmail.com 60 | on_success: change 61 | on_failure: always 62 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /tools/patchelf.sh: -------------------------------------------------------------------------------- 1 | BINDIR=$1 2 | echo $BINDIR 3 | 4 | runpath() { 5 | local exe=$1 6 | test -n "$2" && exe=`echo $1 |sed "s,$2,,"` 7 | [ "${exe:0:2}" = "./" ] && exe=${exe:2} 8 | local d=`echo $exe |sed 's,[^\/],,g'` 9 | d=`echo $d |sed 's,\/,\/..,g'` 10 | # echo "$exe => $d" 11 | echo "\$ORIGIN:\$ORIGIN$d/lib:\$ORIGIN$d" 12 | } 13 | 14 | [ -d "$BINDIR" ] || BINDIR=$PWD 15 | qmlso=(`find $BINDIR/qml -name "*.so" -type f`) 16 | for q in ${qmlso[@]}; do 17 | echo patching $q 18 | patchelf --set-rpath `runpath $q $BINDIR/` $q 19 | done 20 | plugins=(`find $BINDIR/plugins -name "*.so" -type f`) 21 | for p in ${plugins[@]}; do 22 | echo patching $p 23 | patchelf --set-rpath `runpath $p $BINDIR/` $p 24 | done 25 | for qt in $BINDIR/libQt5*.so.5; do 26 | echo patching $qt 27 | patchelf --set-rpath '$ORIGIN' $qt 28 | done 29 | 30 | QMLAV=$BINDIR/QtAV/libQmlAV.so 31 | test -f $QMLAV && echo "$QMLAV" && patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN/..:$ORIGIN/../..' $QMLAV 32 | QMLAV=$BINDIR/qml/QtAV/libQmlAV.so 33 | test -f $QMLAV && echo "$QMLAV" && patchelf --set-rpath '$ORIGIN/../../lib:$ORIGIN/..:$ORIGIN/../..' $QMLAV 34 | 35 | EXE=(`find $BINDIR -maxdepth 1 -executable -type f |grep -v lib`) 36 | for exe in ${EXE[@]}; do 37 | echo "patching $exe..." 38 | patchelf --set-rpath '$ORIGIN:$ORIGIN/lib:$ORIGIN/../lib' $exe 39 | done 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tools/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/qml/QMLPlayer/DelegateItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "utils.js" as Utils 3 | 4 | Rectangle { 5 | id: root 6 | width: Math.max(Utils.kItemWidth, itemText.contentWidth+8) 7 | height: itemText.contentWidth 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 | anchors.fill: parent 16 | anchors.margins: 4 17 | font.pixelSize: Utils.kFontSize 18 | anchors.centerIn: parent 19 | horizontalAlignment: Text.AlignHCenter 20 | verticalAlignment: Text.AlignVCenter 21 | } 22 | MouseArea { 23 | anchors.fill: parent 24 | onClicked: { 25 | root.state = "selected" 26 | root.clicked() 27 | } 28 | } 29 | states: [ 30 | State { 31 | name: "selected" 32 | PropertyChanges { 33 | target: delegateItem 34 | color: selectedColor 35 | } 36 | } 37 | ] 38 | transitions: [ 39 | Transition { 40 | from: "*"; to: "*" 41 | ColorAnimation { 42 | properties: "color" 43 | easing.type: Easing.OutQuart 44 | duration: 500 45 | } 46 | } 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /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.6.0\5.6\mingw492_32 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 | -------------------------------------------------------------------------------- /examples/player/src.pri: -------------------------------------------------------------------------------- 1 | 2 | SOURCES += main.cpp \ 3 | MainWindow.cpp \ 4 | ClickableMenu.cpp \ 5 | StatisticsView.cpp \ 6 | Slider.cpp \ 7 | TVView.cpp \ 8 | EventFilter.cpp \ 9 | config/ConfigDialog.cpp \ 10 | config/ConfigPageBase.cpp \ 11 | config/CaptureConfigPage.cpp \ 12 | config/VideoEQConfigPage.cpp \ 13 | config/DecoderConfigPage.cpp \ 14 | config/MiscPage.cpp \ 15 | filters/OSD.cpp \ 16 | filters/OSDFilter.cpp \ 17 | playlist/PlayListModel.cpp \ 18 | playlist/PlayListItem.cpp \ 19 | playlist/PlayListDelegate.cpp \ 20 | playlist/PlayList.cpp \ 21 | config/PropertyEditor.cpp \ 22 | config/AVFormatConfigPage.cpp \ 23 | config/AVFilterConfigPage.cpp \ 24 | filters/AVFilterSubtitle.cpp 25 | 26 | HEADERS += \ 27 | MainWindow.h \ 28 | ClickableMenu.h \ 29 | StatisticsView.h \ 30 | Slider.h \ 31 | TVView.h \ 32 | EventFilter.h \ 33 | config/ConfigDialog.h \ 34 | config/ConfigPageBase.h \ 35 | config/CaptureConfigPage.h \ 36 | config/VideoEQConfigPage.h \ 37 | config/DecoderConfigPage.h \ 38 | config/MiscPage.h \ 39 | filters/OSD.h \ 40 | filters/OSDFilter.h \ 41 | playlist/PlayListModel.h \ 42 | playlist/PlayListItem.h \ 43 | playlist/PlayListDelegate.h \ 44 | playlist/PlayList.h \ 45 | config/PropertyEditor.h \ 46 | config/AVFormatConfigPage.h \ 47 | config/AVFilterConfigPage.h \ 48 | filters/AVFilterSubtitle.h 49 | -------------------------------------------------------------------------------- /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 | layer.enabled: true 7 | property string selected: "" 8 | property string selectedUrl 9 | property int selectedX: 0 10 | property int selectedY: 0 11 | color: "#80101010" 12 | 13 | signal clicked 14 | 15 | Menu { 16 | id: menu 17 | anchors.fill: parent 18 | anchors.topMargin: Utils.scaled(40) 19 | itemWidth: root.width - Utils.scaled(2) 20 | spacing: Utils.scaled(1) 21 | model: ListModel { 22 | id: contentModel 23 | // ListElement property value can not be script before Qt5.4. translate here(QT_TR_NOOP) and used in other qml fails 24 | } 25 | onClicked: { 26 | selectedX = x 27 | selectedY = y 28 | selectedUrl = model.get(index).url 29 | root.clicked() 30 | } 31 | } 32 | Component.onCompleted: { 33 | contentModel.append({name: qsTr("Media info"), url: "MediaInfoPage.qml" }) 34 | contentModel.append({name: qsTr("Video codec"), url: "VideoCodec.qml" }) 35 | contentModel.append({name: qsTr("Subtitle"), url: "SubtitlePage.qml" }) 36 | contentModel.append({name: qsTr("Audio"), url: "AudioPage.qml" }) 37 | contentModel.append({name: qsTr("Misc"), url: "MiscPage.qml" }) 38 | contentModel.append({name: qsTr("About"), url: "About.qml" }) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | import android.content.pm.ActivityInfo; 10 | 11 | public class QMLPlayerActivity extends QtActivity 12 | { 13 | private final static String TAG = "QMLPlayer"; 14 | private static String m_request_url; 15 | private static QMLPlayerActivity m_instance; 16 | public QMLPlayerActivity() { 17 | m_instance = this; 18 | } 19 | public static String getUrl() { 20 | return m_instance.m_request_url; 21 | } 22 | 23 | @Override 24 | public void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 27 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 28 | Intent intent = getIntent(); 29 | String action = intent.getAction(); 30 | 31 | Log.i("QMLPlayerActivity", "Action: " + action); 32 | Log.i("QMLPlayerActivity", "Data: " + intent.getDataString()); 33 | if (intent.ACTION_VIEW.equals(action)) { 34 | m_request_url = intent.getDataString(); 35 | } 36 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/qrc/main.cpp: -------------------------------------------------------------------------------- 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 | #include 21 | 22 | #include 23 | #include 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | QtAV::Widgets::registerRenderers(); 28 | QApplication a(argc, argv); 29 | QtAV::VideoOutput renderer; 30 | renderer.widget()->show(); 31 | renderer.widget()->setWindowTitle(QString::fromLatin1("Play video from qrc--QtAV %1 wbsecg1@gmail.com").arg(QtAV_Version_String_Long())); 32 | QtAV::AVPlayer player; 33 | player.setRenderer(&renderer); 34 | 35 | player.play(QString::fromLatin1("qrc:/test.mp4")); 36 | 37 | return a.exec(); 38 | } 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/player/player.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 3 | TRANSLATIONS = res/player_zh_CN.ts 4 | VERSION = $$QTAV_VERSION 5 | 6 | PROJECTROOT = $$PWD/../.. 7 | include($$PROJECTROOT/src/libQtAV.pri) 8 | include($$PROJECTROOT/widgets/libQtAVWidgets.pri) 9 | STATICLINK=1 10 | include($$PWD/../common/libcommon.pri) 11 | preparePaths($$OUT_PWD/../../out) 12 | INCLUDEPATH += $$PWD 13 | mac: RC_FILE = $$PROJECTROOT/src/QtAV.icns 14 | genRC($$TARGET) 15 | include(src.pri) 16 | 17 | unix:!android:!mac { 18 | #debian 19 | player_bins = player QMLPlayer 20 | DEB_INSTALL_LIST = $$join(player_bins, \\n.$$[QT_INSTALL_BINS]/, .$$[QT_INSTALL_BINS]/) 21 | DEB_INSTALL_LIST *= \ 22 | usr/share/applications/player.desktop \ 23 | usr/share/applications/QMLPlayer.desktop \ 24 | usr/share/icons/hicolor/64x64/apps/QtAV.svg 25 | deb_install_list.target = qtav-players.install 26 | deb_install_list.commands = echo \"$$join(DEB_INSTALL_LIST, \\n)\" >$$PROJECTROOT/debian/$${deb_install_list.target} 27 | QMAKE_EXTRA_TARGETS += deb_install_list 28 | target.depends *= $${deb_install_list.target} 29 | 30 | qtav_players_links.target = qtav-players.links 31 | qtav_players_links.commands = echo \"$$[QT_INSTALL_BINS]/player /usr/bin/Player\n$$[QT_INSTALL_BINS]/QMLPlayer /usr/bin/QMLPlayer\" >$$PROJECTROOT/debian/$${qtav_players_links.target} 32 | QMAKE_EXTRA_TARGETS *= qtav_players_links 33 | target.depends *= $${qtav_players_links.target} 34 | } 35 | 36 | tv.files = res/tv.ini 37 | #BIN_INSTALLS += tv 38 | target.path = $$[QT_INSTALL_BINS] 39 | include($$PROJECTROOT/deploy.pri) 40 | 41 | RESOURCES += res/player.qrc 42 | -------------------------------------------------------------------------------- /src/subtitle/CharsetDetector.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_UCHARDET_H 23 | #define QTAV_UCHARDET_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_UCHARDET_H 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/player/filters/OSDFilter.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | QtAV: Media play library based on Qt and FFmpeg 3 | Copyright (C) 2012-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 | #include "OSDFilter.h" 23 | #include 24 | #include 25 | 26 | OSDFilter::OSDFilter(QObject *parent) 27 | : VideoFilter(parent) 28 | , OSD() 29 | {} 30 | 31 | void OSDFilter::process(Statistics *statistics, VideoFrame *frame) 32 | { 33 | Q_UNUSED(frame); 34 | if (mShowType == ShowNone) 35 | return; 36 | //qDebug("ctx=%p tid=%p main tid=%p", ctx, QThread::currentThread(), qApp->thread()); 37 | context()->drawPlainText(context()->rect, Qt::AlignCenter, text(statistics)); 38 | } 39 | -------------------------------------------------------------------------------- /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 GLWidgetRenderer2; 29 | class AVPlayer; 30 | class VideoOutput; 31 | } 32 | class Widget : public QWidget 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit Widget(QWidget *parent = 0); 38 | ~Widget(); 39 | 40 | public slots: 41 | void setVideo(); 42 | void playVideo(); 43 | void testRTSP(); 44 | 45 | private: 46 | class 47 | QtAV::VideoOutput *renderer; 48 | QtAV::AVPlayer *player[2]; 49 | QPushButton *play_btn[2]; 50 | QPushButton *file_btn[2]; 51 | }; 52 | 53 | #endif // WIDGET_H 54 | -------------------------------------------------------------------------------- /examples/player/filters/OSDFilter.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_OSDFILTER_H 23 | #define QTAV_OSDFILTER_H 24 | 25 | #include 26 | #include 27 | #include "OSD.h" 28 | 29 | using namespace QtAV; 30 | class OSDFilter : public VideoFilter, public OSD 31 | { 32 | public: 33 | OSDFilter(QObject *parent = 0); 34 | bool isSupported(VideoFilterContext::Type ct) const { 35 | return ct == VideoFilterContext::QtPainter || ct == VideoFilterContext::X11; 36 | } 37 | protected: 38 | void process(Statistics* statistics, VideoFrame* frame); 39 | }; 40 | 41 | #endif // QTAV_OSDFILTER_H 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/QtAV/private/MediaIO_p.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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | !winrt:*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 | !contains(QMAKE_HOST.os, Windows):include($$PROJECTROOT/deploy.pri) 60 | 61 | target.path = $$[QT_INSTALL_BINS] 62 | !contains(QMAKE_HOST.os, Windows):INSTALLS += target 63 | 64 | -------------------------------------------------------------------------------- /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 HAS_ALPHA 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 HAS_ALPHA 43 | v_TexCoords3 = a_TexCoords3; 44 | #endif 45 | #endif //MULTI_COORD 46 | } 47 | -------------------------------------------------------------------------------- /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/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 | QCheckBox *m_egl; 50 | QComboBox *m_log; 51 | }; 52 | 53 | #endif // MISCPAGE_H 54 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/QtAV/VideoDecoderTypes.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_VIDEODECODERTYPES_H 23 | #define QTAV_VIDEODECODERTYPES_H 24 | 25 | #include 26 | 27 | namespace QtAV { 28 | 29 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_FFmpeg; 30 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_CUDA; 31 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_DXVA; 32 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VAAPI; 33 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_Cedarv; 34 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_FFmpeg_VDPAU; 35 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VDA; 36 | extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VideoToolbox; 37 | 38 | 39 | Q_AV_EXPORT void VideoDecoder_RegisterAll(); 40 | 41 | } //namespace QtAV 42 | #endif // QTAV_VIDEODECODERTYPES_H 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/codec/video/VideoDecoderTypes.cpp: -------------------------------------------------------------------------------- 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 | #include "QtAV/VideoDecoderTypes.h" 23 | #include "QtAV/private/mkid.h" 24 | 25 | namespace QtAV { 26 | 27 | VideoDecoderId VideoDecoderId_FFmpeg = mkid::id32base36_6<'F', 'F', 'm', 'p', 'e', 'g'>::value; 28 | VideoDecoderId VideoDecoderId_CUDA = mkid::id32base36_4<'C', 'U', 'D', 'A'>::value; 29 | VideoDecoderId VideoDecoderId_DXVA = mkid::id32base36_4<'D', 'X', 'V', 'A'>::value; 30 | VideoDecoderId VideoDecoderId_VAAPI = mkid::id32base36_5<'V', 'A', 'A', 'P', 'I'>::value; 31 | VideoDecoderId VideoDecoderId_Cedarv = mkid::id32base36_6<'C', 'e', 'd', 'a', 'r', 'V'>::value; 32 | VideoDecoderId VideoDecoderId_VDA = mkid::id32base36_3<'V', 'D', 'A'>::value; 33 | VideoDecoderId VideoDecoderId_VideoToolbox = mkid::id32base36_5<'V', 'T', 'B', 'o', 'x'>::value; 34 | 35 | } //namespace QtAV 36 | -------------------------------------------------------------------------------- /tools/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 | --------------------------------------------------------------------------------