webcamoid-8.1.0+dfsg/ 0000755 0001750 0001750 00000000000 13166615412 013076 5 ustar qemu qemu webcamoid-8.1.0+dfsg/TODO 0000644 0001750 0001750 00000000402 13166615412 013562 0 ustar qemu qemu Ordered by priority:
Webcamoid 9.x series:
- Android port.
- Add support for scripted plugins/addons.
- New and customizable UI.
Webcamoid 10.x series or higher:
- Layouts.
- Add social sharing features.
- Add network broadcast support.
- Audio effects.
webcamoid-8.1.0+dfsg/commons.pri 0000644 0001750 0001750 00000013151 13166615412 015266 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
COMMONS_APPNAME = "Webcamoid"
COMMONS_TARGET = $$lower($${COMMONS_APPNAME})
VER_MAJ = 8
VER_MIN = 1
VER_PAT = 0
VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
isEmpty(BUILDDOCS): BUILDDOCS = 0
isEmpty(QDOCTOOL): {
unix: QDOCTOOL = $$[QT_INSTALL_BINS]/qdoc
!unix: QDOCTOOL = $$[QT_INSTALL_LIBEXECS]/qdoc
}
isEmpty(QMAKE_LRELEASE) {
unix: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
!unix: QMAKE_LRELEASE = $$[QT_INSTALL_LIBEXECS]/lrelease
}
win32 {
host_name = $$lower($$QMAKE_HOST.os)
!isEmpty(ProgramW6432) {
DEFAULT_PREFIX = $(ProgramW6432)/$${COMMONS_APPNAME}
} else: !isEmpty(ProgramFiles) {
DEFAULT_PREFIX = $(ProgramFiles)/$${COMMONS_APPNAME}
} else: contains(host_name, linux) {
DEFAULT_PREFIX = /$${COMMONS_APPNAME}
} else {
DEFAULT_PREFIX = C:/$${COMMONS_APPNAME}
}
} else {
DEFAULT_PREFIX = /usr
}
isEmpty(PREFIX): PREFIX = $${DEFAULT_PREFIX}
isEmpty(EXECPREFIX): EXECPREFIX = $${PREFIX}
isEmpty(BINDIR): BINDIR = $${EXECPREFIX}/bin
isEmpty(SBINDIR): SBINDIR = $${EXECPREFIX}/sbin
isEmpty(LIBEXECDIR): LIBEXECDIR = $${EXECPREFIX}/libexec
isEmpty(DATAROOTDIR): DATAROOTDIR = $${PREFIX}/share
isEmpty(DATDIR): DATDIR = $${DATAROOTDIR}/$${COMMONS_TARGET}
isEmpty(SYSCONFDIR): SYSCONFDIR = $${PREFIX}/etc
isEmpty(SHAREDSTATEDIR): SHAREDSTATEDIR = $${PREFIX}/com
isEmpty(LOCALSTATEDIR): LOCALSTATEDIR = $${PREFIX}/var
isEmpty(INCLUDEDIR): INCLUDEDIR = $${PREFIX}/include
isEmpty(DOCDIR): DOCDIR = $${DATAROOTDIR}/doc/$${COMMONS_TARGET}
isEmpty(INFODIR): INFODIR = $${DATAROOTDIR}/info
isEmpty(HTMLDIR): HTMLDIR = $${DOCDIR}/html
isEmpty(DVIDIR): DVIDIR = $${DOCDIR}/dvi
isEmpty(PDFDIR): PDFDIR = $${DOCDIR}/pdf
isEmpty(PSDIR): PSDIR = $${DOCDIR}/ps
isEmpty(LIBDIR): LIBDIR = $${EXECPREFIX}/lib
isEmpty(LOCALEDIR): LOCALEDIR = $${DATAROOTDIR}/locale
isEmpty(MANDIR): MANDIR = $${DATAROOTDIR}/man
isEmpty(LICENSEDIR): LICENSEDIR = $${DATAROOTDIR}/licenses/$${COMMONS_TARGET}
isEmpty(LOCALDIR): LOCALDIR = $${PREFIX}/local
isEmpty(LOCALLIBDIR): LOCALLIBDIR = $${LOCALDIR}/lib
isEmpty(INSTALLQMLDIR): INSTALLQMLDIR = $${LIBDIR}/qt/qml
DEFINES += \
COMMONS_APPNAME=\"\\\"$$COMMONS_APPNAME\\\"\" \
COMMONS_TARGET=\"\\\"$$COMMONS_TARGET\\\"\" \
COMMONS_VER_MAJ=\"\\\"$$VER_MAJ\\\"\" \
COMMONS_VERSION=\"\\\"$$VERSION\\\"\" \
PREFIX=\"\\\"$$PREFIX\\\"\" \
EXECPREFIX=\"\\\"$$EXECPREFIX\\\"\" \
BINDIR=\"\\\"$$BINDIR\\\"\" \
SBINDIR=\"\\\"$$SBINDIR\\\"\" \
LIBEXECDIR=\"\\\"LIBEXECDIR\\\"\" \
DATAROOTDIR=\"\\\"$$DATAROOTDIR\\\"\" \
DATDIR=\"\\\"$$DATDIR\\\"\" \
SYSCONFDIR=\"\\\"$$SYSCONFDIR\\\"\" \
SHAREDSTATEDIR=\"\\\"$$SHAREDSTATEDIR\\\"\" \
LOCALSTATEDIR=\"\\\"$$LOCALSTATEDIR\\\"\" \
INCLUDEDIR=\"\\\"$$INCLUDEDIR\\\"\" \
DOCDIR=\"\\\"$$DOCDIR\\\"\" \
INFODIR=\"\\\"$$INFODIR\\\"\" \
HTMLDIR=\"\\\"$$HTMLDIR\\\"\" \
DVIDIR=\"\\\"$$DVIDIR\\\"\" \
PDFDIR=\"\\\"$$PDFDIR\\\"\" \
PSDIR=\"\\\"$$PSDIR\\\"\" \
LIBDIR=\"\\\"$$LIBDIR\\\"\" \
LOCALEDIR=\"\\\"$$LOCALEDIR\\\"\" \
MANDIR=\"\\\"$$MANDIR\\\"\" \
LICENSEDIR=\"\\\"$$LICENSEDIR\\\"\" \
LOCALDIR=\"\\\"$$LOCALDIR\\\"\" \
LOCALLIBDIR=\"\\\"$$LOCALLIBDIR\\\"\" \
INSTALLQMLDIR=\"\\\"$$INSTALLQMLDIR\\\"\"
CONFIG(debug, debug|release) {
COMMONS_BUILD_PATH = build/Qt$${QT_VERSION}/$${QMAKE_CC}/debug
DEFINES += QT_DEBUG
} else {
COMMONS_BUILD_PATH = build/Qt$${QT_VERSION}/$${QMAKE_CC}/release
}
MOC_DIR = $${COMMONS_BUILD_PATH}/moc
OBJECTS_DIR = $${COMMONS_BUILD_PATH}/obj
RCC_DIR = $${COMMONS_BUILD_PATH}/rcc
UI_DIR = $${COMMONS_BUILD_PATH}/ui
# Compile translations files.
isEmpty(NOLRELEASE): !isEmpty(TRANSLATIONS): CONFIG(debug, debug|release) {
compiletr.input = TRANSLATIONS
compiletr.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
compiletr.commands = $$QMAKE_LRELEASE -removeidentical -compress ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
compiletr.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += compiletr
PRE_TARGETDEPS += compiler_compiletr_make_all
}
win32 {
CONFIG += skip_target_version_ext
!isEmpty(STATIC_BUILD):!isEqual(STATIC_BUILD, 0) {
win32-g++: QMAKE_LFLAGS = -static-libgcc -static-libstdc++
}
}
macx: QT_CONFIG -= no-pkg-config
# Enable c++11 support in all platforms
!CONFIG(c++11): CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
webcamoid-8.1.0+dfsg/ports/ 0000755 0001750 0001750 00000000000 13166615412 014245 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/ci/ 0000755 0001750 0001750 00000000000 13166615412 014640 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/ci/travis/ 0000755 0001750 0001750 00000000000 13166615412 016150 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/ci/travis/build.sh 0000755 0001750 0001750 00000003671 13166615412 017615 0 ustar qemu qemu #!/bin/bash
if [ -z "${DISABLE_CCACHE}" ]; then
if [ "${CXX}" = clang++ ]; then
UNUSEDARGS="-Qunused-arguments"
fi
COMPILER="ccache ${CXX} ${UNUSEDARGS}"
else
COMPILER=${CXX}
fi
if [ "${TRAVIS_OS_NAME}" = linux ] && [ -z "${ANDROID_BUILD}" ]; then
EXEC="docker exec ${DOCKERSYS}"
fi
BUILDSCRIPT=dockerbuild.sh
if [ "${DOCKERIMG}" = ubuntu:trusty ] || \
[ "${DOCKERIMG}" = ubuntu:xenial ]; then
cat << EOF > ${BUILDSCRIPT}
#!/bin/bash
source /opt/qt58/bin/qt58-env.sh
EOF
chmod +x ${BUILDSCRIPT}
fi
if [ "${ANDROID_BUILD}" = 1 ]; then
export PATH=$PWD/build/Qt/${QTVER:0:3}/android_${TARGET_ARCH}/bin:$PATH
export ANDROID_NDK_ROOT=$PWD/build/android-ndk-${NDKVER}
qmake -spec ${COMPILESPEC} Webcamoid.pro
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
export PATH=$HOME/.local/bin:$PATH
if [ "${DOCKERSYS}" = debian ]; then
if [ "${DOCKERIMG}" = ubuntu:trusty ] || \
[ "${DOCKERIMG}" = ubuntu:xenial ]; then
cat << EOF >> ${BUILDSCRIPT}
qmake -spec ${COMPILESPEC} Webcamoid.pro \
QMAKE_CXX="${COMPILER}"
EOF
${EXEC} bash ${BUILDSCRIPT}
else
${EXEC} qmake -qt=5 -spec ${COMPILESPEC} Webcamoid.pro \
QMAKE_CXX="${COMPILER}"
fi
else
${EXEC} qmake-qt5 -spec ${COMPILESPEC} Webcamoid.pro \
QMAKE_CXX="${COMPILER}"
fi
elif [ "${TRAVIS_OS_NAME}" = osx ]; then
syphonFPath="$PWD/Syphon"
${EXEC} qmake -spec ${COMPILESPEC} Webcamoid.pro \
QMAKE_CXX="${COMPILER}" \
SYPHONINCLUDES="$syphonFPath/Syphon.framework/Headers" \
SYPHONLIBS=-F"$syphonFPath" \
SYPHONLIBS+=-framework \
SYPHONLIBS+=Syphon \
LIBUSBINCLUDES=/usr/local/opt/libusb/include \
LIBUVCINCLUDES=/usr/local/opt/libuvc/include \
LIBUVCLIBS=-L/usr/local/opt/libuvc/lib \
LIBUVCLIBS+=-luvc
fi
if [ -z "${NJOBS}" ]; then
NJOBS=4
fi
${EXEC} make -j${NJOBS}
webcamoid-8.1.0+dfsg/ports/ci/travis/qt_non_interactive_install.qs 0000644 0001750 0001750 00000003640 13166615412 024141 0 ustar qemu qemu function Controller() {
installer.autoRejectMessageBoxes();
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
//gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("HomeDir") + "/Qt");
gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("InstallerDirPath") + "/Qt");
//gui.currentPageWidget().TargetDirectoryLineEdit.setText("/scratch/Qt");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
widget.selectComponent("qt.58.android_armv7");
widget.selectComponent("qt.58.android_x86");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox)
checkBoxForm.launchQtCreatorCheckBox.checked = false;
gui.clickButton(buttons.FinishButton);
}
webcamoid-8.1.0+dfsg/ports/ci/travis/deploy.sh 0000755 0001750 0001750 00000001202 13166615412 017776 0 ustar qemu qemu #!/bin/bash
if [ "${TRAVIS_OS_NAME}" = linux ] && [ -z "${ANDROID_BUILD}" ]; then
EXEC="docker exec ${DOCKERSYS}"
fi
if [ "${ANDROID_BUILD}" = 1 ]; then
echo "Deploy not supported for Android"
elif [ "${TRAVIS_OS_NAME}" = linux ]; then
DEPLOYSCRIPT=dockerbuild.sh
cat << EOF > ${DEPLOYSCRIPT}
#!/bin/bash
export PATH="\$PWD/.local/bin:\$PATH"
xvfb-run --auto-servernum python3 ports/deploy/deploy.py
EOF
chmod +x ${DEPLOYSCRIPT}
${EXEC} bash ${DEPLOYSCRIPT}
elif [ "${TRAVIS_OS_NAME}" = osx ]; then
export DYLD_FRAMEWORK_PATH="$PWD/Syphon:$DYLD_FRAMEWORK_PATH"
${EXEC} python3 ports/deploy/deploy.py
fi
webcamoid-8.1.0+dfsg/ports/ci/travis/qtifw_non_interactive_install.qs 0000644 0001750 0001750 00000003041 13166615412 024642 0 ustar qemu qemu function Controller()
{
installer.autoRejectMessageBoxes;
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
installer.setMessageBoxAutomaticAnswer("stopProcessesForUpdates", QMessageBox.Ignore);
}
Controller.prototype.IntroductionPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
var page = gui.pageWidgetByObjectName("TargetDirectoryPage");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function()
{
var page = gui.pageWidgetByObjectName("ComponentSelectionPage");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function()
{
var page = gui.pageWidgetByObjectName("LicenseAgreementPage");
page.AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function()
{
var page = gui.pageWidgetByObjectName("StartMenuDirectoryPage");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.PerformInstallationPageCallback = function()
{
var page = gui.pageWidgetByObjectName("PerformInstallationPage");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function()
{
var page = gui.pageWidgetByObjectName("FinishedPage");
gui.clickButton(buttons.FinishButton);
}
webcamoid-8.1.0+dfsg/ports/ci/travis/install_deps.sh 0000755 0001750 0001750 00000014151 13166615412 021172 0 ustar qemu qemu #!/bin/bash
if [ "${TRAVIS_OS_NAME}" = linux ] && [ "${ANDROID_BUILD}" != 1 ]; then
mkdir -p .local/bin
# Install Qt Installer Framework
wget -c http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/QtInstallerFramework-linux-x64.run
chmod +x QtInstallerFramework-linux-x64.run
export QT_QPA_PLATFORM=minimal
./QtInstallerFramework-linux-x64.run \
--script "$PWD/ports/ci/travis/qtifw_non_interactive_install.qs" \
--no-force-installations
cp -vf ~/Qt/QtIFW-${QTIFWVER/-*/}/bin/* .local/bin/
# Install AppImageTool
wget -c -O .local/bin/appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/9/appimagetool-x86_64.AppImage
chmod +x .local/bin/appimagetool-x86_64.AppImage
cd .local/bin
./appimagetool-x86_64.AppImage --appimage-extract
cp -vf squashfs-root/usr/bin/* .
cd ../..
# Set default Docker command
EXEC="docker exec ${DOCKERSYS}"
fi
if [ "${ANDROID_BUILD}" = 1 ]; then
sudo apt-get -y install make
mkdir -p build
cd build
# Install Android NDK
wget -c https://dl.google.com/android/repository/android-ndk-${NDKVER}-linux-x86_64.zip
unzip -q android-ndk-${NDKVER}-linux-x86_64.zip
# Install Qt for Android
wget -c https://download.qt.io/archive/qt/${QTVER:0:3}/${QTVER}/qt-opensource-linux-x64-android-${QTVER}.run
chmod +x qt-opensource-linux-x64-android-${QTVER}.run
export QT_QPA_PLATFORM=minimal
./qt-opensource-linux-x64-android-${QTVER}.run \
--script "$PWD/../ports/ci/travis/qt_non_interactive_install.qs" \
--no-force-installations
elif [ "${DOCKERSYS}" = debian ]; then
${EXEC} apt-get -y update
if [ "${DOCKERIMG}" = ubuntu:trusty ]; then
${EXEC} apt-get -y install software-properties-common
${EXEC} add-apt-repository ppa:beineri/opt-qt58-trusty
elif [ "${DOCKERIMG}" = ubuntu:xenial ]; then
${EXEC} apt-get -y install software-properties-common
${EXEC} add-apt-repository ppa:beineri/opt-qt58-xenial
fi
${EXEC} apt-get -y update
${EXEC} apt-get -y upgrade
# Install dev tools
${EXEC} apt-get -y install \
xvfb \
g++ \
clang \
ccache \
make \
pkg-config \
linux-libc-dev \
libgl1-mesa-dev \
libpulse-dev \
libjack-dev \
libasound2-dev \
libv4l-dev \
libgstreamer-plugins-base1.0-dev
# Install Qt dev
if [ "${DOCKERIMG}" = ubuntu:trusty ] || \
[ "${DOCKERIMG}" = ubuntu:xenial ]; then
${EXEC} apt-get -y install \
qt58tools \
qt58declarative \
qt58multimedia \
qt58svg \
qt58quickcontrols \
qt58quickcontrols2 \
qt58graphicaleffects
else
${EXEC} apt-get -y install \
qt5-qmake \
qtdeclarative5-dev \
qtmultimedia5-dev \
libqt5opengl5-dev \
libqt5svg5-dev \
qml-module-qt-labs-folderlistmodel \
qml-module-qt-labs-settings \
qml-module-qtqml-models2 \
qml-module-qtquick-controls \
qml-module-qtquick-dialogs \
qml-module-qtquick-extras \
qml-module-qtquick-privatewidgets
fi
# Install FFmpeg dev
${EXEC} apt-get -y install \
libavcodec-dev \
libavdevice-dev \
libavformat-dev \
libavutil-dev \
libavresample-dev \
libswscale-dev
if [ "${DOCKERIMG}" != ubuntu:trusty ]; then
${EXEC} apt-get -y install \
libswresample-dev
fi
elif [ "${DOCKERSYS}" = fedora ]; then
${EXEC} dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORAVER}.noarch.rpm
${EXEC} dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORAVER}.noarch.rpm
${EXEC} dnf -y update
${EXEC} dnf -y install \
file \
which \
xorg-x11-xauth \
xorg-x11-server-Xvfb \
ccache \
clang \
make \
gcc-c++ \
qt5-qttools-devel \
qt5-qtdeclarative-devel \
qt5-qtmultimedia-devel \
qt5-qtsvg-devel \
qt5-qtquickcontrols \
qt5-qtgraphicaleffects \
ffmpeg-devel \
gstreamer1-plugins-base-devel \
libv4l-devel \
alsa-lib-devel \
pulseaudio-libs-devel \
jack-audio-connection-kit-devel
elif [ "${DOCKERSYS}" = opensuse ]; then
${EXEC} zypper -n update
${EXEC} zypper -n in \
which \
xauth \
xvfb-run \
python3 \
ccache \
clang \
libqt5-linguist \
libqt5-qtbase-devel \
libqt5-qtdeclarative-devel \
libqt5-qtmultimedia-devel \
libqt5-qtsvg-devel \
libqt5-qtquickcontrols \
libqt5-qtgraphicaleffects \
ffmpeg-devel \
gstreamer-plugins-base-devel \
libv4l-devel \
alsa-devel \
libpulse-devel \
libjack-devel
elif [ "${TRAVIS_OS_NAME}" = osx ]; then
brew install \
p7zip \
python3 \
ccache \
pkg-config \
qt5 \
ffmpeg \
gstreamer \
gst-plugins-base \
pulseaudio \
jack \
libuvc
# Install Qt Installer Framework
wget -c http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/QtInstallerFramework-mac-x64.dmg
7z x -oqtifw QtInstallerFramework-mac-x64.dmg
7z x -oqtifw qtifw/5.hfsx
chmod +x qtifw/QtInstallerFramework-mac-x64/QtInstallerFramework-mac-x64.app/Contents/MacOS/QtInstallerFramework-mac-x64
qtifw/QtInstallerFramework-mac-x64/QtInstallerFramework-mac-x64.app/Contents/MacOS/QtInstallerFramework-mac-x64 \
--script "$PWD/ports/ci/travis/qtifw_non_interactive_install.qs" \
--no-force-installations
# Install Syphon framework
wget -c https://github.com/Syphon/Simple/releases/download/version-3/Syphon.Simple.Apps.3.zip
unzip Syphon.Simple.Apps.3.zip
mkdir -p Syphon
cp -Rvf "Syphon Simple Apps/Simple Client.app/Contents/Frameworks/Syphon.framework" ./Syphon
fi
webcamoid-8.1.0+dfsg/ports/ci/appveyor/ 0000755 0001750 0001750 00000000000 13166615412 016505 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/ci/appveyor/deploy.bat 0000644 0001750 0001750 00000000132 13166615412 020465 0 ustar qemu qemu set MAKE_PATH=%TOOLSDIR%\bin\%MAKETOOL%.exe
C:\Python36\python.exe ports\deploy\deploy.py
webcamoid-8.1.0+dfsg/ports/ci/appveyor/build.bat 0000644 0001750 0001750 00000001670 13166615412 020300 0 ustar qemu qemu qmake Webcamoid.pro ^
CONFIG+=%CONFIGURATION% ^
PREFIX="%INSTALL_PREFIX%" ^
FFMPEGINCLUDES="%FFMPEG_DEV_PATH%\include" ^
FFMPEGLIBS=-L"%FFMPEG_DEV_PATH%\lib" ^
FFMPEGLIBS+=-lavcodec ^
FFMPEGLIBS+=-lavdevice ^
FFMPEGLIBS+=-lavformat ^
FFMPEGLIBS+=-lavutil ^
FFMPEGLIBS+=-lswresample ^
FFMPEGLIBS+=-lswscale ^
GSTREAMERINCLUDES="%GSTREAMER_DEV_PATH%\include" ^
GSTREAMERINCLUDES+="%GSTREAMER_DEV_PATH%\include\glib-2.0" ^
GSTREAMERINCLUDES+="%GSTREAMER_DEV_PATH%\lib\glib-2.0\include" ^
GSTREAMERINCLUDES+="%GSTREAMER_DEV_PATH%\include\gstreamer-1.0" ^
GSTREAMERLIBS=-L"%GSTREAMER_DEV_PATH%\lib2" ^
GSTREAMERLIBS+=-lgobject-2.0 ^
GSTREAMERLIBS+=-lglib-2.0 ^
GSTREAMERLIBS+=-lgstreamer-1.0 ^
GSTREAMERLIBS+=-lgstapp-1.0 ^
GSTREAMERLIBS+=-lgstpbutils-1.0 ^
GSTREAMERLIBS+=-lgstaudio-1.0 ^
GSTREAMERLIBS+=-lgstvideo-1.0
%MAKETOOL% -f Makefile qmake_all
%MAKETOOL% -j4
webcamoid-8.1.0+dfsg/ports/ci/appveyor/install_deps.bat 0000644 0001750 0001750 00000005366 13166615412 021670 0 ustar qemu qemu if "%PLATFORM%" == "x86" (
set FF_ARCH=win32
set GST_ARCH=x86
set VC_ARGS=x86
) else (
set FF_ARCH=win64
set GST_ARCH=x86_64
set VC_ARGS=amd64
)
rem Installing various utilities
choco install -y curl 7zip InnoSetup
if not "%VSVER%" == "" call "C:\Program Files (x86)\Microsoft Visual Studio %VSVER%.0\VC\vcvarsall" %VC_ARGS%
set PATH=%PATH%;"C:\Program Files\7-Zip";"C:\Program Files (x86)\Inno Setup 5";%QTDIR%\bin;%TOOLSDIR%\bin
rem Install FFmpeg development headers and libraries
set FFMPEG_DEV_FILE=ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-dev.zip
if not exist %FFMPEG_DEV_FILE% curl --retry 10 -kLOC - https://ffmpeg.zeranoe.com/builds/%FF_ARCH%/dev/%FFMPEG_DEV_FILE%
if exist %FFMPEG_DEV_FILE% 7z x %FFMPEG_DEV_FILE% -aoa
set FFMPEG_DEV_PATH=%CD%\ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-dev
rem Install FFmpeg binaries
set FFMPEG_BIN_FILE=ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-shared.zip
if not exist %FFMPEG_BIN_FILE% curl --retry 10 -kLOC - https://ffmpeg.zeranoe.com/builds/%FF_ARCH%/shared/%FFMPEG_BIN_FILE%
if exist %FFMPEG_BIN_FILE% 7z x %FFMPEG_BIN_FILE% -aoa
set PATH=%CD%\ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-shared\bin;%PATH%
rem Installing GStreamer development headers and libraries
set GSTREAMER_DEV_FILE=gstreamer-1.0-devel-%GST_ARCH%-%GSTREAMER_VERSION%.msi
if not exist %GSTREAMER_DEV_FILE% curl --retry 10 -kLOC - https://gstreamer.freedesktop.org/data/pkg/windows/%GSTREAMER_VERSION%/%GSTREAMER_DEV_FILE%
if exist %GSTREAMER_DEV_FILE% (
start /b /wait msiexec /i %CD%\%GSTREAMER_DEV_FILE% /quiet /qn /norestart
set GSTREAMER_DEV_PATH=C:\gstreamer\1.0\%GST_ARCH%
)
rem Copy necessary libraries to an alternative path to avoid conflicts with
rem Qt's MinGW system libraries
if exist %GSTREAMER_DEV_FILE% (
xcopy %GSTREAMER_DEV_PATH%\lib\*gobject-2.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*glib-2.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*gstreamer-1.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*gstapp-1.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*gstpbutils-1.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*gstaudio-1.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
xcopy %GSTREAMER_DEV_PATH%\lib\*gstvideo-1.0.* %GSTREAMER_DEV_PATH%\lib2 /i /y
)
rem Installing GStreamer binaries
set GSTREAMER_BIN_FILE=gstreamer-1.0-%GST_ARCH%-%GSTREAMER_VERSION%.msi
if not exist %GSTREAMER_BIN_FILE% curl --retry 10 -kLOC - https://gstreamer.freedesktop.org/data/pkg/windows/%GSTREAMER_VERSION%/%GSTREAMER_BIN_FILE%
if exist %GSTREAMER_BIN_FILE% (
start /b /wait msiexec /i %CD%\%GSTREAMER_BIN_FILE% /quiet /qn /norestart
set GSTREAMER_BIN_PATH=C:\gstreamer\1.0\%GST_ARCH%
)
set PATH=%PATH%;%GSTREAMER_BIN_PATH%\bin
webcamoid-8.1.0+dfsg/ports/debian/ 0000755 0001750 0001750 00000000000 13166615412 015467 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/debian/manpage.sgml.ex 0000644 0001750 0001750 00000011072 13166615412 020377 0 ustar qemu qemu manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
The docbook-to-man binary is found in the docbook-to-man package.
Please remember that if you create the nroff version in one of the
debian/rules file targets (such as build), you will need to include
docbook-to-man in your Build-Depends control field.
-->
FIRSTNAME">
SURNAME">
November 1, 2014">
SECTION">
hipersayan.x@gmail.com">
WEBCAMOID">
Debian">
GNU">
GPL">
]>
&dhemail;
&dhfirstname;
&dhsurname;
2003
&dhusername;
&dhdate;
&dhucpackage;
&dhsection;
&dhpackage;
program to do something
&dhpackage;
DESCRIPTION
This manual page documents briefly the
&dhpackage; and bar
commands.
This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in the &gnu;
Info format; see below.
&dhpackage; is a program that...
OPTIONS
These programs follow the usual &gnu; command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
Info files.
Show summary of options.
Show version of program.
SEE ALSO
bar (1), baz (1).
The programs are documented fully by The Rise and
Fall of a Fooish Bar available via the
Info system.
AUTHOR
This manual page was written by &dhusername; &dhemail; for
the &debian; system (and may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the &gnu; General Public License, Version 2 any
later version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL.
webcamoid-8.1.0+dfsg/ports/debian/preinst.ex 0000644 0001750 0001750 00000001264 13166615412 017514 0 ustar qemu qemu #!/bin/sh
# preinst script for webcamoid
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `install'
# * `install'
# * `upgrade'
# * `abort-upgrade'
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
webcamoid-8.1.0+dfsg/ports/debian/README.Debian 0000644 0001750 0001750 00000000275 13166615412 017534 0 ustar qemu qemu webcamoid for Debian
--------------------
-- Gonzalo Pedone Fri, 01 Nov 2014 17:40:31 -0300
webcamoid-8.1.0+dfsg/ports/debian/prerm.ex 0000644 0001750 0001750 00000001557 13166615412 017162 0 ustar qemu qemu #!/bin/sh
# prerm script for webcamoid
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `upgrade'
# * `failed-upgrade'
# * `remove' `in-favour'
# * `deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
webcamoid-8.1.0+dfsg/ports/debian/watch.ex 0000644 0001750 0001750 00000001431 13166615412 017132 0 ustar qemu qemu # Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
#
#http://www.example.com/downloads.php webcamoid-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/webcamoid-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/webcamoid-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/webcamoid/webcamoid-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html webcamoid-(.*)\.tar\.gz
webcamoid-8.1.0+dfsg/ports/debian/compat 0000644 0001750 0001750 00000000002 13166615412 016665 0 ustar qemu qemu 8
webcamoid-8.1.0+dfsg/ports/debian/postrm.ex 0000644 0001750 0001750 00000001644 13166615412 017356 0 ustar qemu qemu #!/bin/sh
# postrm script for webcamoid
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `purge'
# * `upgrade'
# * `failed-upgrade'
# * `abort-install'
# * `abort-install'
# * `abort-upgrade'
# * `disappear'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
webcamoid-8.1.0+dfsg/ports/debian/menu.ex 0000644 0001750 0001750 00000000204 13166615412 016765 0 ustar qemu qemu ?package(webcamoid):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\
title="webcamoid" command="/usr/bin/webcamoid"
webcamoid-8.1.0+dfsg/ports/debian/copyright 0000644 0001750 0001750 00000001637 13166615412 017431 0 ustar qemu qemu Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: webcamoid
Source: https://webcamoid.github.io/
Files: *
Copyright: 2014 Gonzalo Pedone
License: GPL-3+
Webcamoid, webcam capture application.
Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
.
Webcamoid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
Webcamoid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with Webcamoid. If not, see .
webcamoid-8.1.0+dfsg/ports/debian/changelog 0000644 0001750 0001750 00000000301 13166615412 017333 0 ustar qemu qemu webcamoid (8.1.0-1) stable; urgency=low
* Initial release (Closes: #nnnn)
-- Gonzalo Pedone Tue, 10 Oct 2017 12:00:00 -0300
webcamoid-8.1.0+dfsg/ports/debian/rules 0000755 0001750 0001750 00000003431 13166615412 016550 0 ustar qemu qemu #!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
build: build-stamp
build-stamp:
dh_testdir
# Add here commands to compile the package.
mkdir -p build
qmake -qt=5 Webcamoid.pro ROOT_METHOD=sudo
$(MAKE)
# --- end custom part for compiling
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
$(MAKE) clean || true
# --- end custom part for cleaning up
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package
# The DESTDIR Has To Be Exactly /usr/src/packages/BUILD/debian/
$(MAKE) INSTALL_ROOT="$(CURDIR)/debian/webcamoid" install
# --- end custom part for installing
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
dh_installcron
dh_installman
dh_installinfo
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
webcamoid-8.1.0+dfsg/ports/debian/source/ 0000755 0001750 0001750 00000000000 13166615412 016767 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/debian/source/format 0000644 0001750 0001750 00000000014 13166615412 020175 0 ustar qemu qemu 3.0 (quilt)
webcamoid-8.1.0+dfsg/ports/debian/manpage.xml.ex 0000644 0001750 0001750 00000025416 13166615412 020244 0 ustar qemu qemu
. will be generated. You may view the
manual page with: nroff -man . | less'. A typical entry
in a Makefile or Makefile.am is:
DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl
XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0"
manpage.1: manpage.xml
$(XP) $(DB2MAN) $<
The xsltproc binary is found in the xsltproc package. The XSL files are in
docbook-xsl. A description of the parameters you can use can be found in the
docbook-xsl-doc-* packages. Please remember that if you create the nroff
version in one of the debian/rules file targets (such as build), you will need
to include xsltproc and docbook-xsl in your Build-Depends control field.
Alternatively use the xmlto command/package. That will also automatically
pull in xsltproc and docbook-xsl.
Notes for using docbook2x: docbook2x-man does not automatically create the
AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as
... .
To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections
read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be
found in the docbook-xsl-doc-html package.
Validation can be done using: `xmllint -''-noout -''-valid manpage.xml`
General documentation about man-pages and man-page-formatting:
man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
-->
]>
&dhtitle;
&dhpackage;
&dhfirstname;
&dhsurname;
Wrote this manpage for the Debian system.
&dhemail;
2007
&dhusername;
This manual page was written for the Debian system
(and may be used by others).
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU General Public License,
Version 2 or (at your option) any later version published by
the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public
License can be found in
/usr/share/common-licenses/GPL.
&dhucpackage;
&dhsection;
&dhpackage;
program to do something
&dhpackage;
this
this
that
&dhpackage;
DESCRIPTION
This manual page documents briefly the
&dhpackage; and bar
commands.
This manual page was written for the Debian distribution
because the original program does not have a manual page.
Instead, it has documentation in the GNU
info
1
format; see below.
&dhpackage; is a program that...
OPTIONS
The program follows the usual GNU command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
info
1
files.
Does this and that.
Show summary of options.
Show version of program.
FILES
/etc/foo.conf
The system-wide configuration file to control the
behaviour of &dhpackage;. See
foo.conf
5
for further details.
${HOME}/.foo.conf
The per-user configuration file to control the
behaviour of &dhpackage;. See
foo.conf
5
for further details.
ENVIRONMENT
FOO_CONF
If used, the defined file is used as configuration
file (see also ).
DIAGNOSTICS
The following diagnostics may be issued
on stderr:
Bad configuration file. Exiting.
The configuration file seems to contain a broken configuration
line. Use the option, to get more info.
&dhpackage; provides some return codes, that can
be used in scripts:
Code
Diagnostic
0
Program exited successfully.
1
The configuration file seems to be broken.
BUGS
The program is currently limited to only work
with the foobar library.
The upstreams BTS can be found
at .
SEE ALSO
bar
1
,
baz
1
,
foo.conf
5
The programs are documented fully by The Rise and
Fall of a Fooish Bar available via the
info
1
system.
webcamoid-8.1.0+dfsg/ports/debian/init.d.ex 0000644 0001750 0001750 00000011131 13166615412 017207 0 ustar qemu qemu #!/bin/sh
### BEGIN INIT INFO
# Provides: webcamoid
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description:
# Description:
# <...>
# <...>
### END INIT INFO
# Author: Gonzalo Pedone
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=webcamoid # Introduce a short description here
NAME=webcamoid # Introduce the short server's name here
DAEMON=/usr/sbin/webcamoid # Introduce the server's location here
DAEMON_ARGS="" # Arguments to run the daemon with
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x $DAEMON ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# The above code will not work for interpreted scripts, use the next
# six lines below instead (Ref: #643337, start-stop-daemon(8) )
#start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
# --name $NAME --test > /dev/null \
# || return 1
#start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON \
# --name $NAME -- $DAEMON_ARGS \
# || return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
webcamoid-8.1.0+dfsg/ports/debian/control 0000644 0001750 0001750 00000003051 13166615412 017071 0 ustar qemu qemu Source: webcamoid
Section: video
Priority: extra
Maintainer: Gonzalo Pedone
Build-Depends: debhelper (>= 8.0.0),
pkg-config,
linux-libc-dev,
qt5-qmake,
qtdeclarative5-dev,
qtmultimedia5-dev,
libqt5opengl5-dev,
libqt5svg5-dev,
libavcodec-dev,
libavdevice-dev,
libavformat-dev,
libavutil-dev,
libswresample-dev,
libswscale-dev,
libgstreamer-plugins-base1.0-dev,
libpulse-dev,
libjack-dev,
libasound2-dev,
libv4l-dev
Standards-Version: 3.9.4
Homepage: https://webcamoid.github.io/
#Vcs-Git: git://github.com/webcamoid/webcamoid.git
#Vcs-Browser: https://github.com/webcamoid/webcamoid
Package: webcamoid
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
qml-module-qtquick-dialogs,
qml-module-qtquick-controls,
qml-module-qtquick-layouts,
qml-module-qtquick-window2,
libqt5svg5,
libqt5opengl5,
libavcodec56,
libavdevice56,
libavformat56,
libavutil54,
libswresample1,
libswscale3,
libgstreamer-plugins-base1.0-0,
libpulse0,
libjack0,
libasound2,
libv4l-0
Suggests:
v4l2loopback-utils
Description: Webcamoid is a full featured webcam capture application.
Features:
.
* Cross-platform (GNU/Linux, Windows)
* Take pictures and record videos with the webcam.
* Manages multiple webcams.
* Written in C++/Qt.
* Custom controls for each webcam.
* Add funny effects to the webcam.
* +60 effects available.
* Translated to many languages.
* Use custom network and local files as capture devices.
* Capture from desktop.
* Many recording formats.
* Virtual webcam support for feeding other programs.
webcamoid-8.1.0+dfsg/ports/debian/webcamoid.cron.d.ex 0000644 0001750 0001750 00000000211 13166615412 021133 0 ustar qemu qemu #
# Regular cron jobs for the webcamoid package
#
0 4 * * * root [ -x /usr/bin/webcamoid_maintenance ] && /usr/bin/webcamoid_maintenance
webcamoid-8.1.0+dfsg/ports/debian/README.source 0000644 0001750 0001750 00000000305 13166615412 017644 0 ustar qemu qemu webcamoid for Debian
--------------------
webcamoid-8.1.0+dfsg/ports/debian/webcamoid.default.ex 0000644 0001750 0001750 00000000361 13166615412 021402 0 ustar qemu qemu # Defaults for webcamoid initscript
# sourced by /etc/init.d/webcamoid
# installed at /etc/default/webcamoid by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
webcamoid-8.1.0+dfsg/ports/debian/webcamoid.doc-base.EX 0000644 0001750 0001750 00000001031 13166615412 021326 0 ustar qemu qemu Document: webcamoid
Title: Debian webcamoid Manual
Author:
Abstract: This manual describes what webcamoid is
and how it can be used to
manage online manuals on Debian systems.
Section: unknown
Format: debiandoc-sgml
Files: /usr/share/doc/webcamoid/webcamoid.sgml.gz
Format: postscript
Files: /usr/share/doc/webcamoid/webcamoid.ps.gz
Format: text
Files: /usr/share/doc/webcamoid/webcamoid.text.gz
Format: HTML
Index: /usr/share/doc/webcamoid/html/index.html
Files: /usr/share/doc/webcamoid/html/*.html
webcamoid-8.1.0+dfsg/ports/debian/postinst.ex 0000644 0001750 0001750 00000001677 13166615412 017723 0 ustar qemu qemu #!/bin/sh
# postinst script for webcamoid
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `configure'
# * `abort-upgrade'
# * `abort-remove' `in-favour'
#
# * `abort-remove'
# * `abort-deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
webcamoid-8.1.0+dfsg/ports/debian/docs 0000644 0001750 0001750 00000000017 13166615412 016340 0 ustar qemu qemu README.md
TODO
webcamoid-8.1.0+dfsg/ports/debian/manpage.1.ex 0000644 0001750 0001750 00000003164 13166615412 017600 0 ustar qemu qemu .\" Hey, EMACS: -*- nroff -*-
.\" (C) Copyright 2014 Gonzalo Pedone ,
.\"
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH WEBCAMOID SECTION "November 1, 2014"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
webcamoid \- program to do something
.SH SYNOPSIS
.B webcamoid
.RI [ options ] " files" ...
.br
.B bar
.RI [ options ] " files" ...
.SH DESCRIPTION
This manual page documents briefly the
.B webcamoid
and
.B bar
commands.
.PP
.\" TeX users may be more comfortable with the \fB\fP and
.\" \fI\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBwebcamoid\fP is a program that...
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.BR bar (1),
.BR baz (1).
.br
The programs are documented fully by
.IR "The Rise and Fall of a Fooish Bar" ,
available via the Info system.
webcamoid-8.1.0+dfsg/ports/homebrew/ 0000755 0001750 0001750 00000000000 13166615412 016055 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/homebrew/webcamoid.rb 0000644 0001750 0001750 00000001651 13166615412 020337 0 ustar qemu qemu class Webcamoid < Formula
desc "Webcamoid is a full featured webcam capture application."
homepage "https://webcamoid.github.io/"
url "https://github.com/webcamoid/webcamoid/archive/8.1.0.zip"
version "8.1.0"
sha256 "b8ee97a40a3d6c6a522b5e544c67af2dacae0a606b341716cacc62a21d90b68b"
depends_on "pkg-config" => :build
depends_on "qt5"
depends_on "ffmpeg"
depends_on "libuvc" => :optional
def install
if ENV.compiler == :clang
spec = "macx-clang"
else
spec = "macx-g++"
end
args = %W[
-config release
-spec #{spec}
CONFIG-=app_bundle
PREFIX=#{prefix}
]
system "qmake", "Webcamoid.pro", *args
system "make"
system "make", "install"
end
test do
ENV["DYLD_LIBRARY_PATH"] = "#{lib}"
system "#{libexec}/webcamoid", "--version"
end
end
webcamoid-8.1.0+dfsg/ports/rpm/ 0000755 0001750 0001750 00000000000 13166615412 015043 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/rpm/webcamoid.spec 0000644 0001750 0001750 00000013362 13166615412 017656 0 ustar qemu qemu Name: webcamoid
Version: 8.1.0
Release: 1%{?dist}
Summary: The full webcam and multimedia suite
%if %{defined fedora}
Group: Applications/Multimedia
License: GPL
%endif
%if %{defined suse_version}
Group: Productivity/Multimedia/Video/Players
License: GPL-3.0+
%endif
Url: https://webcamoid.github.io/
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# AutoReqProv: no
%if %{defined fedora}
Requires: v4l2loopback
BuildRequires: fdupes
BuildRequires: make
BuildRequires: gcc-c++
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qtdeclarative-devel
BuildRequires: qt5-qtmultimedia-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: ffmpeg-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: libv4l-devel
BuildRequires: alsa-lib-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: jack-audio-connection-kit-devel
%endif
%if %{defined suse_version}
Requires: v4l2loopback-utils
BuildRequires: fdupes
BuildRequires: update-desktop-files
BuildRequires: libqt5-linguist
BuildRequires: libqt5-qtbase-devel
BuildRequires: libqt5-qtdeclarative-devel
BuildRequires: libqt5-qtmultimedia-devel
BuildRequires: libqt5-qtsvg-devel
BuildRequires: ffmpeg-devel
BuildRequires: gstreamer-plugins-base-devel
BuildRequires: libv4l-devel
BuildRequires: alsa-devel
BuildRequires: libpulse-devel
BuildRequires: libjack-devel
%endif
Conflicts: plasmoid-webcamoid
%description
Webcamoid is a full featured webcam capture application.
Features:
* Cross-platform (GNU/Linux, Windows)
* Take pictures and record videos with the webcam.
* Manages multiple webcams.
* Written in C++/Qt.
* Custom controls for each webcam.
* Add funny effects to the webcam.
* +60 effects available.
* Translated to many languages.
* Use custom network and local files as capture devices.
* Capture from desktop.
* Many recording formats.
* Virtual webcam support for feeding other programs.
%package -n libavkys7
Version: 8.1.0
Summary: Modular audio and video processing library
%description -n libavkys7
LibAvKys is a Qt library that provides a wide range of plugins for audio and video playing, recording, capture, and processing.
%package -n akqml
Version: 8.1.0
Summary: Modular audio and video processing library (qml files)
%description -n akqml
LibAvKys is a Qt library that provides a wide range of plugins for audio and video playing, recording, capture, and processing.
%package -n libavkys-devel
Version: 8.1.0
Summary: Modular audio and video processing library (development files)
%if %{defined fedora}
Group: Development/Libraries
%endif
%if %{defined suse_version}
Group: Development/Libraries/Other
%endif
%description -n libavkys-devel
LibAvKys is a Qt library that provides a wide range of plugins for audio and video playing, recording, capture, and processing.
%package -n avkys-plugins
Version: 8.1.0
Summary: Modular audio and video processing library (plugins)
%description -n avkys-plugins
LibAvKys is a Qt library that provides a wide range of plugins for audio and video playing, recording, capture, and processing.
%prep
%setup -q -n %{name}-%{version}
# delete not needed files
find . -name ".gitignore" -exec rm {} \;
%build
%if %{defined fedora}
qmake-qt5 Webcamoid.pro \
LIBDIR=%{_libdir} \
LICENSEDIR=%{_defaultdocdir}/webcamoid \
INSTALLDEVHEADERS=1
%endif
%if %{defined suse_version}
qmake-qt5 Webcamoid.pro \
LIBDIR=%{_libdir} \
LICENSEDIR=%{_defaultdocdir}/webcamoid \
INSTALLDEVHEADERS=1
%endif
%if !%{defined fedora} && !%{defined suse_version}}
qmake -qt=5 Webcamoid.pro \
ROOT_METHOD=sudo \
INSTALLDEVHEADERS=1
%endif
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make INSTALL_ROOT="%{buildroot}" install
%fdupes %{buildroot}
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n libavkys7 -p /sbin/ldconfig
%postun -n libavkys7 -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%{_bindir}/webcamoid
%{_datadir}/applications/webcamoid.desktop
%{_datadir}/icons/hicolor/8x8/
%{_datadir}/icons/hicolor/8x8/apps/
%{_datadir}/icons/hicolor/8x8/apps/webcamoid.png
%{_datadir}/icons/hicolor/16x16/
%{_datadir}/icons/hicolor/16x16/apps/
%{_datadir}/icons/hicolor/16x16/apps/webcamoid.png
%{_datadir}/icons/hicolor/22x22/
%{_datadir}/icons/hicolor/22x22/apps/
%{_datadir}/icons/hicolor/22x22/apps/webcamoid.png
%{_datadir}/icons/hicolor/32x32/
%{_datadir}/icons/hicolor/32x32/apps/
%{_datadir}/icons/hicolor/32x32/apps/webcamoid.png
%{_datadir}/icons/hicolor/48x48/
%{_datadir}/icons/hicolor/48x48/apps/
%{_datadir}/icons/hicolor/48x48/apps/webcamoid.png
%{_datadir}/icons/hicolor/64x64/
%{_datadir}/icons/hicolor/64x64/apps/
%{_datadir}/icons/hicolor/64x64/apps/webcamoid.png
%{_datadir}/icons/hicolor/128x128/
%{_datadir}/icons/hicolor/128x128/apps/
%{_datadir}/icons/hicolor/128x128/apps/webcamoid.png
%{_datadir}/icons/hicolor/256x256/
%{_datadir}/icons/hicolor/256x256/apps/
%{_datadir}/icons/hicolor/256x256/apps/webcamoid.png
%{_datadir}/icons/hicolor/scalable/
%{_datadir}/icons/hicolor/scalable/apps/
%{_datadir}/icons/hicolor/scalable/apps/webcamoid.svg
%{_defaultdocdir}/webcamoid/
%{_defaultdocdir}/webcamoid/COPYING
%{_mandir}/man1/webcamoid.1.gz
%files -n libavkys7
%defattr(-,root,root,-)
%{_libdir}/libavkys.so.8.1.0
%{_defaultdocdir}/avkys/COPYING
%files -n akqml
%defattr(-,root,root,-)
%{_libdir}/qt5/qml/AkQml/
%{_libdir}/qt5/qml/AkQml/libAkQml.so
%{_libdir}/qt5/qml/AkQml/qmldir
%files -n libavkys-devel
%defattr(-,root,root,-)
%{_includedir}/avkys
%{_includedir}/avkys/*.h
%{_libdir}/libavkys.so
%{_libdir}/libavkys.so.8
%{_libdir}/libavkys.so.8.1
%files -n avkys-plugins
%defattr(-,root,root,-)
%{_libdir}/avkys
%{_libdir}/avkys/lib*.so
%changelog
* Tue Oct 10 2017 Gonzalo Exequiel Pedone 8.1.0-1
- New release
webcamoid-8.1.0+dfsg/ports/mingw/ 0000755 0001750 0001750 00000000000 13166615412 015366 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/mingw/build.bat 0000755 0001750 0001750 00000002374 13166615412 017166 0 ustar qemu qemu set PLATFORM=x86
set FFMPEG_VERSION=3.2.2
set QMAKESPEC=win32-g++
set MAKETOOL=mingw32-make
set QTDIR=C:\Qt\5.8\mingw53_32
set TOOLSDIR=C:\Qt\Tools\mingw530_32
set CONFIGURATION=release
if "%PLATFORM%" == "x86" (
set FF_ARCH=win32
set GST_ARCH=x86
set VC_ARGS=x86
) else (
set FF_ARCH=win64
set GST_ARCH=x86_64
set VC_ARGS=amd64
)
rem Installing various utilities
if not "%VSVER%" == "" call "C:\Program Files (x86)\Microsoft Visual Studio %VSVER%.0\VC\vcvarsall" %VC_ARGS%
set PATH=%PATH%;"C:\Program Files\7-Zip";%QTDIR%\bin;%TOOLSDIR%\bin
rem Installing FFmpeg dev
set FFMPEG_FILE=ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-dev.zip
if not exist %FFMPEG_FILE% wget -c https://ffmpeg.zeranoe.com/builds/%FF_ARCH%/dev/%FFMPEG_FILE%
if exist %FFMPEG_FILE% 7z x %FFMPEG_FILE%
set FFMPEG_DEV_PATH=%CD%\ffmpeg-%FFMPEG_VERSION%-%FF_ARCH%-dev
rem Start build
set SOURCES_DIR=%CD%\..\..
qmake %SOURCES_DIR%\Webcamoid.pro ^
CONFIG+=%CONFIGURATION% ^
FFMPEGINCLUDES="%FFMPEG_DEV_PATH%\include" ^
FFMPEGLIBS=-L"%FFMPEG_DEV_PATH%\lib" ^
FFMPEGLIBS+=-lavcodec ^
FFMPEGLIBS+=-lavdevice ^
FFMPEGLIBS+=-lavformat ^
FFMPEGLIBS+=-lavutil ^
FFMPEGLIBS+=-lswresample ^
FFMPEGLIBS+=-lswscale
%MAKETOOL% -j4
%MAKETOOL% install
pause
webcamoid-8.1.0+dfsg/ports/archlinux/ 0000755 0001750 0001750 00000000000 13166615412 016242 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/archlinux/PKGBUILD 0000644 0001750 0001750 00000003134 13166615412 017367 0 ustar qemu qemu # Maintainer: Gonzalo Exequiel Pedone
pkgname=webcamoid
pkgver=8.1.0
pkgrel=1
pkgdesc="Webcamoid is a full featured webcam capture application."
url='https://webcamoid.github.io/'
license=('GPL')
arch=('i686' 'x86_64' 'armv6h')
depends=('qt5-quickcontrols'
'qt5-svg')
optdepends=('v4l-utils: Extra formats support for webcams'
'v4l2loopback-dkms: Virtual camera support'
'ffmpeg: Video playing/recording/conversion (Recommended)'
'gst-plugins-base: Video playing/recording/conversion'
'gst-plugins-good: Video playing/recording/conversion'
'gst-plugins-bad: Video playing/recording/conversion'
'gst-plugins-ugly: Video playing/recording/conversion'
'libpulse: Audio playback (Recommended)'
'alsa-lib: Audio playback'
'jack: Audio playback'
'qt5-multimedia: Audio playback'
'kde-cli-tools: Root privileges for virtual camera module (Recommended)'
'gksu: Root privileges for virtual camera module')
makedepends=('v4l-utils'
'qt5-tools'
'qt5-multimedia'
'ffmpeg'
'gst-plugins-base-libs'
'libpulse'
'alsa-lib'
'jack')
provides=('webcamoid')
install="${pkgrealname}.install"
source=("https://github.com/${pkgname}/${pkgname}/archive/${pkgver}.tar.gz")
md5sums=('SKIP')
build() {
cd "$srcdir/${pkgname}-${pkgver}"
qmake-qt5 Webcamoid.pro
make
}
package() {
cd "$srcdir/${pkgname}-${pkgver}"
make INSTALL_ROOT="${pkgdir}" install
}
webcamoid-8.1.0+dfsg/ports/archlinux/webcamoid.install 0000644 0001750 0001750 00000000701 13166615412 021562 0 ustar qemu qemu post_install() {
cat << EOF
Webcamoid requires at least one of the packages from each of the
following groups to be installed for fully functioning.
Capture backend:
- v4l-utils (RECOMMENDED)
Codec frameworks:
- ffmpeg (RECOMMENDED)
- gst-plugins-*
Audio playback:
- libpulse (RECOMMENDED)
- alsa-lib
- jack
- qt5-multimedia
Virtual camera management:
- kde-cli-tools (RECOMMENDED)
- gksu
EOF
}
webcamoid-8.1.0+dfsg/ports/deploy/ 0000755 0001750 0001750 00000000000 13166615412 015541 5 ustar qemu qemu webcamoid-8.1.0+dfsg/ports/deploy/installscript.windows.qs 0000644 0001750 0001750 00000001007 13166615412 022470 0 ustar qemu qemu function Component()
{
}
Component.prototype.beginInstallation = function()
{
component.beginInstallation();
}
Component.prototype.createOperations = function()
{
component.createOperations();
// Create shortcuts.
var installDir = ["@TargetDir@", "@StartMenuDir@", "@DesktopDir@"];
for (var dir in installDir)
component.addOperation("CreateShortcut",
"@TargetDir@/bin/webcamoid.exe",
installDir[dir] + "/webcamoid.lnk");
}
webcamoid-8.1.0+dfsg/ports/deploy/installscript.mac.qs 0000644 0001750 0001750 00000000315 13166615412 021537 0 ustar qemu qemu function Component()
{
}
Component.prototype.beginInstallation = function()
{
component.beginInstallation();
}
Component.prototype.createOperations = function()
{
component.createOperations();
}
webcamoid-8.1.0+dfsg/ports/deploy/deploy.py 0000755 0001750 0001750 00000006774 13166615412 017430 0 ustar qemu qemu #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
import os
import sys
import platform
class Deploy:
def __init__(self):
self.rootDir = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
self.arch = platform.architecture()[0]
if os.name == 'posix':
if sys.platform.startswith('darwin'):
self.system = 'mac'
else:
self.system = 'posix'
elif os.name == 'nt' and sys.platform.startswith('win32'):
self.system = 'windows'
else:
self.system = 'unknown'
fileName, ext = os.path.splitext(os.path.basename(__file__))
self.platformDeploy = __import__('_'.join([fileName, self.system])) \
.Deploy(self.rootDir, self.system, self.arch)
self.targetSystem = self.platformDeploy.targetSystem
if self.targetSystem != self.system:
self.platformDeploy = __import__('_'.join([fileName, self.system, self.targetSystem])) \
.Deploy(self.rootDir, self.system, self.targetSystem, self.arch)
self.scanPaths = self.platformDeploy.scanPaths
self.targetArch = self.platformDeploy.targetArch
self.programVersion = self.platformDeploy.programVersion
self.qmake = self.platformDeploy.qmake
def __str__(self):
deployInfo = 'Python version: {}\n' \
'Root directory: {}\n' \
'System: {}\n' \
'Architecture: {}\n' \
'Target system: {}\n' \
'Target architecture: {}\n' \
'Scan paths: {}\n' \
'Program version: {}\n' \
'Qmake executable: {}'. \
format(platform.python_version(),
self.rootDir,
self.system,
self.arch,
self.targetSystem,
self.targetArch,
self.scanPaths,
self.programVersion,
self.qmake)
return deployInfo
def prepare(self):
print('\nPreparing for software packaging\n')
self.platformDeploy.prepare()
def solvedeps(self):
self.platformDeploy.solvedeps()
def finish(self):
self.platformDeploy.finish()
def package(self):
self.platformDeploy.package()
def cleanup(self):
self.platformDeploy.cleanup()
if __name__ =='__main__':
deploy = Deploy()
print('\nDeploy info\n')
print(deploy)
deploy.prepare()
deploy.solvedeps()
deploy.finish()
deploy.package()
deploy.cleanup()
webcamoid-8.1.0+dfsg/ports/deploy/deploy_posix_windows.py 0000755 0001750 0001750 00000071437 13166615412 022422 0 ustar qemu qemu #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
import math
import mimetypes
import multiprocessing
import os
import platform
import re
import shutil
import struct
import subprocess
import sys
import threading
import time
import zipfile
class Deploy:
def __init__(self, rootDir, system, targetSystem, arch):
self.scanPaths = ['StandAlone/webcamoid.exe',
'StandAlone/share/qml',
'libAvKys/Plugins']
self.rootDir = rootDir
self.system = system
self.arch = arch
self.targetSystem = targetSystem
self.targetArch = self.detectArch()
self.wineCmd = 'wine64' if self.targetArch == '64bit' and shutil.which('wine64') else 'wine'
self.qmake = self.detectQmake()
self.qtIFW = self.detectQtIFW()
self.qtIFWVersion = self.detectQtIFWVersion()
self.programVersion = self.readVersion()
self.installerIconSize = 256
self.njobs = multiprocessing.cpu_count()
if self.njobs < 4:
self.njobs = 4
def detectArch(self):
exeFile = os.path.join(self.rootDir, self.scanPaths[0])
process = subprocess.Popen(['file', '-b', exeFile],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return '64bit' if b'x86-64' in stdout else '32bit'
def readVersion(self):
tempDir = os.path.join(self.rootDir, 'ports/deploy/temp_priv')
wineRootDir = 'Z:{}'.format(self.rootDir).replace('/', '\\')
wineTempDir = 'Z:{}'.format(tempDir).replace('/', '\\')
if not os.path.exists(tempDir):
os.makedirs(tempDir)
process = subprocess.Popen([self.qmake, '-query', 'QT_INSTALL_BINS'],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
where = 'Z:{}'.format(stdout.strip().decode('utf-8').replace('/', '\\'))
versionBat = os.path.join(tempDir, 'version.bat')
programName = os.path.basename(self.scanPaths[0]).replace('.exe', '')
with open(versionBat, 'w') as f:
f.write('@echo off\n')
f.write('SET PATH={0}\\StandAlone;{0}\\libAvKys\Lib;{1};%PATH%\n'.format(wineRootDir, where))
f.write('@echo on\n')
f.write('{0} --version > "{1}\\version.txt"\n'.format(programName, wineTempDir))
subprocess.run(['wineconsole', '--backend=curses', versionBat],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
with open(os.path.join(tempDir, 'version.txt')) as f:
version = f.readline();
shutil.rmtree(tempDir)
try:
return version.split()[1].strip()
except:
return 'unknown'
def detectQmake(self):
if 'QMAKE_PATH' in os.environ:
return os.environ['QMAKE_PATH']
with open(os.path.join(self.rootDir, 'StandAlone/Makefile')) as f:
for line in f:
if line.startswith('QMAKE'):
return line.split('=')[1].strip()
return ''
def detectQtIFW(self):
if 'BINARYCREATOR' in os.environ:
return os.environ['BINARYCREATOR']
for root, dirs, files in os.walk(os.path.expanduser('~/.wine/drive_c/Qt')):
for f in files:
if f == 'binarycreator.exe':
return os.path.join(root, f)
return self.whereExe('binarycreator.exe')
def detectQtIFWVersion(self):
installerBase = os.path.join(os.path.dirname(self.qtIFW),
'installerbase.exe')
if not os.path.exists(installerBase):
return '2.0.0'
process = subprocess.Popen([self.wineCmd, installerBase,
'--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
for line in stdout.split(b'\n'):
if b'IFW Version:' in line:
return line.split(b' ')[2].replace(b'"', b'').decode(sys.getdefaultencoding())
return version
def qmakeQuery(self, var):
process = subprocess.Popen([self.qmake, '-query', var],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout.strip().decode(sys.getdefaultencoding())
def copy(self, src, dst):
if not os.path.exists(src):
return
basename = os.path.basename(src)
dstpath = os.path.join(dst, basename) if os.path.isdir(dst) else dst
dstdir = dst if os.path.isdir(dst) else os.path.dirname(dst)
if os.path.islink(src):
rsrc = os.path.realpath(src)
rbasename = os.path.basename(rsrc)
rdstpath = os.path.join(dstdir, rbasename)
if not os.path.exists(rdstpath):
shutil.copy(rsrc, rdstpath)
if not os.path.exists(dstpath):
os.symlink(os.path.join('.', rbasename), dstpath)
elif not os.path.exists(dstpath):
shutil.copy(src, dst)
def removeUnneededFiles(self, path):
afiles = set()
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith('.a') \
or f.endswith('.static.prl') \
or f.endswith('.pdb') \
or f.endswith('.lib'):
afiles.add(os.path.join(root, f))
for afile in afiles:
os.remove(afile)
def prepare(self):
self.sysBinsPath = self.qmakeQuery('QT_INSTALL_BINS')
self.sysQmlPath = self.qmakeQuery('QT_INSTALL_QML')
self.sysPluginsPath = self.qmakeQuery('QT_INSTALL_PLUGINS')
self.installDir = os.path.join(self.rootDir, 'ports/deploy/temp_priv/root')
self.pkgsDir = os.path.join(self.rootDir, 'ports/deploy/packages_auto/windows')
previousDir = os.getcwd()
os.chdir(self.rootDir)
process = subprocess.Popen(['make', 'INSTALL_ROOT={}'.format(self.installDir), 'install'],
stdout=subprocess.PIPE)
process.communicate()
os.chdir(previousDir)
def modulePath(self, importLine):
imp = importLine.strip().split()
path = imp[1].replace('.', '/')
majorVersion = imp[2].split('.')[0]
if int(majorVersion) > 1:
path += '.{}'.format(majorVersion)
return path
def scanImports(self, path):
if not os.path.isfile(path):
return []
fileName = os.path.basename(path)
imports = set()
if fileName.endswith('.qml'):
with open(path, 'rb') as f:
for line in f:
if re.match(b'^import \\w+' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
elif fileName == 'qmldir':
with open(path, 'rb') as f:
for line in f:
if re.match(b'^depends ' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
return list(imports)
def listQmlFiles(self, path):
qmlFiles = set()
if os.path.isfile(path):
baseName = os.path.basename(path)
if baseName == 'qmldir' or path.endswith('.qml'):
qmlFiles.add(path)
else:
for root, dirs, files in os.walk(os.path.join(self.rootDir, path)):
for f in files:
if f == 'qmldir' or f.endswith('.qml'):
qmlFiles.add(os.path.join(root, f))
return list(qmlFiles)
def solvedepsQml(self):
print('Copying Qml modules\n')
qmlFiles = set()
for path in self.scanPaths:
path = os.path.join(self.rootDir, path)
for f in self.listQmlFiles(path):
qmlFiles.add(f)
qmlPath = os.path.join(self.installDir, 'webcamoid/lib/qt/qml')
print(qmlPath)
solved = set()
solvedImports = set()
while len(qmlFiles) > 0:
qmlFile = qmlFiles.pop()
for imp in self.scanImports(qmlFile):
if imp in solvedImports:
continue
sysModulePath = os.path.join(self.sysQmlPath, imp)
installModulePath = os.path.join(qmlPath, imp)
if os.path.exists(sysModulePath):
print(' {} -> {}'.format(sysModulePath, installModulePath))
path = installModulePath[: installModulePath.rfind(os.sep)]
if not os.path.exists(path):
os.makedirs(path)
try:
shutil.copytree(sysModulePath, installModulePath, True)
except:
pass
solvedImports.add(imp)
for f in self.listQmlFiles(sysModulePath):
if not f in solved:
qmlFiles.add(f)
solved.add(qmlFile)
def isExe(self, path):
mimetype, encoding = mimetypes.guess_type(path)
if mimetype == 'application/x-msdownload':
return True
return False
def findExes(self, path):
exes = []
for root, dirs, files in os.walk(path):
for f in files:
exePath = os.path.join(root, f)
if not os.path.islink(exePath) and self.isExe(exePath):
exes.append(exePath)
return exes
def whereExe(self, exe):
path = os.path.join(self.sysBinsPath, exe)
return path if os.path.exists(path) else ''
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx
# https://upload.wikimedia.org/wikipedia/commons/1/1b/Portable_Executable_32_bit_Structure_in_SVG_fixed.svg
def exeDump(self, exe):
dllImports = set()
with open(exe, 'rb') as f:
# Check DOS header signature.
if f.read(2) != b'MZ':
return []
# Move to COFF header.
f.seek(0x3c, os.SEEK_SET)
peHeaderOffset = struct.unpack('I', f.read(4))
f.seek(peHeaderOffset[0], os.SEEK_SET)
peSignatue = f.read(4)
# Check COFF header signature.
if peSignatue != b'PE\x00\x00':
return []
# Read COFF header.
coffHeader = struct.unpack('HHIIIHH', f.read(20))
nSections = coffHeader[1]
sectionTablePos = coffHeader[5] + f.tell()
# Read magic signature in standard COFF fields.
peType = 'PE32' if f.read(2) == b'\x0b\x01' else 'PE32+'
# Move to data directories.
f.seek(102 if peType == 'PE32' else 118, os.SEEK_CUR)
# Read the import table.
importTablePos, importTableSize = struct.unpack('II', f.read(8))
# Move to Sections table.
f.seek(sectionTablePos, os.SEEK_SET)
sections = []
idataTableVirtual = -1
idataTablePhysical = -1
# Search for 'idata' section.
for i in range(nSections):
# Read section.
section = struct.unpack('8pIIIIIIHHI', f.read(40))
sectionName = section[0].replace(b'\x00', b'')
# Save a reference to the sections.
sections += [section]
if sectionName == b'idata' or sectionName == b'rdata':
idataTableVirtual = section[2]
idataTablePhysical = section[4]
# If import table was defined calculate it's position in
# the file in relation to the address given by 'idata'.
if importTableSize > 0:
idataTablePhysical += importTablePos - section[2]
if idataTablePhysical < 0:
return []
# Move to 'idata' section.
f.seek(idataTablePhysical, os.SEEK_SET)
dllList = set()
# Read 'idata' directory table.
while True:
# Read DLL entries.
dllImport = struct.unpack('IIIII', f.read(20))
# Null directory entry.
if dllImport[0] | dllImport[1] | dllImport[2] | dllImport[3] | dllImport[4] == 0:
break
# Locate where is located the DLL name in relation to the
# sections.
for section in sections:
if dllImport[3] >= section[2] \
and dllImport[3] < section[1] + section[2]:
dllList.add(dllImport[3] - section[2] + section[4])
break
for dll in dllList:
# Move to DLL name.
f.seek(dll, os.SEEK_SET)
dllName = b''
# Read string until null character.
while True:
c = f.read(1)
if c == b'\x00':
break
dllName += c
dllImports.add(dllName.decode(sys.getdefaultencoding()))
return dllImports
def listDependencies(self, path):
libs = []
for exe in self.exeDump(path):
lib = self.whereExe(exe)
if len(lib) > 0:
libs.append(lib)
return libs
def libName(self, lib):
dep = os.path.basename(lib)
return dep[: dep.find('.')]
def solvedepsPlugins(self):
print('\nCopying required plugins\n')
pluginsMap = {
'Qt53DRenderer': ['sceneparsers'],
'Qt5Declarative': ['qml1tooling'],
'Qt5EglFSDeviceIntegration': ['egldeviceintegrations'],
'Qt5Gui': ['accessible', 'generic', 'iconengines', 'imageformats', 'platforms', 'platforminputcontexts'],
'Qt5Location': ['geoservices'],
'Qt5Multimedia': ['audio', 'mediaservice', 'playlistformats'],
'Qt5Network': ['bearer'],
'Qt5Positioning': ['position'],
'Qt5PrintSupport': ['printsupport'],
'Qt5QmlTooling': ['qmltooling'],
'Qt5Quick': ['scenegraph', 'qmltooling'],
'Qt5Sensors': ['sensors', 'sensorgestures'],
'Qt5SerialBus': ['canbus'],
'Qt5Sql': ['sqldrivers'],
'Qt5TextToSpeech': ['texttospeech'],
'Qt5WebEngine': ['qtwebengine'],
'Qt5WebEngineCore': ['qtwebengine'],
'Qt5WebEngineWidgets': ['qtwebengine'],
'Qt5XcbQpa': ['xcbglintegrations']
}
pluginsMap.update({lib + 'd': pluginsMap[lib] for lib in pluginsMap})
qtDeps = set()
for elfPath in self.findExes(self.installDir):
for dep in self.listDependencies(elfPath):
if self.libName(dep) in pluginsMap:
qtDeps.add(dep)
solved = set()
plugins = []
pluginsPath = os.path.join(self.installDir, 'webcamoid/lib/qt/plugins')
while len(qtDeps) > 0:
dep = qtDeps.pop()
for qtDep in self.listDependencies(dep):
if self.libName(qtDep) in pluginsMap and not qtDep in solved:
qtDeps.add(qtDep)
for plugin in pluginsMap[self.libName(dep)]:
if not plugin in plugins:
sysPluginPath = os.path.join(self.sysPluginsPath, plugin)
pluginPath = os.path.join(pluginsPath, plugin)
print(' {} -> {}'.format(sysPluginPath, pluginPath))
if not os.path.exists(pluginsPath):
os.makedirs(pluginsPath)
try:
shutil.copytree(sysPluginPath, pluginPath, True)
except:
pass
for elfPath in self.findExes(sysPluginPath):
for exeDep in self.listDependencies(elfPath):
if self.libName(exeDep) in pluginsMap \
and exeDep != dep \
and not exeDep in solved:
qtDeps.add(exeDep)
plugins.append(plugin)
solved.add(dep)
def solvedepsLibs(self):
print('\nCopying required libs\n')
deps = set()
extraDeps = ['libeay32.dll',
'ssleay32.dll',
'libEGL.dll',
'libGLESv2.dll',
'D3DCompiler_43.dll',
'D3DCompiler_46.dll',
'D3DCompiler_47.dll']
for dep in extraDeps:
path = os.path.join(self.sysBinsPath, dep)
if os.path.exists(path):
deps.add(path)
for elfPath in self.findExes(self.installDir):
for dep in self.listDependencies(elfPath):
deps.add(dep)
solved = set()
while len(deps) > 0:
dep = deps.pop()
libPath = os.path.join(self.installDir, 'webcamoid/bin', os.path.basename(dep))
print(' {} -> {}'.format(dep, libPath))
self.copy(dep, libPath)
for exeDep in self.listDependencies(dep):
if exeDep != dep and not exeDep in solved:
deps.add(exeDep)
solved.add(dep)
def removeDebugs(self):
dbgFiles = set()
for root, dirs, files in os.walk(os.path.join(self.installDir,
'webcamoid/lib/qt')):
for f in files:
if f.endswith('.dll'):
fname, ext = os.path.splitext(f)
dbgFile = os.path.join(root, '{}d{}'.format(fname, ext))
if os.path.exists(dbgFile):
dbgFiles.add(dbgFile)
for f in dbgFiles:
os.remove(f)
def solvedeps(self):
self.solvedepsQml()
self.solvedepsPlugins()
self.removeDebugs()
self.solvedepsLibs()
def writeQtConf(self):
print('Writting qt.conf file')
paths = {'Plugins': '../lib/qt/plugins',
'Imports': '../lib/qt/qml',
'Qml2Imports': '../lib/qt/qml'}
with open(os.path.join(self.installDir, 'webcamoid/bin/qt.conf'), 'w') as qtconf:
qtconf.write('[Paths]\n')
for path in paths:
qtconf.write('{} = {}\n'.format(path, paths[path]))
def createLauncher(self):
print('Writting launcher file')
with open(os.path.join(self.installDir, 'webcamoid/webcamoid.bat'), 'w') as launcher:
launcher.write('@echo off\n')
launcher.write('\n')
launcher.write('rem Default values: desktop | angle | software\n')
launcher.write('rem set QT_OPENGL=angle\n')
launcher.write('\n')
launcher.write('rem Default values: d3d11 | d3d9 | warp\n')
launcher.write('rem set QT_ANGLE_PLATFORM=d3d11\n')
launcher.write('\n')
launcher.write('rem Default values: software | d3d12 | openvg\n')
launcher.write('rem set QT_QUICK_BACKEND=""\n')
launcher.write('\n')
launcher.write('start /b "" "%~dp0bin\\webcamoid" -q "%~dp0lib\\qt\\qml" -p "%~dp0lib\\avkys" -c "%~dp0share\\config"\n')
def strip(self, binary):
process = subprocess.Popen([os.path.join(self.sysBinsPath, 'strip'),
binary],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
def stripSymbols(self):
print('Stripping symbols')
path = os.path.join(self.installDir, 'webcamoid')
threads = []
for exe in self.findExes(path):
thread = threading.Thread(target=self.strip, args=(exe,))
threads.append(thread)
while threading.active_count() >= self.njobs:
time.sleep(0.25)
thread.start()
for thread in threads:
thread.join()
def finish(self):
print('\nCompleting final package structure\n')
self.writeQtConf()
self.createLauncher()
self.stripSymbols()
print('Removing unnecessary files')
self.removeUnneededFiles(os.path.join(self.installDir, 'webcamoid'))
def hrSize(self, size):
i = int(math.log(size) // math.log(1024))
if i < 1:
return '{} B'.format(size)
units = ['KiB', 'MiB', 'GiB', 'TiB']
sizeKiB = size / (1024 ** i)
return '{:.2f} {}'.format(sizeKiB, units[i - 1])
def printPackageInfo(self, path):
if os.path.exists(path):
print(' ', os.path.basename(path),
self.hrSize(os.path.getsize(path)))
def createPortable(self, mutex):
path = os.path.join(self.installDir, 'webcamoid')
arch = 'win32' if self.targetArch == '32bit' else 'win64'
packagePath = \
os.path.join(self.pkgsDir,
'webcamoid-portable-{}-{}.zip'.format(self.programVersion,
arch))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
with zipfile.ZipFile(packagePath, 'w', zipfile.ZIP_DEFLATED, False) as zipFile:
for root, dirs, files in os.walk(path):
for f in dirs + files:
filePath = os.path.join(root, f)
dstPath = os.path.join('webcamoid',
filePath.replace(path + os.sep, ''))
zipFile.write(filePath, dstPath)
mutex.acquire()
print('Created portable package:')
self.printPackageInfo(packagePath)
mutex.release()
def readChangeLog(self, changeLog, version):
if os.path.exists(changeLog):
with open(changeLog) as f:
for line in f:
if not line.startswith('Webcamoid {}:'.format(version)):
continue
# Skip first line.
f.readline()
changeLogText = ''
for line in f:
if re.match('Webcamoid \d+\.\d+\.\d+:', line):
# Remove last line.
i = changeLogText.rfind('\n')
if i >= 0:
changeLogText = changeLogText[: i]
return changeLogText
changeLogText += line
return ''
def createInstaller(self, mutex):
if not os.path.exists(self.qtIFW):
return
# Create layout
configDir = os.path.join(self.installDir, 'installer/config')
packageDir = os.path.join(self.installDir, 'installer/packages/com.webcamoidprj.webcamoid')
if not os.path.exists(configDir):
os.makedirs(configDir)
dataDir = os.path.join(packageDir, 'data')
metaDir = os.path.join(packageDir, 'meta')
if not os.path.exists(metaDir):
os.makedirs(metaDir)
appIconSrc = os.path.join(self.rootDir, 'StandAlone/share/icons/hicolor/{0}x{0}/webcamoid.ico'.format(self.installerIconSize))
self.copy(appIconSrc, configDir)
self.copy(os.path.join(self.rootDir, 'COPYING'),
os.path.join(metaDir, 'COPYING.txt'))
try:
shutil.copytree(os.path.join(self.installDir, 'webcamoid'), dataDir, True)
except:
pass
configXml = os.path.join(configDir, 'config.xml')
if int(self.qtIFWVersion.split('.')[0]) < 3:
appsDir = '@ApplicationsDir@'
else:
if self.targetArch == '32bit':
appsDir = '@ApplicationsDirX86@'
else:
appsDir = '@ApplicationsDirX64@'
with open(configXml, 'w') as config:
config.write('\n')
config.write('\n')
config.write(' Webcamoid\n')
config.write(' {}\n'.format(self.programVersion))
config.write(' Webcamoid, The ultimate webcam suite!\n')
config.write(' Webcamoid\n')
config.write(' https://webcamoid.github.io/\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' #3F1F7F\n')
config.write(' @TargetDir@/bin/webcamoid.exe\n')
config.write(' Launch Webcamoid now!\n')
config.write(' Webcamoid\n')
config.write(' WebcamoidMaintenanceTool\n')
config.write(' true\n')
config.write(' {}/webcamoid\n'.format(appsDir))
config.write('\n')
self.copy(os.path.join(self.rootDir, 'ports/deploy/installscript.windows.qs'),
os.path.join(metaDir, 'installscript.qs'))
with open(os.path.join(metaDir, 'package.xml'), 'w') as f:
f.write('\n')
f.write('\n')
f.write(' Webcamoid\n')
f.write(' The ultimate webcam suite\n')
f.write(' {}\n'.format(self.programVersion))
f.write(' {}\n'.format(time.strftime('%Y-%m-%d')))
f.write(' com.webcamoidprj.webcamoid\n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(self.readChangeLog(os.path.join(self.rootDir, 'ChangeLog'),
self.programVersion))
f.write(' \n')
f.write(' true\n')
f.write(' true\n')
f.write(' false\n')
f.write('\n')
# Remove old file
arch = 'win32' if self.targetArch == '32bit' else 'win64'
packagePath = os.path.join(self.pkgsDir,
'webcamoid-{}-{}.exe'.format(self.programVersion,
arch))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen([self.wineCmd, self.qtIFW,
'-c', configXml,
'-p', os.path.join(self.installDir,
'installer/packages'),
packagePath],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
mutex.acquire()
print('Created installable package:')
self.printPackageInfo(packagePath)
mutex.release()
def package(self):
print('\nCreating packages\n')
mutex = threading.Lock()
threads = [threading.Thread(target=self.createPortable, args=(mutex,)),
threading.Thread(target=self.createInstaller, args=(mutex,))]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
def cleanup(self):
shutil.rmtree(os.path.join(self.rootDir, 'ports/deploy/temp_priv'),
True)
webcamoid-8.1.0+dfsg/ports/deploy/exclude.posix.linux.txt 0000644 0001750 0001750 00000003226 13166615412 022235 0 ustar qemu qemu # VDSO
ld-linux.so.2
ld-linux-x86-64.so.2
/lib/ld-linux.so.2
/lib64/ld-linux-x86-64.so.2
/usr/lib/ld-linux.so.2
/usr/lib64/ld-linux-x86-64.so.2
# Glibc
libc.so.6
libdl.so.2
libm.so.6
libmvec.so.1
libpthread.so.0
libresolv.so.2
librt.so.1
# GCC
libgcc_s.so.1
libgomp.so.1
libstdc\+\+.so.6
# Core libraries
libSM.so.6
libblkid.so.1
libcap.so.2
libcom_err.so.2
libcrypto.so.1.0.0
libdb-5.3.so
libdbus-1.so.3
libexpat.so.1
libfontconfig.so.1
libfreetype.so.6
libgcrypt.so.20
libgmp.so.10
libgpg-error.so.0
libgssapi_krb5.so.2
libharfbuzz.so.0
libk5crypto.so.3
libkeyutils.so.1
libkrb5.so.3
libkrb5support.so.0
liblz4.so.1
liblzma.so.5
libmount.so.1
libpcre.so.[0-9]+$
libpcre16.so.0
libssh2.so.1
libssl.so.1.0.0
libtasn1.so.6
libusb-1.0.so.0
libuuid.so.1
libz.so.1
# Glib2
libgio-2.0.so.0
libglib-2.0.so.0
libgmodule-2.0.so.0
libgobject-2.0.so.0
# X11
libX11-xcb.so.1
libX11.so.6
libXau.so.6
libXcursor.so.1
libXdamage.so.1
libXdmcp.so.6
libXext.so.6
libXfixes.so.3
libXi.so.6
libXinerama.so.1
libXrandr.so.2
libXrender.so.1
libXss.so.1
libXv.so.1
libXxf86vm.so.1
libglapi.so.0
libp11-kit.so.0
libxcb-dri2.so.0
libxcb-dri3.so.0
libxcb-glx.so.0
# libxcb-icccm.so.4
# libxcb-image.so.0
libxcb-keysyms.so.1
libxcb-present.so.0
libxcb-randr.so.0
libxcb-render-util.so.0
libxcb-render.so.0
libxcb-shape.so.0
libxcb-shm.so.0
libxcb-sync.so.1
# libxcb-util.so.[0-9]+$
libxcb-xfixes.so.0
# libxcb-xinerama.so.0
libxcb-xkb.so.1
libxcb.so.1
libxkbcommon-x11.so.0
# libxkbcommon.so.0
libxshmfence.so.1
# OpenGL
libdrm.so.2
libgbm.so.1
libEGL.so.1
libGL.so.1
libGLX.so.0
libGLdispatch.so.0
# Use system library instead
libasound.so.2
libpulse.so.0
libpulse-simple.so.0
libjack.so.0
libv4l2.so.0
webcamoid-8.1.0+dfsg/ports/deploy/deploy_posix.py 0000755 0001750 0001750 00000114556 13166615412 020650 0 ustar qemu qemu #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
import configparser
import fnmatch
import math
import multiprocessing
import os
import platform
import re
import shutil
import struct
import subprocess
import sys
import tarfile
import threading
import time
class Deploy:
def __init__(self, rootDir, system, arch):
self.scanPaths = ['StandAlone/webcamoid',
'StandAlone/share/qml',
'libAvKys/Plugins']
self.rootDir = rootDir
self.system = system
self.arch = arch
self.targetArch = self.arch
self.targetSystem = self.detectSystem()
self.programVersion = self.readVersion()
self.qmake = self.detectQmake()
self.qtIFW = self.detectQtIFW()
self.appImage = self.detectAppImage()
self.excludes = self.readExcludeList()
self.dependencies = []
self.ldLibraryPath = os.environ['LD_LIBRARY_PATH'].split(':') if 'LD_LIBRARY_PATH' in os.environ else []
self.libsSeachPaths = self.readLdconf() \
+ ['/usr/lib', '/usr/lib64', '/lib', '/lib64']
self.installerIconSize = 128
self.njobs = multiprocessing.cpu_count()
if self.njobs < 4:
self.njobs = 4
def detectSystem(self):
exeFile = os.path.join(self.rootDir, self.scanPaths[0] + '.exe')
return 'windows' if os.path.exists(exeFile) else self.system
def readVersion(self):
if self.targetSystem != 'posix':
return ''
if 'LD_LIBRARY_PATH' in os.environ:
os.environ['LD_LIBRARY_PATH'] = ':'.join([os.path.join(self.rootDir, 'libAvKys/Lib'),
os.environ['LD_LIBRARY_PATH']])
else:
os.environ['LD_LIBRARY_PATH'] = os.path.join(self.rootDir, 'libAvKys/Lib')
programPath = os.path.join(self.rootDir, self.scanPaths[0])
process = subprocess.Popen([programPath, '--version'],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
try:
return stdout.split()[1].strip().decode(sys.getdefaultencoding())
except:
return 'unknown'
def readLdconf(self, ldconf='/etc/ld.so.conf'):
if not os.path.exists(ldconf):
return []
confDir = os.path.dirname(ldconf)
libpaths = []
with open(ldconf) as f:
for line in f:
i = line.find('#')
if i == 0:
continue
if i >= 0:
line = line[: i]
line = line.strip()
if len(line) < 1:
continue
if line.startswith('include'):
conf = line.split()[1]
if not conf.startswith('/'):
conf = os.path.join(confDir, conf)
dirname = os.path.dirname(conf)
if os.path.exists(dirname):
for f in os.listdir(dirname):
path = os.path.join(dirname, f)
if fnmatch.fnmatch(path, conf):
libpaths += self.readLdconf(path)
else:
libpaths.append(line)
return libpaths
def detectQmake(self):
if 'QMAKE_PATH' in os.environ:
return os.environ['QMAKE_PATH']
with open(os.path.join(self.rootDir, 'StandAlone/Makefile')) as f:
for line in f:
if line.startswith('QMAKE'):
return line.split('=')[1].strip()
return ''
def detectQtIFW(self):
if 'BINARYCREATOR' in os.environ:
return os.environ['BINARYCREATOR']
# Try official Qt binarycreator because it is statically linked.
homeQt = os.path.expanduser('~/Qt')
if os.path.exists(homeQt):
for f in os.listdir(homeQt):
path = os.path.join(homeQt, f)
if fnmatch.fnmatch(path, os.path.join(homeQt, 'QtIFW*')):
bcPath = os.path.join(path, 'bin/binarycreator')
if os.path.exists(bcPath):
return bcPath
# binarycreator offered by the system is most probably dynamically
# linked, so it's useful for test purposes only, but not recommended
# for distribution.
return self.whereBin('binarycreator')
def detectAppImage(self):
if 'APPIMAGETOOL' in os.environ:
return os.environ['APPIMAGETOOL']
return self.whereBin('appimagetool')
def qmakeQuery(self, var):
process = subprocess.Popen([self.qmake, '-query', var],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout.strip().decode(sys.getdefaultencoding())
def copy(self, src, dst):
if not os.path.exists(src):
return
basename = os.path.basename(src)
dstpath = os.path.join(dst, basename) if os.path.isdir(dst) else dst
dstdir = dst if os.path.isdir(dst) else os.path.dirname(dst)
if os.path.islink(src):
rsrc = os.path.realpath(src)
rbasename = os.path.basename(rsrc)
rdstpath = os.path.join(dstdir, rbasename)
if not os.path.exists(rdstpath):
shutil.copy(rsrc, rdstpath)
if not os.path.exists(dstpath):
os.symlink(os.path.join('.', rbasename), dstpath)
elif not os.path.exists(dstpath):
shutil.copy(src, dst)
def prepare(self):
self.sysQmlPath = self.qmakeQuery('QT_INSTALL_QML')
self.sysPluginsPath = self.qmakeQuery('QT_INSTALL_PLUGINS')
self.installDir = os.path.join(self.rootDir, 'ports/deploy/temp_priv/root')
self.pkgsDir = os.path.join(self.rootDir, 'ports/deploy/packages_auto', sys.platform)
insQmlDir = os.path.join(self.installDir, self.sysQmlPath)
dstQmlDir = os.path.join(self.installDir, 'usr/lib/qt/qml')
previousDir = os.getcwd()
os.chdir(self.rootDir)
process = subprocess.Popen(['make', 'INSTALL_ROOT={}'.format(self.installDir), 'install'],
stdout=subprocess.PIPE)
process.communicate()
os.chdir(previousDir)
if process.returncode != 0:
return
if insQmlDir != dstQmlDir:
if not os.path.exists(dstQmlDir):
os.makedirs(dstQmlDir)
try:
shutil.copytree(insQmlDir, dstQmlDir, True)
except:
pass
def modulePath(self, importLine):
imp = importLine.strip().split()
path = imp[1].replace('.', '/')
majorVersion = imp[2].split('.')[0]
if int(majorVersion) > 1:
path += '.{}'.format(majorVersion)
return path
def scanImports(self, path):
if not os.path.isfile(path):
return []
fileName = os.path.basename(path)
imports = set()
if fileName.endswith('.qml'):
with open(path, 'rb') as f:
for line in f:
if re.match(b'^import \\w+' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
elif fileName == 'qmldir':
with open(path, 'rb') as f:
for line in f:
if re.match(b'^depends ' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
return list(imports)
def listQmlFiles(self, path):
qmlFiles = set()
if os.path.isfile(path):
baseName = os.path.basename(path)
if baseName == 'qmldir' or path.endswith('.qml'):
qmlFiles.add(path)
else:
for root, dirs, files in os.walk(os.path.join(self.rootDir, path)):
for f in files:
if f == 'qmldir' or f.endswith('.qml'):
qmlFiles.add(os.path.join(root, f))
return list(qmlFiles)
def solvedepsQml(self):
print('Copying Qml modules\n')
qmlFiles = set()
for path in self.scanPaths:
path = os.path.join(self.rootDir, path)
for f in self.listQmlFiles(path):
qmlFiles.add(f)
qmlPath = os.path.join(self.installDir, 'usr/lib/qt/qml')
solved = set()
solvedImports = set()
while len(qmlFiles) > 0:
qmlFile = qmlFiles.pop()
for imp in self.scanImports(qmlFile):
if imp in solvedImports:
continue
sysModulePath = os.path.join(self.sysQmlPath, imp)
installModulePath = os.path.join(qmlPath, imp)
if os.path.exists(sysModulePath):
print(' {} -> {}'.format(sysModulePath, installModulePath))
path = installModulePath[: installModulePath.rfind(os.sep)]
if not os.path.exists(path):
os.makedirs(path)
try:
shutil.copytree(sysModulePath, installModulePath, True)
except:
pass
solvedImports.add(imp)
self.dependencies.append(os.path.join(sysModulePath, 'qmldir'))
for f in self.listQmlFiles(sysModulePath):
if not f in solved:
qmlFiles.add(f)
solved.add(qmlFile)
def isElf(self, path):
with open(path, 'rb') as f:
return f.read(4) == b'\x7fELF'
def findElfs(self, path):
elfs = []
for root, dirs, files in os.walk(path):
for f in files:
elfPath = os.path.join(root, f)
if not os.path.islink(elfPath) and self.isElf(elfPath):
elfs.append(elfPath)
return elfs
def readString(self, f):
s = b''
while True:
c = f.read(1)
if c == b'\x00':
break
s += c
return s
def readNumber(self, f, arch):
if arch == '32bits':
return struct.unpack('I', f.read(4))[0]
return struct.unpack('Q', f.read(8))[0]
def readDynamicEntry(self, f, arch):
if arch == '32bits':
return struct.unpack('iI', f.read(8))
return struct.unpack('qQ', f.read(16))
# https://refspecs.linuxfoundation.org/lsb.shtml (See Core, Generic)
# https://en.wikipedia.org/wiki/Executable_and_Linkable_Format
def elfDump(self, elf):
# ELF file magic
ELFMAGIC = b'\x7fELF'
# Sections
SHT_STRTAB = 0x3
SHT_DYNAMIC = 0x6
# Dynamic section entries
DT_NULL = 0
DT_NEEDED = 1
DT_RPATH = 15
DT_RUNPATH = 0x1d
with open(elf, 'rb') as f:
# Read magic signature.
magic = f.read(4)
if magic != ELFMAGIC:
return {}
# Read the data structure of the file.
eiClass = '32bits' if struct.unpack('B', f.read(1))[0] == 1 else '64bits'
# Read machine code.
f.seek(0x12, os.SEEK_SET)
machine = struct.unpack('H', f.read(2))[0]
# Get a pointer to the sections table.
sectionHeaderTable = 0
if eiClass == '32bits':
f.seek(0x20, os.SEEK_SET)
sectionHeaderTable = self.readNumber(f, eiClass)
f.seek(0x30, os.SEEK_SET)
else:
f.seek(0x28, os.SEEK_SET)
sectionHeaderTable = self.readNumber(f, eiClass)
f.seek(0x3c, os.SEEK_SET)
# Read the number of sections.
nSections = struct.unpack('H', f.read(2))[0]
# Read the index of the string table that stores sections names.
shstrtabIndex = struct.unpack('H', f.read(2))[0]
# Read sections.
f.seek(sectionHeaderTable, os.SEEK_SET)
neededPtr = []
rpathsPtr = []
runpathsPtr = []
strtabs = []
shstrtab = []
for section in range(nSections):
sectionStart = f.tell()
# Read the a pointer to the virtual address in the string table
# that contains the name of this section.
sectionName = struct.unpack('I', f.read(4))[0]
# Read the type of this section.
sectionType = struct.unpack('I', f.read(4))[0]
# Read the virtual address of this section.
f.seek(sectionStart + (0x0c if eiClass == '32bits' else 0x10), os.SEEK_SET)
shAddr = self.readNumber(f, eiClass)
# Read the offset in file to this section.
shOffset = self.readNumber(f, eiClass)
f.seek(shOffset, os.SEEK_SET)
if sectionType == SHT_DYNAMIC:
# Read dynamic sections.
while True:
# Read dynamic entries.
dTag, dVal = self.readDynamicEntry(f, eiClass)
if dTag == DT_NULL:
# End of dynamic sections.
break
elif dTag == DT_NEEDED:
# Dynamically imported libraries.
neededPtr.append(dVal)
elif dTag == DT_RPATH:
# RPATHs.
rpathsPtr.append(dVal)
elif dTag == DT_RUNPATH:
# RUNPATHs.
runpathsPtr.append(dVal)
elif sectionType == SHT_STRTAB:
# Read string tables.
if section == shstrtabIndex:
# We found the string table that stores sections names.
shstrtab = [shAddr, shOffset]
else:
# Save string tables for later usage.
strtabs += [[sectionName, shAddr, shOffset]]
# Move to next section.
f.seek(sectionStart + (0x28 if eiClass == '32bits' else 0x40), os.SEEK_SET)
# Libraries names and RUNPATHs are located in '.dynstr' table.
strtab = []
for tab in strtabs:
f.seek(tab[0] - shstrtab[0] + shstrtab[1], os.SEEK_SET)
if self.readString(f) == b'.dynstr':
strtab = tab
# Read dynamically imported libraries.
needed = set()
for lib in neededPtr:
f.seek(lib + strtab[2], os.SEEK_SET)
needed.add(self.readString(f).decode(sys.getdefaultencoding()))
# Read RPATHs
rpaths = set()
for path in rpathsPtr:
f.seek(path + strtab[2], os.SEEK_SET)
rpaths.add(self.readString(f).decode(sys.getdefaultencoding()))
# Read RUNPATHs
runpaths = set()
for path in runpathsPtr:
f.seek(path + strtab[2], os.SEEK_SET)
runpaths.add(self.readString(f).decode(sys.getdefaultencoding()))
return {'machine': machine,
'imports': needed,
'rpath': rpaths,
'runpath': runpaths}
return {}
def readRpaths(self, elfInfo, binDir):
rpaths = []
runpaths = []
# http://amir.rachum.com/blog/2016/09/17/shared-libraries/
for rpath in ['rpath', 'runpath']:
for path in elfInfo[rpath]:
if '$ORIGIN' in path:
path = path.replace('$ORIGIN', binDir)
if not path.startswith('/'):
path = os.path.join(binDir, path)
path = os.path.normpath(path)
if rpath == 'rpath':
rpaths.append(path)
else:
runpaths.append(path)
return rpaths, runpaths
def libPath(self, lib, machine, rpaths, runpaths):
# man ld.so
searchPaths = rpaths \
+ self.ldLibraryPath \
+ runpaths \
+ self.libsSeachPaths
for libdir in searchPaths:
path = os.path.join(libdir, lib)
if os.path.exists(path):
depElfInfo = self.elfDump(path)
if depElfInfo and depElfInfo['machine'] == machine:
return path
return ''
def listDependencies(self, path):
elfInfo = self.elfDump(path)
if not elfInfo:
return []
rpaths, runpaths = self.readRpaths(elfInfo, os.path.dirname(path))
libs = []
for lib in elfInfo['imports']:
libpath = self.libPath(lib, elfInfo['machine'], rpaths, runpaths)
if len(libpath) > 0:
libs.append(libpath)
return libs
def libName(self, lib):
dep = os.path.basename(lib)[3:]
return dep[: dep.find('.')]
def solvedepsPlugins(self):
print('\nCopying required plugins\n')
pluginsMap = {
'Qt53DRenderer': ['sceneparsers'],
'Qt5Declarative': ['qml1tooling'],
'Qt5EglFSDeviceIntegration': ['egldeviceintegrations'],
'Qt5Gui': ['accessible', 'generic', 'iconengines', 'imageformats', 'platforms', 'platforminputcontexts'],
'Qt5Location': ['geoservices'],
'Qt5Multimedia': ['audio', 'mediaservice', 'playlistformats'],
'Qt5Network': ['bearer'],
'Qt5Positioning': ['position'],
'Qt5PrintSupport': ['printsupport'],
'Qt5QmlTooling': ['qmltooling'],
'Qt5Quick': ['scenegraph', 'qmltooling'],
'Qt5Sensors': ['sensors', 'sensorgestures'],
'Qt5SerialBus': ['canbus'],
'Qt5Sql': ['sqldrivers'],
'Qt5TextToSpeech': ['texttospeech'],
'Qt5WebEngine': ['qtwebengine'],
'Qt5WebEngineCore': ['qtwebengine'],
'Qt5WebEngineWidgets': ['qtwebengine'],
'Qt5XcbQpa': ['xcbglintegrations']
}
pluginsMap.update({lib + 'd': pluginsMap[lib] for lib in pluginsMap})
qtDeps = set()
for elfPath in self.findElfs(self.installDir):
for dep in self.listDependencies(elfPath):
if self.libName(dep) in pluginsMap:
qtDeps.add(dep)
solved = set()
plugins = []
pluginsPath = os.path.join(self.installDir, 'usr/lib/qt/plugins')
while len(qtDeps) > 0:
dep = qtDeps.pop()
for qtDep in self.listDependencies(dep):
if self.libName(qtDep) in pluginsMap and not qtDep in solved:
qtDeps.add(qtDep)
for plugin in pluginsMap[self.libName(dep)]:
if not plugin in plugins:
sysPluginPath = os.path.join(self.sysPluginsPath, plugin)
pluginPath = os.path.join(pluginsPath, plugin)
print(' {} -> {}'.format(sysPluginPath, pluginPath))
if not os.path.exists(pluginsPath):
os.makedirs(pluginsPath)
try:
shutil.copytree(sysPluginPath, pluginPath, True)
except:
pass
for elfPath in self.findElfs(sysPluginPath):
for elfDep in self.listDependencies(elfPath):
if self.libName(elfDep) in pluginsMap \
and elfDep != dep \
and not elfDep in solved:
qtDeps.add(elfDep)
plugins.append(plugin)
self.dependencies.append(sysPluginPath)
solved.add(dep)
def readExcludeList(self):
excludeFile = 'exclude.{}.{}.txt'.format(os.name, sys.platform)
excludePath = os.path.join(self.rootDir, 'ports/deploy', excludeFile)
excludes = []
if os.path.exists(excludePath):
with open(excludePath) as f:
for line in f:
line = line.strip()
if len(line) > 0 and line[0] != '#':
i = line.find('#')
if i >= 0:
line = line[: i]
line = line.strip()
if len(line) > 0:
excludes.append(line)
return excludes
def isExcluded(self, path):
for exclude in self.excludes:
if re.search(exclude, path):
return True
return False
def solvedepsLibs(self):
print('\nCopying required libs\n')
deps = set()
for elfPath in self.findElfs(self.installDir):
for dep in self.listDependencies(elfPath):
deps.add(dep)
_deps = set()
for dep in deps:
if not self.isExcluded(dep):
_deps.add(dep)
solved = set()
while len(_deps) > 0:
dep = _deps.pop()
libPath = os.path.join(self.installDir, 'usr/lib', os.path.basename(dep))
print(' {} -> {}'.format(dep, libPath))
self.copy(dep, libPath)
for elfDep in self.listDependencies(dep):
if elfDep != dep \
and not elfDep in solved \
and not self.isExcluded(elfDep):
_deps.add(elfDep)
solved.add(dep)
self.dependencies.append(dep)
def solvedeps(self):
self.solvedepsQml()
self.solvedepsPlugins()
self.solvedepsLibs()
def whereBin(self, binary):
if not 'PATH' in os.environ or len(os.environ['PATH']) < 1:
return ''
for path in os.environ['PATH'].split(':'):
path = os.path.join(path.strip(), binary)
if os.path.exists(path):
return path
return ''
def searchPackageFor(self, path):
os.environ['LC_ALL'] = 'C'
pacman = self.whereBin('pacman')
if len(pacman) > 0:
process = subprocess.Popen([pacman, '-Qo', path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
return ''
info = stdout.decode(sys.getdefaultencoding()).split(' ')
if len(info) < 2:
return ''
package, version = info[-2:]
return ' '.join([package.strip(), version.strip()])
dpkg = self.whereBin('dpkg')
if len(dpkg) > 0:
process = subprocess.Popen([dpkg, '-S', path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
return ''
package = stdout.split(b':')[0].decode(sys.getdefaultencoding()).strip()
process = subprocess.Popen([dpkg, '-s', package],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
return ''
for line in stdout.decode(sys.getdefaultencoding()).split('\n'):
line = line.strip()
if line.startswith('Version:'):
return ' '.join([package, line.split()[1].strip()])
return ''
rpm = self.whereBin('rpm')
if len(rpm) > 0:
process = subprocess.Popen([rpm, '-qf', path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
if process.returncode != 0:
return ''
return stdout.decode(sys.getdefaultencoding()).strip()
return ''
def sysInfo(self):
info = ''
for f in os.listdir('/etc'):
if f.endswith('-release'):
with open(os.path.join('/etc' , f)) as releaseFile:
info += releaseFile.read()
return info
def writeBuildInfo(self):
print('\nWritting build system information\n')
depsInfoFile = os.path.join(self.installDir, 'usr/share/build-info.txt')
info = self.sysInfo()
with open(depsInfoFile, 'w') as f:
for line in info.split('\n'):
if len(line) > 0:
print(' ' + line)
f.write(line + '\n')
print()
f.write('\n')
packages = set()
for dep in self.dependencies:
packageInfo = self.searchPackageFor(dep)
if len(packageInfo) > 0:
packages.add(packageInfo)
packages = sorted(packages)
with open(depsInfoFile, 'a') as f:
for packge in packages:
print(' ' + packge)
f.write(packge + '\n')
def writeQtConf(self):
print('Writting qt.conf file')
paths = {'Plugins': '../lib/qt/plugins',
'Imports': '../lib/qt/qml',
'Qml2Imports': '../lib/qt/qml'}
with open(os.path.join(self.installDir, 'usr/bin/qt.conf'), 'w') as qtconf:
qtconf.write('[Paths]\n')
for path in paths:
qtconf.write('{} = {}\n'.format(path, paths[path]))
def strip(self, binary):
process = subprocess.Popen(['strip', binary],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
def stripSymbols(self):
print('Stripping symbols')
path = os.path.join(self.installDir, 'usr')
threads = []
for elf in self.findElfs(path):
thread = threading.Thread(target=self.strip, args=(elf,))
threads.append(thread)
while threading.active_count() >= self.njobs:
time.sleep(0.25)
thread.start()
for thread in threads:
thread.join()
def resetFilePermissions(self):
print('Resetting file permissions')
rootPath = os.path.join(self.installDir, 'usr')
binariesPath = os.path.join(rootPath, 'bin')
for root, dirs, files in os.walk(rootPath):
for d in dirs:
os.chmod(os.path.join(root, d), 0o755)
for f in files:
permissions = 0o644
path = os.path.join(root, f)
if root == binariesPath and self.isElf(path):
permissions = 0o744
os.chmod(path, permissions)
def createLauncher(self):
print('Writting launcher file')
path = os.path.join(self.installDir, 'usr/webcamoid')
with open(path + '.sh', 'w') as launcher:
launcher.write('#!/bin/sh\n')
launcher.write('\n')
launcher.write('rootdir() {\n')
launcher.write(' case "$1" in\n')
launcher.write(' /*) dirname "$1"\n')
launcher.write(' ;;\n')
launcher.write(' *) dir=$(dirname "$PWD/$1")\n')
launcher.write(' cwd=$PWD\n')
launcher.write(' cd "$dir" 1>/dev/null\n')
launcher.write(' echo $PWD\n')
launcher.write(' cd "$cwd" 1>/dev/null\n')
launcher.write(' ;;\n')
launcher.write(' esac\n')
launcher.write('}\n')
launcher.write('\n')
launcher.write('ROOTDIR=$(rootdir "$0")\n')
launcher.write('export PATH="${ROOTDIR}/bin:$PATH"\n')
launcher.write('export LD_LIBRARY_PATH="${ROOTDIR}/lib:$LD_LIBRARY_PATH"\n')
launcher.write('#export QT_DEBUG_PLUGINS=1\n')
launcher.write('webcamoid "$@"\n')
os.chmod(path + '.sh', 0o744)
def finish(self):
print('\nCompleting final package structure\n')
self.writeQtConf()
self.stripSymbols()
self.resetFilePermissions()
self.createLauncher()
self.writeBuildInfo()
def hrSize(self, size):
i = int(math.log(size) // math.log(1024))
if i < 1:
return '{} B'.format(size)
units = ['KiB', 'MiB', 'GiB', 'TiB']
sizeKiB = size / (1024 ** i)
return '{:.2f} {}'.format(sizeKiB, units[i - 1])
def printPackageInfo(self, path):
print(' ', os.path.basename(path),
self.hrSize(os.path.getsize(path)))
def createPortable(self, mutex):
path = os.path.join(self.installDir, 'usr')
packagePath = \
os.path.join(self.pkgsDir,
'webcamoid-portable-{}-{}.tar.xz'.format(self.programVersion,
platform.machine()))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
with tarfile.open(packagePath, 'w:xz') as tar:
tar.add(path, 'webcamoid')
mutex.acquire()
print('Created portable package:')
self.printPackageInfo(packagePath)
mutex.release()
def readChangeLog(self, changeLog, version):
if os.path.exists(changeLog):
with open(changeLog) as f:
for line in f:
if not line.startswith('Webcamoid {}:'.format(version)):
continue
# Skip first line.
f.readline()
changeLogText = ''
for line in f:
if re.match('Webcamoid \d+\.\d+\.\d+:', line):
# Remove last line.
i = changeLogText.rfind('\n')
if i >= 0:
changeLogText = changeLogText[: i]
return changeLogText
changeLogText += line
return ''
def createInstaller(self, mutex):
if not os.path.exists(self.qtIFW):
return
# Create layout
configDir = os.path.join(self.installDir, 'installer/config')
packageDir = os.path.join(self.installDir, 'installer/packages/com.webcamoidprj.webcamoid')
if not os.path.exists(configDir):
os.makedirs(configDir)
dataDir = os.path.join(packageDir, 'data')
metaDir = os.path.join(packageDir, 'meta')
if not os.path.exists(metaDir):
os.makedirs(metaDir)
appIconSrc = os.path.join(self.installDir, 'usr/share/icons/hicolor/{0}x{0}/apps/webcamoid.png'.format(self.installerIconSize))
self.copy(appIconSrc, configDir)
self.copy(os.path.join(self.rootDir, 'COPYING'),
os.path.join(metaDir, 'COPYING.txt'))
try:
shutil.copytree(os.path.join(self.installDir, 'usr'), dataDir, True)
except:
pass
configXml = os.path.join(configDir, 'config.xml')
with open(configXml, 'w') as config:
config.write('\n')
config.write('\n')
config.write(' Webcamoid\n')
config.write(' {}\n'.format(self.programVersion))
config.write(' Webcamoid, The ultimate webcam suite!\n')
config.write(' Webcamoid\n')
config.write(' https://webcamoid.github.io/\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' #3F1F7F\n')
config.write(' @TargetDir@/webcamoid.sh\n')
config.write(' Launch Webcamoid now!\n')
config.write(' Webcamoid\n')
config.write(' WebcamoidMaintenanceTool\n')
config.write(' true\n')
config.write(' @HomeDir@/webcamoid\n')
config.write('\n')
self.copy(os.path.join(self.rootDir, 'ports/deploy/installscript.posix.qs'),
os.path.join(metaDir, 'installscript.qs'))
with open(os.path.join(metaDir, 'package.xml'), 'w') as f:
f.write('\n')
f.write('\n')
f.write(' Webcamoid\n')
f.write(' The ultimate webcam suite\n')
f.write(' {}\n'.format(self.programVersion))
f.write(' {}\n'.format(time.strftime('%Y-%m-%d')))
f.write(' com.webcamoidprj.webcamoid\n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(self.readChangeLog(os.path.join(self.rootDir, 'ChangeLog'),
self.programVersion))
f.write(' \n')
f.write(' true\n')
f.write(' true\n')
f.write(' false\n')
f.write('\n')
# Remove old file
packagePath = os.path.join(self.pkgsDir,
'webcamoid-{}-{}.run'.format(self.programVersion,
platform.machine()))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen([self.qtIFW,
'-c', configXml,
'-p', os.path.join(self.installDir,
'installer/packages'),
packagePath],
stdout=subprocess.PIPE)
process.communicate()
mutex.acquire()
print('Created installable package:')
self.printPackageInfo(packagePath)
mutex.release()
def createAppImage(self, mutex):
if not os.path.exists(self.appImage):
return
appDir = \
os.path.join(self.installDir,
'webcamoid-{}-{}.AppDir'.format(self.programVersion,
platform.machine()))
try:
shutil.copytree(os.path.join(self.installDir, 'usr'),
appDir,
True)
except:
pass
launcher = os.path.join(appDir, 'AppRun')
if not os.path.exists(launcher):
os.replace(os.path.join(appDir, 'webcamoid.sh'), launcher)
desktopFile = os.path.join(appDir, 'webcamoid.desktop')
if os.path.exists(desktopFile):
os.remove(desktopFile)
self.copy(os.path.join(appDir, 'share/applications/webcamoid.desktop'), desktopFile)
config = configparser.ConfigParser()
config.optionxform=str
config.read(desktopFile, 'utf-8')
config['Desktop Entry']['Exec'] = 'AppRun'
with open(desktopFile, 'w', encoding='utf-8') as configFile:
config.write(configFile, space_around_delimiters=False)
icon = os.path.join(appDir, 'webcamoid.png')
if not os.path.exists(icon):
os.symlink('./share/icons/hicolor/256x256/apps/webcamoid.png',
icon)
# Remove old file
packagePath = \
os.path.join(self.pkgsDir,
'webcamoid-{}-{}.AppImage'.format(self.programVersion,
platform.machine()))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen([self.appImage,
'-v',
'--no-appstream',
'--comp', 'xz',
appDir,
packagePath],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
mutex.acquire()
print('Created AppImage package:')
self.printPackageInfo(packagePath)
mutex.release()
def package(self):
print('\nCreating packages\n')
mutex = threading.Lock()
threads = [threading.Thread(target=self.createPortable, args=(mutex,)),
threading.Thread(target=self.createInstaller, args=(mutex,)),
threading.Thread(target=self.createAppImage, args=(mutex,))]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
def cleanup(self):
shutil.rmtree(os.path.join(self.rootDir, 'ports/deploy/temp_priv'),
True)
webcamoid-8.1.0+dfsg/ports/deploy/installscript.posix.qs 0000644 0001750 0001750 00000006621 13166615412 022147 0 ustar qemu qemu function Component()
{
}
Component.prototype.beginInstallation = function()
{
component.beginInstallation();
}
Component.prototype.createOperations = function()
{
component.createOperations();
component.addOperation("InstallIcons", "@TargetDir@/share/icons" );
component.addOperation("CreateDesktopEntry",
"Webcamoid.desktop",
"Name=Webcamoid\n"
+ "GenericName=Webcam Capture Software\n"
+ "GenericName[ca]=Programari de Captura de CÃ mera web\n"
+ "GenericName[de]=Webcam-Capture-Software\n"
+ "GenericName[el]=κάμεÏα συλλαμβάνει το λογισμικό\n"
+ "GenericName[es]=Programa para Captura de la Webcam\n"
+ "GenericName[fr]=Logiciel de Capture Webcam\n"
+ "GenericName[gl]=Programa de Captura de Webcam\n"
+ "GenericName[it]=Webcam Capture Software\n"
+ "GenericName[ja]=ウェブカメラã®ã‚ャプãƒãƒ£ã‚½ãƒ•トウェア\n"
+ "GenericName[ko]=ì›¹ìº ìº¡ì²˜ 소프트웨어\n"
+ "GenericName[pt]=Software de Captura de Webcam\n"
+ "GenericName[ru]=Веб-камера захвата программного обеÑпечениÑ\n"
+ "GenericName[zh_CN]=æ‘„åƒå¤´æ•æ‰è½¯ä»¶\n"
+ "GenericName[zh_TW]=æ”åƒé æ•æ‰è»Ÿä»¶\n"
+ "Comment=Take photos and record videos with your webcam\n"
+ "Comment[ca]=Fer fotos i gravar vÃdeos amb la seva webcam\n"
+ "Comment[de]=Maak foto's en video's opnemen met uw webcam\n"
+ "Comment[el]=ΤÏαβήξτε φωτογÏαφίες και εγγÏαφή βίντεο με την κάμεÏα σας\n"
+ "Comment[es]=Tome fotos y grabe videos con su camara web\n"
+ "Comment[fr]=Prenez des photos et enregistrer des vidéos avec votre webcam\n"
+ "Comment[gl]=Facer fotos e gravar vÃdeos coa súa cámara web\n"
+ "Comment[it]=Scatta foto e registrare video con la tua webcam\n"
+ "Comment[ja]=ウェブカメラã§å†™çœŸã‚„記録ビデオを撮影\n"
+ "Comment[ko]=ì›¹ìº ìœ¼ë¡œ 사진과 ê¸°ë¡ ë¹„ë””ì˜¤ë¥¼ ì´¬ì˜\n"
+ "Comment[pt]=Tirar fotos e gravar vÃdeos com sua webcam\n"
+ "Comment[ru]=Возьмите фотографии и запиÑывать видео Ñ Ð²ÐµÐ±-камеры\n"
+ "Comment[zh_CN]=æ‹æ‘„照片和录制视频与您的摄åƒå¤´\n"
+ "Comment[zh_TW]=æ‹æ”ç…§ç‰‡å’ŒéŒ„è£½è¦–é »èˆ‡æ‚¨çš„æ”åƒé \n"
+ "Keywords=photo;video;webcam;\n"
+ "Exec=" + installer.value("RunProgram") + "\n"
+ "Icon=webcamoid\n"
+ "Terminal=false\n"
+ "Type=Application\n"
+ "Categories=AudioVideo;Player;Qt;\n"
+ "StartupNotify=true\n");
}
webcamoid-8.1.0+dfsg/ports/deploy/deploy_mac.py 0000644 0001750 0001750 00000110316 13166615412 020231 0 ustar qemu qemu #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
import fnmatch
import math
import multiprocessing
import os
import platform
import re
import shutil
import struct
import subprocess
import sys
import threading
import time
class Deploy:
def __init__(self, rootDir, system, arch):
self.scanPaths = ['StandAlone/webcamoid',
'StandAlone/share/qml',
'libAvKys/Plugins']
self.rootDir = rootDir
self.system = system
self.arch = arch
self.targetArch = self.arch
self.targetSystem = self.system
self.appPath = os.path.join(self.rootDir, self.scanPaths[0] + '.app')
self.programName = os.path.basename(self.scanPaths[0])
self.programVersion = self.readVersion()
self.qmake = self.detectQmake()
self.qtIFW = self.detectQtIFW()
self.njobs = multiprocessing.cpu_count()
if self.njobs < 4:
self.njobs = 4
# 32 bits magic number.
self.MH_MAGIC = 0xfeedface # Native endian
self.MH_CIGAM = 0xcefaedfe # Reverse endian
# 64 bits magic number.
self.MH_MAGIC_64 = 0xfeedfacf # Native endian
self.MH_CIGAM_64 = 0xcffaedfe # Reverse endian
def readVersion(self):
os.environ['DYLD_LIBRARY_PATH'] = os.path.join(self.rootDir, 'libAvKys/Lib')
programPath = os.path.join(self.appPath,
'Contents/MacOS',
self.programName)
process = subprocess.Popen([programPath, '--version'],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
try:
return stdout.split()[1].strip().decode('utf-8')
except:
return 'unknown'
def detectQmake(self):
if 'QMAKE_PATH' in os.environ:
return os.environ['QMAKE_PATH']
with open(os.path.join(self.rootDir, 'StandAlone/Makefile')) as f:
for line in f:
if line.startswith('QMAKE'):
return line.split('=')[1].strip()
return ''
def detectQtIFW(self):
if 'BINARYCREATOR' in os.environ:
return os.environ['BINARYCREATOR']
# Try official Qt binarycreator because it is statically linked.
homeQt = os.path.expanduser('~/Qt')
if os.path.exists(homeQt):
for f in os.listdir(homeQt):
path = os.path.join(homeQt, f)
if fnmatch.fnmatch(path, os.path.join(homeQt, 'QtIFW*')):
bcPath = os.path.join(path, 'bin/binarycreator')
if os.path.exists(bcPath):
return bcPath
# binarycreator offered by the system is most probably dynamically
# linked, so it's useful for test purposes only, but not recommended
# for distribution.
return self.whereBin('binarycreator')
def qmakeQuery(self, var):
process = subprocess.Popen([self.qmake, '-query', var],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout.strip().decode(sys.getdefaultencoding())
def copy(self, src, dst):
if not os.path.exists(src):
return
basename = os.path.basename(src)
dstpath = os.path.join(dst, basename) if os.path.isdir(dst) else dst
dstdir = dst if os.path.isdir(dst) else os.path.dirname(dst)
if os.path.islink(src):
rsrc = os.path.realpath(src)
rbasename = os.path.basename(rsrc)
rdstpath = os.path.join(dstdir, rbasename)
if not os.path.exists(rdstpath):
shutil.copy(rsrc, rdstpath)
if not os.path.exists(dstpath):
os.symlink(os.path.join('.', rbasename), dstpath)
elif not os.path.exists(dstpath):
shutil.copy(src, dst)
def prepare(self):
self.sysQmlPath = self.qmakeQuery('QT_INSTALL_QML')
self.sysPluginsPath = self.qmakeQuery('QT_INSTALL_PLUGINS')
libDir = os.path.join(self.rootDir, 'libAvKys/Lib')
self.installDir = os.path.join(self.rootDir, 'ports/deploy/temp_priv')
self.pkgsDir = os.path.join(self.rootDir, 'ports/deploy/packages_auto/mac')
if not os.path.exists(self.installDir):
os.makedirs(self.installDir)
self.appInstallPath = os.path.join(self.installDir, os.path.basename(self.appPath))
if not os.path.exists(self.appInstallPath):
shutil.copytree(self.appPath, self.appInstallPath, True)
contents = os.path.join(self.appInstallPath, 'Contents')
rootInstallDir = os.path.join(self.installDir, 'root')
previousDir = os.getcwd()
os.chdir(os.path.join(self.rootDir, 'libAvkys'))
process = subprocess.Popen(['make',
'INSTALL_ROOT={}'.format(rootInstallDir),
'install'],
stdout=subprocess.PIPE)
process.communicate()
os.chdir(previousDir)
if process.returncode != 0:
return
frameworksPath = os.path.join(contents, 'Frameworks')
if not os.path.exists(frameworksPath):
os.makedirs(frameworksPath)
installLibDir = os.path.join(rootInstallDir, 'usr/lib')
for f in os.listdir(installLibDir):
if f.endswith('.dylib'):
self.copy(os.path.join(installLibDir, f),
frameworksPath)
qmlPath = os.path.join(contents, 'Resources/qml')
if not os.path.exists(qmlPath):
os.makedirs(qmlPath)
try:
shutil.copytree(os.path.join(installLibDir, 'qt/qml/AkQml'),
os.path.join(qmlPath, 'AkQml'),
True)
except:
pass
pluginsPath = os.path.join(contents, 'Plugins')
if not os.path.exists(pluginsPath):
os.makedirs(pluginsPath)
try:
shutil.copytree(os.path.join(installLibDir, 'avkys'),
os.path.join(pluginsPath, 'avkys'),
True)
except:
pass
def modulePath(self, importLine):
imp = importLine.strip().split()
path = imp[1].replace('.', '/')
majorVersion = imp[2].split('.')[0]
if int(majorVersion) > 1:
path += '.{}'.format(majorVersion)
return path
def scanImports(self, path):
if not os.path.isfile(path):
return []
fileName = os.path.basename(path)
imports = set()
if fileName.endswith('.qml'):
with open(path, 'rb') as f:
for line in f:
if re.match(b'^import \\w+' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
elif fileName == 'qmldir':
with open(path, 'rb') as f:
for line in f:
if re.match(b'^depends ' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
return list(imports)
def listQmlFiles(self, path):
qmlFiles = set()
if os.path.isfile(path):
baseName = os.path.basename(path)
if baseName == 'qmldir' or path.endswith('.qml'):
qmlFiles.add(path)
else:
for root, dirs, files in os.walk(os.path.join(self.rootDir, path)):
for f in files:
if f == 'qmldir' or f.endswith('.qml'):
qmlFiles.add(os.path.join(root, f))
return list(qmlFiles)
def solvedepsQml(self):
print('Copying Qml modules\n')
qmlFiles = set()
for path in self.scanPaths:
path = os.path.join(self.rootDir, path)
for f in self.listQmlFiles(path):
qmlFiles.add(f)
qmlPath = os.path.join(self.appInstallPath, 'Contents/Resources/qml')
solved = set()
solvedImports = set()
while len(qmlFiles) > 0:
qmlFile = qmlFiles.pop()
for imp in self.scanImports(qmlFile):
if imp in solvedImports:
continue
sysModulePath = os.path.join(self.sysQmlPath, imp)
installModulePath = os.path.join(qmlPath, imp)
if os.path.exists(sysModulePath):
print(' {} -> {}'.format(sysModulePath, installModulePath))
path = installModulePath[: installModulePath.rfind(os.sep)]
if not os.path.exists(path):
os.makedirs(path)
try:
shutil.copytree(sysModulePath, installModulePath, True)
except:
pass
solvedImports.add(imp)
for f in self.listQmlFiles(sysModulePath):
if not f in solved:
qmlFiles.add(f)
solved.add(qmlFile)
def isMach(self, path):
try:
with open(path, 'rb') as f:
# Read magic number.
magic = struct.unpack('I', f.read(4))[0]
if magic == self.MH_MAGIC \
or magic == self.MH_CIGAM \
or magic == self.MH_MAGIC_64 \
or magic == self.MH_CIGAM_64:
return True
except:
pass
return False
def findMachs(self, path):
machs = []
for root, dirs, files in os.walk(path):
for f in files:
machPath = os.path.join(root, f)
if not os.path.islink(machPath) and self.isMach(machPath):
machs.append(machPath)
return machs
# https://github.com/aidansteele/osx-abi-macho-file-format-reference
def machDump(self, mach):
# Commands definitions
LC_REQ_DYLD = 0x80000000
LC_LOAD_DYLIB = 0xc
LC_RPATH = 0x1c | LC_REQ_DYLD
LC_ID_DYLIB = 0xd
dylibImports = []
rpaths = []
dylibId = ''
with open(mach, 'rb') as f:
# Read magic number.
magic = struct.unpack('I', f.read(4))[0]
if magic == self.MH_MAGIC or magic == self.MH_CIGAM:
is32bits = True
elif magic == self.MH_MAGIC_64 or magic == self.MH_CIGAM_64:
is32bits = False
else:
return {}
# Read number of commands.
f.seek(12, os.SEEK_CUR)
ncmds = struct.unpack('I', f.read(4))[0]
# Move to load commands
f.seek(8 if is32bits else 12, os.SEEK_CUR)
for i in range(ncmds):
# Read a load command and store it's position in the file.
loadCommandStart = f.tell()
loadCommand = struct.unpack('II', f.read(8))
# If the command list a library
if loadCommand[0] in [LC_LOAD_DYLIB, LC_RPATH, LC_ID_DYLIB]:
# Save the position of the next command.
nextCommand = f.tell() + loadCommand[1] - 8
# Move to the string
f.seek(loadCommandStart + struct.unpack('I', f.read(4))[0], os.SEEK_SET)
dylib = b''
# Read string until null character.
while True:
c = f.read(1)
if c == b'\x00':
break
dylib += c
s = dylib.decode(sys.getdefaultencoding())
if loadCommand[0] == LC_LOAD_DYLIB:
dylibImports.append(s)
elif loadCommand[0] == LC_RPATH:
rpaths.append(s)
elif loadCommand[0] == LC_ID_DYLIB:
dylibId = s
f.seek(nextCommand, os.SEEK_SET)
else:
f.seek(loadCommand[1] - 8, os.SEEK_CUR)
return {'imports': dylibImports, 'rpaths': rpaths, 'id': dylibId}
def solveRefpath(self, path):
if not path.startswith('@'):
return path
searchPaths = []
if 'DYLD_LIBRARY_PATH' in os.environ:
searchPaths += os.environ['DYLD_LIBRARY_PATH'].split(':')
if 'DYLD_FRAMEWORK_PATH' in os.environ:
searchPaths += os.environ['DYLD_FRAMEWORK_PATH'].split(':')
if path.endswith('.dylib'):
dep = os.path.basename(path)
else:
i = path.rfind(os.sep, 0, path.rfind('.framework'))
dep = path[i + 1:]
for fpath in searchPaths:
realPath = os.path.join(fpath, dep)
if os.path.exists(realPath):
return realPath
return ''
def listDependencies(self, path, solve=True):
machInfo = self.machDump(path)
if not machInfo:
return []
libs = []
for mach in machInfo['imports']:
if solve:
mach = self.solveRefpath(mach)
if len(mach) < 1:
continue
if not mach.startswith('@') and not os.path.exists(mach):
continue
libs.append(mach)
return libs
def libName(self, lib):
dep = os.path.basename(lib)
i = dep.find('.')
if i >= 0:
dep = dep[: dep.find('.')]
if 'Qt' in dep and not 'Qt5' in dep:
dep = dep.replace('Qt', 'Qt5')
return dep
def solvedepsPlugins(self):
print('\nCopying required plugins\n')
pluginsMap = {
'Qt53DRenderer': ['sceneparsers'],
'Qt5Declarative': ['qml1tooling'],
'Qt5EglFSDeviceIntegration': ['egldeviceintegrations'],
'Qt5Gui': ['accessible', 'generic', 'iconengines', 'imageformats', 'platforms', 'platforminputcontexts'],
'Qt5Location': ['geoservices'],
'Qt5Multimedia': ['audio', 'mediaservice', 'playlistformats'],
'Qt5Network': ['bearer'],
'Qt5Positioning': ['position'],
'Qt5PrintSupport': ['printsupport'],
'Qt5QmlTooling': ['qmltooling'],
'Qt5Quick': ['scenegraph', 'qmltooling'],
'Qt5Sensors': ['sensors', 'sensorgestures'],
'Qt5SerialBus': ['canbus'],
'Qt5Sql': ['sqldrivers'],
'Qt5TextToSpeech': ['texttospeech'],
'Qt5WebEngine': ['qtwebengine'],
'Qt5WebEngineCore': ['qtwebengine'],
'Qt5WebEngineWidgets': ['qtwebengine'],
'Qt5XcbQpa': ['xcbglintegrations']
}
pluginsMap.update({lib + 'd': pluginsMap[lib] for lib in pluginsMap})
qtDeps = set()
for machPath in self.findMachs(self.appInstallPath):
for dep in self.listDependencies(machPath):
if self.libName(dep) in pluginsMap:
qtDeps.add(dep)
solved = set()
plugins = []
pluginsPath = os.path.join(self.appInstallPath, 'Contents/PlugIns')
while len(qtDeps) > 0:
dep = qtDeps.pop()
for qtDep in self.listDependencies(dep):
if self.libName(qtDep) in pluginsMap and not qtDep in solved:
qtDeps.add(qtDep)
for plugin in pluginsMap[self.libName(dep)]:
if not plugin in plugins:
sysPluginPath = os.path.join(self.sysPluginsPath, plugin)
pluginPath = os.path.join(pluginsPath, plugin)
print(' {} -> {}'.format(sysPluginPath, pluginPath))
if not os.path.exists(pluginsPath):
os.makedirs(pluginsPath)
try:
shutil.copytree(sysPluginPath, pluginPath, True)
except:
pass
for machPath in self.findMachs(sysPluginPath):
for machDep in self.listDependencies(machPath):
if self.libName(machDep) in pluginsMap \
and machDep != dep \
and not machDep in solved:
qtDeps.add(machDep)
plugins.append(plugin)
solved.add(dep)
def isExcluded(self, path):
if path.startswith('/usr/lib') \
or path.startswith('/System/Library/Frameworks'):
return True
return False
def solvedepsLibs(self):
print('\nCopying required libs\n')
deps = set()
for machPath in self.findMachs(self.appInstallPath):
for dep in self.listDependencies(machPath):
if len(dep) > 0:
deps.add(dep)
_deps = set()
for dep in deps:
if not self.isExcluded(dep):
_deps.add(dep)
solved = set()
frameworksInstallPath = os.path.join(self.appInstallPath,
'Contents/Frameworks')
while len(_deps) > 0:
dep = _deps.pop()
basename = os.path.basename(dep)
framework = ''
frameworkPath = ''
if not basename.endswith('.dylib'):
frameworkPath = dep[: dep.rfind('.framework')] + '.framework'
framework = os.path.basename(frameworkPath)
if len(frameworkPath) < 1:
libPath = os.path.join(frameworksInstallPath, basename)
print(' {} -> {}'.format(dep, libPath))
self.copy(dep, libPath)
else:
libPath = os.path.join(frameworksInstallPath, framework)
print(' {} -> {}'.format(frameworkPath, libPath))
if not os.path.exists(frameworksInstallPath):
os.makedirs(frameworksInstallPath)
try:
shutil.copytree(frameworkPath, libPath, True)
except:
pass
for machDep in self.listDependencies(dep):
if len(machDep) > 0 \
and machDep != dep \
and not machDep in solved \
and not self.isExcluded(machDep):
_deps.add(machDep)
solved.add(dep)
def whereBin(self, binary):
if not 'PATH' in os.environ or len(os.environ['PATH']) < 1:
return ''
for path in os.environ['PATH'].split(':'):
path = os.path.join(path.strip(), binary)
if os.path.exists(path):
return path
return ''
def solvedeps(self):
self.solvedepsQml()
self.solvedepsPlugins()
self.solvedepsLibs()
def writeQtConf(self):
print('Writting qt.conf file')
paths = {'Plugins': '../Plugins',
'Imports': '../Resources/qml',
'Qml2Imports': '../Resources/qml'}
with open(os.path.join(self.appInstallPath, 'Contents/Resources/qt.conf'), 'w') as qtconf:
qtconf.write('[Paths]\n')
for path in paths:
qtconf.write('{} = {}\n'.format(path, paths[path]))
def removeUnneededFiles(self, path):
adirs = set()
afiles = set()
for root, dirs, files in os.walk(path):
for d in dirs:
if d == 'Headers':
adirs.add(os.path.join(root, d))
for f in files:
if f == 'Headers' or f.endswith('.prl'):
afiles.add(os.path.join(root, f))
for adir in adirs:
try:
shutil.rmtree(adir, True)
except:
pass
for afile in afiles:
try:
if os.path.islink(afile):
os.unlink(afile)
else:
os.remove(afile)
except:
pass
def strip(self, binary):
process = subprocess.Popen(['strip', binary],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
def stripSymbols(self):
print('Stripping symbols')
path = os.path.join(self.appInstallPath, 'Contents')
threads = []
for mach in self.findMachs(path):
thread = threading.Thread(target=self.strip, args=(mach,))
threads.append(thread)
while threading.active_count() >= self.njobs:
time.sleep(0.25)
thread.start()
for thread in threads:
thread.join()
def resetFilePermissions(self):
print('Resetting file permissions')
rootPath = os.path.join(self.appInstallPath, 'Contents')
binariesPath = os.path.join(rootPath, 'MacOS')
for root, dirs, files in os.walk(rootPath):
for d in dirs:
os.chmod(os.path.join(root, d), 0o755, follow_symlinks=False)
for f in files:
permissions = 0o644
if root == binariesPath:
permissions = 0o744
os.chmod(os.path.join(root, f), permissions, follow_symlinks=False)
def fixLibRpath(self, mutex, mach):
path = os.path.join(self.appInstallPath, 'Contents')
binariesPath = os.path.join(path, 'MacOS')
frameworksPath = os.path.join(path, 'Frameworks')
rpath = os.path.join('@executable_path', os.path.relpath(frameworksPath, binariesPath))
log = '\tFixed {}\n\n'.format(mach)
machInfo = self.machDump(mach)
# Change rpath
if mach.startswith(binariesPath):
log += '\t\tChanging rpath to {}\n'.format(rpath)
for oldRpath in machInfo['rpaths']:
process = subprocess.Popen(['install_name_tool',
'-delete_rpath', oldRpath, mach],
stdout=subprocess.PIPE)
process.communicate()
process = subprocess.Popen(['install_name_tool',
'-add_rpath', rpath, mach],
stdout=subprocess.PIPE)
process.communicate()
# Change ID
if mach.startswith(binariesPath):
newMachId = machInfo['id']
elif mach.startswith(frameworksPath):
newMachId = mach.replace(frameworksPath, rpath)
else:
newMachId = os.path.basename(mach)
if newMachId != machInfo['id']:
log += '\t\tChanging ID to {}\n'.format(newMachId)
process = subprocess.Popen(['install_name_tool',
'-id', newMachId, mach],
stdout=subprocess.PIPE)
process.communicate()
# Change library links
for dep in machInfo['imports']:
if dep.startswith(rpath):
continue
if self.isExcluded(dep):
continue
basename = os.path.basename(dep)
framework = ''
inFrameworkPath = ''
if not basename.endswith('.dylib'):
frameworkPath = dep[: dep.rfind('.framework')] + '.framework'
framework = os.path.basename(frameworkPath)
inFrameworkPath = os.path.join(framework, dep.replace(frameworkPath + '/', ''))
newDepPath = os.path.join(rpath, basename if len(framework) < 1 else inFrameworkPath)
if dep != newDepPath:
log += '\t\t{} -> {}\n'.format(dep, newDepPath)
process = subprocess.Popen(['install_name_tool',
'-change', dep, newDepPath, mach],
stdout=subprocess.PIPE)
process.communicate()
mutex.acquire()
print(log)
mutex.release()
def fixRpaths(self):
print('Fixing rpaths\n')
path = os.path.join(self.appInstallPath, 'Contents')
mutex = threading.Lock()
threads = []
for mach in self.findMachs(path):
thread = threading.Thread(target=self.fixLibRpath, args=(mutex, mach,))
threads.append(thread)
while threading.active_count() >= self.njobs:
time.sleep(0.25)
thread.start()
for thread in threads:
thread.join()
def finish(self):
print('\nCompleting final package structure\n')
self.writeQtConf()
print('Removing unnecessary files')
self.removeUnneededFiles(os.path.join(self.appInstallPath, 'Contents/Frameworks'))
self.stripSymbols()
self.resetFilePermissions()
self.fixRpaths()
def hrSize(self, size):
i = int(math.log(size) // math.log(1024))
if i < 1:
return '{} B'.format(size)
units = ['KiB', 'MiB', 'GiB', 'TiB']
sizeKiB = size / (1024 ** i)
return '{:.2f} {}'.format(sizeKiB, units[i - 1])
def printPackageInfo(self, path):
print(' ', os.path.basename(path),
self.hrSize(os.path.getsize(path)))
def dirSize(self, path):
size = 0
for root, dirs, files in os.walk(path):
for f in files:
fpath = os.path.join(root, f)
if not os.path.islink(fpath):
size += os.path.getsize(fpath)
return size
# https://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
def createPortable(self, mutex):
staggingDir = os.path.join(self.installDir, 'stagging')
if not os.path.exists(staggingDir):
os.makedirs(staggingDir)
try:
shutil.copytree(self.appInstallPath,
os.path.join(staggingDir, self.programName + '.app'),
True)
except:
pass
imageSize = self.dirSize(staggingDir)
tmpDmg = os.path.join(self.installDir, self.programName + '_tmp.dmg')
volumeName = "{}-portable-{}".format(self.programName,
self.programVersion)
process = subprocess.Popen(['hdiutil', 'create',
'-srcfolder', staggingDir,
'-volname', volumeName,
'-fs', 'HFS+',
'-fsargs', '-c c=64,a=16,e=16',
'-format', 'UDRW',
'-size', str(math.ceil(imageSize * 1.1)),
tmpDmg],
stdout=subprocess.PIPE)
process.communicate()
process = subprocess.Popen(['hdiutil',
'attach',
'-readwrite',
'-noverify',
tmpDmg],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
device = ''
for line in stdout.split(b'\n'):
line = line.strip()
if len(line) < 1:
continue
dev = line.split()
if len(dev) > 2:
device = dev[0].decode(sys.getdefaultencoding())
break
time.sleep(2)
volumePath = os.path.join('/Volumes', volumeName)
volumeIcon = os.path.join(volumePath, '.VolumeIcon.icns')
self.copy(os.path.join(self.rootDir, 'StandAlone/share/icons/webcamoid.icns'),
volumeIcon)
process = subprocess.Popen(['SetFile',
'-c', 'icnC',
volumeIcon],
stdout=subprocess.PIPE)
process.communicate()
process = subprocess.Popen(['SetFile',
'-a', 'C',
volumePath],
stdout=subprocess.PIPE)
process.communicate()
appsShortcut = os.path.join(volumePath, 'Applications')
if not os.path.exists(appsShortcut):
os.symlink('/Applications', appsShortcut)
os.sync()
process = subprocess.Popen(['hdiutil',
'detach',
device],
stdout=subprocess.PIPE)
process.communicate()
packagePath = \
os.path.join(self.pkgsDir,
'{}-portable-{}-{}.dmg'.format(self.programName,
self.programVersion,
platform.machine()))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen(['hdiutil',
'convert',
tmpDmg,
'-format', 'UDZO',
'-imagekey', 'zlib-level=9',
'-o', packagePath],
stdout=subprocess.PIPE)
process.communicate()
mutex.acquire()
print('Created portable package:')
self.printPackageInfo(packagePath)
mutex.release()
def readChangeLog(self, changeLog, version):
if os.path.exists(changeLog):
with open(changeLog) as f:
for line in f:
if not line.startswith('Webcamoid {}:'.format(version)):
continue
# Skip first line.
f.readline()
changeLogText = ''
for line in f:
if re.match('Webcamoid \d+\.\d+\.\d+:', line):
# Remove last line.
i = changeLogText.rfind('\n')
if i >= 0:
changeLogText = changeLogText[: i]
return changeLogText
changeLogText += line
return ''
def createInstaller(self, mutex):
if not os.path.exists(self.qtIFW):
return
# Create layout
configDir = os.path.join(self.installDir, 'installer/config')
packageDir = os.path.join(self.installDir, 'installer/packages/com.webcamoidprj.webcamoid')
if not os.path.exists(configDir):
os.makedirs(configDir)
dataDir = os.path.join(packageDir, 'data')
metaDir = os.path.join(packageDir, 'meta')
if not os.path.exists(metaDir):
os.makedirs(metaDir)
appIconSrc = os.path.join(self.rootDir,
'StandAlone/share/icons/{}.icns'.format(self.programName))
self.copy(appIconSrc, configDir)
self.copy(os.path.join(self.rootDir, 'COPYING'),
os.path.join(metaDir, 'COPYING.txt'))
try:
shutil.copytree(self.appInstallPath,
os.path.join(dataDir, self.programName + '.app'),
True)
except:
pass
configXml = os.path.join(configDir, 'config.xml')
with open(configXml, 'w') as config:
config.write('\n')
config.write('\n')
config.write(' Webcamoid\n')
config.write(' {}\n'.format(self.programVersion))
config.write(' Webcamoid, The ultimate webcam suite!\n')
config.write(' Webcamoid\n')
config.write(' https://webcamoid.github.io/\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' #3F1F7F\n')
config.write(' @TargetDir@/{0}.app/Contents/MacOS/{0}\n'.format(self.programName))
config.write(' Launch Webcamoid now!\n')
config.write(' Webcamoid\n')
config.write(' WebcamoidMaintenanceTool\n')
config.write(' true\n')
config.write(' @ApplicationsDir@/{}\n'.format(self.programName))
config.write('\n')
self.copy(os.path.join(self.rootDir, 'ports/deploy/installscript.mac.qs'),
os.path.join(metaDir, 'installscript.qs'))
with open(os.path.join(metaDir, 'package.xml'), 'w') as f:
f.write('\n')
f.write('\n')
f.write(' Webcamoid\n')
f.write(' The ultimate webcam suite\n')
f.write(' {}\n'.format(self.programVersion))
f.write(' {}\n'.format(time.strftime('%Y-%m-%d')))
f.write(' com.webcamoidprj.webcamoid\n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(self.readChangeLog(os.path.join(self.rootDir, 'ChangeLog'),
self.programVersion))
f.write(' \n')
f.write(' true\n')
f.write(' true\n')
f.write(' false\n')
f.write('\n')
# Remove old file
packagePath = os.path.join(self.pkgsDir,
'{}-{}.dmg'.format(self.programName,
self.programVersion))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen([self.qtIFW,
'-c', configXml,
'-p', os.path.join(self.installDir,
'installer/packages'),
packagePath],
cwd=os.path.join(self.installDir, 'installer'),
stdout=subprocess.PIPE)
process.communicate()
shutil.rmtree(packagePath.replace('.dmg', '.app'), True)
if not os.path.exists(packagePath):
return
mutex.acquire()
print('Created installable package:')
self.printPackageInfo(packagePath)
mutex.release()
def package(self):
print('\nCreating packages\n')
mutex = threading.Lock()
threads = [threading.Thread(target=self.createPortable, args=(mutex,)),
threading.Thread(target=self.createInstaller, args=(mutex,))]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
def cleanup(self):
shutil.rmtree(os.path.join(self.rootDir, 'ports/deploy/temp_priv'),
True)
webcamoid-8.1.0+dfsg/ports/deploy/deploy_windows.py 0000755 0001750 0001750 00000071032 13166615412 021167 0 ustar qemu qemu #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
import math
import mimetypes
import multiprocessing
import os
import platform
import re
import shutil
import struct
import subprocess
import sys
import threading
import time
import zipfile
class Deploy:
def __init__(self, rootDir, system, arch):
self.scanPaths = ['StandAlone\\webcamoid.exe',
'StandAlone\\share\\qml',
'libAvKys\\Plugins']
self.rootDir = rootDir
self.buildDir = os.environ['BUILD_DIR'] if 'BUILD_DIR' in os.environ else rootDir
self.system = system
self.arch = arch
self.targetSystem = system
self.targetArch = self.detectArch()
self.qmake = self.detectQmake()
self.qtIFW = self.detectQtIFW()
self.qtIFWVersion = self.detectQtIFWVersion()
self.programVersion = self.readVersion()
self.make = self.detectMake()
self.installerIconSize = 256
self.njobs = multiprocessing.cpu_count()
if self.njobs < 4:
self.njobs = 4
def detectArch(self):
exeFile = os.path.join(self.buildDir, self.scanPaths[0])
return platform.architecture(exeFile)[0]
def readVersion(self):
self.sysBinsPath = self.qmakeQuery('QT_INSTALL_BINS')
os.environ['PATH'] = ';'.join([os.path.join(self.buildDir, 'libAvKys\\Lib'),
self.sysBinsPath,
os.environ['PATH']])
programPath = os.path.join(self.buildDir, self.scanPaths[0])
process = subprocess.Popen([programPath, '--version'],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
try:
return stdout.split()[1].strip().decode('utf-8')
except:
return 'unknown'
def detectQmake(self):
if 'QMAKE_PATH' in os.environ:
return os.environ['QMAKE_PATH']
with open(os.path.join(self.buildDir, 'StandAlone\\Makefile')) as f:
for line in f:
if line.startswith('QMAKE'):
return line.split('=')[1].strip()
return ''
def detectMake(self):
if 'MAKE_PATH' in os.environ:
return os.environ['MAKE_PATH']
defaultPath = os.path.dirname(self.qmake)
makePaths = [os.path.join(defaultPath, 'mingw32-make.exe'),
os.path.join(defaultPath, 'make.exe'),
'C:\\MinGW\\bin\\mingw32-make.exe']
for path in makePaths:
if os.path.exists(path):
return path
return ''
def qmakeQuery(self, var):
process = subprocess.Popen([self.qmake, '-query', var],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout.strip().decode(sys.getdefaultencoding())
def detectQtIFW(self):
if 'BINARYCREATOR' in os.environ:
return os.environ['BINARYCREATOR']
for root, dirs, files in os.walk('C:\\Qt'):
for f in files:
if f == 'binarycreator.exe':
return os.path.join(root, f)
return self.whereExe('binarycreator.exe')
def detectQtIFWVersion(self):
installerBase = os.path.join(os.path.dirname(self.qtIFW),
'installerbase.exe')
version = '2.0.0'
if not os.path.exists(installerBase):
return version
process = subprocess.Popen([installerBase,
'--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
for line in stdout.split(b'\n'):
if b'IFW Version:' in line:
return line.split(b' ')[2].replace(b'"', b'').decode(sys.getdefaultencoding())
return version
def copy(self, src, dst):
if not os.path.exists(src):
return
basename = os.path.basename(src)
dstpath = os.path.join(dst, basename) if os.path.isdir(dst) else dst
dstdir = dst if os.path.isdir(dst) else os.path.dirname(dst)
if os.path.islink(src):
rsrc = os.path.realpath(src)
rbasename = os.path.basename(rsrc)
rdstpath = os.path.join(dstdir, rbasename)
if not os.path.exists(rdstpath):
shutil.copy(rsrc, rdstpath)
if not os.path.exists(dstpath):
os.symlink(os.path.join('.', rbasename), dstpath)
elif not os.path.exists(dstpath):
shutil.copy(src, dst)
def prepare(self):
self.sysQmlPath = self.qmakeQuery('QT_INSTALL_QML')
self.sysPluginsPath = self.qmakeQuery('QT_INSTALL_PLUGINS')
self.tempDir = os.path.join(self.buildDir, 'ports\\deploy\\temp_priv')
self.installDir = os.environ['INSTALL_PREFIX'] if 'INSTALL_PREFIX' in os.environ else os.path.join(self.tempDir, 'root')
self.pkgsDir = os.path.join(self.rootDir, 'ports\\deploy\\packages_auto', sys.platform)
previousDir = os.getcwd()
os.chdir(self.buildDir)
process = subprocess.Popen([self.make, 'install'],
stdout=subprocess.PIPE)
stdout, stderr = process.communicate()
os.chdir(previousDir)
def modulePath(self, importLine):
imp = importLine.strip().split()
path = imp[1].replace('.', '/')
majorVersion = imp[2].split('.')[0]
if int(majorVersion) > 1:
path += '.{}'.format(majorVersion)
return path
def scanImports(self, path):
if not os.path.isfile(path):
return []
fileName = os.path.basename(path)
imports = set()
if fileName.endswith('.qml'):
with open(path, 'rb') as f:
for line in f:
if re.match(b'^import \\w+' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
elif fileName == 'qmldir':
with open(path, 'rb') as f:
for line in f:
if re.match(b'^depends ' , line):
imports.add(self.modulePath(line.strip().decode(sys.getdefaultencoding())))
return list(imports)
def listQmlFiles(self, path):
qmlFiles = set()
if os.path.isfile(path):
baseName = os.path.basename(path)
if baseName == 'qmldir' or path.endswith('.qml'):
qmlFiles.add(path)
else:
for root, dirs, files in os.walk(os.path.join(self.rootDir, path)):
for f in files:
if f == 'qmldir' or f.endswith('.qml'):
qmlFiles.add(os.path.join(root, f))
return list(qmlFiles)
def solvedepsQml(self):
print('Copying Qml modules\n')
qmlFiles = set()
for path in self.scanPaths:
path = os.path.join(self.rootDir, path)
for f in self.listQmlFiles(path):
qmlFiles.add(f)
qmlPath = os.path.join(self.installDir, 'lib\\qt\\qml')
solved = set()
solvedImports = set()
while len(qmlFiles) > 0:
qmlFile = qmlFiles.pop()
for imp in self.scanImports(qmlFile):
if imp in solvedImports:
continue
sysModulePath = os.path.join(self.sysQmlPath, imp)
installModulePath = os.path.join(qmlPath, imp)
if os.path.exists(sysModulePath):
print(' {} -> {}'.format(sysModulePath, installModulePath))
path = installModulePath[: installModulePath.rfind(os.sep)]
if not os.path.exists(path):
os.makedirs(path)
try:
shutil.copytree(sysModulePath, installModulePath, True)
except:
pass
solvedImports.add(imp)
for f in self.listQmlFiles(sysModulePath):
if not f in solved:
qmlFiles.add(f)
solved.add(qmlFile)
def isExe(self, path):
mimetype, encoding = mimetypes.guess_type(path)
if mimetype == 'application/x-msdownload':
return True
return False
def findExes(self, path):
exes = []
for root, dirs, files in os.walk(path):
for f in files:
exePath = os.path.join(root, f)
if not os.path.islink(exePath) and self.isExe(exePath):
exes.append(exePath)
return exes
def whereExe(self, exe):
if not 'PATH' in os.environ or len(os.environ['PATH']) < 1:
return ''
for path in os.environ['PATH'].split(';'):
path = os.path.join(path.strip(), exe)
if os.path.exists(path):
return path
return ''
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx
# https://upload.wikimedia.org/wikipedia/commons/1/1b/Portable_Executable_32_bit_Structure_in_SVG_fixed.svg
def exeDump(self, exe):
dllImports = set()
with open(exe, 'rb') as f:
# Check DOS header signature.
if f.read(2) != b'MZ':
return []
# Move to COFF header.
f.seek(0x3c, os.SEEK_SET)
peHeaderOffset = struct.unpack('I', f.read(4))
f.seek(peHeaderOffset[0], os.SEEK_SET)
peSignatue = f.read(4)
# Check COFF header signature.
if peSignatue != b'PE\x00\x00':
return []
# Read COFF header.
coffHeader = struct.unpack('HHIIIHH', f.read(20))
nSections = coffHeader[1]
sectionTablePos = coffHeader[5] + f.tell()
# Read magic signature in standard COFF fields.
peType = 'PE32' if f.read(2) == b'\x0b\x01' else 'PE32+'
# Move to data directories.
f.seek(102 if peType == 'PE32' else 118, os.SEEK_CUR)
# Read the import table.
importTablePos, importTableSize = struct.unpack('II', f.read(8))
# Move to Sections table.
f.seek(sectionTablePos, os.SEEK_SET)
sections = []
idataTableVirtual = -1
idataTablePhysical = -1
# Search for 'idata' section.
for i in range(nSections):
# Read section.
section = struct.unpack('8pIIIIIIHHI', f.read(40))
sectionName = section[0].replace(b'\x00', b'')
# Save a reference to the sections.
sections += [section]
if sectionName == b'idata' or sectionName == b'rdata':
idataTableVirtual = section[2]
idataTablePhysical = section[4]
# If import table was defined calculate it's position in
# the file in relation to the address given by 'idata'.
if importTableSize > 0:
idataTablePhysical += importTablePos - section[2]
if idataTablePhysical < 0:
return []
# Move to 'idata' section.
f.seek(idataTablePhysical, os.SEEK_SET)
dllList = set()
# Read 'idata' directory table.
while True:
# Read DLL entries.
dllImport = struct.unpack('IIIII', f.read(20))
# Null directory entry.
if dllImport[0] | dllImport[1] | dllImport[2] | dllImport[3] | dllImport[4] == 0:
break
# Locate where is located the DLL name in relation to the
# sections.
for section in sections:
if dllImport[3] >= section[2] \
and dllImport[3] < section[1] + section[2]:
dllList.add(dllImport[3] - section[2] + section[4])
break
for dll in dllList:
# Move to DLL name.
f.seek(dll, os.SEEK_SET)
dllName = b''
# Read string until null character.
while True:
c = f.read(1)
if c == b'\x00':
break
dllName += c
dllImports.add(dllName.decode(sys.getdefaultencoding()))
return dllImports
def listDependencies(self, path):
libs = []
for exe in self.exeDump(path):
lib = self.whereExe(exe)
dirname = os.path.dirname(lib).replace('/', '\\').lower()
if len(lib) > 0 \
and os.path.exists(lib) \
and dirname != 'c:\\windows\\system32':
libs.append(lib)
return libs
def libName(self, lib):
dep = os.path.basename(lib)
return dep[: dep.find('.')]
def solvedepsPlugins(self):
print('\nCopying required plugins\n')
pluginsMap = {
'Qt53DRenderer': ['sceneparsers'],
'Qt5Declarative': ['qml1tooling'],
'Qt5EglFSDeviceIntegration': ['egldeviceintegrations'],
'Qt5Gui': ['accessible', 'generic', 'iconengines', 'imageformats', 'platforms', 'platforminputcontexts'],
'Qt5Location': ['geoservices'],
'Qt5Multimedia': ['audio', 'mediaservice', 'playlistformats'],
'Qt5Network': ['bearer'],
'Qt5Positioning': ['position'],
'Qt5PrintSupport': ['printsupport'],
'Qt5QmlTooling': ['qmltooling'],
'Qt5Quick': ['scenegraph', 'qmltooling'],
'Qt5Sensors': ['sensors', 'sensorgestures'],
'Qt5SerialBus': ['canbus'],
'Qt5Sql': ['sqldrivers'],
'Qt5TextToSpeech': ['texttospeech'],
'Qt5WebEngine': ['qtwebengine'],
'Qt5WebEngineCore': ['qtwebengine'],
'Qt5WebEngineWidgets': ['qtwebengine'],
'Qt5XcbQpa': ['xcbglintegrations']
}
pluginsMap.update({lib + 'd': pluginsMap[lib] for lib in pluginsMap})
qtDeps = set()
for exePath in self.findExes(self.installDir):
for dep in self.listDependencies(exePath):
if self.libName(dep) in pluginsMap:
qtDeps.add(dep)
solved = set()
plugins = []
pluginsPath = os.path.join(self.installDir, 'lib\\qt\\plugins')
while len(qtDeps) > 0:
dep = qtDeps.pop()
for qtDep in self.listDependencies(dep):
if self.libName(qtDep) in pluginsMap and not qtDep in solved:
qtDeps.add(qtDep)
for plugin in pluginsMap[self.libName(dep)]:
if not plugin in plugins:
sysPluginPath = os.path.join(self.sysPluginsPath, plugin)
pluginPath = os.path.join(pluginsPath, plugin)
print(' {} -> {}'.format(sysPluginPath, pluginPath))
if not os.path.exists(pluginsPath):
os.makedirs(pluginsPath)
try:
shutil.copytree(sysPluginPath, pluginPath, True)
except:
pass
for elfPath in self.findExes(sysPluginPath):
for exeDep in self.listDependencies(elfPath):
if self.libName(exeDep) in pluginsMap \
and exeDep != dep \
and not exeDep in solved:
qtDeps.add(exeDep)
plugins.append(plugin)
solved.add(dep)
def solvedepsLibs(self):
print('\nCopying required libs\n')
deps = set()
extraDeps = ['libeay32.dll',
'ssleay32.dll',
'libEGL.dll',
'libGLESv2.dll',
'D3DCompiler_43.dll',
'D3DCompiler_46.dll',
'D3DCompiler_47.dll']
for dep in extraDeps:
path = self.whereExe(dep)
if len(path) > 0 and os.path.exists(path):
deps.add(path)
for elfPath in self.findExes(self.installDir):
for dep in self.listDependencies(elfPath):
deps.add(dep)
solved = set()
while len(deps) > 0:
dep = deps.pop()
libPath = os.path.join(self.installDir, 'bin', os.path.basename(dep))
print(' {} -> {}'.format(dep, libPath))
self.copy(dep, libPath)
for exeDep in self.listDependencies(dep):
if exeDep != dep and not exeDep in solved:
deps.add(exeDep)
solved.add(dep)
def removeDebugs(self):
dbgFiles = set()
for root, dirs, files in os.walk(os.path.join(self.installDir,
'lib\\qt')):
for f in files:
if f.endswith('.dll'):
fname, ext = os.path.splitext(f)
dbgFile = os.path.join(root, '{}d{}'.format(fname, ext))
if os.path.exists(dbgFile):
dbgFiles.add(dbgFile)
for f in dbgFiles:
os.remove(f)
def solvedeps(self):
self.solvedepsQml()
self.solvedepsPlugins()
self.removeDebugs()
self.solvedepsLibs()
def writeQtConf(self):
print('Writting qt.conf file')
paths = {'Plugins': '../lib/qt/plugins',
'Imports': '../lib/qt/qml',
'Qml2Imports': '../lib/qt/qml'}
with open(os.path.join(self.installDir, 'bin\\qt.conf'), 'w') as qtconf:
qtconf.write('[Paths]\n')
for path in paths:
qtconf.write('{} = {}\n'.format(path, paths[path]))
def createLauncher(self):
print('Writting launcher file')
with open(os.path.join(self.installDir, 'webcamoid.bat'), 'w') as launcher:
launcher.write('@echo off\n')
launcher.write('\n')
launcher.write('rem Default values: desktop | angle | software\n')
launcher.write('rem set QT_OPENGL=angle\n')
launcher.write('\n')
launcher.write('rem Default values: d3d11 | d3d9 | warp\n')
launcher.write('rem set QT_ANGLE_PLATFORM=d3d11\n')
launcher.write('\n')
launcher.write('rem Default values: software | d3d12 | openvg\n')
launcher.write('rem set QT_QUICK_BACKEND=""\n')
launcher.write('\n')
launcher.write('start /b "" "%~dp0bin\\webcamoid" -q "%~dp0lib\\qt\\qml" -p "%~dp0lib\\avkys" -c "%~dp0share\\config"\n')
def removeUnneededFiles(self, path):
afiles = set()
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith('.a') \
or f.endswith('.static.prl') \
or f.endswith('.pdb') \
or f.endswith('.lib'):
afiles.add(os.path.join(root, f))
for afile in afiles:
os.remove(afile)
def strip(self, strip, binary):
process = subprocess.Popen([strip, binary],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
def stripSymbols(self):
strip = self.whereExe('strip.exe')
if len(strip) < 1:
return
print('Stripping symbols')
path = os.path.join(self.installDir)
threads = []
for exe in self.findExes(path):
thread = threading.Thread(target=self.strip, args=(strip, exe,))
threads.append(thread)
while threading.active_count() >= self.njobs:
time.sleep(0.25)
thread.start()
for thread in threads:
thread.join()
def finish(self):
print('\nCompleting final package structure\n')
self.writeQtConf()
self.createLauncher()
self.stripSymbols()
print('Removing unnecessary files')
self.removeUnneededFiles(self.installDir)
def hrSize(self, size):
i = int(math.log(size) // math.log(1024))
if i < 1:
return '{} B'.format(size)
units = ['KiB', 'MiB', 'GiB', 'TiB']
sizeKiB = size / (1024 ** i)
return '{:.2f} {}'.format(sizeKiB, units[i - 1])
def printPackageInfo(self, path):
if os.path.exists(path):
print(' ', os.path.basename(path),
self.hrSize(os.path.getsize(path)))
def createPortable(self, mutex):
path = self.installDir
arch = 'win32' if self.targetArch == '32bit' else 'win64'
packagePath = \
os.path.join(self.pkgsDir,
'webcamoid-portable-{}-{}.zip'.format(self.programVersion,
arch))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
with zipfile.ZipFile(packagePath, 'w', zipfile.ZIP_DEFLATED, False) as zipFile:
for root, dirs, files in os.walk(path):
for f in dirs + files:
filePath = os.path.join(root, f)
dstPath = os.path.join('webcamoid',
filePath.replace(path + os.sep, ''))
zipFile.write(filePath, dstPath)
mutex.acquire()
print('Created portable package:')
self.printPackageInfo(packagePath)
mutex.release()
def readChangeLog(self, changeLog, version):
if os.path.exists(changeLog):
with open(changeLog) as f:
for line in f:
if not line.startswith('Webcamoid {}:'.format(version)):
continue
# Skip first line.
f.readline()
changeLogText = ''
for line in f:
if re.match('Webcamoid \d+\.\d+\.\d+:', line):
# Remove last line.
i = changeLogText.rfind('\n')
if i >= 0:
changeLogText = changeLogText[: i]
return changeLogText
changeLogText += line
return ''
def createInstaller(self, mutex):
if not os.path.exists(self.qtIFW):
return
# Create layout
configDir = os.path.join(self.tempDir, 'installer\\config')
packageDir = os.path.join(self.tempDir, 'installer\\packages\\com.webcamoidprj.webcamoid')
if not os.path.exists(configDir):
os.makedirs(configDir)
dataDir = os.path.join(packageDir, 'data')
metaDir = os.path.join(packageDir, 'meta')
if not os.path.exists(metaDir):
os.makedirs(metaDir)
appIconSrc = os.path.join(self.rootDir, 'StandAlone\\share\\icons\\hicolor\\{0}x{0}\\webcamoid.ico'.format(self.installerIconSize))
self.copy(appIconSrc, configDir)
self.copy(os.path.join(self.rootDir, 'COPYING'),
os.path.join(metaDir, 'COPYING.txt'))
try:
shutil.copytree(self.installDir, dataDir, True)
except:
pass
version = '1.0.0' if self.programVersion == 'unknown' else self.programVersion
configXml = os.path.join(configDir, 'config.xml')
if int(self.qtIFWVersion.split('.')[0]) < 3:
appsDir = '@ApplicationsDir@'
else:
if self.targetArch == '32bit':
appsDir = '@ApplicationsDirX86@'
else:
appsDir = '@ApplicationsDirX64@'
with open(configXml, 'w') as config:
config.write('\n')
config.write('\n')
config.write(' Webcamoid\n')
config.write(' {}\n'.format(version))
config.write(' Webcamoid, The ultimate webcam suite!\n')
config.write(' Webcamoid\n')
config.write(' https://webcamoid.github.io/\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' webcamoid\n')
config.write(' #3F1F7F\n')
config.write(' @TargetDir@/bin/webcamoid.exe\n')
config.write(' Launch Webcamoid now!\n')
config.write(' Webcamoid\n')
config.write(' WebcamoidMaintenanceTool\n')
config.write(' true\n')
config.write(' {}/webcamoid\n'.format(appsDir))
config.write('\n')
self.copy(os.path.join(self.rootDir, 'ports/deploy/installscript.windows.qs'),
os.path.join(metaDir, 'installscript.qs'))
with open(os.path.join(metaDir, 'package.xml'), 'w') as f:
f.write('\n')
f.write('\n')
f.write(' Webcamoid\n')
f.write(' The ultimate webcam suite\n')
f.write(' {}\n'.format(version))
f.write(' {}\n'.format(time.strftime('%Y-%m-%d')))
f.write(' com.webcamoidprj.webcamoid\n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(' \n')
f.write(self.readChangeLog(os.path.join(self.rootDir, 'ChangeLog'),
version))
f.write(' \n')
f.write(' true\n')
f.write(' true\n')
f.write(' false\n')
f.write('\n')
# Remove old file
arch = 'win32' if self.targetArch == '32bit' else 'win64'
packagePath = os.path.join(self.pkgsDir,
'webcamoid-{}-{}.exe'.format(version,
arch))
if not os.path.exists(self.pkgsDir):
os.makedirs(self.pkgsDir)
if os.path.exists(packagePath):
os.remove(packagePath)
process = subprocess.Popen([self.qtIFW,
'-c', configXml,
'-p', os.path.join(self.tempDir,
'installer\\packages'),
packagePath],
stdout=subprocess.PIPE)
process.communicate()
mutex.acquire()
print('Created installable package:')
self.printPackageInfo(packagePath)
mutex.release()
def package(self):
print('\nCreating packages\n')
mutex = threading.Lock()
threads = [threading.Thread(target=self.createPortable, args=(mutex,)),
threading.Thread(target=self.createInstaller, args=(mutex,))]
for thread in threads:
thread.start()
for thread in threads:
thread.join()
def cleanup(self):
shutil.rmtree(os.path.join(self.rootDir, 'ports\\deploy\\temp_priv'),
True)
webcamoid-8.1.0+dfsg/README.md 0000644 0001750 0001750 00000004627 13166615412 014366 0 ustar qemu qemu # Webcamoid, The ultimate webcam suite! #
[Webcamoid](https://webcamoid.github.io/) is a full featured and multiplatform webcam suite.
## Features ##
* Cross-platform (GNU/Linux, Mac, Windows)
* Take pictures and record videos with the webcam.
* Manages multiple webcams.
* Written in C++/Qt.
* Custom controls for each webcam.
* Add funny effects to the webcam.
* +60 effects available.
* Translated to many languages.
* Use custom network and local files as capture devices.
* Capture from desktop.
* Many recording formats.
* Virtual webcam support for feeding other programs.
## Build and Install ##
Visit the [wiki](https://github.com/webcamoid/webcamoid/wiki) for a comprehensive compile and install instructions.
## Status ##
[](https://travis-ci.org/webcamoid/webcamoid)[](https://ci.appveyor.com/project/hipersayanX/webcamoid)[](https://hosted.weblate.org/engage/webcamoid/?utm_source=widget)[](https://www.openhub.net/p/Webcamoid)[](https://github.com/webcamoid/webcamoid/releases)[](http://www.softpedia.com/get/Internet/WebCam/Webcamoid.shtml)
[](https://repology.org/metapackage/webcamoid)
## Reporting Bugs ##
Use Webcamoid until an abnormal event happen, write a list with the following information:
1. Your Webcamoid version.
2. Your operating system.
3. Your Qt version.
4. Your GCC/Clang version.
5. Your DE/WM version.
6. Any other useful information.
Send this list to the [issues page](http://github.com/webcamoid/webcamoid/issues). Please report **ANY** problem you have with Webcamoid in the official website, help to centralize information in one unique place.
## Subscribe ##
Stay tuned to new releases with the project [feeds](https://github.com/webcamoid/webcamoid/releases.atom).
webcamoid-8.1.0+dfsg/webcamoid.desktop 0000644 0001750 0001750 00000003505 13166615412 016426 0 ustar qemu qemu [Desktop Entry]
Name=Webcamoid
GenericName=Webcam Capture Software
GenericName[ca]=Programari de Captura de CÃ mera web
GenericName[de]=Webcam-Capture-Software
GenericName[el]=κάμεÏα συλλαμβάνει το λογισμικό
GenericName[es]=Programa para Captura de la Webcam
GenericName[fr]=Logiciel de Capture Webcam
GenericName[gl]=Programa de Captura de Webcam
GenericName[it]=Webcam Capture Software
GenericName[ja]=ウェブカメラã®ã‚ャプãƒãƒ£ã‚½ãƒ•トウェア
GenericName[ko]=ì›¹ìº ìº¡ì²˜ 소프트웨어
GenericName[pt]=Software de Captura de Webcam
GenericName[ru]=Веб-камера захвата программного обеÑпечениÑ
GenericName[zh_CN]=æ‘„åƒå¤´æ•æ‰è½¯ä»¶
GenericName[zh_TW]=æ”åƒé æ•æ‰è»Ÿä»¶
Comment=Take photos and record videos with your webcam
Comment[ca]=Fer fotos i gravar vÃdeos amb la seva webcam
Comment[de]=Maak foto's en video's opnemen met uw webcam
Comment[el]=ΤÏαβήξτε φωτογÏαφίες και εγγÏαφή βίντεο με την κάμεÏα σας
Comment[es]=Tome fotos y grabe videos con su camara web
Comment[fr]=Prenez des photos et enregistrer des vidéos avec votre webcam
Comment[gl]=Facer fotos e gravar vÃdeos coa súa cámara web
Comment[it]=Scatta foto e registrare video con la tua webcam
Comment[ja]=ウェブカメラã§å†™çœŸã‚„記録ビデオを撮影
Comment[ko]=ì›¹ìº ìœ¼ë¡œ 사진과 ê¸°ë¡ ë¹„ë””ì˜¤ë¥¼ ì´¬ì˜
Comment[pt]=Tirar fotos e gravar vÃdeos com sua webcam
Comment[ru]=Возьмите фотографии и запиÑывать видео Ñ Ð²ÐµÐ±-камеры
Comment[zh_CN]=æ‹æ‘„照片和录制视频与您的摄åƒå¤´
Comment[zh_TW]=æ‹æ”ç…§ç‰‡å’ŒéŒ„è£½è¦–é »èˆ‡æ‚¨çš„æ”åƒé
Keywords=photo;video;webcam;
Exec=webcamoid
Icon=webcamoid
Terminal=false
Type=Application
Categories=AudioVideo;Player;Qt;
StartupNotify=true
webcamoid-8.1.0+dfsg/THANKS 0000644 0001750 0001750 00000000221 13166615412 014004 0 ustar qemu qemu This users helps on the Webcamoid development:
- nik3nt3 (http://opendesktop.org/usermanager/search.php?username=nik3nt3) (Popup plasmoid tip.)
webcamoid-8.1.0+dfsg/libAvKys/ 0000755 0001750 0001750 00000000000 13166615412 014622 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Lib/ 0000755 0001750 0001750 00000000000 13166615412 015330 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Lib/Lib.pro 0000644 0001750 0001750 00000004145 13166615412 016564 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
exists(commons.pri) {
include(commons.pri)
} else {
exists(../commons.pri) {
include(../commons.pri)
} else {
error("commons.pri file not found.")
}
}
CONFIG += qt
!isEmpty(STATIC_BUILD):!isEqual(STATIC_BUILD, 0): CONFIG += static
DEFINES += \
QT_DEPRECATED_WARNINGS \
AKCOMMONS_LIBRARY \
QT_INSTALL_QML=\"\\\"$$[QT_INSTALL_QML]\\\"\"
HEADERS = \
src/ak.h \
src/akutils.h \
src/akcaps.h \
src/akcommons.h \
src/akelement.h \
src/akfrac.h \
src/akpacket.h \
src/akplugin.h \
src/akmultimediasourceelement.h \
src/akvideocaps.h \
src/akaudiocaps.h \
src/akvideopacket.h \
src/akaudiopacket.h
QT += qml
SOURCES = \
src/ak.cpp \
src/akutils.cpp \
src/akcaps.cpp \
src/akelement.cpp \
src/akfrac.cpp \
src/akpacket.cpp \
src/akplugin.cpp \
src/akmultimediasourceelement.cpp \
src/akvideocaps.cpp \
src/akaudiocaps.cpp \
src/akvideopacket.cpp \
src/akaudiopacket.cpp
win32: LIBS += -lole32
DESTDIR = $${PWD}
TARGET = $${COMMONS_TARGET}
TEMPLATE = lib
CODECFORTR = UTF-8
CODECFORSRC = UTF-8
INSTALLS += target
unix:target.path = $${LIBDIR}
!unix:target.path = $${BINDIR}
!isEmpty(INSTALLDEVHEADERS):!isEqual(INSTALLDEVHEADERS, 0) {
INSTALLS += headers
headers.files = src/*.h
headers.path = $${INCLUDEDIR}/$${COMMONS_TARGET}
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/ 0000755 0001750 0001750 00000000000 13166615412 016117 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akaudiopacket.h 0000644 0001750 0001750 00000004450 13166615412 021100 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKAUDIOPACKET_H
#define AKAUDIOPACKET_H
#include "akpacket.h"
#include "akaudiocaps.h"
class AkAudioPacketPrivate;
class AKCOMMONS_EXPORT AkAudioPacket: public AkPacket
{
Q_OBJECT
Q_PROPERTY(AkAudioCaps caps
READ caps
WRITE setCaps
RESET resetCaps
NOTIFY capsChanged)
public:
explicit AkAudioPacket(QObject *parent=nullptr);
AkAudioPacket(const AkAudioCaps &caps,
const QByteArray &buffer=QByteArray(),
qint64 pts=0,
const AkFrac &timeBase=AkFrac(),
int index=-1,
qint64 id=-1);
AkAudioPacket(const AkPacket &other);
AkAudioPacket(const AkAudioPacket &other);
~AkAudioPacket();
AkAudioPacket &operator =(const AkPacket &other);
AkAudioPacket &operator =(const AkAudioPacket &other);
operator bool() const;
Q_INVOKABLE AkAudioCaps caps() const;
Q_INVOKABLE AkAudioCaps &caps();
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkPacket toPacket() const;
private:
AkAudioPacketPrivate *d;
Q_SIGNALS:
void capsChanged(const AkAudioCaps &caps);
public Q_SLOTS:
void setCaps(const AkAudioCaps &caps);
void resetCaps();
friend QDebug operator <<(QDebug debug, const AkAudioPacket &packet);
};
QDebug operator <<(QDebug debug, const AkAudioPacket &packet);
Q_DECLARE_METATYPE(AkAudioPacket)
#endif // AKAUDIOPACKET_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akfrac.h 0000644 0001750 0001750 00000007162 13166615412 017525 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKFRAC_H
#define AKFRAC_H
#include
#include
#include "akcommons.h"
class AkFracPrivate;
class AKCOMMONS_EXPORT AkFrac: public QObject
{
Q_OBJECT
Q_PROPERTY(int num
READ num
WRITE setNum
RESET resetNum
NOTIFY numChanged)
Q_PROPERTY(int den
READ den
WRITE setDen
RESET resetDen
NOTIFY denChanged)
Q_PROPERTY(bool isValid
READ isValid
NOTIFY isValidChanged)
Q_PROPERTY(qreal value
READ value
NOTIFY valueChanged)
Q_PROPERTY(QString string
READ toString
NOTIFY stringChanged)
public:
explicit AkFrac(QObject *parent=nullptr);
AkFrac(qint64 num, qint64 den);
AkFrac(const QString &fracString);
AkFrac(const AkFrac &other);
virtual ~AkFrac();
AkFrac &operator =(const AkFrac &other);
bool operator ==(const AkFrac &other) const;
bool operator !=(const AkFrac &other) const;
AkFrac operator *(const AkFrac &other) const;
Q_INVOKABLE qint64 num() const;
Q_INVOKABLE qint64 den() const;
Q_INVOKABLE qreal value() const;
Q_INVOKABLE qint64 fastValue() const;
Q_INVOKABLE bool isValid() const;
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkFrac invert() const;
private:
AkFracPrivate *d;
Q_SIGNALS:
void numChanged();
void denChanged();
void isValidChanged();
void valueChanged();
void stringChanged();
public Q_SLOTS:
void setNumDen(qint64 num, qint64 den);
void setNumDen(const QString &fracString);
void setNum(qint64 num);
void setDen(qint64 den);
void resetNum();
void resetDen();
friend QDebug operator <<(QDebug debug, const AkFrac &frac);
friend QDataStream &operator >>(QDataStream &istream, AkFrac &frac);
friend QDataStream &operator <<(QDataStream &ostream, const AkFrac &frac);
friend AkFrac operator *(int number, const AkFrac &frac);
friend AkFrac operator /(const AkFrac &fracNum, const AkFrac &fracDen);
friend AkFrac operator +(const AkFrac &frac1, const AkFrac &frac2);
friend AkFrac operator -(const AkFrac &frac1, const AkFrac &frac2);
};
QDebug operator <<(QDebug debug, const AkFrac &frac);
QDataStream &operator >>(QDataStream &istream, AkFrac &frac);
QDataStream &operator <<(QDataStream &ostream, const AkFrac &frac);
AkFrac operator *(int number, const AkFrac &frac);
AkFrac operator /(int number, const AkFrac &frac);
AkFrac operator /(const AkFrac &fracNum, const AkFrac &fracDen);
AkFrac operator +(const AkFrac &frac1, const AkFrac &frac2);
AkFrac operator -(const AkFrac &frac1, const AkFrac &frac2);
Q_DECLARE_METATYPE(AkFrac)
#endif // AKFRAC_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akelement.cpp 0000644 0001750 0001750 00000066431 13166615412 020602 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "ak.h"
#define SUBMODULES_PATH "submodules"
class AkPluginInfoPrivate
{
public:
QString m_id;
QString m_path;
QVariantMap m_metaData;
bool m_used;
};
class AkElementPrivate
{
public:
QString m_pluginId;
QString m_pluginPath;
QString m_pluginFilePattern;
QStringList m_pluginsSearchPaths;
QStringList m_defaultPluginsSearchPaths;
QStringList m_pluginsBlackList;
QList m_pluginsList;
QString m_subModulesPath;
QDir m_applicationDir;
AkElement::ElementState m_state;
bool m_recursiveSearchPaths;
bool m_pluginsScanned;
AkElementPrivate()
{
this->m_recursiveSearchPaths = false;
this->m_pluginsScanned = false;
this->m_defaultPluginsSearchPaths << QString("%1/%2")
.arg(LIBDIR)
.arg(COMMONS_TARGET);
#ifdef Q_OS_OSX
QString defaultPath;
if (QCoreApplication::applicationDirPath()
.endsWith(".app/Contents/MacOS")) {
QDir appDir(QCoreApplication::applicationDirPath());
appDir.cd(QString("../Plugins/%1").arg(COMMONS_TARGET));
defaultPath = appDir.absolutePath();
}
#else
QString defaultPath = QString("%1/../lib/%2")
.arg(QCoreApplication::applicationDirPath())
.arg(COMMONS_TARGET);
#endif
if (!defaultPath.isEmpty())
this->m_defaultPluginsSearchPaths << this->convertToAbsolute(defaultPath);
this->m_applicationDir.setPath(QCoreApplication::applicationDirPath());
this->m_subModulesPath = SUBMODULES_PATH;
#ifdef Q_OS_OSX
this->m_pluginFilePattern = "lib*.dylib";
#elif defined(Q_OS_WIN32)
this->m_pluginFilePattern = "*.dll";
#else
this->m_pluginFilePattern = "lib*.so";
#endif
}
static inline QList methodsByName(const QObject *object,
const QString &methodName)
{
QList methods;
QStringList methodSignatures;
for (int i = 0; i < object->metaObject()->methodCount(); i++) {
QMetaMethod method = object->metaObject()->method(i);
QString signature(method.methodSignature());
if (QRegExp(QString("\\s*%1\\s*\\(.*").arg(methodName))
.exactMatch(signature))
if (!methodSignatures.contains(signature)) {
methods << method;
methodSignatures << signature;
}
}
return methods;
}
static inline bool methodCompat(const QMetaMethod &method1,
const QMetaMethod &method2)
{
if (method1.parameterTypes() == method2.parameterTypes())
return true;
return false;
}
static inline QString pluginId(const QString &fileName)
{
auto pluginId = QFileInfo(fileName).baseName();
#ifdef Q_OS_WIN32
return pluginId;
;
#else
return pluginId.remove(QRegExp("^lib"));
#endif
}
inline QString convertToAbsolute(const QString &path) const
{
if (!QDir::isRelativePath(path))
return QDir::cleanPath(path);
QString absPath = this->m_applicationDir.absoluteFilePath(path);
return QDir::cleanPath(absPath);
}
inline void listPlugins()
{
QVector sPaths {
&this->m_pluginsSearchPaths,
&this->m_defaultPluginsSearchPaths
};
for (auto sPath: sPaths)
for (int i = sPath->length() - 1; i >= 0; i--) {
QString searchDir(sPath->at(i));
searchDir.replace(QRegExp("((\\\\/?)|(/\\\\?))+"),
QDir::separator());
while (searchDir.endsWith(QDir::separator()))
searchDir.resize(searchDir.size() - 1);
QStringList searchPaths(searchDir);
while (!searchPaths.isEmpty()) {
QString path = searchPaths.takeFirst();
if (this->m_pluginsBlackList.contains(path))
continue;
auto pluginId = this->pluginId(path);
bool found = false;
for (auto &pluginInfo: this->m_pluginsList)
if (pluginInfo.m_path == path) {
if (pluginInfo.m_metaData.isEmpty()) {
QPluginLoader pluginLoader(path);
if (pluginLoader.load()) {
if (pluginInfo.m_id.isEmpty())
pluginInfo.m_id = pluginId;
pluginInfo.m_metaData =
pluginLoader.metaData().toVariantMap();
pluginInfo.m_used = true;
pluginLoader.unload();
}
} else {
if (pluginInfo.m_id.isEmpty())
pluginInfo.m_id = pluginId;
pluginInfo.m_used = true;
}
found = true;
break;
}
if (found)
continue;
if (QFileInfo(path).isFile()) {
QString fileName = QFileInfo(path).fileName();
if (QRegExp(this->m_pluginFilePattern,
Qt::CaseSensitive,
QRegExp::Wildcard).exactMatch(fileName)) {
QPluginLoader pluginLoader(path);
if (pluginLoader.load()) {
auto metaData = pluginLoader.metaData();
if (metaData["MetaData"].toObject().contains("pluginType")
&& metaData["MetaData"].toObject()["pluginType"] == AK_PLUGIN_TYPE_ELEMENT) {
this->m_pluginsList <<
AkPluginInfoPrivate {
pluginId,
path,
metaData.toVariantMap(),
true
};
}
pluginLoader.unload();
}
}
} else {
QDir dir(path);
auto fileList = dir.entryList({this->m_pluginFilePattern},
QDir::Files
| QDir::CaseSensitive,
QDir::Name);
for (const QString &file: fileList)
searchPaths << dir.absoluteFilePath(file);
if (this->m_recursiveSearchPaths) {
auto dirList = dir.entryList(QDir::Dirs
| QDir::NoDotAndDotDot,
QDir::Name);
for (const QString &path: dirList)
searchPaths << dir.absoluteFilePath(path);
}
}
}
}
this->m_pluginsScanned = true;
}
};
Q_GLOBAL_STATIC(AkElementPrivate, akElementGlobalStuff)
AkElement::AkElement(QObject *parent):
QObject(parent)
{
this->d = new AkElementPrivate();
this->d->m_state = ElementStateNull;
}
AkElement::~AkElement()
{
this->setState(AkElement::ElementStateNull);
delete this->d;
}
QString AkElement::pluginId() const
{
return this->d->m_pluginId;
}
QString AkElement::pluginId(const QString &path)
{
return akElementGlobalStuff->pluginId(path);
}
QString AkElement::pluginPath() const
{
return this->d->m_pluginPath;
}
AkElement::ElementState AkElement::state() const
{
return this->d->m_state;
}
QObject *AkElement::controlInterface(QQmlEngine *engine,
const QString &controlId) const
{
Q_UNUSED(controlId)
if (!engine)
return nullptr;
auto qmlFile = this->controlInterfaceProvide(controlId);
if (qmlFile.isEmpty())
return nullptr;
// Load the UI from the plugin.
QQmlComponent component(engine, qmlFile);
if (component.isError()) {
qDebug() << "Error in plugin "
<< this->metaObject()->className()
<< ":"
<< component.errorString();
return nullptr;
}
// Create a context for the plugin.
QQmlContext *context = new QQmlContext(engine->rootContext());
this->controlInterfaceConfigure(context, controlId);
// Create an item with the plugin context.
QObject *item = component.create(context);
if (!item) {
delete context;
return nullptr;
}
QQmlEngine::setObjectOwnership(item, QQmlEngine::JavaScriptOwnership);
context->setParent(item);
return item;
}
bool AkElement::link(const QObject *dstElement,
Qt::ConnectionType connectionType) const
{
return this->link(this, dstElement, connectionType);
}
bool AkElement::link(const AkElementPtr &dstElement, Qt::ConnectionType connectionType) const
{
return this->link(static_cast(dstElement.data()), connectionType);
}
bool AkElement::unlink(const QObject *dstElement) const
{
return this->unlink(this, dstElement);
}
bool AkElement::unlink(const AkElementPtr &dstElement) const
{
return this->unlink(static_cast(dstElement.data()));
}
bool AkElement::link(const AkElementPtr &srcElement,
const QObject *dstElement,
Qt::ConnectionType connectionType)
{
return srcElement->link(dstElement, connectionType);
}
bool AkElement::link(const AkElementPtr &srcElement,
const AkElementPtr &dstElement,
Qt::ConnectionType connectionType)
{
return srcElement->link(dstElement, connectionType);
}
bool AkElement::link(const QObject *srcElement,
const QObject *dstElement,
Qt::ConnectionType connectionType)
{
if (!srcElement || !dstElement)
return false;
QList signalList = AkElementPrivate::methodsByName(srcElement, "oStream");
QList slotList = AkElementPrivate::methodsByName(dstElement, "iStream");
for (const QMetaMethod &signal: signalList)
for (const QMetaMethod &slot: slotList)
if (AkElementPrivate::methodCompat(signal, slot) &&
signal.methodType() == QMetaMethod::Signal &&
slot.methodType() == QMetaMethod::Slot)
QObject::connect(srcElement, signal, dstElement, slot, connectionType);
return true;
}
bool AkElement::unlink(const AkElementPtr &srcElement,
const QObject *dstElement)
{
return srcElement->unlink(dstElement);
}
bool AkElement::unlink(const AkElementPtr &srcElement,
const AkElementPtr &dstElement)
{
return srcElement->unlink(dstElement);
}
bool AkElement::unlink(const QObject *srcElement, const QObject *dstElement)
{
if (!srcElement || !dstElement)
return false;
for (const QMetaMethod &signal: AkElementPrivate::methodsByName(srcElement, "oStream"))
for (const QMetaMethod &slot: AkElementPrivate::methodsByName(dstElement, "iStream"))
if (AkElementPrivate::methodCompat(signal, slot) &&
signal.methodType() == QMetaMethod::Signal &&
slot.methodType() == QMetaMethod::Slot)
QObject::disconnect(srcElement, signal, dstElement, slot);
return true;
}
AkElementPtr AkElement::create(const QString &pluginId,
const QString &elementName)
{
auto element = AkElement::createPtr(pluginId, elementName);
if (!element)
return AkElementPtr();
return AkElementPtr(element);
}
AkElement *AkElement::createPtr(const QString &pluginId, const QString &elementName)
{
QString filePath = AkElement::pluginPath(pluginId);
if (filePath.isEmpty())
return nullptr;
QPluginLoader pluginLoader(filePath);
if (!pluginLoader.load()) {
qDebug() << "Error loading plugin " << pluginId << ":" << pluginLoader.errorString();
return nullptr;
}
auto plugin = qobject_cast(pluginLoader.instance());
if (!plugin)
return nullptr;
auto element = qobject_cast(plugin->create(AK_PLUGIN_TYPE_ELEMENT, ""));
delete plugin;
if (!element)
return nullptr;
if (!elementName.isEmpty())
element->setObjectName(elementName);
element->d->m_pluginId = pluginId;
element->d->m_pluginPath = filePath;
return element;
}
QStringList AkElement::listSubModules(const QString &pluginId,
const QString &type)
{
QStringList subModules;
auto subModulesPaths = AkElement::listSubModulesPaths(pluginId);
for (const QString &path: subModulesPaths) {
QPluginLoader pluginLoader(path);
QJsonObject metaData = pluginLoader.metaData();
QString pluginId = AkElementPrivate::pluginId(path);
if (!type.isEmpty()
&& metaData["MetaData"].toObject().contains("type")
&& metaData["MetaData"].toObject()["type"] == type
&& !subModules.contains(pluginId))
subModules << pluginId;
else if (type.isEmpty()
&& !subModules.contains(pluginId))
subModules << pluginId;
}
subModules.sort();
return subModules;
}
QStringList AkElement::listSubModules(const QStringList &types)
{
QString pluginId;
if (this->d->m_pluginId.isEmpty()) {
pluginId = this->metaObject()->className();
pluginId.replace(QRegExp("Element$"), "");
} else {
pluginId = this->d->m_pluginId;
}
if (types.isEmpty())
return AkElement::listSubModules(pluginId);
QStringList subModules;
for (const QString &type: types)
subModules << AkElement::listSubModules(pluginId, type);
return subModules;
}
QStringList AkElement::listSubModulesPaths(const QString &pluginId)
{
auto filePath = AkElement::pluginPath(pluginId);
if (filePath.isEmpty())
return QStringList();
auto pluginDir = QFileInfo(filePath).absoluteDir();
if (!pluginDir.cd(akElementGlobalStuff->m_subModulesPath
+ QDir::separator()
+ pluginId))
return QStringList();
QStringList subModulesPaths;
auto plugins = pluginDir.entryList({akElementGlobalStuff->m_pluginFilePattern},
QDir::Files
| QDir::AllDirs
| QDir::NoDotAndDotDot,
QDir::Name);
for (const QString &pluginFile: plugins) {
auto pluginPath = pluginDir.absoluteFilePath(pluginFile);
QPluginLoader pluginLoader(pluginPath);
if (!pluginLoader.load())
continue;
auto metaData = pluginLoader.metaData();
if (metaData["MetaData"].toObject().contains("pluginType")
&& metaData["MetaData"].toObject()["pluginType"] == AK_PLUGIN_TYPE_SUBMODULE) {
subModulesPaths << pluginPath;
}
}
return subModulesPaths;
}
QStringList AkElement::listSubModulesPaths()
{
QString pluginId;
if (this->d->m_pluginId.isEmpty()) {
pluginId = this->metaObject()->className();
pluginId.replace(QRegExp("Element$"), "");
} else {
pluginId = this->d->m_pluginId;
}
return AkElement::listSubModulesPaths(pluginId);
}
QObject *AkElement::loadSubModule(const QString &pluginId,
const QString &subModule)
{
auto subModulesPaths = AkElement::listSubModulesPaths(pluginId);
for (const QString &subModulesPath: subModulesPaths) {
if (AkElementPrivate::pluginId(subModulesPath) == subModule) {
QPluginLoader pluginLoader(subModulesPath);
if (!pluginLoader.load()) {
qDebug() << QString("Error loading submodule '%1' for '%2' plugin: %3")
.arg(subModule)
.arg(pluginId)
.arg(pluginLoader.errorString());
return nullptr;
}
auto plugin = qobject_cast(pluginLoader.instance());
if (!plugin)
return nullptr;
auto obj = plugin->create(AK_PLUGIN_TYPE_SUBMODULE, "");
delete plugin;
return obj;
}
}
return nullptr;
}
QObject *AkElement::loadSubModule(const QString &subModule)
{
QString pluginId;
if (this->d->m_pluginId.isEmpty()) {
pluginId = this->metaObject()->className();
pluginId.replace(QRegExp("Element$"), "");
} else {
pluginId = this->d->m_pluginId;
}
return AkElement::loadSubModule(pluginId, subModule);
}
bool AkElement::recursiveSearch()
{
return akElementGlobalStuff->m_recursiveSearchPaths;
}
void AkElement::setRecursiveSearch(bool enable)
{
akElementGlobalStuff->m_recursiveSearchPaths = enable;
}
QStringList AkElement::searchPaths()
{
return akElementGlobalStuff->m_pluginsSearchPaths;
}
void AkElement::addSearchPath(const QString &path)
{
auto absPath = akElementGlobalStuff->convertToAbsolute(path);
if (!path.isEmpty()
&& QDir(absPath).exists()
&& !akElementGlobalStuff->m_pluginsSearchPaths.contains(absPath))
akElementGlobalStuff->m_pluginsSearchPaths << absPath;
}
void AkElement::setSearchPaths(const QStringList &searchPaths)
{
akElementGlobalStuff->m_pluginsSearchPaths.clear();
for (const QString &path: searchPaths)
AkElement::addSearchPath(path);
}
void AkElement::resetSearchPaths()
{
akElementGlobalStuff->m_pluginsSearchPaths.clear();
}
QString AkElement::subModulesPath()
{
return akElementGlobalStuff->m_subModulesPath;
}
void AkElement::setSubModulesPath(const QString &subModulesPath)
{
akElementGlobalStuff->m_subModulesPath = subModulesPath;
}
void AkElement::resetSubModulesPath()
{
akElementGlobalStuff->m_subModulesPath = SUBMODULES_PATH;
}
QStringList AkElement::listPlugins(const QString &type)
{
if (!akElementGlobalStuff->m_pluginsScanned)
akElementGlobalStuff->listPlugins();
QStringList plugins;
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList) {
auto metaData = pluginInfo.m_metaData["MetaData"].toMap();
if (!type.isEmpty()
&& metaData.contains("type")
&& metaData["type"] == type
&& !plugins.contains(pluginInfo.m_id))
plugins << pluginInfo.m_id;
else if (type.isEmpty()
&& !plugins.contains(pluginInfo.m_id))
plugins << pluginInfo.m_id;
}
plugins.sort();
return plugins;
}
QStringList AkElement::listPluginPaths(const QString &searchPath)
{
if (!akElementGlobalStuff->m_pluginsScanned)
akElementGlobalStuff->listPlugins();
QString searchDir(searchPath);
searchDir.replace(QRegExp("((\\\\/?)|(/\\\\?))+"),
QDir::separator());
QStringList files;
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList)
if (pluginInfo.m_path.startsWith(searchDir))
files << pluginInfo.m_path;
return files;
}
QStringList AkElement::listPluginPaths(bool all)
{
if (!akElementGlobalStuff->m_pluginsScanned)
akElementGlobalStuff->listPlugins();
QStringList files;
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList)
if (!pluginInfo.m_path.isEmpty()
&& !pluginInfo.m_id.isEmpty()
&& (all || pluginInfo.m_used))
files << pluginInfo.m_path;
return files;
}
void AkElement::setPluginPaths(const QStringList &paths)
{
for (auto &path: paths) {
bool contains = false;
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList)
if (pluginInfo.m_path == path) {
contains = true;
break;
}
if (!contains)
akElementGlobalStuff->m_pluginsList
<< AkPluginInfoPrivate {
akElementGlobalStuff->pluginId(path),
path,
{},
false
};
}
}
QStringList AkElement::pluginsBlackList()
{
return akElementGlobalStuff->m_pluginsBlackList;
}
void AkElement::setPluginsBlackList(const QStringList &blackList)
{
akElementGlobalStuff->m_pluginsBlackList = blackList;
}
QString AkElement::pluginPath(const QString &pluginId)
{
QStringList pluginPaths = AkElement::listPluginPaths();
for (const QString &path: pluginPaths) {
QString baseName = QFileInfo(path).baseName();
#ifdef Q_OS_WIN32
if (baseName == pluginId)
return path;
#else
if (baseName == QString("lib%1").arg(pluginId))
return path;
#endif
}
return QString();
}
QVariantMap AkElement::pluginInfo(const QString &pluginId)
{
if (!akElementGlobalStuff->m_pluginsScanned)
akElementGlobalStuff->listPlugins();
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList)
if (pluginInfo.m_id == pluginId)
return pluginInfo.m_metaData;
return QVariantMap();
}
void AkElement::setPluginInfo(const QString &path,
const QVariantMap &metaData)
{
for (auto &pluginInfo: akElementGlobalStuff->m_pluginsList)
if (pluginInfo.m_path == path) {
pluginInfo.m_metaData = metaData;
return;
}
akElementGlobalStuff->m_pluginsList
<< AkPluginInfoPrivate {
akElementGlobalStuff->pluginId(path),
path,
metaData,
false
};
}
void AkElement::clearCache()
{
akElementGlobalStuff->m_pluginsList.clear();
akElementGlobalStuff->m_pluginsScanned = false;
}
AkPacket AkElement::operator ()(const AkPacket &packet)
{
return this->iStream(packet);
}
AkPacket AkElement::operator ()(const AkAudioPacket &packet)
{
return this->iStream(packet);
}
AkPacket AkElement::operator ()(const AkVideoPacket &packet)
{
return this->iStream(packet);
}
QString AkElement::controlInterfaceProvide(const QString &controlId) const
{
Q_UNUSED(controlId)
return QString();
}
void AkElement::controlInterfaceConfigure(QQmlContext *context,
const QString &controlId) const
{
Q_UNUSED(context)
Q_UNUSED(controlId)
}
void AkElement::stateChange(AkElement::ElementState from, AkElement::ElementState to)
{
Q_UNUSED(from)
Q_UNUSED(to)
}
AkPacket AkElement::iStream(const AkPacket &packet)
{
if (packet.caps().mimeType() == "audio/x-raw")
return this->iStream(AkAudioPacket(packet));
else if (packet.caps().mimeType() == "video/x-raw")
return this->iStream(AkVideoPacket(packet));
return AkPacket();
}
AkPacket AkElement::iStream(const AkAudioPacket &packet)
{
Q_UNUSED(packet)
return AkPacket();
}
AkPacket AkElement::iStream(const AkVideoPacket &packet)
{
Q_UNUSED(packet)
return AkPacket();
}
bool AkElement::setState(AkElement::ElementState state)
{
if (this->d->m_state == state)
return false;
ElementState preState = this->d->m_state;
this->d->m_state = state;
switch (preState) {
case ElementStateNull: {
switch (state) {
case ElementStatePaused:
emit this->stateChanged(state);
emit this->stateChange(preState, state);
break;
case ElementStatePlaying:
emit this->stateChanged(ElementStatePaused);
emit this->stateChange(preState, ElementStatePaused);
emit this->stateChanged(state);
emit this->stateChange(ElementStatePaused, state);
break;
case ElementStateNull:
break;
}
break;
}
case ElementStatePaused: {
switch (state) {
case ElementStateNull:
case ElementStatePlaying:
emit this->stateChanged(state);
emit this->stateChange(preState, state);
break;
case ElementStatePaused:
break;
}
break;
}
case ElementStatePlaying: {
switch (state) {
case ElementStateNull:
emit this->stateChanged(ElementStatePaused);
emit this->stateChange(preState, ElementStatePaused);
emit this->stateChanged(state);
emit this->stateChange(ElementStatePaused, state);
break;
case ElementStatePaused:
emit this->stateChanged(state);
emit this->stateChange(preState, state);
break;
case ElementStatePlaying:
break;
}
break;
}
}
return true;
}
void AkElement::resetState()
{
this->setState(ElementStateNull);
}
QDataStream &operator >>(QDataStream &istream, AkElement::ElementState &state)
{
int stateInt;
istream >> stateInt;
state = static_cast(stateInt);
return istream;
}
QDataStream &operator <<(QDataStream &ostream, AkElement::ElementState state)
{
ostream << static_cast(state);
return ostream;
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akplugin.cpp 0000644 0001750 0001750 00000001477 13166615412 020446 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akplugin.h"
AkPlugin::~AkPlugin()
{
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akaudiocaps.h 0000644 0001750 0001750 00000032521 13166615412 020557 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKAUDIOCAPS_H
#define AKAUDIOCAPS_H
#include "akcaps.h"
class AkAudioCapsPrivate;
class AKCOMMONS_EXPORT AkAudioCaps: public QObject
{
Q_OBJECT
Q_ENUMS(SampleFormat)
Q_ENUMS(SampleType)
Q_ENUMS(Position)
Q_ENUMS(ChannelLayout)
Q_PROPERTY(bool isValid
READ isValid)
Q_PROPERTY(SampleFormat format
READ format
WRITE setFormat
RESET resetFormat
NOTIFY formatChanged)
Q_PROPERTY(int bps
READ bps
WRITE setBps
RESET resetBps
NOTIFY bpsChanged)
Q_PROPERTY(int channels
READ channels
WRITE setChannels
RESET resetChannels
NOTIFY channelsChanged)
Q_PROPERTY(int rate
READ rate
WRITE setRate
RESET resetRate
NOTIFY rateChanged)
Q_PROPERTY(ChannelLayout layout
READ layout
WRITE setLayout
RESET resetLayout
NOTIFY layoutChanged)
Q_PROPERTY(int samples
READ samples
WRITE setSamples
RESET resetSamples
NOTIFY samplesChanged)
Q_PROPERTY(bool align
READ align
WRITE setAlign
RESET resetAlign
NOTIFY alignChanged)
public:
enum SampleFormat
{
SampleFormat_none = -1,
SampleFormat_s8,
SampleFormat_u8,
SampleFormat_s16,
SampleFormat_s16le,
SampleFormat_s16be,
SampleFormat_u16,
SampleFormat_u16le,
SampleFormat_u16be,
SampleFormat_s24,
SampleFormat_s24le,
SampleFormat_s24be,
SampleFormat_u24,
SampleFormat_u24le,
SampleFormat_u24be,
SampleFormat_s32,
SampleFormat_s32le,
SampleFormat_s32be,
SampleFormat_u32,
SampleFormat_u32le,
SampleFormat_u32be,
SampleFormat_s64,
SampleFormat_s64le,
SampleFormat_s64be,
SampleFormat_u64,
SampleFormat_u64le,
SampleFormat_u64be,
SampleFormat_flt,
SampleFormat_fltle,
SampleFormat_fltbe,
SampleFormat_dbl,
SampleFormat_dblle,
SampleFormat_dblbe,
SampleFormat_u8p,
SampleFormat_s16p,
SampleFormat_s32p,
SampleFormat_s64p,
SampleFormat_fltp,
SampleFormat_dblp
};
enum SampleType
{
SampleType_unknown = -1,
SampleType_int,
SampleType_uint,
SampleType_float
};
enum Position
{
Position_unknown = 0x00000000,
Position_FrontLeft = 0x00000001,
Position_FrontRight = 0x00000002,
Position_FrontCenter = 0x00000004,
Position_LowFrequency1 = 0x00000008,
Position_BackLeft = 0x00000010,
Position_BackRight = 0x00000020,
Position_FrontLeftOfCenter = 0x00000040,
Position_FrontRightOfCenter = 0x00000080,
Position_BackCenter = 0x00000100,
Position_LowFrequency2 = 0x00000200,
Position_SideLeft = 0x00000400,
Position_SideRight = 0x00000800,
Position_TopCenter = 0x00001000,
Position_TopFrontLeft = 0x00002000,
Position_TopFrontCenter = 0x00004000,
Position_TopFrontRight = 0x00008000,
Position_TopBackLeft = 0x00010000,
Position_TopBackCenter = 0x00020000,
Position_TopBackRight = 0x00040000,
Position_TopSideLeft = 0x00080000,
Position_TopSideRight = 0x00100000,
Position_BottomFrontCenter = 0x00200000,
Position_BottomFrontLeft = 0x00400000,
Position_BottomFrontRight = 0x00800000,
Position_StereoLeft = 0x01000000,
Position_StereoRight = 0x02000000,
Position_WideLeft = 0x04000000,
Position_WideRight = 0x08000000,
Position_SurroundDirectLeft = 0x10000000,
Position_SurroundDirectRight = 0x20000000
};
Q_DECLARE_FLAGS(Positions, Position)
Q_FLAG(Positions)
enum ChannelLayout
{
Layout_none = 0,
Layout_mono = Position_FrontCenter,
Layout_stereo = Position_FrontLeft | Position_FrontRight,
Layout_2p1 = Layout_stereo | Position_LowFrequency1,
Layout_3p0 = Layout_stereo | Position_FrontCenter,
Layout_3p0_back = Layout_stereo | Position_BackCenter,
Layout_3p1 = Layout_3p0 | Position_LowFrequency1,
Layout_4p0 = Layout_3p0 | Position_BackCenter,
Layout_quad = Layout_stereo | Position_BackLeft | Position_BackRight,
Layout_quad_side = Layout_stereo | Position_SideLeft | Position_SideRight,
Layout_4p1 = Layout_4p0 | Position_LowFrequency1,
Layout_5p0 = Layout_3p0 | Position_BackLeft | Position_BackRight,
Layout_5p0_side = Layout_3p0 | Position_SideLeft | Position_SideRight,
Layout_5p1 = Layout_5p0 | Position_LowFrequency1,
Layout_5p1_side = Layout_5p0_side | Position_LowFrequency1,
Layout_6p0 = Layout_5p0_side | Position_BackCenter,
Layout_6p0_front = Layout_quad_side | Position_FrontLeftOfCenter | Position_FrontRightOfCenter,
Layout_hexagonal = Layout_5p0 | Position_BackCenter,
Layout_6p1 = Layout_5p1_side | Position_BackCenter,
Layout_6p1_back = Layout_5p1 | Position_BackCenter,
Layout_6p1_front = Layout_6p0_front | Position_LowFrequency1,
Layout_7p0 = Layout_5p0_side | Position_BackLeft | Position_BackRight,
Layout_7p0_front = Layout_5p0_side | Position_FrontLeftOfCenter | Position_FrontRightOfCenter,
Layout_7p1 = Layout_5p1_side | Position_BackLeft | Position_BackRight,
Layout_7p1_wide = Layout_5p1_side | Position_FrontLeftOfCenter | Position_FrontRightOfCenter,
Layout_7p1_wide_side = Layout_5p1 | Position_FrontLeftOfCenter | Position_FrontRightOfCenter,
Layout_octagonal = Layout_7p0 | Position_BackCenter,
Layout_hexadecagonal = Layout_octagonal
| Position_WideLeft | Position_WideRight
| Position_BackLeft | Position_BackRight
| Position_TopBackCenter | Position_TopFrontCenter
| Position_TopFrontLeft | Position_TopFrontRight,
Layout_downmix = Position_StereoLeft | Position_StereoRight
};
explicit AkAudioCaps(QObject *parent=nullptr);
AkAudioCaps(const QVariantMap &caps);
AkAudioCaps(const QString &caps);
AkAudioCaps(const AkCaps &caps);
AkAudioCaps(const AkAudioCaps &other);
AkAudioCaps(SampleFormat format, int channels, int rate);
~AkAudioCaps();
AkAudioCaps &operator =(const AkAudioCaps &other);
AkAudioCaps &operator =(const AkCaps &caps);
AkAudioCaps &operator =(const QString &caps);
bool operator ==(const AkAudioCaps &other) const;
bool operator !=(const AkAudioCaps &other) const;
operator bool() const;
operator AkCaps() const;
Q_INVOKABLE bool isValid() const;
Q_INVOKABLE bool &isValid();
Q_INVOKABLE SampleFormat format() const;
Q_INVOKABLE SampleFormat &format();
Q_INVOKABLE int bps() const;
Q_INVOKABLE int &bps();
Q_INVOKABLE int channels() const;
Q_INVOKABLE int &channels();
Q_INVOKABLE int rate() const;
Q_INVOKABLE int &rate();
Q_INVOKABLE ChannelLayout layout() const;
Q_INVOKABLE ChannelLayout &layout();
Q_INVOKABLE int samples() const;
Q_INVOKABLE int &samples();
Q_INVOKABLE bool align() const;
Q_INVOKABLE bool &align();
Q_INVOKABLE AkAudioCaps &fromMap(const QVariantMap &caps);
Q_INVOKABLE AkAudioCaps &fromString(const QString &caps);
Q_INVOKABLE QVariantMap toMap() const;
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkAudioCaps &update(const AkCaps &caps);
Q_INVOKABLE AkCaps toCaps() const;
Q_INVOKABLE static int bitsPerSample(SampleFormat sampleFormat);
Q_INVOKABLE static int bitsPerSample(const QString &sampleFormat);
Q_INVOKABLE static QString sampleFormatToString(SampleFormat sampleFormat);
Q_INVOKABLE static SampleFormat sampleFormatFromString(const QString &sampleFormat);
Q_INVOKABLE static SampleFormat sampleFormatFromProperties(AkAudioCaps::SampleType type,
int bps,
int endianness,
bool planar);
Q_INVOKABLE static bool sampleFormatProperties(SampleFormat sampleFormat,
AkAudioCaps::SampleType *type=nullptr,
int *bps=nullptr,
int *endianness=nullptr,
bool *planar=nullptr);
Q_INVOKABLE static bool sampleFormatProperties(const QString &sampleFormat,
AkAudioCaps::SampleType *type=nullptr,
int *bps=nullptr,
int *endianness=nullptr,
bool *planar=nullptr);
Q_INVOKABLE static SampleType sampleType(SampleFormat sampleFormat);
Q_INVOKABLE static SampleType sampleType(const QString &sampleFormat);
Q_INVOKABLE static QString channelLayoutToString(ChannelLayout channelLayout);
Q_INVOKABLE static ChannelLayout channelLayoutFromString(const QString &channelLayout);
Q_INVOKABLE static int channelCount(ChannelLayout channelLayout);
Q_INVOKABLE static int channelCount(const QString &channelLayout);
Q_INVOKABLE static int endianness(SampleFormat sampleFormat);
Q_INVOKABLE static int endianness(const QString &sampleFormat);
Q_INVOKABLE static bool isPlanar(SampleFormat sampleFormat);
Q_INVOKABLE static bool isPlanar(const QString &sampleFormat);
Q_INVOKABLE static ChannelLayout defaultChannelLayout(int channelCount);
Q_INVOKABLE static QString defaultChannelLayoutString(int channelCount);
private:
AkAudioCapsPrivate *d;
Q_SIGNALS:
void formatChanged(SampleFormat format);
void bpsChanged(int bps);
void channelsChanged(int channels);
void rateChanged(int rate);
void layoutChanged(ChannelLayout layout);
void samplesChanged(int samples);
void alignChanged(bool align);
public Q_SLOTS:
void setFormat(SampleFormat format);
void setBps(int bps);
void setChannels(int channels);
void setRate(int rate);
void setLayout(ChannelLayout layout);
void setSamples(int samples);
void setAlign(bool align);
void resetFormat();
void resetBps();
void resetChannels();
void resetRate();
void resetLayout();
void resetSamples();
void resetAlign();
friend QDebug operator <<(QDebug debug, const AkAudioCaps &caps);
friend QDataStream &operator >>(QDataStream &istream, AkAudioCaps &caps);
friend QDataStream &operator <<(QDataStream &ostream, const AkAudioCaps &caps);
};
QDebug operator <<(QDebug debug, const AkAudioCaps &caps);
QDataStream &operator >>(QDataStream &istream, AkAudioCaps &caps);
QDataStream &operator <<(QDataStream &ostream, const AkAudioCaps &caps);
Q_DECLARE_METATYPE(AkAudioCaps)
Q_DECLARE_METATYPE(AkAudioCaps::SampleFormat)
Q_DECLARE_METATYPE(AkAudioCaps::ChannelLayout)
Q_DECLARE_OPERATORS_FOR_FLAGS(AkAudioCaps::Positions)
#endif // AKAUDIOCAPS_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akutils.h 0000644 0001750 0001750 00000002621 13166615412 017745 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKUTILS_H
#define AKUTILS_H
#include
#include "akvideopacket.h"
namespace AkUtils
{
AKCOMMONS_EXPORT AkPacket imageToPacket(const QImage &image,
const AkPacket &defaultPacket);
AKCOMMONS_EXPORT QImage packetToImage(const AkPacket &packet);
AKCOMMONS_EXPORT AkPacket roundSizeTo(const AkPacket &packet, int n);
AKCOMMONS_EXPORT AkVideoPacket convertVideo(const AkVideoPacket &packet,
AkVideoCaps::PixelFormat format,
const QSize &size=QSize());
}
#endif // AKUTILS_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akplugin.h 0000644 0001750 0001750 00000002317 13166615412 020105 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKPLUGIN_H
#define AKPLUGIN_H
#include
#include "akcommons.h"
#define AK_PLUGIN_TYPE_ELEMENT "Ak.Element"
#define AK_PLUGIN_TYPE_SUBMODULE "Ak.SubModule"
class AKCOMMONS_EXPORT AkPlugin
{
public:
virtual ~AkPlugin();
virtual QObject *create(const QString &name, const QString &spec) = 0;
virtual QStringList keys() const = 0;
};
Q_DECLARE_INTERFACE(AkPlugin, "Ak.Plugin")
#endif // AKPLUGIN_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akutils.cpp 0000644 0001750 0001750 00000010245 13166615412 020301 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akutils.h"
typedef QMap ImageToPixelFormatMap;
inline ImageToPixelFormatMap initImageToPixelFormatMap()
{
ImageToPixelFormatMap imageToFormat;
imageToFormat[QImage::Format_Mono] = AkVideoCaps::Format_monob;
imageToFormat[QImage::Format_RGB32] = AkVideoCaps::Format_0rgb;
imageToFormat[QImage::Format_ARGB32] = AkVideoCaps::Format_argb;
imageToFormat[QImage::Format_RGB16] = AkVideoCaps::Format_rgb565le;
imageToFormat[QImage::Format_RGB555] = AkVideoCaps::Format_rgb555le;
imageToFormat[QImage::Format_RGB888] = AkVideoCaps::Format_rgb24;
imageToFormat[QImage::Format_RGB444] = AkVideoCaps::Format_rgb444le;
imageToFormat[QImage::Format_Grayscale8] = AkVideoCaps::Format_gray;
return imageToFormat;
}
Q_GLOBAL_STATIC_WITH_ARGS(ImageToPixelFormatMap, AkImageToFormat, (initImageToPixelFormatMap()))
AkPacket AkUtils::imageToPacket(const QImage &image, const AkPacket &defaultPacket)
{
if (!AkImageToFormat->contains(image.format()))
return AkPacket();
QByteArray oBuffer(image.byteCount(), 0);
memcpy(oBuffer.data(), image.constBits(), size_t(image.byteCount()));
AkVideoCaps caps(defaultPacket.caps());
caps.format() = AkImageToFormat->value(image.format());
caps.bpp() = AkVideoCaps::bitsPerPixel(caps.format());
caps.width() = image.width();
caps.height() = image.height();
AkPacket packet = defaultPacket;
packet.setCaps(caps.toCaps());
packet.setBuffer(oBuffer);
return packet;
}
QImage AkUtils::packetToImage(const AkPacket &packet)
{
AkVideoCaps caps(packet.caps());
if (!caps)
return QImage();
if (!AkImageToFormat->values().contains(caps.format()))
return QImage();
QImage image(caps.width(),
caps.height(),
AkImageToFormat->key(caps.format()));
memcpy(image.bits(), packet.buffer().constData(), size_t(packet.buffer().size()));
if (caps.format() == AkVideoCaps::Format_gray)
for (int i = 0; i < 256; i++)
image.setColor(i, QRgb(i));
return image;
}
AkPacket AkUtils::roundSizeTo(const AkPacket &packet, int n)
{
int frameWidth = packet.property("width").toInt();
int frameHeight = packet.property("height").toInt();
int width = n * qRound(frameWidth / qreal(n));
int height = n * qRound(frameHeight / qreal(n));
if (frameWidth == width
&& frameHeight == height)
return packet;
QImage frame = AkUtils::packetToImage(packet);
if (frame.isNull())
return packet;
return AkUtils::imageToPacket(frame.scaled(width, height), packet);
}
AkVideoPacket AkUtils::convertVideo(const AkVideoPacket &packet,
AkVideoCaps::PixelFormat format,
const QSize &size)
{
if (!AkImageToFormat->values().contains(format))
return AkVideoPacket();
if (packet.caps().format() == format
&& (size.isEmpty() || packet.caps().size() == size))
return packet;
QImage frame = AkUtils::packetToImage(packet.toPacket());
if (frame.isNull())
return packet;
QImage convertedFrame;
if (size.isEmpty())
convertedFrame = frame.convertToFormat(AkImageToFormat->key(format));
else
convertedFrame = frame.convertToFormat(AkImageToFormat->key(format)).scaled(size);
return AkUtils::imageToPacket(convertedFrame, packet.toPacket());
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akcaps.h 0000644 0001750 0001750 00000006235 13166615412 017540 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKCAPS_H
#define AKCAPS_H
#include
#include
#include
#include "akcommons.h"
class AkCapsPrivate;
class AKCOMMONS_EXPORT AkCaps: public QObject
{
Q_OBJECT
Q_ENUMS(CapsType)
Q_PROPERTY(bool isValid
READ isValid)
Q_PROPERTY(QString mimeType
READ mimeType
WRITE setMimeType
RESET resetMimeType
NOTIFY mimeTypeChanged)
public:
enum CapsType
{
CapsUnknown = -1,
CapsAudio,
CapsVideo,
CapsSubtitle
};
explicit AkCaps(QObject *parent=nullptr);
AkCaps(const QVariantMap &caps);
AkCaps(const QString &caps);
AkCaps(const AkCaps &other);
virtual ~AkCaps();
AkCaps &operator =(const AkCaps &other);
AkCaps &operator =(const QString &other);
bool operator ==(const AkCaps &other) const;
bool operator ==(const QString &caps) const;
bool operator !=(const AkCaps &other) const;
bool operator !=(const QString &caps) const;
operator bool() const;
Q_INVOKABLE virtual bool isValid() const;
Q_INVOKABLE virtual bool &isValid();
Q_INVOKABLE virtual QString mimeType() const;
Q_INVOKABLE AkCaps &fromMap(const QVariantMap &caps);
Q_INVOKABLE AkCaps &fromString(const QString &caps);
Q_INVOKABLE QVariantMap toMap() const;
Q_INVOKABLE virtual QString toString() const;
Q_INVOKABLE AkCaps &update(const AkCaps &other);
Q_INVOKABLE bool isCompatible(const AkCaps &other) const;
Q_INVOKABLE bool contains(const QString &property) const;
private:
AkCapsPrivate *d;
Q_SIGNALS:
void mimeTypeChanged(const QString &mimeType);
public Q_SLOTS:
virtual void setMimeType(const QString &mimeType);
virtual void resetMimeType();
void clear();
friend QDebug operator <<(QDebug debug, const AkCaps &caps);
friend QDataStream &operator >>(QDataStream &istream, AkCaps &caps);
friend QDataStream &operator <<(QDataStream &ostream, const AkCaps &caps);
};
QDebug operator <<(QDebug debug, const AkCaps &caps);
QDataStream &operator >>(QDataStream &istream, AkCaps &caps);
QDataStream &operator <<(QDataStream &ostream, const AkCaps &caps);
Q_DECLARE_METATYPE(AkCaps)
Q_DECLARE_METATYPE(AkCaps::CapsType)
#endif // AKCAPS_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akcommons.h 0000644 0001750 0001750 00000001751 13166615412 020263 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKCOMMONS_H
#define AKCOMMONS_H
#include
#if defined(AKCOMMONS_LIBRARY)
# define AKCOMMONS_EXPORT Q_DECL_EXPORT
#else
# define AKCOMMONS_EXPORT Q_DECL_IMPORT
#endif
#endif // AKCOMMONS_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akaudiopacket.cpp 0000644 0001750 0001750 00000011461 13166615412 021433 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akaudiopacket.h"
class AkAudioPacketPrivate
{
public:
AkAudioCaps m_caps;
};
AkAudioPacket::AkAudioPacket(QObject *parent):
AkPacket(parent)
{
this->d = new AkAudioPacketPrivate();
}
AkAudioPacket::AkAudioPacket(const AkAudioCaps &caps,
const QByteArray &buffer,
qint64 pts,
const AkFrac &timeBase,
int index,
qint64 id)
{
this->d = new AkAudioPacketPrivate();
this->d->m_caps = caps;
this->buffer() = buffer;
this->pts() = pts;
this->timeBase() = timeBase;
this->index() = index;
this->id() = id;
}
AkAudioPacket::AkAudioPacket(const AkPacket &other)
{
this->d = new AkAudioPacketPrivate();
this->d->m_caps = other.caps();
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
AkAudioPacket::AkAudioPacket(const AkAudioPacket &other):
AkPacket()
{
this->d = new AkAudioPacketPrivate();
this->d->m_caps = other.d->m_caps;
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
AkAudioPacket::~AkAudioPacket()
{
delete this->d;
}
AkAudioPacket &AkAudioPacket::operator =(const AkPacket &other)
{
this->d->m_caps = other.caps();
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
return *this;
}
AkAudioPacket &AkAudioPacket::operator =(const AkAudioPacket &other)
{
if (this != &other) {
this->d->m_caps = other.d->m_caps;
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
return *this;
}
AkAudioPacket::operator bool() const
{
return this->d->m_caps.isValid();
}
AkAudioCaps AkAudioPacket::caps() const
{
return this->d->m_caps;
}
AkAudioCaps &AkAudioPacket::caps()
{
return this->d->m_caps;
}
QString AkAudioPacket::toString() const
{
QString packetInfo;
QDebug debug(&packetInfo);
debug.nospace() << "Caps : "
<< this->d->m_caps.toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Data : "
<< this->data()
<< "\n";
debug.nospace() << "Buffer Size: "
<< this->buffer().size()
<< "\n";
debug.nospace() << "Id : "
<< this->id()
<< "\n";
debug.nospace() << "Pts : "
<< this->pts()
<< " ("
<< this->pts() * this->timeBase().value()
<< ")\n";
debug.nospace() << "Time Base : "
<< this->timeBase().toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Index : "
<< this->index();
return packetInfo;
}
AkPacket AkAudioPacket::toPacket() const
{
AkPacket packet;
packet.caps() = this->d->m_caps.toCaps();
packet.buffer() = this->buffer();
packet.pts() = this->pts();
packet.timeBase() = this->timeBase();
packet.index() = this->index();
packet.id() = this->id();
return packet;
}
void AkAudioPacket::setCaps(const AkAudioCaps &caps)
{
if (this->d->m_caps == caps)
return;
this->d->m_caps = caps;
emit this->capsChanged(caps);
}
void AkAudioPacket::resetCaps()
{
this->setCaps(AkAudioCaps());
}
QDebug operator <<(QDebug debug, const AkAudioPacket &packet)
{
debug.nospace() << packet.toString().toStdString().c_str();
return debug.space();
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akmultimediasourceelement.cpp 0000644 0001750 0001750 00000004606 13166615412 024072 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akmultimediasourceelement.h"
class AkMultimediaSourceElementPrivate
{
public:
QStringList m_medias;
QString m_media;
QList m_streams;
bool m_loop;
};
AkMultimediaSourceElement::AkMultimediaSourceElement(QObject *parent):
AkElement(parent)
{
this->d = new AkMultimediaSourceElementPrivate();
this->d->m_loop = false;
}
AkMultimediaSourceElement::~AkMultimediaSourceElement()
{
delete this->d;
}
QStringList AkMultimediaSourceElement::medias()
{
return this->d->m_medias;
}
QString AkMultimediaSourceElement::media() const
{
return this->d->m_media;
}
QList AkMultimediaSourceElement::streams() const
{
return this->d->m_streams;
}
bool AkMultimediaSourceElement::loop() const
{
return this->d->m_loop;
}
int AkMultimediaSourceElement::defaultStream(const QString &mimeType)
{
Q_UNUSED(mimeType)
return -1;
}
QString AkMultimediaSourceElement::description(const QString &media)
{
Q_UNUSED(media)
return QString();
}
AkCaps AkMultimediaSourceElement::caps(int stream)
{
Q_UNUSED(stream)
return AkCaps();
}
void AkMultimediaSourceElement::setMedia(const QString &media)
{
this->d->m_media = media;
}
void AkMultimediaSourceElement::setStreams(const QList &streams)
{
this->d->m_streams = streams;
}
void AkMultimediaSourceElement::setLoop(bool loop)
{
this->d->m_loop = loop;
}
void AkMultimediaSourceElement::resetMedia()
{
this->setMedia("");
}
void AkMultimediaSourceElement::resetStreams()
{
this->setStreams(QList());
}
void AkMultimediaSourceElement::resetLoop()
{
this->setLoop(false);
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/ak.h 0000644 0001750 0001750 00000002313 13166615412 016662 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AK_H
#define AK_H
#include "akplugin.h"
#include "akelement.h"
namespace Ak
{
AKCOMMONS_EXPORT qint64 id();
AKCOMMONS_EXPORT void setQmlEngine(QQmlEngine *engine);
AKCOMMONS_EXPORT QStringList qmlImportPathList();
AKCOMMONS_EXPORT void addQmlImportPath(const QString &path);
AKCOMMONS_EXPORT void setQmlImportPathList(const QStringList &paths);
AKCOMMONS_EXPORT void resetQmlImportPathList();
}
#endif // AK_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akvideopacket.cpp 0000644 0001750 0001750 00000011461 13166615412 021440 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akvideopacket.h"
class AkVideoPacketPrivate
{
public:
AkVideoCaps m_caps;
};
AkVideoPacket::AkVideoPacket(QObject *parent):
AkPacket(parent)
{
this->d = new AkVideoPacketPrivate();
}
AkVideoPacket::AkVideoPacket(const AkVideoCaps &caps,
const QByteArray &buffer,
qint64 pts,
const AkFrac &timeBase,
int index,
qint64 id)
{
this->d = new AkVideoPacketPrivate();
this->d->m_caps = caps;
this->buffer() = buffer;
this->pts() = pts;
this->timeBase() = timeBase;
this->index() = index;
this->id() = id;
}
AkVideoPacket::AkVideoPacket(const AkPacket &other)
{
this->d = new AkVideoPacketPrivate();
this->d->m_caps = other.caps();
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
AkVideoPacket::AkVideoPacket(const AkVideoPacket &other):
AkPacket()
{
this->d = new AkVideoPacketPrivate();
this->d->m_caps = other.d->m_caps;
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
AkVideoPacket::~AkVideoPacket()
{
delete this->d;
}
AkVideoPacket &AkVideoPacket::operator =(const AkPacket &other)
{
this->d->m_caps = other.caps();
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
return *this;
}
AkVideoPacket &AkVideoPacket::operator =(const AkVideoPacket &other)
{
if (this != &other) {
this->d->m_caps = other.d->m_caps;
this->data() = other.data();
this->buffer() = other.buffer();
this->pts() = other.pts();
this->timeBase() = other.timeBase();
this->index() = other.index();
this->id() = other.id();
}
return *this;
}
AkVideoPacket::operator bool() const
{
return this->d->m_caps.isValid();
}
AkVideoCaps AkVideoPacket::caps() const
{
return this->d->m_caps;
}
AkVideoCaps &AkVideoPacket::caps()
{
return this->d->m_caps;
}
QString AkVideoPacket::toString() const
{
QString packetInfo;
QDebug debug(&packetInfo);
debug.nospace() << "Caps : "
<< this->d->m_caps.toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Data : "
<< this->data()
<< "\n";
debug.nospace() << "Buffer Size: "
<< this->buffer().size()
<< "\n";
debug.nospace() << "Id : "
<< this->id()
<< "\n";
debug.nospace() << "Pts : "
<< this->pts()
<< " ("
<< this->pts() * this->timeBase().value()
<< ")\n";
debug.nospace() << "Time Base : "
<< this->timeBase().toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Index : "
<< this->index();
return packetInfo;
}
AkPacket AkVideoPacket::toPacket() const
{
AkPacket packet;
packet.caps() = this->d->m_caps.toCaps();
packet.buffer() = this->buffer();
packet.pts() = this->pts();
packet.timeBase() = this->timeBase();
packet.index() = this->index();
packet.id() = this->id();
return packet;
}
void AkVideoPacket::setCaps(const AkVideoCaps &caps)
{
if (this->d->m_caps == caps)
return;
this->d->m_caps = caps;
emit this->capsChanged(caps);
}
void AkVideoPacket::resetCaps()
{
this->setCaps(AkVideoCaps());
}
QDebug operator <<(QDebug debug, const AkVideoPacket &packet)
{
debug.nospace() << packet.toString().toStdString().c_str();
return debug.space();
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akcaps.cpp 0000644 0001750 0001750 00000016301 13166615412 020066 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include "akcaps.h"
class AkCapsPrivate
{
public:
bool m_isValid;
QString m_mimeType;
};
AkCaps::AkCaps(QObject *parent): QObject(parent)
{
this->d = new AkCapsPrivate();
this->d->m_isValid = false;
this->d->m_mimeType = "";
}
AkCaps::AkCaps(const QVariantMap &caps)
{
this->d = new AkCapsPrivate();
this->d->m_isValid = false;
this->d->m_mimeType = "";
this->fromMap(caps);
}
AkCaps::AkCaps(const QString &caps)
{
this->d = new AkCapsPrivate();
this->d->m_isValid = false;
this->d->m_mimeType = "";
this->fromString(caps);
}
AkCaps::AkCaps(const AkCaps &other):
QObject()
{
this->d = new AkCapsPrivate();
this->d->m_isValid = other.d->m_isValid;
this->d->m_mimeType = other.d->m_mimeType;
this->update(other);
}
AkCaps::~AkCaps()
{
delete this->d;
}
AkCaps &AkCaps::operator =(const AkCaps &other)
{
if (this != &other) {
this->clear();
this->d->m_isValid = other.d->m_isValid;
this->d->m_mimeType = other.d->m_mimeType;
this->update(other);
}
return *this;
}
AkCaps &AkCaps::operator =(const QString &other)
{
return this->operator =(AkCaps(other));
}
bool AkCaps::operator ==(const AkCaps &other) const
{
return this->toString() == other.toString();
}
bool AkCaps::operator ==(const QString &caps) const
{
return this->toString() == caps;
}
bool AkCaps::operator !=(const AkCaps &other) const
{
return !(*this == other);
}
bool AkCaps::operator !=(const QString &caps) const
{
return !(*this == caps);
}
AkCaps::operator bool() const
{
return this->d->m_isValid;
}
bool AkCaps::isValid() const
{
return this->d->m_isValid;
}
bool &AkCaps::isValid()
{
return this->d->m_isValid;
}
QString AkCaps::mimeType() const
{
return this->d->m_mimeType;
}
AkCaps &AkCaps::fromMap(const QVariantMap &caps)
{
QList properties = this->dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property, QVariant());
if (!caps.contains("mimeType")) {
this->d->m_isValid = false;
this->d->m_mimeType = "";
return *this;
}
for (const QString &key: caps.keys())
if (key == "mimeType") {
this->d->m_isValid = QRegExp("\\s*[a-z]+/\\w+(?:(?:-|\\+|\\.)\\w+)*\\s*")
.exactMatch(caps[key].toString());
this->d->m_mimeType = caps[key].toString().trimmed();
} else
this->setProperty(key.trimmed().toStdString().c_str(), caps[key]);
return *this;
}
AkCaps &AkCaps::fromString(const QString &caps)
{
this->d->m_isValid = QRegExp("\\s*[a-z]+/\\w+(?:(?:-|\\+|\\.)\\w+)*"
"(?:\\s*,\\s*[a-zA-Z_]\\w*\\s*="
"\\s*[^,=]+)*\\s*").exactMatch(caps);
QList properties = this->dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property, QVariant());
QStringList capsChunks;
if (this->d->m_isValid)
capsChunks = caps.split(QRegExp("\\s*,\\s*"),
QString::SkipEmptyParts);
for (int i = 1; i < capsChunks.length(); i++) {
QStringList pair = capsChunks[i].split(QRegExp("\\s*=\\s*"),
QString::SkipEmptyParts);
this->setProperty(pair[0].trimmed().toStdString().c_str(),
pair[1].trimmed());
}
this->setMimeType(this->d->m_isValid? capsChunks[0].trimmed(): QString(""));
return *this;
}
QVariantMap AkCaps::toMap() const
{
if (!this->d->m_isValid)
return QVariantMap();
QVariantMap caps;
caps["mimeType"] = this->d->m_mimeType;
for (const QByteArray &property: this->dynamicPropertyNames()) {
QString key = QString::fromUtf8(property.constData());
caps[key] = this->property(property.toStdString().c_str());
}
return caps;
}
QString AkCaps::toString() const
{
if (!this->d->m_isValid)
return QString();
QString caps = this->d->m_mimeType;
QStringList properties;
for (const QByteArray &property: this->dynamicPropertyNames())
properties << QString::fromUtf8(property.constData());
properties.sort();
for (const QString &property: properties)
caps.append(QString(",%1=%2").arg(property)
.arg(this->property(property.toStdString().c_str()).toString()));
return caps;
}
AkCaps &AkCaps::update(const AkCaps &other)
{
if (this->d->m_mimeType != other.d->m_mimeType)
return *this;
for (const QByteArray &property: other.dynamicPropertyNames())
this->setProperty(property.constData(),
other.property(property.constData()));
return *this;
}
bool AkCaps::isCompatible(const AkCaps &other) const
{
if (this->d->m_mimeType != other.d->m_mimeType)
return false;
for (const QByteArray &property: other.dynamicPropertyNames())
if (!this->dynamicPropertyNames().contains(property) ||
this->property(property.constData()) != other.property(property.constData()))
return false;
return true;
}
bool AkCaps::contains(const QString &property) const
{
return this->dynamicPropertyNames().contains(property.toUtf8());
}
void AkCaps::setMimeType(const QString &mimeType)
{
this->d->m_isValid = QRegExp("\\s*[a-z]+/\\w+(?:(?:-|\\+|\\.)\\w+)*\\s*").exactMatch(mimeType);
QString _mimeType = this->d->m_isValid? mimeType.trimmed(): QString("");
if (this->d->m_mimeType == _mimeType)
return;
this->d->m_mimeType = _mimeType;
emit this->mimeTypeChanged(this->d->m_mimeType);
}
void AkCaps::resetMimeType()
{
this->setMimeType("");
}
void AkCaps::clear()
{
this->d->m_mimeType.clear();
this->d->m_isValid = false;
QList properties = this->dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property.constData(), QVariant());
}
QDebug operator <<(QDebug debug, const AkCaps &caps)
{
debug.nospace() << caps.toString();
return debug.space();
}
QDataStream &operator >>(QDataStream &istream, AkCaps &caps)
{
QString capsStr;
istream >> capsStr;
caps.fromString(capsStr);
return istream;
}
QDataStream &operator <<(QDataStream &ostream, const AkCaps &caps)
{
ostream << caps.toString();
return ostream;
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akmultimediasourceelement.h 0000644 0001750 0001750 00000003733 13166615412 023537 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKMULTIMEDIASOURCEELEMENT_H
#define AKMULTIMEDIASOURCEELEMENT_H
#include "akelement.h"
class AkMultimediaSourceElement;
class AkMultimediaSourceElementPrivate;
typedef QSharedPointer AkMultimediaSourceElementPtr;
class AKCOMMONS_EXPORT AkMultimediaSourceElement: public AkElement
{
Q_OBJECT
public:
AkMultimediaSourceElement(QObject *parent=nullptr);
~AkMultimediaSourceElement();
Q_INVOKABLE virtual QStringList medias();
Q_INVOKABLE virtual QString media() const;
Q_INVOKABLE virtual QList streams() const;
Q_INVOKABLE virtual bool loop() const;
Q_INVOKABLE virtual int defaultStream(const QString &mimeType);
Q_INVOKABLE virtual QString description(const QString &media);
Q_INVOKABLE virtual AkCaps caps(int stream);
private:
AkMultimediaSourceElementPrivate *d;
public Q_SLOTS:
virtual void setMedia(const QString &media);
virtual void setStreams(const QList &streams);
virtual void setLoop(bool loop);
virtual void resetMedia();
virtual void resetStreams();
virtual void resetLoop();
};
#endif // AKMULTIMEDIASOURCEELEMENT_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akelement.h 0000644 0001750 0001750 00000016141 13166615412 020240 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKELEMENT_H
#define AKELEMENT_H
#include
#include
#include
#include
#include "akaudiopacket.h"
#include "akvideopacket.h"
#define akSend(packet) { \
if (packet) \
emit this->oStream(packet); \
\
return packet; \
}
class AkElement;
class AkElementPrivate;
typedef QSharedPointer AkElementPtr;
/// Plugin template.
class AKCOMMONS_EXPORT AkElement: public QObject
{
Q_OBJECT
Q_ENUMS(ElementState)
Q_PROPERTY(QString pluginId
READ pluginId)
Q_PROPERTY(QString pluginPath
READ pluginPath)
Q_PROPERTY(AkElement::ElementState state
READ state
WRITE setState
RESET resetState
NOTIFY stateChanged)
public:
enum ElementState
{
ElementStateNull,
ElementStatePaused,
ElementStatePlaying
};
explicit AkElement(QObject *parent=nullptr);
virtual ~AkElement();
Q_INVOKABLE QString pluginId() const;
Q_INVOKABLE static QString pluginId(const QString &path);
Q_INVOKABLE QString pluginPath() const;
Q_INVOKABLE virtual AkElement::ElementState state() const;
Q_INVOKABLE virtual QObject *controlInterface(QQmlEngine *engine,
const QString &controlId) const;
Q_INVOKABLE virtual bool link(const QObject *dstElement,
Qt::ConnectionType connectionType=Qt::AutoConnection) const;
Q_INVOKABLE virtual bool link(const AkElementPtr &dstElement,
Qt::ConnectionType connectionType=Qt::AutoConnection) const;
Q_INVOKABLE virtual bool unlink(const QObject *dstElement) const;
Q_INVOKABLE virtual bool unlink(const AkElementPtr &dstElement) const;
Q_INVOKABLE static bool link(const AkElementPtr &srcElement,
const QObject *dstElement,
Qt::ConnectionType connectionType=Qt::AutoConnection);
Q_INVOKABLE static bool link(const AkElementPtr &srcElement,
const AkElementPtr &dstElement,
Qt::ConnectionType connectionType=Qt::AutoConnection);
Q_INVOKABLE static bool link(const QObject *srcElement,
const QObject *dstElement,
Qt::ConnectionType connectionType=Qt::AutoConnection);
Q_INVOKABLE static bool unlink(const AkElementPtr &srcElement,
const QObject *dstElement);
Q_INVOKABLE static bool unlink(const AkElementPtr &srcElement,
const AkElementPtr &dstElement);
Q_INVOKABLE static bool unlink(const QObject *srcElement,
const QObject *dstElement);
Q_INVOKABLE static AkElementPtr create(const QString &pluginId,
const QString &elementName="");
Q_INVOKABLE static AkElement *createPtr(const QString &pluginId,
const QString &elementName="");
Q_INVOKABLE static QStringList listSubModules(const QString &pluginId,
const QString &type="");
Q_INVOKABLE QStringList listSubModules(const QStringList &types={});
Q_INVOKABLE static QStringList listSubModulesPaths(const QString &pluginId);
Q_INVOKABLE QStringList listSubModulesPaths();
Q_INVOKABLE static QObject *loadSubModule(const QString &pluginId,
const QString &subModule);
Q_INVOKABLE QObject *loadSubModule(const QString &subModule);
Q_INVOKABLE static bool recursiveSearch();
Q_INVOKABLE static void setRecursiveSearch(bool enable);
Q_INVOKABLE static QStringList searchPaths();
Q_INVOKABLE static void addSearchPath(const QString &path);
Q_INVOKABLE static void setSearchPaths(const QStringList &searchPaths);
Q_INVOKABLE static void resetSearchPaths();
Q_INVOKABLE static QString subModulesPath();
Q_INVOKABLE static void setSubModulesPath(const QString &subModulesPath);
Q_INVOKABLE static void resetSubModulesPath();
Q_INVOKABLE static QStringList listPlugins(const QString &type="");
Q_INVOKABLE static QStringList listPluginPaths(const QString &searchPath);
Q_INVOKABLE static QStringList listPluginPaths(bool all=false);
Q_INVOKABLE static void setPluginPaths(const QStringList &paths);
Q_INVOKABLE static QStringList pluginsBlackList();
Q_INVOKABLE static void setPluginsBlackList(const QStringList &blackList);
Q_INVOKABLE static QString pluginPath(const QString &pluginId);
Q_INVOKABLE static QVariantMap pluginInfo(const QString &pluginId);
Q_INVOKABLE static void setPluginInfo(const QString &path,
const QVariantMap &metaData);
Q_INVOKABLE static void clearCache();
virtual AkPacket operator ()(const AkPacket &packet);
virtual AkPacket operator ()(const AkAudioPacket &packet);
virtual AkPacket operator ()(const AkVideoPacket &packet);
private:
AkElementPrivate *d;
protected:
virtual QString controlInterfaceProvide(const QString &controlId) const;
virtual void controlInterfaceConfigure(QQmlContext *context,
const QString &controlId) const;
virtual void stateChange(AkElement::ElementState from, AkElement::ElementState to);
Q_SIGNALS:
void stateChanged(AkElement::ElementState state);
void oStream(const AkPacket &packet);
public Q_SLOTS:
virtual AkPacket iStream(const AkPacket &packet);
virtual AkPacket iStream(const AkAudioPacket &packet);
virtual AkPacket iStream(const AkVideoPacket &packet);
virtual bool setState(AkElement::ElementState state);
virtual void resetState();
};
QDataStream &operator >>(QDataStream &istream, AkElement::ElementState &state);
QDataStream &operator <<(QDataStream &ostream, AkElement::ElementState state);
Q_DECLARE_METATYPE(AkElement::ElementState)
#endif // AKELEMENT_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akaudiocaps.cpp 0000644 0001750 0001750 00000064501 13166615412 021115 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include "akaudiocaps.h"
class SampleFormats
{
public:
AkAudioCaps::SampleFormat format;
AkAudioCaps::SampleType type;
int bps;
int endianness;
bool planar;
static inline const QVector &formats()
{
static const QVector sampleFormats = {
{AkAudioCaps::SampleFormat_none , AkAudioCaps::SampleType_unknown, 0, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s8 , AkAudioCaps::SampleType_int , 8, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_u8 , AkAudioCaps::SampleType_uint , 8, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s16 , AkAudioCaps::SampleType_int , 16, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s16le, AkAudioCaps::SampleType_int , 16, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_s16be, AkAudioCaps::SampleType_int , 16, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_u16 , AkAudioCaps::SampleType_uint , 16, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_u16le, AkAudioCaps::SampleType_uint , 16, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_u16be, AkAudioCaps::SampleType_uint , 16, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_s24 , AkAudioCaps::SampleType_int , 24, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s24le, AkAudioCaps::SampleType_int , 24, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_s24be, AkAudioCaps::SampleType_int , 24, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_u24 , AkAudioCaps::SampleType_uint , 24, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_u24le, AkAudioCaps::SampleType_uint , 24, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_u24be, AkAudioCaps::SampleType_uint , 24, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_s32 , AkAudioCaps::SampleType_int , 32, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s32le, AkAudioCaps::SampleType_int , 32, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_s32be, AkAudioCaps::SampleType_int , 32, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_u32 , AkAudioCaps::SampleType_uint , 32, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_u32le, AkAudioCaps::SampleType_uint , 32, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_u32be, AkAudioCaps::SampleType_uint , 32, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_s64 , AkAudioCaps::SampleType_int , 64, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_s64le, AkAudioCaps::SampleType_int , 64, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_s64be, AkAudioCaps::SampleType_int , 64, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_u64 , AkAudioCaps::SampleType_uint , 64, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_u64le, AkAudioCaps::SampleType_uint , 64, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_u64be, AkAudioCaps::SampleType_uint , 64, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_flt , AkAudioCaps::SampleType_float , 32, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_fltle, AkAudioCaps::SampleType_float , 32, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_fltbe, AkAudioCaps::SampleType_float , 32, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_dbl , AkAudioCaps::SampleType_float , 64, Q_BYTE_ORDER , false},
{AkAudioCaps::SampleFormat_dblle, AkAudioCaps::SampleType_float , 64, Q_LITTLE_ENDIAN, false},
{AkAudioCaps::SampleFormat_dblbe, AkAudioCaps::SampleType_float , 64, Q_BIG_ENDIAN , false},
{AkAudioCaps::SampleFormat_u8p , AkAudioCaps::SampleType_uint , 8, Q_BYTE_ORDER , true},
{AkAudioCaps::SampleFormat_s16p , AkAudioCaps::SampleType_int , 16, Q_BYTE_ORDER , true},
{AkAudioCaps::SampleFormat_s32p , AkAudioCaps::SampleType_int , 32, Q_BYTE_ORDER , true},
{AkAudioCaps::SampleFormat_s64p , AkAudioCaps::SampleType_int , 64, Q_BYTE_ORDER , true},
{AkAudioCaps::SampleFormat_fltp , AkAudioCaps::SampleType_float , 32, Q_BYTE_ORDER , true},
{AkAudioCaps::SampleFormat_dblp , AkAudioCaps::SampleType_float , 64, Q_BYTE_ORDER , true},
};
return sampleFormats;
}
static inline const SampleFormats *byFormat(AkAudioCaps::SampleFormat format)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].format == format)
return &formats()[i];
return &formats()[0];
}
static inline const SampleFormats *byType(AkAudioCaps::SampleType type)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].type == type)
return &formats()[i];
return &formats()[0];
}
static inline const SampleFormats *byBps(int bps)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].bps == bps)
return &formats()[i];
return &formats()[0];
}
static inline const SampleFormats *byEndianness(int endianness)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].endianness == endianness)
return &formats()[i];
return &formats()[0];
}
static inline const SampleFormats *byPlanar(bool planar)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].planar == planar)
return &formats()[i];
return &formats()[0];
}
};
class ChannelLayouts
{
public:
AkAudioCaps::ChannelLayout layout;
int channels;
QString description;
static inline const QVector &layouts()
{
static const QVector channelLayouts = {
{AkAudioCaps::Layout_none , 0, "none" },
{AkAudioCaps::Layout_mono , 1, "mono" },
{AkAudioCaps::Layout_stereo , 2, "stereo" },
{AkAudioCaps::Layout_2p1 , 3, "2.1" },
{AkAudioCaps::Layout_3p0 , 3, "3.0" },
{AkAudioCaps::Layout_3p0_back , 3, "3.0(back)" },
{AkAudioCaps::Layout_3p1 , 4, "3.1" },
{AkAudioCaps::Layout_4p0 , 4, "4.0" },
{AkAudioCaps::Layout_quad , 4, "quad" },
{AkAudioCaps::Layout_quad_side , 4, "quad(side)" },
{AkAudioCaps::Layout_4p1 , 5, "4.1" },
{AkAudioCaps::Layout_5p0 , 5, "5.0" },
{AkAudioCaps::Layout_5p0_side , 5, "5.0(side)" },
{AkAudioCaps::Layout_5p1 , 6, "5.1" },
{AkAudioCaps::Layout_5p1_side , 6, "5.1(side)" },
{AkAudioCaps::Layout_6p0 , 6, "6.0" },
{AkAudioCaps::Layout_6p0_front , 6, "6.0(front)" },
{AkAudioCaps::Layout_hexagonal , 6, "hexagonal" },
{AkAudioCaps::Layout_6p1 , 7, "6.1" },
{AkAudioCaps::Layout_6p1_front , 7, "6.1(back)" },
{AkAudioCaps::Layout_6p1_front , 7, "6.1(front)" },
{AkAudioCaps::Layout_7p0 , 7, "7.0" },
{AkAudioCaps::Layout_7p0_front , 7, "7.0(front)" },
{AkAudioCaps::Layout_7p1 , 8, "7.1" },
{AkAudioCaps::Layout_7p1_wide , 8, "7.1(wide)" },
{AkAudioCaps::Layout_7p1_wide_side, 8, "7.1(wide-side)"},
{AkAudioCaps::Layout_octagonal , 8, "octagonal" },
{AkAudioCaps::Layout_hexadecagonal, 16, "hexadecagonal" },
{AkAudioCaps::Layout_downmix , 2, "downmix" },
};
return channelLayouts;
}
static inline const ChannelLayouts *byLayout(AkAudioCaps::ChannelLayout layout)
{
for (int i = 0; i < layouts().size(); i++)
if (layouts()[i].layout == layout)
return &layouts()[i];
return &layouts()[0];
}
static inline const ChannelLayouts *byChannels(int channels)
{
for (int i = 0; i < layouts().size(); i++)
if (layouts()[i].channels == channels)
return &layouts()[i];
return &layouts()[0];
}
static inline const ChannelLayouts *byDescription(const QString &description)
{
for (int i = 0; i < layouts().size(); i++)
if (layouts()[i].description == description)
return &layouts()[i];
return &layouts()[0];
}
};
class AkAudioCapsPrivate
{
public:
AkAudioCaps::SampleFormat m_format;
int m_bps;
int m_channels;
int m_rate;
AkAudioCaps::ChannelLayout m_layout;
int m_samples;
bool m_align;
bool m_isValid;
};
AkAudioCaps::AkAudioCaps(QObject *parent):
QObject(parent)
{
this->d = new AkAudioCapsPrivate();
this->d->m_isValid = false;
this->d->m_format = SampleFormat_none;
this->d->m_bps = 0;
this->d->m_channels = 0;
this->d->m_rate = 0;
this->d->m_layout = Layout_none;
this->d->m_samples = 0;
this->d->m_align = false;
}
AkAudioCaps::AkAudioCaps(const QVariantMap &caps)
{
this->d = new AkAudioCapsPrivate();
this->d->m_format = caps["format"].value();
this->d->m_isValid = this->d->m_format != SampleFormat_none;
this->d->m_bps = caps["bps"].toInt();
this->d->m_channels = caps["channels"].toInt();
this->d->m_rate = caps["rate"].toInt();
this->d->m_layout = caps["layout"].value();
this->d->m_samples = caps["samples"].toInt();
this->d->m_align = caps["align"].toBool();
}
AkAudioCaps::AkAudioCaps(const QString &caps)
{
this->d = new AkAudioCapsPrivate();
this->d->m_isValid = false;
this->d->m_format = SampleFormat_none;
this->d->m_bps = 0;
this->d->m_channels = 0;
this->d->m_rate = 0;
this->d->m_layout = Layout_none;
this->d->m_samples = 0;
this->d->m_align = false;
*this = caps;
}
AkAudioCaps::AkAudioCaps(const AkCaps &caps)
{
this->d = new AkAudioCapsPrivate();
if (caps.mimeType() == "audio/x-raw") {
this->d->m_isValid = caps.isValid();
this->d->m_format = this->sampleFormatFromString(caps.property("format").toString());
this->d->m_bps = caps.property("bps").toInt();
this->d->m_channels = caps.property("channels").toInt();
this->d->m_rate = caps.property("rate").toInt();
QString layout = caps.property("layout").toString();
this->d->m_layout = ChannelLayouts::byDescription(layout)->layout;
this->d->m_samples = caps.property("samples").toInt();
this->d->m_align = caps.property("align").toBool();
} else {
this->d->m_isValid = false;
this->d->m_format = SampleFormat_none;
this->d->m_bps = 0;
this->d->m_channels = 0;
this->d->m_rate = 0;
this->d->m_layout = Layout_none;
this->d->m_samples = 0;
this->d->m_align = false;
}
}
AkAudioCaps::AkAudioCaps(const AkAudioCaps &other):
QObject()
{
this->d = new AkAudioCapsPrivate();
this->d->m_isValid = other.d->m_isValid;
this->d->m_format = other.d->m_format;
this->d->m_bps = other.d->m_bps;
this->d->m_channels = other.d->m_channels;
this->d->m_rate = other.d->m_rate;
this->d->m_layout = other.d->m_layout;
this->d->m_samples = other.d->m_samples;
this->d->m_align = other.d->m_align;
}
AkAudioCaps::AkAudioCaps(AkAudioCaps::SampleFormat format,
int channels,
int rate)
{
this->d = new AkAudioCapsPrivate();
this->d->m_format = format;
this->d->m_isValid = this->d->m_format != SampleFormat_none;
this->d->m_bps = this->bitsPerSample(format);
this->d->m_channels = channels;
this->d->m_rate = rate;
this->d->m_layout = this->defaultChannelLayout(channels);
this->d->m_samples = 0;
this->d->m_align = false;
}
AkAudioCaps::~AkAudioCaps()
{
delete this->d;
}
AkAudioCaps &AkAudioCaps::operator =(const AkAudioCaps &other)
{
if (this != &other) {
this->d->m_isValid = other.d->m_isValid;
this->d->m_format = other.d->m_format;
this->d->m_bps = other.d->m_bps;
this->d->m_channels = other.d->m_channels;
this->d->m_rate = other.d->m_rate;
this->d->m_layout = other.d->m_layout;
this->d->m_samples = other.d->m_samples;
this->d->m_align = other.d->m_align;
}
return *this;
}
AkAudioCaps &AkAudioCaps::operator =(const AkCaps &caps)
{
if (caps.mimeType() == "audio/x-raw") {
this->d->m_isValid = caps.isValid();
this->d->m_format = this->sampleFormatFromString(caps.property("format").toString());
this->d->m_bps = caps.property("bps").toInt();
this->d->m_channels = caps.property("channels").toInt();
this->d->m_rate = caps.property("rate").toInt();
QString layout = caps.property("layout").toString();
this->d->m_layout = ChannelLayouts::byDescription(layout)->layout;
this->d->m_samples = caps.property("samples").toInt();
this->d->m_align = caps.property("align").toBool();
} else {
this->d->m_isValid = false;
this->d->m_format = SampleFormat_none;
this->d->m_bps = 0;
this->d->m_channels = 0;
this->d->m_rate = 0;
this->d->m_layout = Layout_none;
this->d->m_samples = 0;
this->d->m_align = false;
}
return *this;
}
AkAudioCaps &AkAudioCaps::operator =(const QString &caps)
{
return this->operator =(AkCaps(caps));
}
bool AkAudioCaps::operator ==(const AkAudioCaps &other) const
{
return this->d->m_isValid == other.d->m_isValid
&& this->d->m_format == other.d->m_format
&& this->d->m_bps == other.d->m_bps
&& this->d->m_channels == other.d->m_channels
&& this->d->m_rate == other.d->m_rate
&& this->d->m_layout == other.d->m_layout
&& this->d->m_samples == other.d->m_samples
&& this->d->m_align == other.d->m_align;
}
bool AkAudioCaps::operator !=(const AkAudioCaps &other) const
{
return !(*this == other);
}
AkAudioCaps::operator AkCaps() const
{
return this->toCaps();
}
bool AkAudioCaps::isValid() const
{
return this->d->m_isValid;
}
bool &AkAudioCaps::isValid()
{
return this->d->m_isValid;
}
AkAudioCaps::SampleFormat AkAudioCaps::format() const
{
return this->d->m_format;
}
AkAudioCaps::SampleFormat &AkAudioCaps::format()
{
return this->d->m_format;
}
int AkAudioCaps::bps() const
{
return this->d->m_bps;
}
int &AkAudioCaps::bps()
{
return this->d->m_bps;
}
int AkAudioCaps::channels() const
{
return this->d->m_channels;
}
int &AkAudioCaps::channels()
{
return this->d->m_channels;
}
int AkAudioCaps::rate() const
{
return this->d->m_rate;
}
int &AkAudioCaps::rate()
{
return this->d->m_rate;
}
AkAudioCaps::ChannelLayout AkAudioCaps::layout() const
{
return this->d->m_layout;
}
AkAudioCaps::ChannelLayout &AkAudioCaps::layout()
{
return this->d->m_layout;
}
int AkAudioCaps::samples() const
{
return this->d->m_samples;
}
int &AkAudioCaps::samples()
{
return this->d->m_samples;
}
bool AkAudioCaps::align() const
{
return this->d->m_align;
}
bool &AkAudioCaps::align()
{
return this->d->m_align;
}
AkAudioCaps &AkAudioCaps::fromMap(const QVariantMap &caps)
{
this->d->m_format = caps["format"].value();
this->d->m_isValid = this->d->m_format != AkAudioCaps::SampleFormat_none;
this->d->m_bps = caps["bps"].toInt();
this->d->m_channels = caps["channels"].toInt();
this->d->m_rate = caps["rate"].toInt();
this->d->m_layout = caps["layout"].value();
this->d->m_samples = caps["samples"].toInt();
this->d->m_align = caps["align"].toBool();
return *this;
}
AkAudioCaps::operator bool() const
{
return this->d->m_isValid;
}
AkAudioCaps &AkAudioCaps::fromString(const QString &caps)
{
return *this = caps;
}
QVariantMap AkAudioCaps::toMap() const
{
return QVariantMap {
{"format" , this->d->m_format },
{"bps" , this->d->m_bps },
{"channels", this->d->m_channels},
{"rate" , this->d->m_rate },
{"layout" , this->d->m_layout },
{"samples" , this->d->m_samples },
{"align" , this->d->m_align }
};
}
QString AkAudioCaps::toString() const
{
if (!this->d->m_isValid)
return QString();
QString sampleFormat = this->sampleFormatToString(this->d->m_format);
QString layout = ChannelLayouts::byLayout(this->d->m_layout)->description;
return QString("audio/x-raw,"
"format=%1,"
"bps=%2,"
"channels=%3,"
"rate=%4,"
"layout=%5,"
"samples=%6,"
"align=%7").arg(sampleFormat)
.arg(this->d->m_bps)
.arg(this->d->m_channels)
.arg(this->d->m_rate)
.arg(layout)
.arg(this->d->m_samples)
.arg(this->d->m_align);
}
AkAudioCaps &AkAudioCaps::update(const AkCaps &caps)
{
if (caps.mimeType() != "audio/x-raw")
return *this;
if (caps.contains("format"))
this->d->m_format = this->sampleFormatFromString(caps.property("format").toString());
if (caps.contains("bps"))
this->d->m_bps = caps.property("bps").toInt();
if (caps.contains("channels"))
this->d->m_channels = caps.property("channels").toInt();
if (caps.contains("rate"))
this->d->m_rate = caps.property("rate").toInt();
if (caps.contains("layout")) {
QString layout = caps.property("layout").toString();
this->d->m_layout = ChannelLayouts::byDescription(layout)->layout;
}
if (caps.contains("samples"))
this->d->m_samples = caps.property("samples").toInt();
if (caps.contains("align"))
this->d->m_align = caps.property("align").toBool();
return *this;
}
AkCaps AkAudioCaps::toCaps() const
{
return AkCaps(this->toString());
}
int AkAudioCaps::bitsPerSample(AkAudioCaps::SampleFormat sampleFormat)
{
return SampleFormats::byFormat(sampleFormat)->bps;
}
int AkAudioCaps::bitsPerSample(const QString &sampleFormat)
{
return AkAudioCaps::bitsPerSample(AkAudioCaps::sampleFormatFromString(sampleFormat));
}
QString AkAudioCaps::sampleFormatToString(AkAudioCaps::SampleFormat sampleFormat)
{
AkAudioCaps caps;
int formatIndex = caps.metaObject()->indexOfEnumerator("SampleFormat");
QMetaEnum formatEnum = caps.metaObject()->enumerator(formatIndex);
QString format(formatEnum.valueToKey(sampleFormat));
format.remove("SampleFormat_");
return format;
}
AkAudioCaps::SampleFormat AkAudioCaps::sampleFormatFromString(const QString &sampleFormat)
{
AkAudioCaps caps;
QString format = "SampleFormat_" + sampleFormat;
int formatIndex = caps.metaObject()->indexOfEnumerator("SampleFormat");
QMetaEnum formatEnum = caps.metaObject()->enumerator(formatIndex);
int formatInt = formatEnum.keyToValue(format.toStdString().c_str());
return static_cast(formatInt);
}
AkAudioCaps::SampleFormat AkAudioCaps::sampleFormatFromProperties(AkAudioCaps::SampleType type,
int bps,
int endianness,
bool planar)
{
for (const SampleFormats &sampleFormat: SampleFormats::formats())
if (sampleFormat.type == type
&& sampleFormat.bps == bps
&& sampleFormat.endianness == endianness
&& sampleFormat.planar == planar) {
return sampleFormat.format;
}
return AkAudioCaps::SampleFormat_none;
}
bool AkAudioCaps::sampleFormatProperties(AkAudioCaps::SampleFormat sampleFormat,
AkAudioCaps::SampleType *type,
int *bps,
int *endianness,
bool *planar)
{
auto format = SampleFormats::byFormat(sampleFormat);
if (!format)
return false;
if (type)
*type = format->type;
if (bps)
*bps = format->bps;
if (endianness)
*endianness = format->endianness;
if (planar)
*planar = format->planar;
return true;
}
bool AkAudioCaps::sampleFormatProperties(const QString &sampleFormat,
AkAudioCaps::SampleType *type,
int *bps,
int *endianness,
bool *planar)
{
return AkAudioCaps::sampleFormatProperties(AkAudioCaps::sampleFormatFromString(sampleFormat),
type,
bps,
endianness,
planar);
}
AkAudioCaps::SampleType AkAudioCaps::sampleType(AkAudioCaps::SampleFormat sampleFormat)
{
return SampleFormats::byFormat(sampleFormat)->type;
}
AkAudioCaps::SampleType AkAudioCaps::sampleType(const QString &sampleFormat)
{
return AkAudioCaps::sampleType(AkAudioCaps::sampleFormatFromString(sampleFormat));
}
QString AkAudioCaps::channelLayoutToString(AkAudioCaps::ChannelLayout channelLayout)
{
return ChannelLayouts::byLayout(channelLayout)->description;
}
AkAudioCaps::ChannelLayout AkAudioCaps::channelLayoutFromString(const QString &channelLayout)
{
return ChannelLayouts::byDescription(channelLayout)->layout;
}
int AkAudioCaps::channelCount(AkAudioCaps::ChannelLayout channelLayout)
{
return ChannelLayouts::byLayout(channelLayout)->channels;
}
int AkAudioCaps::channelCount(const QString &channelLayout)
{
return ChannelLayouts::byDescription(channelLayout)->channels;
}
int AkAudioCaps::endianness(AkAudioCaps::SampleFormat sampleFormat)
{
return SampleFormats::byFormat(sampleFormat)->endianness;
}
int AkAudioCaps::endianness(const QString &sampleFormat)
{
return AkAudioCaps::endianness(AkAudioCaps::sampleFormatFromString(sampleFormat));
}
bool AkAudioCaps::isPlanar(AkAudioCaps::SampleFormat sampleFormat)
{
return SampleFormats::byFormat(sampleFormat)->planar;
}
bool AkAudioCaps::isPlanar(const QString &sampleFormat)
{
return AkAudioCaps::isPlanar(AkAudioCaps::sampleFormatFromString(sampleFormat));
}
AkAudioCaps::ChannelLayout AkAudioCaps::defaultChannelLayout(int channelCount)
{
return ChannelLayouts::byChannels(channelCount)->layout;
}
QString AkAudioCaps::defaultChannelLayoutString(int channelCount)
{
return ChannelLayouts::byChannels(channelCount)->description;
}
void AkAudioCaps::setFormat(AkAudioCaps::SampleFormat format)
{
if (this->d->m_format == format)
return;
this->d->m_format = format;
emit this->formatChanged(format);
}
void AkAudioCaps::setBps(int bps)
{
if (this->d->m_bps == bps)
return;
this->d->m_bps = bps;
emit this->bpsChanged(bps);
}
void AkAudioCaps::setChannels(int channels)
{
if (this->d->m_channels == channels)
return;
this->d->m_channels = channels;
emit this->channelsChanged(channels);
}
void AkAudioCaps::setRate(int rate)
{
if (this->d->m_rate == rate)
return;
this->d->m_rate = rate;
emit this->rateChanged(rate);
}
void AkAudioCaps::setLayout(AkAudioCaps::ChannelLayout layout)
{
if (this->d->m_layout == layout)
return;
this->d->m_layout = layout;
emit this->layoutChanged(layout);
}
void AkAudioCaps::setSamples(int samples)
{
if (this->d->m_samples == samples)
return;
this->d->m_samples = samples;
emit this->samplesChanged(samples);
}
void AkAudioCaps::setAlign(bool align)
{
if (this->d->m_align == align)
return;
this->d->m_align = align;
emit this->alignChanged(align);
}
void AkAudioCaps::resetFormat()
{
this->setFormat(SampleFormat_none);
}
void AkAudioCaps::resetBps()
{
this->setBps(0);
}
void AkAudioCaps::resetChannels()
{
this->setChannels(0);
}
void AkAudioCaps::resetRate()
{
this->setRate(0);
}
void AkAudioCaps::resetLayout()
{
this->setLayout(Layout_none);
}
void AkAudioCaps::resetSamples()
{
this->setSamples(0);
}
void AkAudioCaps::resetAlign()
{
this->setAlign(false);
}
QDebug operator <<(QDebug debug, const AkAudioCaps &caps)
{
debug.nospace() << caps.toString();
return debug.space();
}
QDataStream &operator >>(QDataStream &istream, AkAudioCaps &caps)
{
QString capsStr;
istream >> capsStr;
caps.fromString(capsStr);
return istream;
}
QDataStream &operator <<(QDataStream &ostream, const AkAudioCaps &caps)
{
ostream << caps.toString();
return ostream;
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akvideocaps.cpp 0000644 0001750 0001750 00000060150 13166615412 021116 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include "akvideocaps.h"
class VideoFormat
{
public:
AkVideoCaps::PixelFormat format;
int bpp;
quint32 fourCC;
static inline const QVector &formats()
{
static const QVector videoFormats = {
{AkVideoCaps::Format_none, 0, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p, 12, AkFourCC('I', '4', '2', '0')},
{AkVideoCaps::Format_yuyv422, 16, AkFourCC('Y', 'U', 'Y', '2')},
{AkVideoCaps::Format_rgb24, 24, AkFourCC('R', 'G', 'B', '3')},
{AkVideoCaps::Format_bgr24, 24, AkFourCC('B', 'G', 'R', '3')},
{AkVideoCaps::Format_yuv422p, 16, AkFourCC('Y', '4', '2', 'B')},
{AkVideoCaps::Format_yuv444p, 24, AkFourCC('4', '4', '4', 'P')},
{AkVideoCaps::Format_yuv410p, 9, AkFourCC('Y', 'U', 'V', '9')},
{AkVideoCaps::Format_yuv411p, 12, AkFourCC('Y', '4', '1', 'B')},
{AkVideoCaps::Format_gray, 8, AkFourCC('Y', '8', '0', '0')},
{AkVideoCaps::Format_monow, 1, AkFourCC('B', '1', 'W', '0')},
{AkVideoCaps::Format_monob, 1, AkFourCC('B', '0', 'W', '1')},
{AkVideoCaps::Format_pal8, 8, AkFourCC('P', 'A', 'L', '\x8')},
{AkVideoCaps::Format_yuvj420p, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuvj422p, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuvj444p, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_uyvy422, 16, AkFourCC('U', 'Y', 'V', 'Y')},
{AkVideoCaps::Format_uyyvyy411, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr4, 4, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr4_byte, 4, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb4, 4, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb4_byte, 4, AK_FOURCC_NULL},
{AkVideoCaps::Format_nv12, 12, AkFourCC('N', 'V', '1', '2')},
{AkVideoCaps::Format_nv21, 12, AkFourCC('N', 'V', '2', '1')},
{AkVideoCaps::Format_argb, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgba, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_abgr, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgra, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_gray16be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_gray16le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv440p, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuvj440p, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb48be, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb48le, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb565be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb565le, 16, AkFourCC('R', 'G', 'B', 'P')},
{AkVideoCaps::Format_rgb555be, 15, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb555le, 15, AkFourCC('R', 'G', 'B', 'O')},
{AkVideoCaps::Format_bgr565be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr565le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr555be, 15, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr555le, 15, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p16le, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p16be, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p16le, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p16be, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p16le, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p16be, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb444le, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgb444be, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr444le, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr444be, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_ya8, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr48be, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr48le, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p9be, 13, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p9le, 13, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p10be, 15, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p10le, 15, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p10be, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p10le, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p9be, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p9le, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p10be, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p10le, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p9be, 18, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p9le, 18, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp9be, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp9le, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp10be, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp10le, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp16be, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp16le, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p9be, 22, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p9le, 22, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p9be, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p9le, 27, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p9be, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p9le, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p10be, 25, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p10le, 25, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p10be, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p10le, 30, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p10be, 40, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p10le, 40, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p16be, 40, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva420p16le, 40, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p16be, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p16le, 48, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p16be, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p16le, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_xyz12le, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_xyz12be, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_nv16, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_nv20le, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_nv20be, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_yvyu422, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_ya16be, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_ya16le, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgba64be, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_rgba64le, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgra64be, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgra64le, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_0rgb, 24, AkFourCC('R', 'G', 'B', '4')},
{AkVideoCaps::Format_rgb0, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_0bgr, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_bgr0, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva444p, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuva422p, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p12be, 18, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p12le, 18, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p14be, 21, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv420p14le, 21, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p12be, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p12le, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p14be, 28, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv422p14le, 28, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p12be, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p12le, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p14be, 42, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv444p14le, 42, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp12be, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp12le, 36, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp14be, 42, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrp14le, 42, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrap, 32, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrap16be, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_gbrap16le, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuvj411p, 12, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_bggr8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_rggb8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_gbrg8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_grbg8, 8, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_bggr16le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_bggr16be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_rggb16le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_rggb16be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_gbrg16le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_gbrg16be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_grbg16le, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_bayer_grbg16be, 16, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv440p10le, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv440p10be, 20, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv440p12le, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_yuv440p12be, 24, AK_FOURCC_NULL},
{AkVideoCaps::Format_ayuv64le, 64, AK_FOURCC_NULL},
{AkVideoCaps::Format_ayuv64be, 64, AK_FOURCC_NULL},
};
return videoFormats;
}
static inline const VideoFormat *byFormat(AkVideoCaps::PixelFormat format)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].format == format)
return &formats()[i];
return &formats()[0];
}
static inline const VideoFormat *byBpp(int bpp)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].bpp == bpp)
return &formats()[i];
return &formats()[0];
}
static inline const VideoFormat *byFourCC(quint32 fourCC)
{
for (int i = 0; i < formats().size(); i++)
if (formats()[i].fourCC == fourCC)
return &formats()[i];
return &formats()[0];
}
};
class AkVideoCapsPrivate
{
public:
bool m_isValid;
AkVideoCaps::PixelFormat m_format;
int m_bpp;
int m_width;
int m_height;
AkFrac m_fps;
};
AkVideoCaps::AkVideoCaps(QObject *parent):
QObject(parent)
{
this->d = new AkVideoCapsPrivate();
this->d->m_isValid = false;
this->d->m_format = AkVideoCaps::Format_none;
this->d->m_bpp = 0;
this->d->m_width = 0;
this->d->m_height = 0;
}
AkVideoCaps::AkVideoCaps(const QVariantMap &caps)
{
this->d = new AkVideoCapsPrivate();
this->d->m_isValid = true;
this->d->m_format = AkVideoCaps::Format_none;
this->d->m_bpp = 0;
this->d->m_width = 0;
this->d->m_height = 0;
this->fromMap(caps);
}
AkVideoCaps::AkVideoCaps(const QString &caps)
{
this->d = new AkVideoCapsPrivate();
this->d->m_isValid = false;
this->d->m_format = AkVideoCaps::Format_none;
this->d->m_bpp = 0;
this->d->m_width = 0;
this->d->m_height = 0;
this->fromString(caps);
}
AkVideoCaps::AkVideoCaps(const AkCaps &caps)
{
this->d = new AkVideoCapsPrivate();
if (caps.mimeType() == "video/x-raw") {
this->d->m_isValid = caps.isValid();
this->update(caps);
} else {
this->d->m_isValid = false;
this->d->m_format = AkVideoCaps::Format_none;
this->d->m_bpp = 0;
this->d->m_width = 0;
this->d->m_height = 0;
}
}
AkVideoCaps::AkVideoCaps(const AkVideoCaps &other):
QObject()
{
this->d = new AkVideoCapsPrivate();
this->d->m_isValid = other.d->m_isValid;
this->d->m_format = other.d->m_format;
this->d->m_bpp = other.d->m_bpp;
this->d->m_width = other.d->m_width;
this->d->m_height = other.d->m_height;
this->d->m_fps = other.d->m_fps;
QList properties = other.dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property, other.property(property));
}
AkVideoCaps::~AkVideoCaps()
{
delete this->d;
}
AkVideoCaps &AkVideoCaps::operator =(const AkVideoCaps &other)
{
if (this != &other) {
this->d->m_isValid = other.d->m_isValid;
this->d->m_format = other.d->m_format;
this->d->m_bpp = other.d->m_bpp;
this->d->m_width = other.d->m_width;
this->d->m_height = other.d->m_height;
this->d->m_fps = other.d->m_fps;
this->clear();
QList properties = other.dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property, other.property(property));
}
return *this;
}
AkVideoCaps &AkVideoCaps::operator =(const AkCaps &caps)
{
if (caps.mimeType() == "video/x-raw") {
this->d->m_isValid = caps.isValid();
this->update(caps);
} else {
this->d->m_isValid = false;
this->d->m_format = AkVideoCaps::Format_none;
this->d->m_bpp = 0;
this->d->m_width = 0;
this->d->m_height = 0;
this->d->m_fps = AkFrac();
}
return *this;
}
AkVideoCaps &AkVideoCaps::operator =(const QString &caps)
{
return this->operator =(AkCaps(caps));
}
bool AkVideoCaps::operator ==(const AkVideoCaps &other) const
{
return this->toString() == other.toString();
}
bool AkVideoCaps::operator !=(const AkVideoCaps &other) const
{
return !(*this == other);
}
AkVideoCaps::operator bool() const
{
return this->d->m_isValid;
}
AkVideoCaps::operator AkCaps() const
{
return this->toCaps();
}
bool AkVideoCaps::isValid() const
{
return this->d->m_isValid;
}
bool &AkVideoCaps::isValid()
{
return this->d->m_isValid;
}
AkVideoCaps::PixelFormat AkVideoCaps::format() const
{
return this->d->m_format;
}
AkVideoCaps::PixelFormat &AkVideoCaps::format()
{
return this->d->m_format;
}
int AkVideoCaps::bpp() const
{
return this->d->m_bpp;
}
int &AkVideoCaps::bpp()
{
return this->d->m_bpp;
}
QSize AkVideoCaps::size() const
{
return QSize(this->d->m_width, this->d->m_height);
}
int AkVideoCaps::width() const
{
return this->d->m_width;
}
int &AkVideoCaps::width()
{
return this->d->m_width;
}
int AkVideoCaps::height() const
{
return this->d->m_height;
}
int &AkVideoCaps::height()
{
return this->d->m_height;
}
AkFrac AkVideoCaps::fps() const
{
return this->d->m_fps;
}
AkFrac &AkVideoCaps::fps()
{
return this->d->m_fps;
}
int AkVideoCaps::pictureSize() const
{
return this->d->m_bpp * this->d->m_width * this->d->m_height / 8;
}
AkVideoCaps &AkVideoCaps::fromMap(const QVariantMap &caps)
{
QList properties = this->dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property, QVariant());
if (!caps.contains("mimeType")) {
this->d->m_isValid = false;
return *this;
}
for (const QString &key: caps.keys())
if (key == "mimeType") {
this->d->m_isValid = caps[key].toString() == "video/x-raw";
if (!this->d->m_isValid)
return *this;
} else
this->setProperty(key.trimmed().toStdString().c_str(), caps[key]);
return *this;
}
AkVideoCaps &AkVideoCaps::fromString(const QString &caps)
{
return *this = caps;
}
QVariantMap AkVideoCaps::toMap() const
{
QVariantMap map = {
{"format", this->pixelFormatToString(this->d->m_format)},
{"bpp" , this->d->m_bpp },
{"width" , this->d->m_width },
{"height", this->d->m_height },
{"fps" , QVariant::fromValue(this->d->m_fps) }
};
for (const QByteArray &property: this->dynamicPropertyNames()) {
QString key = QString::fromUtf8(property.constData());
map[key] = this->property(property);
}
return map;
}
QString AkVideoCaps::toString() const
{
if (!this->d->m_isValid)
return QString();
QString format = this->pixelFormatToString(this->d->m_format);
QString caps = QString("video/x-raw,"
"format=%1,"
"bpp=%2,"
"width=%3,"
"height=%4,"
"fps=%5").arg(format)
.arg(this->d->m_bpp)
.arg(this->d->m_width)
.arg(this->d->m_height)
.arg(this->d->m_fps.toString());
QStringList properties;
for (const QByteArray &property: this->dynamicPropertyNames())
properties << QString::fromUtf8(property.constData());
properties.sort();
for (const QString &property: properties)
caps.append(QString(",%1=%2").arg(property)
.arg(this->property(property.toStdString().c_str()).toString()));
return caps;
}
AkVideoCaps &AkVideoCaps::update(const AkCaps &caps)
{
if (caps.mimeType() != "video/x-raw")
return *this;
this->clear();
QList properties = caps.dynamicPropertyNames();
for (const QByteArray &property: properties)
if (property == "format")
this->d->m_format = this->pixelFormatFromString(caps.property(property).toString());
else if (property == "bpp")
this->d->m_bpp = caps.property(property).toInt();
else if (property == "width")
this->d->m_width = caps.property(property).toInt();
else if (property == "height")
this->d->m_height = caps.property(property).toInt();
else if (property == "fps")
this->d->m_fps = caps.property("fps").toString();
else
this->setProperty(property, caps.property(property));
return *this;
}
AkCaps AkVideoCaps::toCaps() const
{
return AkCaps(this->toString());
}
int AkVideoCaps::bitsPerPixel(AkVideoCaps::PixelFormat pixelFormat)
{
return VideoFormat::byFormat(pixelFormat)->bpp;
}
int AkVideoCaps::bitsPerPixel(const QString &pixelFormat)
{
return AkVideoCaps::bitsPerPixel(AkVideoCaps::pixelFormatFromString(pixelFormat));
}
QString AkVideoCaps::pixelFormatToString(AkVideoCaps::PixelFormat pixelFormat)
{
AkVideoCaps caps;
int formatIndex = caps.metaObject()->indexOfEnumerator("PixelFormat");
QMetaEnum formatEnum = caps.metaObject()->enumerator(formatIndex);
QString format(formatEnum.valueToKey(pixelFormat));
format.remove("Format_");
return format;
}
AkVideoCaps::PixelFormat AkVideoCaps::pixelFormatFromString(const QString &pixelFormat)
{
AkVideoCaps caps;
QString format = "Format_" + pixelFormat;
int enumIndex = caps.metaObject()->indexOfEnumerator("PixelFormat");
QMetaEnum enumType = caps.metaObject()->enumerator(enumIndex);
int enumValue = enumType.keyToValue(format.toStdString().c_str());
return static_cast(enumValue);
}
quint32 AkVideoCaps::fourCC(AkVideoCaps::PixelFormat pixelFormat)
{
return VideoFormat::byFormat(pixelFormat)->fourCC;
}
quint32 AkVideoCaps::fourCC(const QString &pixelFormat)
{
return AkVideoCaps::fourCC(AkVideoCaps::pixelFormatFromString(pixelFormat));
}
void AkVideoCaps::setFormat(AkVideoCaps::PixelFormat format)
{
if (this->d->m_format == format)
return;
this->d->m_format = format;
emit this->formatChanged(format);
}
void AkVideoCaps::setBpp(int bpp)
{
if (this->d->m_bpp == bpp)
return;
this->d->m_bpp = bpp;
emit this->bppChanged(bpp);
}
void AkVideoCaps::setSize(const QSize &size)
{
QSize curSize(this->d->m_width, this->d->m_height);
if (curSize == size)
return;
this->setWidth(size.width());
this->setHeight(size.height());
emit sizeChanged(size);
}
void AkVideoCaps::setWidth(int width)
{
if (this->d->m_width == width)
return;
this->d->m_width = width;
emit this->widthChanged(width);
}
void AkVideoCaps::setHeight(int height)
{
if (this->d->m_height == height)
return;
this->d->m_height = height;
emit this->heightChanged(height);
}
void AkVideoCaps::setFps(const AkFrac &fps)
{
if (this->d->m_fps == fps)
return;
this->d->m_fps = fps;
emit this->fpsChanged(fps);
}
void AkVideoCaps::resetFormat()
{
this->setFormat(AkVideoCaps::Format_none);
}
void AkVideoCaps::resetBpp()
{
this->setBpp(0);
}
void AkVideoCaps::resetSize()
{
this->setSize(QSize());
}
void AkVideoCaps::resetWidth()
{
this->setWidth(0);
}
void AkVideoCaps::resetHeight()
{
this->setHeight(0);
}
void AkVideoCaps::resetFps()
{
this->setFps(AkFrac());
}
void AkVideoCaps::clear()
{
QList properties = this->dynamicPropertyNames();
for (const QByteArray &property: properties)
this->setProperty(property.constData(), QVariant());
}
QDebug operator <<(QDebug debug, const AkVideoCaps &caps)
{
debug.nospace() << caps.toString();
return debug.space();
}
QDataStream &operator >>(QDataStream &istream, AkVideoCaps &caps)
{
QString capsStr;
istream >> capsStr;
caps.fromString(capsStr);
return istream;
}
QDataStream &operator <<(QDataStream &ostream, const AkVideoCaps &caps)
{
ostream << caps.toString();
return ostream;
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/ak.cpp 0000644 0001750 0001750 00000014450 13166615412 017222 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#ifdef Q_OS_WIN32
#include
#endif
#include "ak.h"
#include "akvideocaps.h"
class AkPrivate
{
public:
QQmlEngine *m_globalEngine;
QStringList m_qmlImportPathList;
QStringList m_qmlDefaultImportPathList;
QDir m_applicationDir;
AkPrivate()
{
this->m_globalEngine = nullptr;
qRegisterMetaType("QRgb");
qRegisterMetaType("QColor");
qRegisterMetaType("AkCaps");
qRegisterMetaTypeStreamOperators("AkCaps");
qRegisterMetaType("AkCaps::CapsType");
qRegisterMetaType("CapsType");
qRegisterMetaType("AkAudioCaps");
qRegisterMetaTypeStreamOperators("AkAudioCaps");
qRegisterMetaType("AkAudioCaps::SampleFormat");
qRegisterMetaType("SampleFormat");
qRegisterMetaType("AkAudioCaps::SampleType");
qRegisterMetaType("SampleType");
qRegisterMetaType("AkAudioCaps::ChannelLayout");
qRegisterMetaType("ChannelLayout");
qRegisterMetaType("AkVideoCaps");
qRegisterMetaTypeStreamOperators("AkVideoCaps");
qRegisterMetaType("AkVideoCaps::PixelFormat");
qRegisterMetaType("PixelFormat");
qRegisterMetaType("AkElement::ElementState");
qRegisterMetaType("ElementState");
qRegisterMetaTypeStreamOperators("AkElement::ElementState");
qRegisterMetaType("AkFrac");
qRegisterMetaTypeStreamOperators("AkFrac");
qRegisterMetaType("AkPacket");
qRegisterMetaType("AkElementPtr");
this->m_applicationDir.setPath(QCoreApplication::applicationDirPath());
#ifdef Q_OS_WIN32
// Initialize the COM library in multithread mode.
CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
}
~AkPrivate()
{
#ifdef Q_OS_WIN32
// Close COM library.
CoUninitialize();
#endif
}
inline QString convertToAbsolute(const QString &path) const
{
if (!QDir::isRelativePath(path))
return QDir::cleanPath(path);
QString absPath = this->m_applicationDir.absoluteFilePath(path);
return QDir::cleanPath(absPath);
}
inline QStringList qmlImportPaths() const
{
QStringList importPaths {QString(QT_INSTALL_QML)};
#ifdef Q_OS_WIN32
QString relativePath =
QString("%1/../lib/qt/qml")
.arg(QCoreApplication::applicationDirPath());
#elif defined(Q_OS_OSX)
QString relativePath =
QString("%1/../Resources/qml")
.arg(QCoreApplication::applicationDirPath());
#else
QString relativePath =
QString("%1/../lib/qt/qml")
.arg(QCoreApplication::applicationDirPath());
#endif
importPaths << this->convertToAbsolute(relativePath);
return importPaths;
}
};
Q_GLOBAL_STATIC(AkPrivate, akGlobalStuff)
qint64 Ak::id()
{
static qint64 id = 0;
return id++;
}
void Ak::setQmlEngine(QQmlEngine *engine)
{
if (engine == akGlobalStuff->m_globalEngine)
return;
if (akGlobalStuff->m_globalEngine) {
akGlobalStuff->m_globalEngine->setImportPathList(akGlobalStuff->m_qmlDefaultImportPathList);
akGlobalStuff->m_globalEngine = nullptr;
}
if (!engine)
return;
akGlobalStuff->m_globalEngine = engine;
akGlobalStuff->m_qmlDefaultImportPathList = akGlobalStuff->m_globalEngine->importPathList();
for (auto &path: akGlobalStuff->qmlImportPaths())
akGlobalStuff->m_globalEngine->addImportPath(path);
for (auto &path: akGlobalStuff->m_qmlImportPathList)
akGlobalStuff->m_globalEngine->addImportPath(path);
}
QStringList Ak::qmlImportPathList()
{
return akGlobalStuff->m_qmlImportPathList;
}
void Ak::addQmlImportPath(const QString &path)
{
akGlobalStuff->m_qmlImportPathList << path;
if (akGlobalStuff->m_globalEngine) {
akGlobalStuff->m_globalEngine->setImportPathList(akGlobalStuff->m_qmlDefaultImportPathList);
for (auto &path: akGlobalStuff->qmlImportPaths())
akGlobalStuff->m_globalEngine->addImportPath(path);
for (auto &path: akGlobalStuff->m_qmlImportPathList)
akGlobalStuff->m_globalEngine->addImportPath(path);
}
}
void Ak::setQmlImportPathList(const QStringList &paths)
{
if (akGlobalStuff->m_qmlImportPathList == paths)
return;
akGlobalStuff->m_qmlImportPathList = paths;
if (akGlobalStuff->m_globalEngine) {
akGlobalStuff->m_globalEngine->setImportPathList(akGlobalStuff->m_qmlDefaultImportPathList);
for (auto &path: akGlobalStuff->qmlImportPaths())
akGlobalStuff->m_globalEngine->addImportPath(path);
for (auto &path: akGlobalStuff->m_qmlImportPathList)
akGlobalStuff->m_globalEngine->addImportPath(path);
}
}
void Ak::resetQmlImportPathList()
{
Ak::setQmlImportPathList({});
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akfrac.cpp 0000644 0001750 0001750 00000015430 13166615412 020055 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include "akfrac.h"
#define SIGN(n) ((n < 0)? -1: 1)
class AkFracPrivate
{
public:
qint64 m_num;
qint64 m_den;
bool m_isValid;
static inline qint64 gcd(qint64 num, qint64 den)
{
num = qAbs(num);
den = qAbs(den);
while (num > 0) {
qint64 tmp = num;
num = den % num;
den = tmp;
}
return den;
}
static inline void reduce(qint64 *num, qint64 *den)
{
qint64 gcd = AkFracPrivate::gcd(*num, *den);
if (gcd) {
*num /= gcd;
*den /= gcd;
}
}
};
AkFrac::AkFrac(QObject *parent):
QObject(parent)
{
this->d = new AkFracPrivate();
this->d->m_num = 0;
this->d->m_den = 0;
this->d->m_isValid = false;
}
AkFrac::AkFrac(qint64 num, qint64 den):
QObject(nullptr)
{
this->d = new AkFracPrivate();
this->d->m_num = 0;
this->d->m_den = 0;
this->d->m_isValid = false;
this->setNumDen(num, den);
}
AkFrac::AkFrac(const QString &fracString):
QObject(nullptr)
{
this->d = new AkFracPrivate();
this->d->m_num = 0;
this->d->m_den = 0;
this->d->m_isValid = false;
this->setNumDen(fracString);
}
AkFrac::AkFrac(const AkFrac &other):
QObject()
{
this->d = new AkFracPrivate();
this->d->m_num = other.d->m_num;
this->d->m_den = other.d->m_den;
this->d->m_isValid = other.d->m_isValid;
}
AkFrac::~AkFrac()
{
delete this->d;
}
AkFrac &AkFrac::operator =(const AkFrac &other)
{
if (this != &other) {
this->d->m_num = other.d->m_num;
this->d->m_den = other.d->m_den;
this->d->m_isValid = other.d->m_isValid;
}
return *this;
}
bool AkFrac::operator ==(const AkFrac &other) const
{
return this->toString() == other.toString();
}
bool AkFrac::operator !=(const AkFrac &other) const
{
return !(*this == other);
}
AkFrac AkFrac::operator *(const AkFrac &other) const
{
return AkFrac(this->d->m_num * other.d->m_num,
this->d->m_den * other.d->m_den);
}
qint64 AkFrac::num() const
{
return this->d->m_num;
}
qint64 AkFrac::den() const
{
return this->d->m_den;
}
qreal AkFrac::value() const
{
return this->d->m_num / qreal(this->d->m_den);
}
qint64 AkFrac::fastValue() const
{
return this->d->m_num / this->d->m_den;
}
bool AkFrac::isValid() const
{
return this->d->m_isValid;
}
QString AkFrac::toString() const
{
return QString("%1/%2")
.arg(this->d->m_num)
.arg(this->d->m_den);
}
AkFrac AkFrac::invert() const
{
return AkFrac(this->d->m_den,
this->d->m_num);
}
void AkFrac::setNumDen(qint64 num, qint64 den)
{
bool changed = false;
if (!den) {
if (this->d->m_num != 0) {
this->d->m_num = 0;
changed = true;
emit this->numChanged();
}
if (this->d->m_den != 0) {
this->d->m_den = 0;
changed = true;
emit this->denChanged();
}
if (this->d->m_isValid != false) {
this->d->m_isValid = false;
changed = true;
emit this->isValidChanged();
}
if (changed) {
emit this->valueChanged();
emit this->stringChanged();
}
return;
}
num = SIGN(den) * num;
den = qAbs(den);
AkFracPrivate::reduce(&num, &den);
if (this->d->m_num != num) {
this->d->m_num = num;
changed = true;
emit this->numChanged();
}
if (this->d->m_den != den) {
this->d->m_den = den;
changed = true;
emit this->denChanged();
}
if (this->d->m_isValid != true) {
this->d->m_isValid = true;
changed = true;
emit this->isValidChanged();
}
if (changed) {
emit this->valueChanged();
emit this->stringChanged();
}
}
void AkFrac::setNumDen(const QString &fracString)
{
bool match = QRegExp("(\\s*-)?\\s*\\d+\\s*/"
"\\s*\\d+\\s*").exactMatch(fracString);
if (!match) {
this->setNumDen(0, 0);
return;
}
QStringList fracChunks = fracString.split(QRegExp("\\s*/\\s*"),
QString::SkipEmptyParts);
qint64 num = fracChunks[0].trimmed().toInt();
qint64 den = fracChunks[1].trimmed().toInt();
this->setNumDen(num, den);
}
void AkFrac::setNum(qint64 num)
{
this->setNumDen(num, this->d->m_den);
}
void AkFrac::setDen(qint64 den)
{
this->setNumDen(this->d->m_num, den);
}
void AkFrac::resetNum()
{
this->setNum(0);
}
void AkFrac::resetDen()
{
this->setDen(0);
}
QDebug operator <<(QDebug debug, const AkFrac &frac)
{
debug.nospace() << frac.toString();
return debug.space();
}
QDataStream &operator >>(QDataStream &istream, AkFrac &frac)
{
istream >> frac.d->m_num;
istream >> frac.d->m_den;
istream >> frac.d->m_isValid;
return istream;
}
QDataStream &operator <<(QDataStream &ostream, const AkFrac &frac)
{
ostream << frac.d->m_num;
ostream << frac.d->m_den;
ostream << frac.d->m_isValid;
return ostream;
}
AkFrac operator *(int number, const AkFrac &frac)
{
return AkFrac(number * frac.d->m_num, frac.d->m_den);
}
AkFrac operator /(int number, const AkFrac &frac)
{
return number * frac.invert();
}
AkFrac operator /(const AkFrac &fracNum, const AkFrac &fracDen)
{
return AkFrac(fracNum.d->m_num * fracDen.d->m_den,
fracNum.d->m_den * fracDen.d->m_num);
}
AkFrac operator +(const AkFrac &frac1, const AkFrac &frac2)
{
return AkFrac(frac1.d->m_num * frac2.d->m_den
+ frac2.d->m_num * frac1.d->m_den,
frac1.d->m_den * frac2.d->m_den);
}
AkFrac operator -(const AkFrac &frac1, const AkFrac &frac2)
{
return AkFrac(frac1.d->m_num * frac2.d->m_den
- frac2.d->m_num * frac1.d->m_den,
frac1.d->m_den * frac2.d->m_den);
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akvideocaps.h 0000644 0001750 0001750 00000024477 13166615412 020577 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKVIDEOCAPS_H
#define AKVIDEOCAPS_H
#include
#include "akcaps.h"
#include "akfrac.h"
inline quint32 AkFourCC(quint32 a, quint32 b, quint32 c, quint32 d)
{
return (d << 24) | (c << 16) | (b << 8) | a;
}
#define AK_FOURCC_NULL AkFourCC('\x0', '\x0', '\x0', '\x0')
class AkVideoCapsPrivate;
class AKCOMMONS_EXPORT AkVideoCaps: public QObject
{
Q_OBJECT
Q_ENUMS(PixelFormat)
Q_PROPERTY(bool isValid
READ isValid)
Q_PROPERTY(PixelFormat format
READ format
WRITE setFormat
RESET resetFormat
NOTIFY formatChanged)
Q_PROPERTY(int bpp
READ bpp
WRITE setBpp
RESET resetBpp
NOTIFY bppChanged)
Q_PROPERTY(QSize size
READ size
WRITE setSize
RESET resetSize
NOTIFY sizeChanged)
Q_PROPERTY(int width
READ width
WRITE setWidth
RESET resetWidth
NOTIFY widthChanged)
Q_PROPERTY(int height
READ height
WRITE setHeight
RESET resetHeight
NOTIFY heightChanged)
Q_PROPERTY(AkFrac fps
READ fps
WRITE setFps
RESET resetFps
NOTIFY fpsChanged)
Q_PROPERTY(int pictureSize
READ pictureSize)
public:
enum PixelFormat
{
Format_none = -1,
Format_yuv420p,
Format_yuyv422,
Format_rgb24,
Format_bgr24,
Format_yuv422p,
Format_yuv444p,
Format_yuv410p,
Format_yuv411p,
Format_gray,
Format_monow,
Format_monob,
Format_pal8,
Format_yuvj420p,
Format_yuvj422p,
Format_yuvj444p,
Format_xvmcmc,
Format_xvmcidct,
Format_uyvy422,
Format_uyyvyy411,
Format_bgr8,
Format_bgr4,
Format_bgr4_byte,
Format_rgb8,
Format_rgb4,
Format_rgb4_byte,
Format_nv12,
Format_nv21,
Format_argb,
Format_rgba,
Format_abgr,
Format_bgra,
Format_gray16be,
Format_gray16le,
Format_yuv440p,
Format_yuvj440p,
Format_yuva420p,
Format_vdpau_h264,
Format_vdpau_mpeg1,
Format_vdpau_mpeg2,
Format_vdpau_wmv3,
Format_vdpau_vc1,
Format_rgb48be,
Format_rgb48le,
Format_rgb565be,
Format_rgb565le,
Format_rgb555be,
Format_rgb555le,
Format_bgr565be,
Format_bgr565le,
Format_bgr555be,
Format_bgr555le,
Format_vaapi_moco,
Format_vaapi_idct,
Format_vaapi_vld,
Format_yuv420p16le,
Format_yuv420p16be,
Format_yuv422p16le,
Format_yuv422p16be,
Format_yuv444p16le,
Format_yuv444p16be,
Format_vdpau_mpeg4,
Format_dxva2_vld,
Format_rgb444le,
Format_rgb444be,
Format_bgr444le,
Format_bgr444be,
Format_ya8,
Format_bgr48be,
Format_bgr48le,
Format_yuv420p9be,
Format_yuv420p9le,
Format_yuv420p10be,
Format_yuv420p10le,
Format_yuv422p10be,
Format_yuv422p10le,
Format_yuv444p9be,
Format_yuv444p9le,
Format_yuv444p10be,
Format_yuv444p10le,
Format_yuv422p9be,
Format_yuv422p9le,
Format_vda_vld,
Format_gbrp,
Format_gbrp9be,
Format_gbrp9le,
Format_gbrp10be,
Format_gbrp10le,
Format_gbrp16be,
Format_gbrp16le,
Format_yuva420p9be,
Format_yuva420p9le,
Format_yuva422p9be,
Format_yuva422p9le,
Format_yuva444p9be,
Format_yuva444p9le,
Format_yuva420p10be,
Format_yuva420p10le,
Format_yuva422p10be,
Format_yuva422p10le,
Format_yuva444p10be,
Format_yuva444p10le,
Format_yuva420p16be,
Format_yuva420p16le,
Format_yuva422p16be,
Format_yuva422p16le,
Format_yuva444p16be,
Format_yuva444p16le,
Format_vdpau,
Format_xyz12le,
Format_xyz12be,
Format_nv16,
Format_nv20le,
Format_nv20be,
Format_yvyu422,
Format_vda,
Format_ya16be,
Format_ya16le,
Format_qsv,
Format_mmal,
Format_d3d11va_vld,
Format_rgba64be,
Format_rgba64le,
Format_bgra64be,
Format_bgra64le,
Format_0rgb,
Format_rgb0,
Format_0bgr,
Format_bgr0,
Format_yuva444p,
Format_yuva422p,
Format_yuv420p12be,
Format_yuv420p12le,
Format_yuv420p14be,
Format_yuv420p14le,
Format_yuv422p12be,
Format_yuv422p12le,
Format_yuv422p14be,
Format_yuv422p14le,
Format_yuv444p12be,
Format_yuv444p12le,
Format_yuv444p14be,
Format_yuv444p14le,
Format_gbrp12be,
Format_gbrp12le,
Format_gbrp14be,
Format_gbrp14le,
Format_gbrap,
Format_gbrap16be,
Format_gbrap16le,
Format_yuvj411p,
Format_bayer_bggr8,
Format_bayer_rggb8,
Format_bayer_gbrg8,
Format_bayer_grbg8,
Format_bayer_bggr16le,
Format_bayer_bggr16be,
Format_bayer_rggb16le,
Format_bayer_rggb16be,
Format_bayer_gbrg16le,
Format_bayer_gbrg16be,
Format_bayer_grbg16le,
Format_bayer_grbg16be,
Format_yuv440p10le,
Format_yuv440p10be,
Format_yuv440p12le,
Format_yuv440p12be,
Format_ayuv64le,
Format_ayuv64be,
Format_v210,
Format_v216,
Format_v308
};
explicit AkVideoCaps(QObject *parent=nullptr);
AkVideoCaps(const QVariantMap &caps);
AkVideoCaps(const QString &caps);
AkVideoCaps(const AkCaps &caps);
AkVideoCaps(const AkVideoCaps &other);
~AkVideoCaps();
AkVideoCaps &operator =(const AkVideoCaps &other);
AkVideoCaps &operator =(const AkCaps &caps);
AkVideoCaps &operator =(const QString &caps);
bool operator ==(const AkVideoCaps &other) const;
bool operator !=(const AkVideoCaps &other) const;
operator bool() const;
operator AkCaps() const;
Q_INVOKABLE bool isValid() const;
Q_INVOKABLE bool &isValid();
Q_INVOKABLE PixelFormat format() const;
Q_INVOKABLE PixelFormat &format();
Q_INVOKABLE int bpp() const;
Q_INVOKABLE int &bpp();
Q_INVOKABLE QSize size() const;
Q_INVOKABLE int width() const;
Q_INVOKABLE int &width();
Q_INVOKABLE int height() const;
Q_INVOKABLE int &height();
Q_INVOKABLE AkFrac fps() const;
Q_INVOKABLE AkFrac &fps();
Q_INVOKABLE int pictureSize() const;
Q_INVOKABLE AkVideoCaps &fromMap(const QVariantMap &caps);
Q_INVOKABLE AkVideoCaps &fromString(const QString &caps);
Q_INVOKABLE QVariantMap toMap() const;
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkVideoCaps &update(const AkCaps &caps);
Q_INVOKABLE AkCaps toCaps() const;
Q_INVOKABLE static int bitsPerPixel(PixelFormat pixelFormat);
Q_INVOKABLE static int bitsPerPixel(const QString &pixelFormat);
Q_INVOKABLE static QString pixelFormatToString(PixelFormat pixelFormat);
Q_INVOKABLE static PixelFormat pixelFormatFromString(const QString &pixelFormat);
Q_INVOKABLE static quint32 fourCC(PixelFormat pixelFormat);
Q_INVOKABLE static quint32 fourCC(const QString &pixelFormat);
private:
AkVideoCapsPrivate *d;
Q_SIGNALS:
void formatChanged(PixelFormat format);
void bppChanged(int bpp);
void sizeChanged(const QSize &size);
void widthChanged(int width);
void heightChanged(int height);
void fpsChanged(const AkFrac &fps);
public Q_SLOTS:
void setFormat(PixelFormat format);
void setBpp(int bpp);
void setSize(const QSize &size);
void setWidth(int width);
void setHeight(int height);
void setFps(const AkFrac &fps);
void resetFormat();
void resetBpp();
void resetSize();
void resetWidth();
void resetHeight();
void resetFps();
void clear();
friend QDebug operator <<(QDebug debug, const AkVideoCaps &caps);
friend QDataStream &operator >>(QDataStream &istream, AkVideoCaps &caps);
friend QDataStream &operator <<(QDataStream &ostream, const AkVideoCaps &caps);
};
QDebug operator <<(QDebug debug, const AkVideoCaps &caps);
QDataStream &operator >>(QDataStream &istream, AkVideoCaps &caps);
QDataStream &operator <<(QDataStream &ostream, const AkVideoCaps &caps);
Q_DECLARE_METATYPE(AkVideoCaps)
Q_DECLARE_METATYPE(AkVideoCaps::PixelFormat)
#endif // AKVIDEOCAPS_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akpacket.h 0000644 0001750 0001750 00000010164 13166615412 020055 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKPACKET_H
#define AKPACKET_H
#include
#include "akcaps.h"
#include "akfrac.h"
class AkPacketPrivate;
template
inline T AkNoPts()
{
return T(0x1) << (sizeof(T) - 1);
}
class AKCOMMONS_EXPORT AkPacket: public QObject
{
Q_OBJECT
Q_PROPERTY(AkCaps caps
READ caps
WRITE setCaps
RESET resetCaps
NOTIFY capsChanged)
Q_PROPERTY(QVariant data
READ data
WRITE setData
RESET resetData
NOTIFY dataChanged)
Q_PROPERTY(QByteArray buffer
READ buffer
WRITE setBuffer
RESET resetBuffer
NOTIFY bufferChanged)
Q_PROPERTY(qint64 id
READ id
WRITE setId
RESET resetId
NOTIFY idChanged)
Q_PROPERTY(qint64 pts
READ pts
WRITE setPts
RESET resetPts
NOTIFY ptsChanged)
Q_PROPERTY(AkFrac timeBase
READ timeBase
WRITE setTimeBase
RESET resetTimeBase
NOTIFY timeBaseChanged)
Q_PROPERTY(int index
READ index
WRITE setIndex
RESET resetIndex
NOTIFY indexChanged)
public:
explicit AkPacket(QObject *parent=nullptr);
AkPacket(const AkCaps &caps,
const QByteArray &buffer=QByteArray(),
qint64 pts=0,
const AkFrac &timeBase=AkFrac(),
int index=-1,
qint64 id=-1);
AkPacket(const AkPacket &other);
virtual ~AkPacket();
AkPacket &operator =(const AkPacket &other);
operator bool() const;
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkCaps caps() const;
Q_INVOKABLE AkCaps &caps();
Q_INVOKABLE QVariant data() const;
Q_INVOKABLE QVariant &data();
Q_INVOKABLE QByteArray buffer() const;
Q_INVOKABLE QByteArray &buffer();
Q_INVOKABLE qint64 id() const;
Q_INVOKABLE qint64 &id();
Q_INVOKABLE qint64 pts() const;
Q_INVOKABLE qint64 &pts();
Q_INVOKABLE AkFrac timeBase() const;
Q_INVOKABLE AkFrac &timeBase();
Q_INVOKABLE int index() const;
Q_INVOKABLE int &index();
private:
AkPacketPrivate *d;
Q_SIGNALS:
void capsChanged(const AkCaps &caps);
void dataChanged(const QVariant &data);
void bufferChanged(const QByteArray &buffer);
void idChanged(qint64 id);
void ptsChanged(qint64 pts);
void timeBaseChanged(const AkFrac &timeBase);
void indexChanged(int index);
public Q_SLOTS:
void setCaps(const AkCaps &caps);
void setData(const QVariant &data);
void setBuffer(const QByteArray &buffer);
void setId(qint64 id);
void setPts(qint64 pts);
void setTimeBase(const AkFrac &timeBase);
void setIndex(int index);
void resetCaps();
void resetData();
void resetBuffer();
void resetId();
void resetPts();
void resetTimeBase();
void resetIndex();
friend QDebug operator <<(QDebug debug, const AkPacket &packet);
};
QDebug operator <<(QDebug debug, const AkPacket &packet);
Q_DECLARE_METATYPE(AkPacket)
#endif // AKPACKET_H
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akpacket.cpp 0000644 0001750 0001750 00000014174 13166615412 020415 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include "akpacket.h"
class AkPacketPrivate
{
public:
AkCaps m_caps;
QVariant m_data;
QByteArray m_buffer;
qint64 m_pts;
AkFrac m_timeBase;
int m_index;
qint64 m_id;
};
AkPacket::AkPacket(QObject *parent):
QObject(parent)
{
this->d = new AkPacketPrivate();
this->d->m_pts = 0;
this->d->m_index = -1;
this->d->m_id = -1;
}
AkPacket::AkPacket(const AkCaps &caps,
const QByteArray &buffer,
qint64 pts,
const AkFrac &timeBase,
int index,
qint64 id)
{
this->d = new AkPacketPrivate();
this->d->m_caps = caps;
bool isValid = this->d->m_caps.isValid();
this->d->m_buffer = isValid? buffer: QByteArray();
this->d->m_pts = isValid? pts: 0;
this->d->m_timeBase = isValid? timeBase: AkFrac();
this->d->m_index = isValid? index: -1;
this->d->m_id = isValid? id: -1;
}
AkPacket::AkPacket(const AkPacket &other):
QObject()
{
this->d = new AkPacketPrivate();
this->d->m_caps = other.d->m_caps;
this->d->m_data = other.d->m_data;
this->d->m_buffer = other.d->m_buffer;
this->d->m_pts = other.d->m_pts;
this->d->m_timeBase = other.d->m_timeBase;
this->d->m_index = other.d->m_index;
this->d->m_id = other.d->m_id;
}
AkPacket::~AkPacket()
{
delete this->d;
}
AkPacket &AkPacket::operator =(const AkPacket &other)
{
if (this != &other) {
this->d->m_caps = other.d->m_caps;
this->d->m_data = other.d->m_data;
this->d->m_buffer = other.d->m_buffer;
this->d->m_pts = other.d->m_pts;
this->d->m_timeBase = other.d->m_timeBase;
this->d->m_index = other.d->m_index;
this->d->m_id = other.d->m_id;
}
return *this;
}
AkPacket::operator bool() const
{
return this->d->m_caps.isValid();
}
QString AkPacket::toString() const
{
QString packetInfo;
QDebug debug(&packetInfo);
debug.nospace() << "Caps : "
<< this->d->m_caps.toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Data : "
<< this->d->m_data
<< "\n";
debug.nospace() << "Buffer Size: "
<< this->d->m_buffer.size()
<< "\n";
debug.nospace() << "Id : "
<< this->d->m_id
<< "\n";
debug.nospace() << "Pts : "
<< this->d->m_pts
<< " ("
<< this->d->m_pts * this->d->m_timeBase.value()
<< ")\n";
debug.nospace() << "Time Base : "
<< this->d->m_timeBase.toString().toStdString().c_str()
<< "\n";
debug.nospace() << "Index : "
<< this->d->m_index;
return packetInfo;
}
AkCaps AkPacket::caps() const
{
return this->d->m_caps;
}
AkCaps &AkPacket::caps()
{
return this->d->m_caps;
}
QVariant AkPacket::data() const
{
return this->d->m_data;
}
QVariant &AkPacket::data()
{
return this->d->m_data;
}
QByteArray AkPacket::buffer() const
{
return this->d->m_buffer;
}
QByteArray &AkPacket::buffer()
{
return this->d->m_buffer;
}
qint64 AkPacket::id() const
{
return this->d->m_id;
}
qint64 &AkPacket::id()
{
return this->d->m_id;
}
qint64 AkPacket::pts() const
{
return this->d->m_pts;
}
qint64 &AkPacket::pts()
{
return this->d->m_pts;
}
AkFrac AkPacket::timeBase() const
{
return this->d->m_timeBase;
}
AkFrac &AkPacket::timeBase()
{
return this->d->m_timeBase;
}
int AkPacket::index() const
{
return this->d->m_index;
}
int &AkPacket::index()
{
return this->d->m_index;
}
void AkPacket::setCaps(const AkCaps &caps)
{
if (this->d->m_caps == caps)
return;
this->d->m_caps = caps;
emit this->capsChanged(caps);
}
void AkPacket::setData(const QVariant &data)
{
if (this->d->m_data == data)
return;
this->d->m_data = data;
emit this->dataChanged(data);
}
void AkPacket::setBuffer(const QByteArray &buffer)
{
if (this->d->m_buffer == buffer)
return;
this->d->m_buffer = buffer;
emit this->bufferChanged(buffer);
}
void AkPacket::setId(qint64 id)
{
if (this->d->m_id == id)
return;
this->d->m_id = id;
emit this->idChanged(id);
}
void AkPacket::setPts(qint64 pts)
{
if (this->d->m_pts == pts)
return;
this->d->m_pts = pts;
emit this->ptsChanged(pts);
}
void AkPacket::setTimeBase(const AkFrac &timeBase)
{
if (this->d->m_timeBase == timeBase)
return;
this->d->m_timeBase = timeBase;
emit this->timeBaseChanged(timeBase);
}
void AkPacket::setIndex(int index)
{
if (this->d->m_index == index)
return;
this->d->m_index = index;
emit this->indexChanged(index);
}
void AkPacket::resetCaps()
{
this->setCaps(AkCaps());
}
void AkPacket::resetData()
{
this->setData(QVariant());
}
void AkPacket::resetBuffer()
{
this->setBuffer(QByteArray());
}
void AkPacket::resetId()
{
this->setId(-1);
}
void AkPacket::resetPts()
{
this->setPts(0);
}
void AkPacket::resetTimeBase()
{
this->setTimeBase(AkFrac());
}
void AkPacket::resetIndex()
{
this->setIndex(-1);
}
QDebug operator <<(QDebug debug, const AkPacket &packet)
{
debug.nospace() << packet.toString().toStdString().c_str();
return debug.space();
}
webcamoid-8.1.0+dfsg/libAvKys/Lib/src/akvideopacket.h 0000644 0001750 0001750 00000004450 13166615412 021105 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifndef AKVIDEOPACKET_H
#define AKVIDEOPACKET_H
#include "akpacket.h"
#include "akvideocaps.h"
class AkVideoPacketPrivate;
class AKCOMMONS_EXPORT AkVideoPacket: public AkPacket
{
Q_OBJECT
Q_PROPERTY(AkVideoCaps caps
READ caps
WRITE setCaps
RESET resetCaps
NOTIFY capsChanged)
public:
explicit AkVideoPacket(QObject *parent=nullptr);
AkVideoPacket(const AkVideoCaps &caps,
const QByteArray &buffer=QByteArray(),
qint64 pts=0,
const AkFrac &timeBase=AkFrac(),
int index=-1,
qint64 id=-1);
AkVideoPacket(const AkPacket &other);
AkVideoPacket(const AkVideoPacket &other);
~AkVideoPacket();
AkVideoPacket &operator =(const AkPacket &other);
AkVideoPacket &operator =(const AkVideoPacket &other);
operator bool() const;
Q_INVOKABLE AkVideoCaps caps() const;
Q_INVOKABLE AkVideoCaps &caps();
Q_INVOKABLE QString toString() const;
Q_INVOKABLE AkPacket toPacket() const;
private:
AkVideoPacketPrivate *d;
Q_SIGNALS:
void capsChanged(const AkVideoCaps &caps);
public Q_SLOTS:
void setCaps(const AkVideoCaps &caps);
void resetCaps();
friend QDebug operator <<(QDebug debug, const AkVideoPacket &packet);
};
QDebug operator <<(QDebug debug, const AkVideoPacket &packet);
Q_DECLARE_METATYPE(AkVideoPacket)
#endif // AKVIDEOPACKET_H
webcamoid-8.1.0+dfsg/libAvKys/commons.pri 0000644 0001750 0001750 00000013234 13166615412 017014 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
COMMONS_APPNAME = "libAvKys"
COMMONS_TARGET = $$lower($${COMMONS_APPNAME})
COMMONS_TARGET = $$replace(COMMONS_TARGET, lib, "")
VER_MAJ = 8
VER_MIN = 1
VER_PAT = 0
VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
isEmpty(BUILDDOCS): BUILDDOCS = 0
isEmpty(QDOCTOOL): {
unix: QDOCTOOL = $$[QT_INSTALL_BINS]/qdoc
!unix: QDOCTOOL = $$[QT_INSTALL_LIBEXECS]/qdoc
}
isEmpty(QMAKE_LRELEASE) {
unix: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
!unix: QMAKE_LRELEASE = $$[QT_INSTALL_LIBEXECS]/lrelease
}
win32 {
host_name = $$lower($$QMAKE_HOST.os)
!isEmpty(ProgramW6432) {
DEFAULT_PREFIX = $(ProgramW6432)/$${COMMONS_APPNAME}
} else: !isEmpty(ProgramFiles) {
DEFAULT_PREFIX = $(ProgramFiles)/$${COMMONS_APPNAME}
} else: contains(host_name, linux) {
DEFAULT_PREFIX = /$${COMMONS_APPNAME}
} else {
DEFAULT_PREFIX = C:/$${COMMONS_APPNAME}
}
} else {
DEFAULT_PREFIX = /usr
}
isEmpty(PREFIX): PREFIX = $${DEFAULT_PREFIX}
isEmpty(EXECPREFIX): EXECPREFIX = $${PREFIX}
isEmpty(BINDIR): BINDIR = $${EXECPREFIX}/bin
isEmpty(SBINDIR): SBINDIR = $${EXECPREFIX}/sbin
isEmpty(LIBEXECDIR): LIBEXECDIR = $${EXECPREFIX}/libexec
isEmpty(DATAROOTDIR): DATAROOTDIR = $${PREFIX}/share
isEmpty(DATDIR): DATDIR = $${DATAROOTDIR}/$${COMMONS_TARGET}
isEmpty(SYSCONFDIR): SYSCONFDIR = $${PREFIX}/etc
isEmpty(SHAREDSTATEDIR): SHAREDSTATEDIR = $${PREFIX}/com
isEmpty(LOCALSTATEDIR): LOCALSTATEDIR = $${PREFIX}/var
isEmpty(INCLUDEDIR): INCLUDEDIR = $${PREFIX}/include
isEmpty(DOCDIR): DOCDIR = $${DATAROOTDIR}/doc/$${COMMONS_TARGET}
isEmpty(INFODIR): INFODIR = $${DATAROOTDIR}/info
isEmpty(HTMLDIR): HTMLDIR = $${DOCDIR}/html
isEmpty(DVIDIR): DVIDIR = $${DOCDIR}/dvi
isEmpty(PDFDIR): PDFDIR = $${DOCDIR}/pdf
isEmpty(PSDIR): PSDIR = $${DOCDIR}/ps
isEmpty(LIBDIR): LIBDIR = $${EXECPREFIX}/lib
isEmpty(LOCALEDIR): LOCALEDIR = $${DATAROOTDIR}/locale
isEmpty(MANDIR): MANDIR = $${DATAROOTDIR}/man
isEmpty(LICENSEDIR): LICENSEDIR = $${DATAROOTDIR}/licenses/$${COMMONS_TARGET}
isEmpty(LOCALDIR): LOCALDIR = $${PREFIX}/local
isEmpty(LOCALLIBDIR): LOCALLIBDIR = $${LOCALDIR}/lib
isEmpty(INSTALLQMLDIR): INSTALLQMLDIR = $${LIBDIR}/qt/qml
DEFINES += \
COMMONS_APPNAME=\"\\\"$$COMMONS_APPNAME\\\"\" \
COMMONS_TARGET=\"\\\"$$COMMONS_TARGET\\\"\" \
COMMONS_VER_MAJ=\"\\\"$$VER_MAJ\\\"\" \
COMMONS_VERSION=\"\\\"$$VERSION\\\"\" \
PREFIX=\"\\\"$$PREFIX\\\"\" \
EXECPREFIX=\"\\\"$$EXECPREFIX\\\"\" \
BINDIR=\"\\\"$$BINDIR\\\"\" \
SBINDIR=\"\\\"$$SBINDIR\\\"\" \
LIBEXECDIR=\"\\\"LIBEXECDIR\\\"\" \
DATAROOTDIR=\"\\\"$$DATAROOTDIR\\\"\" \
DATDIR=\"\\\"$$DATDIR\\\"\" \
SYSCONFDIR=\"\\\"$$SYSCONFDIR\\\"\" \
SHAREDSTATEDIR=\"\\\"$$SHAREDSTATEDIR\\\"\" \
LOCALSTATEDIR=\"\\\"$$LOCALSTATEDIR\\\"\" \
INCLUDEDIR=\"\\\"$$INCLUDEDIR\\\"\" \
DOCDIR=\"\\\"$$DOCDIR\\\"\" \
INFODIR=\"\\\"$$INFODIR\\\"\" \
HTMLDIR=\"\\\"$$HTMLDIR\\\"\" \
DVIDIR=\"\\\"$$DVIDIR\\\"\" \
PDFDIR=\"\\\"$$PDFDIR\\\"\" \
PSDIR=\"\\\"$$PSDIR\\\"\" \
LIBDIR=\"\\\"$$LIBDIR\\\"\" \
LOCALEDIR=\"\\\"$$LOCALEDIR\\\"\" \
MANDIR=\"\\\"$$MANDIR\\\"\" \
LICENSEDIR=\"\\\"$$LICENSEDIR\\\"\" \
LOCALDIR=\"\\\"$$LOCALDIR\\\"\" \
LOCALLIBDIR=\"\\\"$$LOCALLIBDIR\\\"\" \
INSTALLQMLDIR=\"\\\"$$INSTALLQMLDIR\\\"\"
CONFIG(debug, debug|release) {
COMMONS_BUILD_PATH = build/Qt$${QT_VERSION}/$${QMAKE_CC}/debug
DEFINES += QT_DEBUG
} else {
COMMONS_BUILD_PATH = build/Qt$${QT_VERSION}/$${QMAKE_CC}/release
}
MOC_DIR = $${COMMONS_BUILD_PATH}/moc
OBJECTS_DIR = $${COMMONS_BUILD_PATH}/obj
RCC_DIR = $${COMMONS_BUILD_PATH}/rcc
UI_DIR = $${COMMONS_BUILD_PATH}/ui
# Compile translations files.
isEmpty(NOLRELEASE): !isEmpty(TRANSLATIONS): CONFIG(debug, debug|release) {
compiletr.input = TRANSLATIONS
compiletr.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
compiletr.commands = $$QMAKE_LRELEASE -removeidentical -compress ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
compiletr.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += compiletr
PRE_TARGETDEPS += compiler_compiletr_make_all
}
win32 {
CONFIG += skip_target_version_ext
!isEmpty(STATIC_BUILD):!isEqual(STATIC_BUILD, 0) {
win32-g++: QMAKE_LFLAGS = -static-libgcc -static-libstdc++
}
}
macx: QT_CONFIG -= no-pkg-config
# Enable c++11 support in all platforms
!CONFIG(c++11): CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
webcamoid-8.1.0+dfsg/libAvKys/Tests/ 0000755 0001750 0001750 00000000000 13166615412 015724 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_subtitledata/ 0000755 0001750 0001750 00000000000 13166615412 023421 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_subtitledata/test.cpp 0000644 0001750 0001750 00000001673 13166615412 025113 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
AVSubtitleRect subtitleRect;
std::cout << &subtitleRect.data;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_subtitledata/ffmpeg_avcodec_subtitledata.pro 0000644 0001750 0001750 00000002113 13166615412 031635 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/dshow/ 0000755 0001750 0001750 00000000000 13166615412 017050 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/dshow/dshow.pro 0000644 0001750 0001750 00000001671 13166615412 020723 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
DEFINES += __STDC_CONSTANT_MACROS NO_DSHOW_STRSAFE
LIBS += \
-lstrmiids \
-luuid \
-lole32 \
-loleaut32
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/dshow/test.cpp 0000644 0001750 0001750 00000001546 13166615412 020541 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4lutils/ 0000755 0001750 0001750 00000000000 13166615412 017512 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/v4lutils/test.cpp 0000644 0001750 0001750 00000001501 13166615412 021172 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4lutils/v4lutils.pro 0000644 0001750 0001750 00000001525 13166615412 022025 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
SOURCES = \
test.cpp
CONFIG += link_pkgconfig
PKGCONFIG += libv4l2
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_extracodecformats/ 0000755 0001750 0001750 00000000000 13166615412 024451 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_extracodecformats/test.cpp 0000644 0001750 0001750 00000001734 13166615412 026141 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
std::cout << AV_CODEC_ID_CPIA
<< AV_CODEC_ID_VP9
<< AV_CODEC_ID_XFACE;
return 0;
}
././@LongLink 0000644 0000000 0000000 00000000152 00000000000 011601 L ustar root root webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_extracodecformats/ffmpeg_avcodec_extracodecformats.pro webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_extracodecformats/ffmpeg_avcodec_extracodecformat0000644 0001750 0001750 00000002113 13166615412 032733 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_packetref/ 0000755 0001750 0001750 00000000000 13166615412 022700 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_packetref/test.cpp 0000644 0001750 0001750 00000001624 13166615412 024366 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
av_packet_ref(NULL, NULL);
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_packetref/ffmpeg_avcodec_packetref.pro 0000644 0001750 0001750 00000002113 13166615412 030373 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_framealloc/ 0000755 0001750 0001750 00000000000 13166615412 022741 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_framealloc/test.cpp 0000644 0001750 0001750 00000001673 13166615412 024433 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
av_frame_alloc();
av_frame_unref(NULL);
av_frame_free(NULL);
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_framealloc/ffmpeg_avutil_framealloc.pro 0000644 0001750 0001750 00000002112 13166615412 030474 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavutil
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_rescalets/ 0000755 0001750 0001750 00000000000 13166615412 022721 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_rescalets/ffmpeg_avcodec_rescalets.pro 0000644 0001750 0001750 00000002113 13166615412 030435 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_rescalets/test.cpp 0000644 0001750 0001750 00000001663 13166615412 024412 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
av_packet_rescale_ts(NULL, AVRational {}, AVRational {});
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avresample/ 0000755 0001750 0001750 00000000000 13166615412 021407 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avresample/ffmpeg_avresample.pro 0000644 0001750 0001750 00000002116 13166615412 025614 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavresample
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avresample/test.cpp 0000644 0001750 0001750 00000001545 13166615412 023077 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
extern "C"
{
#include
}
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/coreaudio/ 0000755 0001750 0001750 00000000000 13166615412 017676 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/coreaudio/coreaudio.pro 0000644 0001750 0001750 00000001616 13166615412 022376 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
OBJECTIVE_SOURCES = \
test.mm
LIBS += \
-framework CoreFoundation \
-framework CoreAudio \
-framework AudioUnit
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/coreaudio/test.mm 0000644 0001750 0001750 00000001556 13166615412 021217 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extrapixformats/ 0000755 0001750 0001750 00000000000 13166615412 024074 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extrapixformats/test.cpp 0000644 0001750 0001750 00000002242 13166615412 025557 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
std::cout << AV_PIX_FMT_RGB0
<< AV_PIX_FMT_BGR0
<< AV_PIX_FMT_NV16
<< AV_PIX_FMT_BAYER_BGGR8
<< AV_PIX_FMT_BAYER_GBRG8
<< AV_PIX_FMT_BAYER_GRBG8
<< AV_PIX_FMT_BAYER_RGGB8
<< AV_PIX_FMT_BAYER_BGGR16LE;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extrapixformats/ffmpeg_avutil_extrapixformats.pro 0000644 0001750 0001750 00000002112 13166615412 032762 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavutil
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/avfoundation/ 0000755 0001750 0001750 00000000000 13166615412 020421 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/avfoundation/avfoundation.pro 0000644 0001750 0001750 00000001650 13166615412 023642 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
OBJECTIVE_SOURCES = \
test.mm
LIBS += \
-framework CoreMedia \
-framework CoreVideo \
-framework Foundation \
-framework AVFoundation
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/avfoundation/test.mm 0000644 0001750 0001750 00000001522 13166615412 021733 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#import
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/wasapi/ 0000755 0001750 0001750 00000000000 13166615412 017210 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/wasapi/test.cpp 0000644 0001750 0001750 00000001641 13166615412 020675 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/wasapi/wasapi.pro 0000644 0001750 0001750 00000001544 13166615412 021222 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
SOURCES = \
test.cpp
LIBS += \
-lole32 \
-lwinmm
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/alsa/ 0000755 0001750 0001750 00000000000 13166615412 016644 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/alsa/test.cpp 0000644 0001750 0001750 00000001510 13166615412 020324 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/alsa/alsa.pro 0000644 0001750 0001750 00000001522 13166615412 020306 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
SOURCES = \
test.cpp
CONFIG += link_pkgconfig
PKGCONFIG += alsa
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extraoptions/ 0000755 0001750 0001750 00000000000 13166615412 023373 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extraoptions/ffmpeg_avutil_extraoptions.pro 0000644 0001750 0001750 00000002112 13166615412 031560 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavutil
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_extraoptions/test.cpp 0000644 0001750 0001750 00000002311 13166615412 025053 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
std::cout << AV_OPT_TYPE_DICT
<< AV_OPT_TYPE_IMAGE_SIZE
<< AV_OPT_TYPE_PIXEL_FMT
<< AV_OPT_TYPE_SAMPLE_FMT
<< AV_OPT_TYPE_VIDEO_RATE
<< AV_OPT_TYPE_DURATION
<< AV_OPT_TYPE_COLOR
<< AV_OPT_TYPE_CHANNEL_LAYOUT
<< AV_OPT_TYPE_BOOL;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/qtaudio/ 0000755 0001750 0001750 00000000000 13166615412 017372 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/qtaudio/qtaudio.pro 0000644 0001750 0001750 00000001505 13166615412 021563 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
SOURCES = \
test.cpp
CONFIG += qt
QT += multimedia
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/qtaudio/test.cpp 0000644 0001750 0001750 00000001567 13166615412 021066 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/syphon/ 0000755 0001750 0001750 00000000000 13166615412 017244 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/syphon/test.mm 0000644 0001750 0001750 00000001477 13166615412 020567 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#import
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/syphon/syphon.pro 0000644 0001750 0001750 00000001746 13166615412 021316 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
!isEmpty(SYPHONINCLUDES): INCLUDEPATH += $${SYPHONINCLUDES}
isEmpty(SYPHONLIBS) {
LIBS += -framework Syphon
} else {
LIBS += $${SYPHONLIBS}
}
LIBS += -framework Foundation
OBJECTIVE_SOURCES = \
test.mm
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/oss/ 0000755 0001750 0001750 00000000000 13166615412 016530 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/oss/test.cpp 0000644 0001750 0001750 00000001607 13166615412 020217 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#ifdef HAVE_OSS_LINUX
#include
#else
#include
#endif
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/oss/oss.pro 0000644 0001750 0001750 00000001553 13166615412 020062 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
exists($${INCLUDEDIR}/linux/soundcard.h): DEFINES += HAVE_OSS_LINUX
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/jack/ 0000755 0001750 0001750 00000000000 13166615412 016634 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/jack/test.cpp 0000644 0001750 0001750 00000001503 13166615412 020316 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/jack/jack.pro 0000644 0001750 0001750 00000001564 13166615412 020274 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
macx: QT_CONFIG -= no-pkg-config
SOURCES = \
test.cpp
CONFIG += link_pkgconfig
PKGCONFIG += jack
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/pulseaudio/ 0000755 0001750 0001750 00000000000 13166615412 020076 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/pulseaudio/test.cpp 0000644 0001750 0001750 00000001730 13166615412 021562 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/pulseaudio/pulseaudio.pro 0000644 0001750 0001750 00000001577 13166615412 023004 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
macx: QT_CONFIG -= no-pkg-config
SOURCES = \
test.cpp
CONFIG += link_pkgconfig
PKGCONFIG += libpulse-simple
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvc/ 0000755 0001750 0001750 00000000000 13166615412 017210 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvc/test.cpp 0000644 0001750 0001750 00000001533 13166615412 020675 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvc/libuvc.pro 0000644 0001750 0001750 00000002262 13166615412 021220 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
SOURCES = \
test.cpp
!isEmpty(LIBUSBINCLUDES): INCLUDEPATH += $${LIBUSBINCLUDES}
!isEmpty(LIBUSBLIBS): LIBS += $${LIBUSBLIBS}
isEmpty(LIBUSBLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += libusb-1.0
}
!isEmpty(LIBUVCINCLUDES): INCLUDEPATH += $${LIBUVCINCLUDES}
!isEmpty(LIBUVCLIBS): LIBS += $${LIBUVCLIBS}
isEmpty(LIBUVCLIBS) {
LIBS += -luvc
}
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/vcamwin/ 0000755 0001750 0001750 00000000000 13166615412 017370 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/vcamwin/vcamwin.pro 0000644 0001750 0001750 00000001755 13166615412 021566 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
SOURCES = \
test.cpp
LIBS += \
-lstrmiids \
-luuid \
-lole32 \
-loleaut32 \
-ladvapi32 \
-luser32 \
-lwinmm \
-lgdi32 \
-lgdiplus
win32-g++: LIBS += -lksguid
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/vcamwin/test.cpp 0000644 0001750 0001750 00000001501 13166615412 021050 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg/ 0000755 0001750 0001750 00000000000 13166615412 017170 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg/ffmpeg.pro 0000644 0001750 0001750 00000002240 13166615412 021154 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavdevice \
libavformat \
libavcodec \
libswscale \
libavutil
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg/test.cpp 0000644 0001750 0001750 00000001761 13166615412 020660 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
extern "C"
{
#include
#include
#include
#include
#include
}
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvcdev/ 0000755 0001750 0001750 00000000000 13166615412 017707 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvcdev/test.cpp 0000644 0001750 0001750 00000001574 13166615412 021401 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
int main()
{
uvc_get_format_descs(NULL);
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/libuvcdev/libuvcdev.pro 0000644 0001750 0001750 00000002262 13166615412 022416 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
SOURCES = \
test.cpp
!isEmpty(LIBUSBINCLUDES): INCLUDEPATH += $${LIBUSBINCLUDES}
!isEmpty(LIBUSBLIBS): LIBS += $${LIBUSBLIBS}
isEmpty(LIBUSBLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += libusb-1.0
}
!isEmpty(LIBUVCINCLUDES): INCLUDEPATH += $${LIBUVCINCLUDES}
!isEmpty(LIBUVCLIBS): LIBS += $${LIBUVCLIBS}
isEmpty(LIBUVCLIBS) {
LIBS += -luvc
}
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/gstreamer/ 0000755 0001750 0001750 00000000000 13166615412 017715 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/gstreamer/test.cpp 0000644 0001750 0001750 00000002031 13166615412 021374 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
#include
int main()
{
gst_init(NULL, NULL);
gst_video_info_new();
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/gstreamer/gstreamer.pro 0000644 0001750 0001750 00000002262 13166615412 022432 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
!isEmpty(GSTREAMERINCLUDES): INCLUDEPATH += $${GSTREAMERINCLUDES}
!isEmpty(GSTREAMERLIBS): LIBS += $${GSTREAMERLIBS}
isEmpty(GSTREAMERLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
gstreamer-1.0 \
gstreamer-app-1.0 \
gstreamer-audio-1.0 \
gstreamer-video-1.0 \
gstreamer-pbutils-1.0
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2/ 0000755 0001750 0001750 00000000000 13166615412 016513 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2/test.cpp 0000644 0001750 0001750 00000001706 13166615412 020202 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
#include
#include
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2/v4l2.pro 0000644 0001750 0001750 00000001446 13166615412 020031 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avformat_codecpar/ 0000755 0001750 0001750 00000000000 13166615412 022727 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avformat_codecpar/ffmpeg_avformat_codecpar.pro 0000644 0001750 0001750 00000002114 13166615412 030452 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavformat
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avformat_codecpar/test.cpp 0000644 0001750 0001750 00000001657 13166615412 024423 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
AVStream stream;
std::cout << &stream.codecpar;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_sampleformat64/ 0000755 0001750 0001750 00000000000 13166615412 023500 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_sampleformat64/test.cpp 0000644 0001750 0001750 00000001676 13166615412 025175 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
std::cout << AV_SAMPLE_FMT_S64
<< AV_SAMPLE_FMT_S64P;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avutil_sampleformat64/ffmpeg_avutil_sampleformat64.pro 0000644 0001750 0001750 00000002112 13166615412 031772 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavutil
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_contextframerate/ 0000755 0001750 0001750 00000000000 13166615412 024307 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_contextframerate/test.cpp 0000644 0001750 0001750 00000001700 13166615412 025770 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
AVCodecContext codecContext;
std::cout << &codecContext.framerate;
return 0;
}
././@LongLink 0000644 0000000 0000000 00000000151 00000000000 011600 L ustar root root webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_contextframerate/ffmpeg_avcodec_extracodecformats.pro webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_contextframerate/ffmpeg_avcodec_extracodecformats0000644 0001750 0001750 00000002113 13166615412 032754 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_swresample/ 0000755 0001750 0001750 00000000000 13166615412 021432 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_swresample/test.cpp 0000644 0001750 0001750 00000001545 13166615412 023122 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
extern "C"
{
#include
}
int main()
{
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_swresample/ffmpeg_swresample.pro 0000644 0001750 0001750 00000002116 13166615412 025662 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libswresample
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_sendrecv/ 0000755 0001750 0001750 00000000000 13166615412 022545 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_sendrecv/ffmpeg_avcodec_sendrecv.pro 0000644 0001750 0001750 00000002113 13166615412 030105 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see .
#
# Web-Site: http://webcamoid.github.io/
CONFIG += console c++11
macx: QT_CONFIG -= no-pkg-config
DEFINES += __STDC_CONSTANT_MACROS
!isEmpty(FFMPEGINCLUDES): INCLUDEPATH += $${FFMPEGINCLUDES}
!isEmpty(FFMPEGLIBS): LIBS += $${FFMPEGLIBS}
isEmpty(FFMPEGLIBS) {
CONFIG += link_pkgconfig
PKGCONFIG += \
libavcodec
}
SOURCES = \
test.cpp
TARGET = test_auto
webcamoid-8.1.0+dfsg/libAvKys/Tests/ffmpeg_avcodec_sendrecv/test.cpp 0000644 0001750 0001750 00000001635 13166615412 024235 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
extern "C"
{
#include
}
int main()
{
avcodec_receive_packet(NULL, NULL);
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2_extendedcontrols/ 0000755 0001750 0001750 00000000000 13166615412 022157 5 ustar qemu qemu webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2_extendedcontrols/test.cpp 0000644 0001750 0001750 00000002130 13166615412 023636 0 ustar qemu qemu /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see .
*
* Web-Site: http://webcamoid.github.io/
*/
#include
#include
#include
#include
#include
#include
#include
#include
int main()
{
std::cout << V4L2_CTRL_TYPE_STRING
<< V4L2_CTRL_TYPE_BITMASK
<< V4L2_CTRL_TYPE_INTEGER_MENU;
return 0;
}
webcamoid-8.1.0+dfsg/libAvKys/Tests/v4l2_extendedcontrols/v4l2extendedcontrols.pro 0000644 0001750 0001750 00000001446 13166615412 027002 0 ustar qemu qemu # Webcamoid, webcam capture application.
# Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
#
# Webcamoid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Webcamoid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Webcamoid. If not, see