Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 98a7ebba authored by Jan Grulich's avatar Jan Grulich

Add support for upcoming PipeWire 0.3

Also drop support for old PipeWire 0.1 and simplify buffer handling
parent 026f6407
......@@ -61,7 +61,7 @@
# Use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_PipeWire QUIET libpipewire-0.1 libpipewire-0.2)
pkg_check_modules(PKG_PipeWire QUIET libpipewire-0.2 libpipewire-0.3)
set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS_OTHER}")
set(PipeWire_VERSION "${PKG_PipeWire_VERSION}")
......@@ -75,7 +75,7 @@ find_path(PipeWire_INCLUDE_DIRS
find_library(PipeWire_LIBRARIES
NAMES
pipewire-0.1 pipewire-0.2
pipewire-0.2 pipewire-0.3
HINTS
${PKG_PipeWire_LIBRARIES_DIRS}
)
......
This diff is collapsed.
......@@ -26,10 +26,15 @@
#include <glib-object.h>
#include <pipewire/version.h>
#if !PW_CHECK_VERSION(0, 2, 9)
#include <spa/support/type-map.h>
#include <spa/param/format-utils.h>
#include <spa/param/video/format-utils.h>
#include <spa/param/video/raw-utils.h>
#endif
#include <spa/param/video/format-utils.h>
#include <spa/param/props.h>
#include <pipewire/factory.h>
......@@ -37,16 +42,7 @@
#include <pipewire/remote.h>
#include <pipewire/stream.h>
#ifdef __has_include
#if __has_include(<pipewire/version.h>)
#include<pipewire/version.h>
#else
#define PW_API_PRE_0_2_0
#endif // __has_include(<pipewire/version.h>)
#else
#define PW_API_PRE_0_2_0
#endif // __has_include
#if !PW_CHECK_VERSION(0, 2, 9)
class PwType {
public:
spa_type_media_type media_type;
......@@ -54,6 +50,7 @@ public:
spa_type_format_video format_video;
spa_type_video_format video_format;
};
#endif
class QSocketNotifier;
......@@ -81,20 +78,28 @@ Q_SIGNALS:
void startStreaming();
void stopStreaming();
#if !PW_CHECK_VERSION(0, 2, 9)
private:
void initializePwTypes();
#endif
private Q_SLOTS:
void processPipewireEvents();
public:
#if PW_CHECK_VERSION(0, 2, 9)
struct pw_core *pwCore = nullptr;
struct pw_loop *pwLoop = nullptr;
struct pw_stream *pwStream = nullptr;
struct pw_remote *pwRemote = nullptr;
#else
pw_core *pwCore = nullptr;
pw_loop *pwLoop = nullptr;
pw_node *pwNode = nullptr;
pw_stream *pwStream = nullptr;
pw_type *pwCoreType = nullptr;
pw_remote *pwRemote = nullptr;
pw_type *pwCoreType = nullptr;
PwType *pwType = nullptr;
#endif
spa_hook remoteListener;
spa_hook streamListener;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment