Skip to content

Instantly share code, notes, and snippets.

@akhenakh
Created June 27, 2018 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhenakh/e2225d8ee6c14ba74e3834225b44ea85 to your computer and use it in GitHub Desktop.
Save akhenakh/e2225d8ee6c14ba74e3834225b44ea85 to your computer and use it in GitHub Desktop.
patched qtmultimedia to support non interlaced camera via gstreamer see https://blog.nobugware.com/post/2018/my_own_car_system_raspberry_pi_offline_mapping/
--- src/plugins/gstreamer/camerabin/camerabinsession.cpp 2018-04-25 00:21:50.000000000 -0400
+++ src/plugins/gstreamer/camerabin/camerabinsession.cpp.new 2018-06-04 09:26:55.853527569 -0400
@@ -556,6 +556,22 @@
gst_object_unref(GST_OBJECT(camSrc));
}
+
+ const QByteArray envInterlace = qgetenv("QT_GSTREAMER_CAMERABIN_VIDEO_INTERLACE");
+ if (envInterlace.length() > 0) {
+ GstElement *interlace = gst_element_factory_make ("interlace", NULL);
+ if (interlace == NULL)
+ g_error ("Could not create 'interlace' element");
+
+
+ g_object_set(G_OBJECT(m_camerabin), "viewfinder-filter", interlace, NULL);
+
+ #if CAMERABIN_DEBUG
+ qDebug() << "set camera filter" << interlace;
+ #endif
+ gst_object_unref (interlace);
+ }
+
return m_cameraSrc;
}
# $Id: PKGBUILD 240297 2015-06-03 10:22:03Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
pkgname=qt5-multimedia
_qtver=5.11.1
pkgver=${_qtver/-/}
pkgrel=1
arch=('x86_64' 'armv7h')
url='http://qt-project.org/'
license=('GPL3' 'LGPL3' 'FDL' 'custom')
pkgdesc='Classes for audio, video, radio and camera functionality'
depends=('qt5-base' 'gst-plugins-base' 'libpulse' 'openal')
makedepends=('qt5-declarative' 'gst-plugins-bad')
optdepends=('qt5-declarative: QML bindings' 'gst-plugins-good: camera support, additional plugins'
'gst-plugins-bad: camera support, additional plugins' 'gst-plugins-ugly: additional plugins'
'gst-libav: ffmpeg plugin')
groups=('qt' 'qt5')
_pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" "interlace.patch")
sha256sums=('f28bb57890b4666a9aafaa116a30c51dedb0f23b60a510280a27eb032b58c90c'
'c987af5a170b1f3f3363f8eb03ba07fdaca1becefab5a9458d3834c7aacd6e13')
prepare() {
mkdir -p build
cd $srcdir/${_pkgfqn}
patch -Np1 -i "${srcdir}/interlace.patch"
}
build() {
cd build
qmake ../${_pkgfqn}
make
}
package() {
cd build
make INSTALL_ROOT="$pkgdir" install
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment