[SCM] kamoso packaging branch, master, updated. 1956296da39ee74320db2aa5b244d999ec6c88e8

Diane Trout diane-guest at moszumanska.debian.org
Thu May 28 03:20:31 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kamoso.git;a=commitdiff;h=c1f72af

The following commit has been merged in the master branch:
commit c1f72af18d176f7d60a8d8d5fb5c93c202df0a9d
Author: Diane Trout <diane at ghic.org>
Date:   Tue May 26 20:12:58 2015 -0700

    Backport upstream commit b85e8c187b4eabf9765bc05348f6232ba32c9493 to build against QtGstreamer 1.0 API
---
 debian/changelog                     |   2 +
 debian/patches/qt-gstreamer-1.0.diff | 251 +++++++++++++++++++++++++++++++++++
 2 files changed, 253 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 549134f..c550d17 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ kamoso (2.0.2-3) UNRELEASED; urgency=medium
 
   [ Diane Trout ]
   * Update watch file to http://downloads.kde.org
+  * Backport upstream commit b85e8c187b4eabf9765bc05348f6232ba32c9493
+    to build against QtGstreamer 1.0 API
 
  -- Diane Trout <diane at ghic.org>  Tue, 26 May 2015 19:20:12 -0700
 
diff --git a/debian/patches/qt-gstreamer-1.0.diff b/debian/patches/qt-gstreamer-1.0.diff
new file mode 100644
index 0000000..3fa90ae
--- /dev/null
+++ b/debian/patches/qt-gstreamer-1.0.diff
@@ -0,0 +1,251 @@
+Author:  Andreas Cord-Landwehr <cordlandwehr at kde.org>
+Description: Porting to GStreamer-1.0 API and QtGstreamer 1.2
+Applied-Upstream: https://projects.kde.org/projects/extragear/multimedia/kamoso/repository/revisions/b85e8c187b4eabf9765bc05348f6232ba32c9493
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,8 +6,8 @@
+ find_package(Kipi REQUIRED)
+ find_package(Phonon REQUIRED)
+ find_package(GLIB2 REQUIRED)
+-find_package(GStreamer REQUIRED)
+-find_package(QtGStreamer REQUIRED)
++find_package(GStreamer 1.0.0)
++find_package(QtGStreamer 1.1.90 REQUIRED)
+ 
+ macro_optional_find_package(Nepomuk)
+ macro_log_feature(NEPOMUK_FOUND "Nepomuk" "Handles all kinds of metadata on the KDE desktop to provide a semantic desktop" "http://nepomuk.kde.org/" FALSE "" "STRONGLY_RECOMMENDED: Nepomuk is used to provide metadata on objects like files, emails etc. to provide a semantic desktop.")
+@@ -15,6 +15,10 @@
+ macro_display_feature_log()
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ 
++include_directories(
++    ${QTGSTREAMER_INCLUDE_DIR}
++)
++
+ add_subdirectory(src)
+ add_subdirectory(icons)
+ 
+--- a/cmake/FindGStreamer.cmake
++++ b/cmake/FindGStreamer.cmake
+@@ -15,40 +15,38 @@
+ 
+ # TODO: Other versions --> GSTREAMER_X_Y_FOUND (Example: GSTREAMER_0_8_FOUND and GSTREAMER_0_10_FOUND etc)
+ 
+-IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
++IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY)
+    # in cache already
+    SET(GStreamer_FIND_QUIETLY TRUE)
+-ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
++ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY)
+    SET(GStreamer_FIND_QUIETLY FALSE)
+-ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
++ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY)
+ 
++SET(GSTREAMER_API_VERSION 1.0)
+ IF (NOT WIN32)
+    FIND_PACKAGE(PkgConfig REQUIRED)
+    # use pkg-config to get the directories and then use these values
+    # in the FIND_PATH() and FIND_LIBRARY() calls
+    # don't make this check required - otherwise you can't use macro_optional_find_package on this one
+-   PKG_CHECK_MODULES(PKG_GSTREAMER gstreamer-0.10)
++   PKG_CHECK_MODULES(PKG_GSTREAMER gstreamer-${GSTREAMER_API_VERSION})
+    SET(GSTREAMER_VERSION ${PKG_GSTREAMER_VERSION})
+    SET(GSTREAMER_DEFINITIONS ${PKG_GSTREAMER_CFLAGS})
+ ENDIF (NOT WIN32)
+ 
++MESSAGE(STATUS "Found GStreamer package: ${PKG_GSTREAMER_VERSION}")
++
+ FIND_PATH(GSTREAMER_INCLUDE_DIR gst/gst.h
+    PATHS
+    ${PKG_GSTREAMER_INCLUDE_DIRS}
+-   PATH_SUFFIXES gstreamer-0.10
+-   )
+-
+-FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-0.10
+-   PATHS
+-   ${PKG_GSTREAMER_LIBRARY_DIRS}
++   PATH_SUFFIXES gstreamer-${GSTREAMER_API_VERSION}
+    )
+ 
+-FIND_LIBRARY(GSTREAMER_BASE_LIBRARY NAMES gstbase-0.10
++FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-${GSTREAMER_API_VERSION}
+    PATHS
+    ${PKG_GSTREAMER_LIBRARY_DIRS}
+    )
+ 
+-FIND_LIBRARY(GSTREAMER_INTERFACE_LIBRARY NAMES gstinterfaces-0.10
++FIND_LIBRARY(GSTREAMER_BASE_LIBRARY NAMES gstbase-${GSTREAMER_API_VERSION}
+    PATHS
+    ${PKG_GSTREAMER_LIBRARY_DIRS}
+    )
+@@ -63,12 +61,7 @@
+    MESSAGE(STATUS "GStreamer: WARNING: library not found")
+ ENDIF (GSTREAMER_LIBRARIES)
+ 
+-IF (GSTREAMER_INTERFACE_LIBRARY)
+-ELSE (GSTREAMER_INTERFACE_LIBRARY)
+-   MESSAGE(STATUS "GStreamer: WARNING: interface library not found")
+-ENDIF (GSTREAMER_INTERFACE_LIBRARY)
+-
+ INCLUDE(FindPackageHandleStandardArgs)
+-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY)
++FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY)
+ 
+-MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY)
++MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY)
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -55,8 +55,9 @@
+ #include <QGst/Structure>
+ #include <QGst/Clock>
+ #include <QGst/Init>
+-#include <QGst/XOverlay>
++#include <QGst/VideoOverlay>
+ #include <QGst/Message>
++#include <QGst/Memory>
+ #include <gst/gst.h>
+ #include <gst/video/video.h>
+ #include <QGst/Bus>
+@@ -130,8 +131,7 @@
+     QByteArray pipe = basicPipe();
+ 
+     //Set the right colorspace to convert to QImage
+-    pipe += " ! ffmpegcolorspace ! "
+-            GST_VIDEO_CAPS_xRGB_HOST_ENDIAN
++    pipe += " ! videoconvert"
+             " ! fakesink name=fakesink";
+ 
+     kDebug() << "================ PIPELINE ================";
+@@ -157,7 +157,7 @@
+     setVideoSettings();
+ 
+     kDebug() << "================ Capabilities ================";
+-    kDebug() << d->m_pipeline->getElementByName("v4l2src")->getStaticPad("src")->caps()->toString();
++//     kDebug() << d->m_pipeline->getElementByName("v4l2src")->getStaticPad("src")->currentCaps()->toString(); //commented out for now: src-pad returns null
+     d->m_pipeline->setState(QGst::StatePlaying);
+ }
+ 
+@@ -179,34 +179,51 @@
+     }
+     kDebug() << dest;
+     d->destination = dest;
++    if (!d->m_bin) {
++        return false;
++    }
+     d->m_bin->getElementByName("fakesink")->setProperty("signal-handoffs", true);
+     QGlib::connect(d->m_bin->getElementByName("fakesink"), "handoff", this, &WebcamWidget::photoGstCallback);
+     return true;
+ }
+ 
+ //This code has been borrowed from the Qt Multimedia project.
+-void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr)
++void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr pad)
+ {
+     kDebug();
+ 
+     QImage img;
+-    QGst::CapsPtr caps = buffer->caps();
++    QGst::CapsPtr caps = pad->currentCaps();
+ 
+     const QGst::StructurePtr structure = caps->internalStructure(0);
+     int width, height;
++    QString format;
++    format = structure.data()->value("format").get<QString>();
+     width = structure.data()->value("width").get<int>();
+     height = structure.data()->value("height").get<int>();
+     kDebug() << "We've got a caps in here";
+     kDebug() << "Size: " << width << "x" << height;
+     kDebug() << "Name: " << structure.data()->name();
++    kDebug() << "Format: " << format;
+ 
+-    if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw-yuv") == 0) {
++    if (format == "YUV") {
+         QGst::Fourcc fourcc = structure->value("format").get<QGst::Fourcc>();
+         kDebug() << "fourcc: " << fourcc.value.as_integer;
+         if (fourcc.value.as_integer == QGst::Fourcc("I420").value.as_integer) {
+             img = QImage(width/2, height/2, QImage::Format_RGB32);
+ 
+-            const uchar *data = (const uchar *)buffer->data();
++            QGst::MemoryPtr memory;
++            QGst::MapInfo info;
++            memory = buffer->getMemory(0);
++            if (!memory) {
++                kError() << "Could not get memory for buffer.";
++                return;
++            }
++            if (!memory->map(info, QGst::MapRead)) {
++                kError() << "Could not map memory buffer.";
++                return;
++            }
++            const uchar *data = (const uchar *)info.data();
+ 
+             for (int y=0; y<height; y+=2) {
+                 const uchar *yLine = data + y*width;
+@@ -225,6 +242,7 @@
+                     img.setPixel(x/2,y/2,qRgb(r,g,b));
+                 }
+             }
++            memory->unmap(info);
+         } else {
+             kDebug() << "Not I420";
+         }
+@@ -240,11 +258,23 @@
+             format = QImage::Format_RGB32;
+ 
+         if (format != QImage::Format_Invalid) {
+-            img = QImage((const uchar *)buffer->data(),
++            QGst::MemoryPtr memory;
++            QGst::MapInfo info;
++            memory = buffer->getMemory(0);
++            if (!memory) {
++                kError() << "Could not get memory for buffer.";
++                return;
++            }
++            if (!memory->map(info, QGst::MapRead)) {
++                kError() << "Could not map memory buffer.";
++                return;
++            }
++            img = QImage((const uchar *)info.data(),
+                             width,
+                             height,
+                             format);
+             img.bits(); //detach
++            memory->unmap(info);
+         }
+     }
+ 
+@@ -285,7 +315,7 @@
+         //Get the audio from alsa
+         " ! mux. autoaudiosrc "
+         //Sound type and quality
+-        " ! audio/x-raw-int,rate=48000,channels=2,depth=16 "
++        " ! audio/x-raw,rate=48000,channels=2,depth=16 "
+         //Encode sound as vorbis
+         " ! queue ! audioconvert ! queue "
+         " ! vorbisenc "
+@@ -368,11 +398,11 @@
+ 
+     //Accepted capabilities
+     pipe +=
+-    " ! ffmpegcolorspace"
+-    " ! video/x-raw-yuv, width=640, height=480, framerate=15/1;"
+-    " video/x-raw-yuv, width=640, height=480, framerate=24/1;"
+-    " video/x-raw-yuv, width=640, height=480, framerate=30/1;"
+-    " video/x-raw-yuv, width=352, height=288, framerate=15/1"
++    " ! videoconvert"
++    " ! video/x-raw, format=RGB, width=640, height=480, framerate=15/1;"
++    " video/x-raw, format=RGB, width=640, height=480, framerate=24/1;"
++    " video/x-raw, format=RGB, width=640, height=480, framerate=30/1;"
++    " video/x-raw, format=RGB, width=352, height=288, framerate=15/1"
+ 
+     //Basic plug-in for video controls
+     " ! gamma name=gamma"
+@@ -424,7 +454,7 @@
+ {
+     QGst::BinPtr sink = d->m_bin->getElementByName("videosink").staticCast<QGst::Bin>();
+ 
+-    QGlib::RefPointer<QGst::XOverlay> over =  sink->getElementByInterface<QGst::XOverlay>();
++    QGlib::RefPointer<QGst::VideoOverlay> over =  sink->getElementByInterface<QGst::VideoOverlay>();
+ 
+     if (over->findProperty("force-aspect-ratio")) {
+         kDebug() << "Setting aspect ratio";

-- 
kamoso packaging



More information about the pkg-kde-commits mailing list