Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1733
Browse files Browse the repository at this point in the history
It is based on:
* psi: ccdbb7d4
* plugins: 3c71dec
* psimedia: c154fbb
* resources: 2ef1865
  • Loading branch information
tehnick committed Apr 1, 2024
1 parent a99e25f commit d7c4176
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 46 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ option( PLUGINS_NO_DEBUG "Add -DPLUGINS_NO_DEBUG definition" OFF )
option( DEV_MODE "Enable prepare-bin-libs target for MS Windows only. Set PSI_DATADIR and PSI_LIBDIR to CMAKE_RUNTIME_OUTPUT_DIRECTORY to debug plugins for Linux only" OFF )
# Iris options
option( BUNDLED_IRIS "Build iris library bundled" ON )
option( BUNDLED_IRIS_ALL "Build iris library with bundled QCA and bundled USRSCTP" OFF)
option( BUNDLED_IRIS_ALL "Build bundled iris library with bundled QCA and bundled USRSCTP" OFF)
option( IRIS_BUNDLED_QCA "Adds: DTLS, Blake2b and other useful for XMPP crypto-stuff" ${DEFAULT_BUNDLED_QCA} )
option( IRIS_BUNDLED_USRSCTP "Compile compatible usrsctp lib when system one is not available or uncompatible (required for p2p file transfer)" ${DEFAULT_BUNDLED_USRSCTP} )
if (UNIX AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
Expand Down
23 changes: 14 additions & 9 deletions cmake/modules/win32-prepare-deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -296,24 +296,28 @@ if(WIN32)
gstreamer-1.0-0.dll
gstriff-1.0-0.dll
gstrtp-1.0-0.dll
gstrtsp-1.0.0.dll
gsttag-1.0-0.dll
gstvideo-1.0-0.dll
gstwebrtc-1.0.0.dll
gstwinrt-1.0.0.dll
gthread-2.0-0.dll
libgcc_s_sjlj-1.dll
libharfbuzz-0.dll
harfbuzz.dll
libiconv-2.dll
intl-8.dll
libjpeg-8.dll
libogg-0.dll
ogg-0.dll
libopus-0.dll
opus-0.dll
orc-0.4-0.dll
libpng16-16.dll
libtheora-0.dll
libtheoradec-1.dll
libtheoraenc-1.dll
libvorbis-0.dll
libvorbisenc-2.dll
libwinpthread-1.dll
libx264-157.dll
libxml2-2.dll
z-1.dll
)
Expand All @@ -333,12 +337,13 @@ if(WIN32)
gstplayback.dll
gstrtp.dll
gstrtpmanager.dll
gsttheora.dll
gstvideoconvertscale.dll
gstvideoconvert.dll
gstvideorate.dll
gstvideoscale.dll
gstvolume.dll
gstvorbis.dll
gstvpx.dll
gstwasapi.dll
gstwinks.dll
)
Expand All @@ -363,16 +368,16 @@ if(WIN32)
libgstreamer-1.0-0.dll
libgstriff-1.0-0.dll
libgstrtp-1.0-0.dll
libgstrtsp-1.0.0.dll
libgsttag-1.0-0.dll
libgstvideo-1.0-0.dll
libgthread-2.0-0.dll
libgstwebrtc-1.0.0.dll
libogg-0.dll
libopus-0.dll
libtheora-0.dll
libtheoradec-1.dll
libtheoraenc-1.dll
libvorbis-0.dll
libvorbisenc-2.dll
libx264-155.dll
)
set(GSTREAMER_PLUGINS
libgstapp.dll
Expand All @@ -391,12 +396,12 @@ if(WIN32)
libgstplayback.dll
libgstrtp.dll
libgstrtpmanager.dll
libgsttheora.dll
libgstvideoconvert.dll
libgstvideorate.dll
libgstvideoscale.dll
libgstvolume.dll
libgstvorbis.dll
libgstvpx.dll
libgstwasapi.dll
libgstwinks.dll
)
Expand Down Expand Up @@ -507,7 +512,7 @@ if(WIN32)
find_psi_lib("${LIBRARIES_LIST}" "${PATHES}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/")
if(NOT BUNDLED_QCA)
set(QCA_LIB
libqca-qt5${D}.dll
libqca-qt${QT_DEFAULT_MAJOR_VERSION}${D}.dll
)
# qca and plugins
set(QCA_PLUGINS
Expand Down
2 changes: 1 addition & 1 deletion plugins/generic/psimedia/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(gstprovider LANGUAGES CXX)

get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)

set( CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
Expand Down
58 changes: 31 additions & 27 deletions plugins/generic/psimedia/gstprovider/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include <QSet>
#include <gst/gst.h>

#include <algorithm>
#include <ranges>

// FIXME: this file is heavily commented out and a mess, mainly because
// all of my attempts at a dynamic pipeline were futile. someday we
// can uncomment and clean this up...
Expand Down Expand Up @@ -117,36 +120,37 @@ static GstCaps *filter_for_capture_size(const QSize &size)
nullptr);
}

static GstCaps *filter_for_desired_size(const QSize &size)
static GstCaps *filter_for_desired_size(GstDevice *dev, const QSize &size)
{
Q_UNUSED(size)
QList<int> widths;
widths << 160 << 320 << 640 << 800 << 1024 << 1280 << 1920;
for (int n = 0; n < widths.count(); ++n) {
if (widths[n] < size.width()) {
widths.removeAt(n);
--n; // adjust position
}
}
static std::array mime_prioriry { QLatin1String { "video/x-raw" }, QLatin1String { "image/jpeg" },
QLatin1String("video/h264") };
namespace views = std::ranges::views;
auto desiredScore = double(size.width()) * size.height();
auto capsScore = [&desiredScore](const auto &c) { // less is better
auto it = std::find(mime_prioriry.begin(), mime_prioriry.end(), c.mime);
return std::abs(double(c.video.width) * c.video.height - desiredScore)
+ (it == mime_prioriry.end() ? mime_prioriry.size()
: std::distance(mime_prioriry.begin(), mime_prioriry.end()));
};

std::vector<std::pair<double, PDevice::Caps>> srcCaps;
std::ranges::copy(dev->caps | views::filter([](auto const &c) { return c.video.framerate_numerator >= 24; })
| views::transform([&](auto const &c) { return std::make_pair(capsScore(c), c); }),
std::back_inserter(srcCaps));
std::ranges::sort(srcCaps, [](const auto &a, const auto &b) { return a.first < b.first; });

// GstElement *capsfilter = gst_element_factory_make("capsfilter", nullptr);
GstCaps *caps = gst_caps_new_empty();

for (int n = 0; n < widths.count(); ++n) {
GstStructure *cs;
cs = gst_structure_new("image/jpeg", "width", GST_TYPE_INT_RANGE, 1, widths[n], "height", GST_TYPE_INT_RANGE, 1,
G_MAXINT, "framerate", GST_TYPE_FRACTION, 30, 1, nullptr);
gst_caps_append_structure(caps, cs);

cs = gst_structure_new("video/h264", "width", GST_TYPE_INT_RANGE, 1, widths[n], "height", GST_TYPE_INT_RANGE, 1,
G_MAXINT, "framerate", GST_TYPE_FRACTION, 30, 1, nullptr);
gst_caps_append_structure(caps, cs);

cs = gst_structure_new("video/x-raw", "width", GST_TYPE_INT_RANGE, 1, widths[n], "height", GST_TYPE_INT_RANGE,
1, G_MAXINT, "framerate", GST_TYPE_FRACTION, 30, 1, nullptr);
gst_caps_append_structure(caps, cs);
if (srcCaps.empty()) {
// try to get at least something starting from those usually having good bitrate
gst_caps_append_structure(caps, gst_structure_new_empty("image/jpeg"));
gst_caps_append_structure(caps, gst_structure_new_empty("video/h264"));
gst_caps_append_structure(caps, gst_structure_new_empty("video/x-raw"));
return caps;
} else {
auto const &selected = srcCaps[0].second;
return gst_caps_new_simple(selected.mime.toLatin1().constData(), "width", G_TYPE_INT, selected.video.width,
"height", G_TYPE_INT, selected.video.height, nullptr);
}
return caps;
}

static GstElement *make_webrtcdsp_filter()
Expand Down Expand Up @@ -287,7 +291,7 @@ path2::caps="video/x-raw" \
if (captureSize.isValid())
capsfilter = filter_for_capture_size(captureSize);
else if (options.videoSize.isValid())
capsfilter = filter_for_desired_size(options.videoSize);
capsfilter = filter_for_desired_size(device, options.videoSize);

gst_bin_add(GST_BIN(bin), deviceElement);

Expand Down
8 changes: 1 addition & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,7 @@ include_directories(
${PROJECT_SOURCE_DIR}/3rdparty/qite/libqite
)

if(BUNDLED_IRIS)
# include_directories(
# ${PROJECT_SOURCE_DIR}/iris/src
# ${PROJECT_SOURCE_DIR}/iris/include
# ${PROJECT_SOURCE_DIR}/iris/include/iris
# )
else()
if(NOT BUNDLED_IRIS)
include_directories(${Iris_INCLUDE_DIR})
endif()

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1732 (2024-03-31, 3b984219)
1.5.1733 (2024-04-01, ccdbb7d4)

0 comments on commit d7c4176

Please sign in to comment.