[kamoso] build against GStreamer 1 and QtGStreamer 1 on F21+ (#1092655)
Kevin Kofler
kkofler at fedoraproject.org
Wed Jul 23 18:29:52 UTC 2014
commit e12aa352a0426819eb2b9ad629afd672df7e4b0c
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date: Wed Jul 23 20:29:42 2014 +0200
build against GStreamer 1 and QtGStreamer 1 on F21+ (#1092655)
* Wed Jul 23 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 2.0.2-18
- build against GStreamer 1 and QtGStreamer 1 on F21+ (#1092655)
...e-FindGStreamer-to-look-for-GStreamer-1.0.patch | 84 ++++++++++++++++++
...er1-0002-update-caps-strings-to-1.0-style.patch | 71 ++++++++++++++++
...3-Use-Buffer-map-to-map-memory-regions-in.patch | 89 ++++++++++++++++++++
...0004-XOverlay-was-renamed-to-VideoOverlay.patch | 34 ++++++++
...w-on-pads-not-buffers-so-we-need-to-actua.patch | 32 +++++++
...1-0006-Return-failure-instead-of-crashing.patch | 28 ++++++
...ot-part-of-the-name-so-we-need-to-get-it-.patch | 43 ++++++++++
...HACK-commented-out-line-that-was-crashing.patch | 27 ++++++
...s-got-to-be-a-way-of-getting-the-bits-per.patch | 27 ++++++
kamoso.spec | 41 ++++++++-
10 files changed, 473 insertions(+), 3 deletions(-)
---
diff --git a/kamoso-2.0.2-gstreamer1-0001-Update-FindGStreamer-to-look-for-GStreamer-1.0.patch b/kamoso-2.0.2-gstreamer1-0001-Update-FindGStreamer-to-look-for-GStreamer-1.0.patch
new file mode 100644
index 0000000..0aaac36
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0001-Update-FindGStreamer-to-look-for-GStreamer-1.0.patch
@@ -0,0 +1,84 @@
+From 22e1674b928d9c909d6fa71cd237e13f05434a94 Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 12:38:47 -0800
+Subject: [PATCH 1/9] Update FindGStreamer to look for GStreamer 1.0
+
+Change the API version, and remove looking for the interfaces library
+as that no longer exists.
+---
+ cmake/FindGStreamer.cmake | 31 ++++++++++++-------------------
+ 1 file changed, 12 insertions(+), 19 deletions(-)
+
+diff --git a/cmake/FindGStreamer.cmake b/cmake/FindGStreamer.cmake
+index a1b6e33..b5634bb 100644
+--- 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 @@ ELSE (GSTREAMER_LIBRARIES)
+ 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 )
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0002-update-caps-strings-to-1.0-style.patch b/kamoso-2.0.2-gstreamer1-0002-update-caps-strings-to-1.0-style.patch
new file mode 100644
index 0000000..b6e9de0
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0002-update-caps-strings-to-1.0-style.patch
@@ -0,0 +1,71 @@
+From 9f41901dc6dd6f5786d5d0f0147d0dc77d03bafc Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:27:54 -0800
+Subject: [PATCH 2/9] update caps strings to 1.0 style
+
+---
+ src/webcamwidget.cpp | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 62b7831..2cad55c 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -130,8 +130,8 @@ void WebcamWidget::playFile(const Device &device)
+ QByteArray pipe = basicPipe();
+
+ //Set the right colorspace to convert to QImage
+- pipe += " ! ffmpegcolorspace ! "
+- GST_VIDEO_CAPS_xRGB_HOST_ENDIAN
++ pipe += " ! videoconvert ! "
++ GST_VIDEO_CAPS_MAKE("RGB")
+ " ! fakesink name=fakesink";
+
+ kDebug() << "================ PIPELINE ================";
+@@ -200,7 +200,7 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr)
+ kDebug() << "Size: " << width << "x" << height;
+ kDebug() << "Name: " << structure.data()->name();
+
+- if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw-yuv") == 0) {
++ if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw, format=yuv") == 0) {
+ 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) {
+@@ -229,7 +229,7 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr)
+ kDebug() << "Not I420";
+ }
+
+- } else if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw-rgb") == 0) {
++ } else if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw, format=rgb") == 0) {
+ kDebug() << "RGB name";
+ QImage::Format format = QImage::Format_Invalid;
+ int bpp = structure.data()->value("bpp").get<int>();
+@@ -285,7 +285,7 @@ void WebcamWidget::recordVideo(bool sound)
+ //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 +368,11 @@ QByteArray WebcamWidget::basicPipe()
+
+ //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, width=640, height=480, framerate=15/1;"
++ " video/x-raw, width=640, height=480, framerate=24/1;"
++ " video/x-raw, width=640, height=480, framerate=30/1;"
++ " video/x-raw, width=352, height=288, framerate=15/1"
+
+ //Basic plug-in for video controls
+ " ! gamma name=gamma"
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0003-Use-Buffer-map-to-map-memory-regions-in.patch b/kamoso-2.0.2-gstreamer1-0003-Use-Buffer-map-to-map-memory-regions-in.patch
new file mode 100644
index 0000000..a2f6b97
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0003-Use-Buffer-map-to-map-memory-regions-in.patch
@@ -0,0 +1,89 @@
+From debcef9b06ceed7b57b3c8d1897793cd86c42fa7 Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:29:12 -0800
+Subject: [PATCH 3/9] Use Buffer::map to map memory regions in
+
+---
+ src/webcamwidget.cpp | 45 +++++++++++++++++++++++++++------------------
+ 1 file changed, 27 insertions(+), 18 deletions(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 2cad55c..2f8df50 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -46,6 +46,7 @@
+ #include <QGst/Element>
+ #include <QGst/Parse>
+ #include <QGst/Buffer>
++#include <QGst/Memory>
+ #include <QGst/Pad>
+ #include <QGst/Fourcc>
+ #include <QGst/ElementFactory>
+@@ -204,26 +205,30 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr)
+ 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) {
++ QGst::MapInfo memory_info;
+ img = QImage(width/2, height/2, QImage::Format_RGB32);
+
+- const uchar *data = (const uchar *)buffer->data();
++ if (buffer->map(memory_info, QGst::MapRead)) {
++ const uchar *data = (const uchar *)memory_info.data;
+
+- for (int y=0; y<height; y+=2) {
+- const uchar *yLine = data + y*width;
+- const uchar *uLine = data + width*height + y*width/4;
+- const uchar *vLine = data + width*height*5/4 + y*width/4;
++ for (int y=0; y<height; y+=2) {
++ const uchar *yLine = data + y*width;
++ const uchar *uLine = data + width*height + y*width/4;
++ const uchar *vLine = data + width*height*5/4 + y*width/4;
+
+- for (int x=0; x<width; x+=2) {
+- const qreal Y = 1.164*(yLine[x]-16);
+- const int U = uLine[x/2]-128;
+- const int V = vLine[x/2]-128;
++ for (int x=0; x<width; x+=2) {
++ const qreal Y = 1.164*(yLine[x]-16);
++ const int U = uLine[x/2]-128;
++ const int V = vLine[x/2]-128;
+
+- int b = qBound(0, int(Y + 2.018*U), 255);
+- int g = qBound(0, int(Y - 0.813*V - 0.391*U), 255);
+- int r = qBound(0, int(Y + 1.596*V), 255);
++ int b = qBound(0, int(Y + 2.018*U), 255);
++ int g = qBound(0, int(Y - 0.813*V - 0.391*U), 255);
++ int r = qBound(0, int(Y + 1.596*V), 255);
+
+- img.setPixel(x/2,y/2,qRgb(r,g,b));
++ img.setPixel(x/2,y/2,qRgb(r,g,b));
++ }
+ }
++ buffer->unmap(memory_info);
+ }
+ } else {
+ kDebug() << "Not I420";
+@@ -240,11 +245,15 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr)
+ format = QImage::Format_RGB32;
+
+ if (format != QImage::Format_Invalid) {
+- img = QImage((const uchar *)buffer->data(),
+- width,
+- height,
+- format);
+- img.bits(); //detach
++ QGst::MapInfo memory_info;
++ if (buffer->map(memory_info, QGst::MapRead)) {
++ img = QImage((const uchar *)memory_info.data,
++ width,
++ height,
++ format);
++ img.bits(); //detach
++ buffer->unmap(memory_info);
++ }
+ }
+ }
+
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0004-XOverlay-was-renamed-to-VideoOverlay.patch b/kamoso-2.0.2-gstreamer1-0004-XOverlay-was-renamed-to-VideoOverlay.patch
new file mode 100644
index 0000000..7627c84
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0004-XOverlay-was-renamed-to-VideoOverlay.patch
@@ -0,0 +1,34 @@
+From afb79bf039e607d949780ec6736b388c0281fbe3 Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:30:36 -0800
+Subject: [PATCH 4/9] XOverlay was renamed to VideoOverlay
+
+---
+ src/webcamwidget.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 2f8df50..c2bbb29 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -56,7 +56,7 @@
+ #include <QGst/Structure>
+ #include <QGst/Clock>
+ #include <QGst/Init>
+-#include <QGst/XOverlay>
++#include <QGst/VideoOverlay>
+ #include <QGst/Message>
+ #include <gst/gst.h>
+ #include <gst/video/video.h>
+@@ -433,7 +433,7 @@ void WebcamWidget::activeAspectRatio()
+ {
+ 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";
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0005-Caps-are-now-on-pads-not-buffers-so-we-need-to-actua.patch b/kamoso-2.0.2-gstreamer1-0005-Caps-are-now-on-pads-not-buffers-so-we-need-to-actua.patch
new file mode 100644
index 0000000..fd47ee7
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0005-Caps-are-now-on-pads-not-buffers-so-we-need-to-actua.patch
@@ -0,0 +1,32 @@
+From 150c0b8b6d5d6809d8049a6f275ac0bad34ffaed Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:32:27 -0800
+Subject: [PATCH 5/9] Caps are now on pads, not buffers so we need to actually
+ use the pad parameter to photoGstCallback
+
+---
+ src/webcamwidget.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index c2bbb29..1dd23b8 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -186,12 +186,12 @@ bool WebcamWidget::takePhoto(const KUrl &dest)
+ }
+
+ //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->caps();
+
+ const QGst::StructurePtr structure = caps->internalStructure(0);
+ int width, height;
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0006-Return-failure-instead-of-crashing.patch b/kamoso-2.0.2-gstreamer1-0006-Return-failure-instead-of-crashing.patch
new file mode 100644
index 0000000..cc15659
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0006-Return-failure-instead-of-crashing.patch
@@ -0,0 +1,28 @@
+From a664246650cd51519fe0940dca0a339d60ca9efd Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:33:11 -0800
+Subject: [PATCH 6/9] Return failure instead of crashing.
+
+If something goes wrong creating the pipeline you can get a null m_bin,
+so test for the error condition before accessing it.
+---
+ src/webcamwidget.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 1dd23b8..5e6d023 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -180,6 +180,9 @@ bool WebcamWidget::takePhoto(const KUrl &dest)
+ }
+ 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;
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0007-Format-is-not-part-of-the-name-so-we-need-to-get-it-.patch b/kamoso-2.0.2-gstreamer1-0007-Format-is-not-part-of-the-name-so-we-need-to-get-it-.patch
new file mode 100644
index 0000000..30a0032
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0007-Format-is-not-part-of-the-name-so-we-need-to-get-it-.patch
@@ -0,0 +1,43 @@
+From 023cdaf83613706c8866221b8ece31b0bf260298 Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:35:22 -0800
+Subject: [PATCH 7/9] Format is not part of the name, so we need to get it as a
+ property of the caps
+
+---
+ src/webcamwidget.cpp | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 5e6d023..10cc63e 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -200,11 +200,14 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr pad)
+ int width, height;
+ width = structure.data()->value("width").get<int>();
+ height = structure.data()->value("height").get<int>();
++ QString format;
++ format = structure.data()->value("format").get<QString>();
+ 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, format=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) {
+@@ -237,8 +240,7 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr pad)
+ kDebug() << "Not I420";
+ }
+
+- } else if (qstrcmp(structure.data()->name().toLatin1(), "video/x-raw, format=rgb") == 0) {
+- kDebug() << "RGB name";
++ } else if (format == "RGB") {
+ QImage::Format format = QImage::Format_Invalid;
+ int bpp = structure.data()->value("bpp").get<int>();
+
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0008-HACK-commented-out-line-that-was-crashing.patch b/kamoso-2.0.2-gstreamer1-0008-HACK-commented-out-line-that-was-crashing.patch
new file mode 100644
index 0000000..c570269
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0008-HACK-commented-out-line-that-was-crashing.patch
@@ -0,0 +1,27 @@
+From dc3f9e4bbd311eb7bfff3d9c93475385ac26419b Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:36:40 -0800
+Subject: [PATCH 8/9] HACK: commented out line that was crashing
+
+d->m_pipeline->getElementByName("v4l2src")->getStaticPad("src")->caps() was null
+so the attempt to get information about the caps caused a crash.
+---
+ src/webcamwidget.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index 10cc63e..f3bcb39 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -158,7 +158,7 @@ void WebcamWidget::playFile(const Device &device)
+ setVideoSettings();
+
+ kDebug() << "================ Capabilities ================";
+- kDebug() << d->m_pipeline->getElementByName("v4l2src")->getStaticPad("src")->caps()->toString();
++ //kDebug() << d->m_pipeline->getElementByName("v4l2src")->getStaticPad("src")->caps()->toString();
+ d->m_pipeline->setState(QGst::StatePlaying);
+ }
+
+--
+1.8.3.1
+
diff --git a/kamoso-2.0.2-gstreamer1-0009-HACK-there-s-got-to-be-a-way-of-getting-the-bits-per.patch b/kamoso-2.0.2-gstreamer1-0009-HACK-there-s-got-to-be-a-way-of-getting-the-bits-per.patch
new file mode 100644
index 0000000..ce071b7
--- /dev/null
+++ b/kamoso-2.0.2-gstreamer1-0009-HACK-there-s-got-to-be-a-way-of-getting-the-bits-per.patch
@@ -0,0 +1,27 @@
+From dd995f48ffc4c772e94a9647fabeca4d0d08f833 Mon Sep 17 00:00:00 2001
+From: Diane Trout <diane at ghic.org>
+Date: Wed, 15 Jan 2014 13:37:20 -0800
+Subject: [PATCH 9/9] HACK: there's got to be a way of getting the
+ bits-per-pixel
+
+however it doesn't appear to be a property of the caps.
+---
+ src/webcamwidget.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/webcamwidget.cpp b/src/webcamwidget.cpp
+index f3bcb39..d57a4cc 100644
+--- a/src/webcamwidget.cpp
++++ b/src/webcamwidget.cpp
+@@ -244,6 +244,8 @@ void WebcamWidget::photoGstCallback(QGst::BufferPtr buffer, QGst::PadPtr pad)
+ QImage::Format format = QImage::Format_Invalid;
+ int bpp = structure.data()->value("bpp").get<int>();
+
++ // need a better solution.
++ bpp = 24;
+ if (bpp == 24)
+ format = QImage::Format_RGB888;
+ else if (bpp == 32)
+--
+1.8.3.1
+
diff --git a/kamoso.spec b/kamoso.spec
index 1faa375..e1d72e3 100644
--- a/kamoso.spec
+++ b/kamoso.spec
@@ -1,6 +1,6 @@
Name: kamoso
Version: 2.0.2
-Release: 17%{?dist}
+Release: 18%{?dist}
Summary: Application for taking pictures and videos from a webcam
License: GPLv2+
@@ -16,11 +16,31 @@ Patch133: 0033-initial-port-to-libkipi-2.x.patch
Patch134: 0034-add-license-header.patch
Patch135: 0035-fix-build-for-libkipi-2.patch
+## patches from https://github.com/detrout/kamoso/commits/gst-1.0-port
+Patch201: kamoso-2.0.2-gstreamer1-0001-Update-FindGStreamer-to-look-for-GStreamer-1.0.patch
+Patch202: kamoso-2.0.2-gstreamer1-0002-update-caps-strings-to-1.0-style.patch
+Patch203: kamoso-2.0.2-gstreamer1-0003-Use-Buffer-map-to-map-memory-regions-in.patch
+Patch204: kamoso-2.0.2-gstreamer1-0004-XOverlay-was-renamed-to-VideoOverlay.patch
+Patch205: kamoso-2.0.2-gstreamer1-0005-Caps-are-now-on-pads-not-buffers-so-we-need-to-actua.patch
+Patch206: kamoso-2.0.2-gstreamer1-0006-Return-failure-instead-of-crashing.patch
+Patch207: kamoso-2.0.2-gstreamer1-0007-Format-is-not-part-of-the-name-so-we-need-to-get-it-.patch
+Patch208: kamoso-2.0.2-gstreamer1-0008-HACK-commented-out-line-that-was-crashing.patch
+Patch209: kamoso-2.0.2-gstreamer1-0009-HACK-there-s-got-to-be-a-way-of-getting-the-bits-per.patch
+
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: kdelibs4-devel >= 4.6.0
-BuildRequires: pkgconfig(libkipi)
-BuildRequires: qt-gstreamer-devel
+BuildRequires: pkgconfig(libkipi)
+%if 0%{?fedora} > 20 || 0%{?rhel} > 7
+# use GStreamer 1 and QtGStreamer 1 on F21+ and RHEL8+
+%global gstreamer1 1
+BuildRequires: pkgconfig(QtGStreamer-1.0)
+%else
+# We don't want to use GStreamer 1 where the rest of the Qt 4 stack doesn't,
+# or we run into symbol conflicts. So build against GStreamer 0.10 on Fedora up
+# to 20 and RHEL up to 7. (Up to RHEL 6, GStreamer 0.10 is the only option.)
+BuildRequires: pkgconfig(QtGStreamer-0.10)
+%endif
Requires: kde-runtime%{?_kde4_version: >= %{_kde4_version}}
@@ -39,6 +59,18 @@ Kamoso is an application to take pictures and videos out of your webcam.
%patch134 -p1 -b .0034
%patch135 -p1 -b .0035
+%if 0%{?gstreamer1}
+%patch201 -p1 -b .gstreamer1-0001
+%patch202 -p1 -b .gstreamer1-0002
+%patch203 -p1 -b .gstreamer1-0003
+%patch204 -p1 -b .gstreamer1-0004
+%patch205 -p1 -b .gstreamer1-0005
+%patch206 -p1 -b .gstreamer1-0006
+%patch207 -p1 -b .gstreamer1-0007
+%patch208 -p1 -b .gstreamer1-0008
+%patch209 -p1 -b .gstreamer1-0009
+%endif
+
# rename some icons that conflict with kdeplasma-addons
# upstreamed,
# http://commits.kde.org/kamoso/b8b03322d58a920deac198c2360d65deddccd610
@@ -95,6 +127,9 @@ gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null || :
%changelog
+* Wed Jul 23 2014 Kevin Kofler <Kevin at tigcc.ticalc.org> - 2.0.2-18
+- build against GStreamer 1 and QtGStreamer 1 on F21+ (#1092655)
+
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.2-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
More information about the scm-commits
mailing list