diff --git a/multimedia/libopenshot/Makefile b/multimedia/libopenshot/Makefile index 3e1df32a406d..c70b7ed360ed 100644 --- a/multimedia/libopenshot/Makefile +++ b/multimedia/libopenshot/Makefile @@ -1,74 +1,84 @@ PORTNAME= libopenshot DISTVERSIONPREFIX= v -DISTVERSION= 0.7.0 -PORTREVISION= 1 +DISTVERSION= 1.0.0 CATEGORIES= multimedia PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= tatsuki_makino@hotmail.com COMMENT= OpenShot Video Library WWW= https://www.openshot.org/ LICENSE= BSD3CLAUSE LGPL3+ LICENSE_COMB= multi LICENSE_FILE_BSD3CLAUSE= ${WRKSRC}/LICENSES/BSD-3-Clause.txt LICENSE_FILE_LGPL3+ = ${WRKSRC}/COPYING BUILD_DEPENDS= ${PY_SETUPTOOLS} \ swig:devel/swig \ ${LOCALBASE}/include/zmq.hpp:net/cppzmq LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \ libbabl-0.1.so:x11/babl \ libjsoncpp.so:devel/jsoncpp \ libopenshot-audio.so:audio/libopenshot-audio \ libzmq.so:net/libzmq4 -USES= cmake compiler:c++17-lang pkgconfig python qt:5 +USES= cmake compiler:c++17-lang pkgconfig python qt:6 USE_GITHUB= yes GH_ACCOUNT= OpenShot USE_LDCONFIG= yes USE_PYTHON= flavors -USE_QT= core gui widgets buildtools:build qmake:build +USE_QT= base +CMAKE_ARGS= -DUSE_QT6:STRING=ON CMAKE_ON= USE_SYSTEM_JSONCPP DISABLE_BUNDLED_JSONCPP\ USE_HW_ACCEL ENABLE_PYTHON\ CMAKE_DISABLE_FIND_PACKAGE_Catch2 CMAKE_OFF= ENABLE_IWYU ENABLE_PARALLEL_CTEST VERBOSE_TESTS\ ENABLE_COVERAGE APPIMAGE_BUILD ENABLE_VULKAN_BENCHMARK\ BUILD_TESTING ENABLE_TESTS ENABLE_JAVA ENABLE_GODOT DEBUG_FLAGS?= -g DEBUG_FLAGS+= -D_DEBUG -DJUCE_FORCE_DEBUG=1 PLIST_SUB= VERSION=${DISTVERSION} -OPTIONS_DEFINE= DOCS DOXYGEN IMAGEMAGICK OPENCV RESVG RUBY +OPTIONS_DEFINE= DOCS DOXYGEN IMAGEMAGICK OPENCV RESVG RUBY WAYLAND OPTIONS_DEFAULT= IMAGEMAGICK OPENCV OPTIONS_SUB= yes RESVG_DESC?= SVG vector graphics support via resvg DOCS_CMAKE_ON= -DCMAKE_INSTALL_DOCDIR:PATH=${DOCSDIR_REL:Q} DOCS_PORTDOCS= * DOXYGEN_IMPLIES= DOCS DOXYGEN_BUILD_DEPENDS= doxygen:devel/doxygen DOXYGEN_CMAKE_BOOL= ENABLE_LIB_DOCS DOXYGEN_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Doxygen IMAGEMAGICK_USES= magick IMAGEMAGICK_CMAKE_BOOL= ENABLE_MAGICK IMAGEMAGICK_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_ImageMagick OPENCV_LIB_DEPENDS= libopencv_core.so:graphics/opencv \ libprotobuf.so:devel/protobuf OPENCV_CMAKE_BOOL= ENABLE_OPENCV OPENCV_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_OpenCV\ CMAKE_DISABLE_FIND_PACKAGE_Protobuf OPENCV_CMAKE_ON= -DOpenCV_DIR:STRING=${LOCALBASE:Q}/cmake/opencv4 RESVG_LIB_DEPENDS= libresvg.so:graphics/resvg-capi -RESVG_USE_OFF= QT=svg +RESVG_USE_OFF= qt=svg RESVG_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Resvg -RESVG_CMAKE_ON= -DRESVGDIR:STRING=${LOCALBASE:Q} -RUBY_LIB_DEPENDS= libruby${RUBY_SUFFIX}.so:lang/ruby${RUBY_SUFFIX} -RUBY_USES= ruby:build +RESVG_CMAKE_ON= -DResvg_ROOT:STRING=${LOCALBASE:Q} +RUBY_LIB_DEPENDS= libruby${RUBY_SHLIBVER}.so:${RUBY_PORT} +RUBY_USES= ruby:none RUBY_CMAKE_BOOL= ENABLE_RUBY RUBY_CMAKE_BOOL_OFF= CMAKE_DISABLE_FIND_PACKAGE_Ruby +WAYLAND_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire +WAYLAND_USES= gnome +WAYLAND_USE= gnome=glib20 +WAYLAND_CMAKE_BOOL= ENABLE_WAYLAND_CAPTURE .if !exists(/usr/include/omp.h) USE_GCC= yes .endif +# OpenGL that needs to be detected within +# Qt6/FindWrapOpenGL.cmake by find_package is not used. +# It seems that Qt was being loaded by dlopen, +# so it needs to be resolved on the Qt side. +LDFLAGS+= -Wl,--as-needed + .include diff --git a/multimedia/libopenshot/distinfo b/multimedia/libopenshot/distinfo index 342d712ead14..8f8092ca3418 100644 --- a/multimedia/libopenshot/distinfo +++ b/multimedia/libopenshot/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1775703600 -SHA256 (OpenShot-libopenshot-v0.7.0_GH0.tar.gz) = a7954c6af479fbd2e83059d4b6cbb13228de183f9a4eefcbcc8b3fd8de630dd2 -SIZE (OpenShot-libopenshot-v0.7.0_GH0.tar.gz) = 27078138 +TIMESTAMP = 1788577200 +SHA256 (OpenShot-libopenshot-v1.0.0_GH0.tar.gz) = 5c5f3790f6f70977f3573b9d039372d5b85bddc46f8944244a6225a79891acf2 +SIZE (OpenShot-libopenshot-v1.0.0_GH0.tar.gz) = 27227731 diff --git a/multimedia/libopenshot/files/patch-CMakeLists.txt b/multimedia/libopenshot/files/patch-CMakeLists.txt index 8906919b946d..22b4964fcb11 100644 --- a/multimedia/libopenshot/files/patch-CMakeLists.txt +++ b/multimedia/libopenshot/files/patch-CMakeLists.txt @@ -1,30 +1,30 @@ ---- CMakeLists.txt.orig 2026-04-02 23:34:37 UTC +--- CMakeLists.txt.orig 2026-07-22 19:42:15 UTC +++ CMakeLists.txt -@@ -131,7 +131,9 @@ add_subdirectory(src) +@@ -132,7 +132,9 @@ add_subdirectory(src) ### Process subdirectories ### add_subdirectory(src) +if(BUILD_EXAMPLES) add_subdirectory(examples) +endif(BUILD_EXAMPLES) add_subdirectory(bindings) ### -@@ -189,6 +191,8 @@ if (ENABLE_LIB_DOCS AND CMAKE_VERSION VERSION_GREATER +@@ -190,6 +192,8 @@ if (ENABLE_LIB_DOCS AND CMAKE_VERSION VERSION_GREATER set(DOXYGEN_INTERACTIVE_SVG YES) set(DOXYGEN_DOT_TRANSPARENT YES) + set(DOXYGEN_DOT_GRAPH_MAX_NODES "100") # set in src/config.xml of doxygen. the default value in 1.9.6 is 50. + doxygen_add_docs(${PROJECT_NAME}-doc ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/doc -@@ -209,7 +213,7 @@ if (TARGET ${PROJECT_NAME}-doc) +@@ -210,7 +214,7 @@ if (TARGET ${PROJECT_NAME}-doc) OPTIONAL ) # No error if the docs aren't found if(NOT TARGET doc) - add_custom_target(doc) + add_custom_target(doc ALL) endif() if(TARGET doc) add_dependencies(doc ${PROJECT_NAME}-doc) diff --git a/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt b/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt index 99df36c003ea..aa9dbc64b3a2 100644 --- a/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt +++ b/multimedia/libopenshot/files/patch-bindings_python_CMakeLists.txt @@ -1,11 +1,11 @@ ---- bindings/python/CMakeLists.txt.orig 2026-03-20 19:34:28 UTC +--- bindings/python/CMakeLists.txt.orig 2026-07-22 19:42:15 UTC +++ bindings/python/CMakeLists.txt -@@ -117,7 +117,7 @@ if (NOT DEFINED PYTHON_MODULE_PATH) +@@ -123,7 +123,7 @@ if (NOT DEFINED PYTHON_MODULE_PATH) if (NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${PYTHON_MODULE_PATH}") ### Calculate the python module path (prefer sysconfig, fallback to distutils for compatibility) execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; p=sysconfig.get_path('platlib', scheme='posix_prefix'); p=p[5:] if p.startswith('/usr/') else p.lstrip('/'); print(p)" + COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; p=sysconfig.get_path('platlib', scheme='posix_prefix'); d = sysconfig.get_path('data', scheme='posix_prefix'); p = p[len(d):].lstrip('/') if p.startswith(d) else p.lstrip('/'); print(p)" OUTPUT_VARIABLE PYTHON_MODULE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) endif() diff --git a/multimedia/libopenshot/files/patch-ffmpeg9 b/multimedia/libopenshot/files/patch-ffmpeg9 index d6e971fb04de..6461721c8719 100644 --- a/multimedia/libopenshot/files/patch-ffmpeg9 +++ b/multimedia/libopenshot/files/patch-ffmpeg9 @@ -1,134 +1,138 @@ ---- src/FFmpegWriter.cpp 2026-04-03 01:34:37.000000000 +0200 -+++ src/FFmpegWriter.cpp 2026-08-13 19:59:55.020084338 +0200 -@@ -1042,38 +1042,60 @@ +--- src/FFmpegWriter.cpp.orig 2026-08-18 06:00:44 UTC ++++ src/FFmpegWriter.cpp +@@ -1142,19 +1142,30 @@ AVStream *FFmpegWriter::add_audio_stream() { #endif // Set valid sample rate (or throw error) - if (codec->supported_samplerates) { - int i; - for (i = 0; codec->supported_samplerates[i] != 0; i++) - if (info.sample_rate == codec->supported_samplerates[i]) { - // Set the valid sample rate - c->sample_rate = info.sample_rate; - break; - } - if (codec->supported_samplerates[i] == 0) - throw InvalidSampleRate("An invalid sample rate was detected for this codec.", path); - } else - // Set sample rate - c->sample_rate = info.sample_rate; + // AVCodec.supported_samplerates removed in FFmpeg 9+ + { + const int *supported_samplerates = NULL; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) + if (avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_SAMPLE_RATE, 0, + (const void **)&supported_samplerates, NULL) < 0) + supported_samplerates = NULL; +#else + supported_samplerates = codec->supported_samplerates; +#endif + if (supported_samplerates) { + int i; + for (i = 0; supported_samplerates[i] != 0; i++) + if (info.sample_rate == supported_samplerates[i]) { + // Set the valid sample rate + c->sample_rate = info.sample_rate; + break; + } + if (supported_samplerates[i] == 0) + throw InvalidSampleRate("An invalid sample rate was detected for this codec.", path); + } else + // Set sample rate + c->sample_rate = info.sample_rate; + } + c->time_base = AVRational{1, c->sample_rate}; + st->time_base = c->time_base; +@@ -1162,22 +1173,33 @@ AVStream *FFmpegWriter::add_audio_stream() { uint64_t channel_layout = info.channel_layout; #if HAVE_CH_LAYOUT // Set a valid number of channels (or throw error) + // AVCodec.ch_layouts removed in FFmpeg 9+ AVChannelLayout ch_layout; av_channel_layout_from_mask(&ch_layout, info.channel_layout); - if (codec->ch_layouts) { - int i; - for (i = 0; av_channel_layout_check(&codec->ch_layouts[i]); i++) - if (av_channel_layout_compare(&ch_layout, &codec->ch_layouts[i])) { - // Set valid channel layout - av_channel_layout_copy(&c->ch_layout, &ch_layout); - break; - } - if (!av_channel_layout_check(&codec->ch_layouts[i])) - throw InvalidChannels("An invalid channel layout was detected (i.e. MONO / STEREO).", path); - } else - // Set valid channel layout - av_channel_layout_copy(&c->ch_layout, &ch_layout); + { + const AVChannelLayout *ch_layouts = NULL; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) + if (avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_CHANNEL_LAYOUT, 0, + (const void **)&ch_layouts, NULL) < 0) + ch_layouts = NULL; -+#else + #else + ch_layouts = codec->ch_layouts; +#endif + if (ch_layouts) { + int i; + for (i = 0; av_channel_layout_check(&ch_layouts[i]); i++) + if (av_channel_layout_compare(&ch_layout, &ch_layouts[i])) { + // Set valid channel layout + av_channel_layout_copy(&c->ch_layout, &ch_layout); + break; + } + if (!av_channel_layout_check(&ch_layouts[i])) + throw InvalidChannels("An invalid channel layout was detected (i.e. MONO / STEREO).", path); + } else + // Set valid channel layout + av_channel_layout_copy(&c->ch_layout, &ch_layout); + } - #else ++#else // Set a valid number of channels (or throw error) if (codec->channel_layouts) { -@@ -1092,11 +1114,22 @@ + int i; +@@ -1195,11 +1217,22 @@ AVStream *FFmpegWriter::add_audio_stream() { #endif // Choose a valid sample_fmt - if (codec->sample_fmts) { - for (int i = 0; codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { - // Set sample format to 1st valid format (and then exit loop) - c->sample_fmt = codec->sample_fmts[i]; - break; + // AVCodec.sample_fmts removed in FFmpeg 9+ + { + const enum AVSampleFormat *sample_fmts = NULL; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) + if (avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_SAMPLE_FORMAT, 0, + (const void **)&sample_fmts, NULL) < 0) + sample_fmts = NULL; +#else + sample_fmts = codec->sample_fmts; +#endif + if (sample_fmts) { + for (int i = 0; sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { + // Set sample format to 1st valid format (and then exit loop) + c->sample_fmt = sample_fmts[i]; + break; + } } } if (c->sample_fmt == AV_SAMPLE_FMT_NONE) { -@@ -1297,7 +1330,15 @@ +@@ -1401,7 +1434,15 @@ AVStream *FFmpegWriter::add_video_stream() { #endif // Find all supported pixel formats for this codec - const PixelFormat *supported_pixel_formats = codec->pix_fmts; + // AVCodec.pix_fmts removed in FFmpeg 9+ + const PixelFormat *supported_pixel_formats = NULL; +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) + if (avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_PIX_FORMAT, 0, + (const void **)&supported_pixel_formats, NULL) < 0) + supported_pixel_formats = NULL; +#else + supported_pixel_formats = codec->pix_fmts; +#endif while (supported_pixel_formats != NULL && *supported_pixel_formats != PIX_FMT_NONE) { // Assign the 1st valid pixel format (if one is missing) if (c->pix_fmt == PIX_FMT_NONE) diff --git a/multimedia/libopenshot/files/patch-src_CMakeLists.txt b/multimedia/libopenshot/files/patch-src_CMakeLists.txt index 212415c64884..98805cf827e1 100644 --- a/multimedia/libopenshot/files/patch-src_CMakeLists.txt +++ b/multimedia/libopenshot/files/patch-src_CMakeLists.txt @@ -1,29 +1,38 @@ ---- src/CMakeLists.txt.orig 2025-12-17 05:23:44 UTC +--- src/CMakeLists.txt.orig 2026-08-18 06:00:44 UTC +++ src/CMakeLists.txt -@@ -524,6 +524,26 @@ add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Us +@@ -96,7 +96,7 @@ set(OPENSHOT_WAYLAND_CAPTURE FALSE) + ) + + set(OPENSHOT_WAYLAND_CAPTURE FALSE) +-if(ENABLE_WAYLAND_CAPTURE AND CMAKE_SYSTEM_NAME STREQUAL "Linux") ++if(ENABLE_WAYLAND_CAPTURE) + find_package(PkgConfig) + if(PkgConfig_FOUND) + pkg_check_modules(PC_PIPEWIRE QUIET IMPORTED_TARGET libpipewire-0.3) +@@ -621,6 +621,26 @@ add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Us + endif() endif() # ENABLE_OPENCV add_feature_info("OpenCV algorithms" ENABLE_OPENCV "Use OpenCV algorithms") - ++ +# +include(CheckFunctionExists) +include(CheckLibraryExists) + +# EXECINFO +check_function_exists(backtrace FUNCTION_BACKTRACE_FOUND) +if(NOT FUNCTION_BACKTRACE_FOUND) + find_library(EXECINFO_LIBRARY NAMES execinfo) + if(EXECINFO_LIBRARY) + unset(FUNCTION_BACKTRACE_FOUND CACHE) + check_library_exists(${EXECINFO_LIBRARY} backtrace "" FUNCTION_BACKTRACE_FOUND) + endif(EXECINFO_LIBRARY) +endif(NOT FUNCTION_BACKTRACE_FOUND) +if(NOT FUNCTION_BACKTRACE_FOUND) + message(FATAL_ERROR "backtrace - ${FUNCTION_BACKTRACE_FOUND}") +endif(NOT FUNCTION_BACKTRACE_FOUND) +if(EXECINFO_LIBRARY) + target_link_libraries(openshot PRIVATE ${EXECINFO_LIBRARY}) +endif(EXECINFO_LIBRARY) -+ + ############### LINK LIBRARY ################# # Link remaining dependency libraries - if(DEFINED PROFILER) diff --git a/multimedia/libopenshot/files/patch-src_CameraCaptureReader.cpp b/multimedia/libopenshot/files/patch-src_CameraCaptureReader.cpp new file mode 100644 index 000000000000..51433691269c --- /dev/null +++ b/multimedia/libopenshot/files/patch-src_CameraCaptureReader.cpp @@ -0,0 +1,29 @@ +--- src/CameraCaptureReader.cpp.orig 2026-08-18 06:00:44 UTC ++++ src/CameraCaptureReader.cpp +@@ -137,7 +137,7 @@ bool CameraCaptureReader::IsBackendSupported(CameraCap + + bool CameraCaptureReader::IsBackendSupported(CameraCaptureBackend backend) + { +-#if defined(__linux__) ++#if defined(__unix__) + return backend == CAMERA_CAPTURE_V4L2 || backend == CAMERA_CAPTURE_AUTO; + #elif defined(_WIN32) + return backend == CAMERA_CAPTURE_WINDOWS_DSHOW || backend == CAMERA_CAPTURE_AUTO; +@@ -151,7 +151,7 @@ CameraCaptureBackend CameraCaptureReader::DefaultBacke + + CameraCaptureBackend CameraCaptureReader::DefaultBackend() + { +-#if defined(__linux__) ++#if defined(__unix__) + return CAMERA_CAPTURE_V4L2; + #elif defined(_WIN32) + return CAMERA_CAPTURE_WINDOWS_DSHOW; +@@ -170,7 +170,7 @@ AudioDeviceList CameraCaptureReader::GetDeviceNames(Ca + + AudioDeviceList devices; + const char* input_format_name = nullptr; +-#if defined(__linux__) ++#if defined(__unix__) + if (backend == CAMERA_CAPTURE_V4L2) { + input_format_name = "v4l2"; + } diff --git a/multimedia/libopenshot/files/patch-src_Clip.cpp b/multimedia/libopenshot/files/patch-src_Clip.cpp index cd8fb58c72c5..e7180e64b7be 100644 --- a/multimedia/libopenshot/files/patch-src_Clip.cpp +++ b/multimedia/libopenshot/files/patch-src_Clip.cpp @@ -1,10 +1,10 @@ ---- src/Clip.cpp.orig 2026-04-02 23:34:37 UTC +--- src/Clip.cpp.orig 2026-07-22 19:42:15 UTC +++ src/Clip.cpp -@@ -1441,6 +1441,7 @@ QSize Clip::scale_size(QSize source_size, ScaleType so +@@ -1535,6 +1535,7 @@ QSize Clip::scale_size(QSize source_size, ScaleType so source_size.scale(target_width, target_height, Qt::KeepAspectRatioByExpanding);; break; } + default: ; } return source_size; diff --git a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp index 5a545b352457..9272a9883507 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegReader.cpp @@ -1,35 +1,35 @@ ---- src/FFmpegReader.cpp.orig 2026-04-02 23:34:37 UTC +--- src/FFmpegReader.cpp.orig 2026-07-22 19:42:15 UTC +++ src/FFmpegReader.cpp -@@ -170,7 +170,7 @@ static enum AVPixelFormat get_hw_dec_format(AVCodecCon +@@ -172,7 +172,7 @@ static enum AVPixelFormat get_hw_dec_format(AVCodecCon for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) { switch (*p) { -#if defined(__linux__) +#if defined(__unix__) // Linux pix formats case AV_PIX_FMT_VAAPI: if (selected == 1) { -@@ -357,7 +357,7 @@ void FFmpegReader::Open() { +@@ -359,7 +359,7 @@ void FFmpegReader::Open() { pCodecCtx->get_format = get_hw_dec_format; if (adapter_num < 3 && adapter_num >=0) { -#if defined(__linux__) +#if defined(__unix__) snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); adapter_ptr = adapter; i_decoder_hw = openshot::Settings::Instance()->HARDWARE_DECODER; -@@ -420,11 +420,13 @@ void FFmpegReader::Open() { +@@ -422,11 +422,13 @@ void FFmpegReader::Open() { } // Check if it is there and writable -#if defined(__linux__) +#if defined(__unix__) if( adapter_ptr != NULL && access( adapter_ptr, W_OK ) == 0 ) { #elif defined(_WIN32) if( adapter_ptr != NULL ) { #elif defined(__APPLE__) + if( adapter_ptr != NULL ) { +#else if( adapter_ptr != NULL ) { #endif ZmqLogger::Instance()->AppendDebugMethod("Decode Device present using device"); diff --git a/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h b/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h index 62190bdf24b9..796acbbfb5dc 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h +++ b/multimedia/libopenshot/files/patch-src_FFmpegUtilities.h @@ -1,11 +1,11 @@ ---- src/FFmpegUtilities.h.orig 2026-04-02 23:34:37 UTC +--- src/FFmpegUtilities.h.orig 2026-07-22 19:42:15 UTC +++ src/FFmpegUtilities.h -@@ -411,7 +411,7 @@ inline static void* aligned_malloc(size_t size, size_t +@@ -410,7 +410,7 @@ inline static void* aligned_malloc(size_t size, size_t { #if defined(_WIN32) return _aligned_malloc(size, alignment); -#elif defined(__APPLE__) || defined(__linux__) +#elif defined(__APPLE__) || defined(__unix__) void* ptr = nullptr; if (posix_memalign(&ptr, alignment, size) != 0) return nullptr; diff --git a/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp index da5883144421..3d7d481d47d9 100644 --- a/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp +++ b/multimedia/libopenshot/files/patch-src_FFmpegWriter.cpp @@ -1,65 +1,65 @@ ---- src/FFmpegWriter.cpp.orig 2026-04-02 23:34:37 UTC +--- src/FFmpegWriter.cpp.orig 2026-07-22 19:42:15 UTC +++ src/FFmpegWriter.cpp @@ -168,7 +168,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std const AVCodec *new_codec; // Check if the codec selected is a hardware accelerated codec #if USE_HW_ACCEL -#if defined(__linux__) +#if defined(__unix__) if (strstr(codec.c_str(), "_vaapi") != NULL) { new_codec = avcodec_find_encoder_by_name(codec.c_str()); hw_en_on = 1; @@ -218,7 +218,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std } #else // unknown OS new_codec = avcodec_find_encoder_by_name(codec.c_str()); -#endif //__linux__/_WIN32/__APPLE__ +#endif //__unix__/_WIN32/__APPLE__ #else // USE_HW_ACCEL new_codec = avcodec_find_encoder_by_name(codec.c_str()); #endif // USE_HW_ACCEL @@ -564,6 +564,7 @@ void FFmpegWriter::SetOption(StreamType stream, std::s else { av_opt_set_int(c->priv_data, "crf", std::min(std::stoi(value),63), 0); } + break; case AV_CODEC_ID_HEVC : c->bit_rate = 0; if (strstr(info.vcodec.c_str(), "svt_hevc") != NULL) { @@ -572,6 +573,8 @@ void FFmpegWriter::SetOption(StreamType stream, std::s av_opt_set_int(c->priv_data, "forced-idr",1,0); } break; + default: + break; } #endif // FFmpeg 4.0+ } else { -@@ -1429,21 +1432,25 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS +@@ -1533,21 +1536,25 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; std::clog << "Encoding Device Nr: " << adapter_num << "\n"; if (adapter_num < 3 && adapter_num >=0) { -#if defined(__linux__) +#if defined(__unix__) snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); // Maybe 127 is better because the first card would be 1?! adapter_ptr = adapter; #elif defined(_WIN32) || defined(__APPLE__) adapter_ptr = NULL; +#else + adapter_ptr = NULL; #endif } else { adapter_ptr = NULL; // Just to be sure } // Check if it is there and writable -#if defined(__linux__) +#if defined(__unix__) if( adapter_ptr != NULL && access( adapter_ptr, W_OK ) == 0 ) { #elif defined(_WIN32) || defined(__APPLE__) + if( adapter_ptr != NULL ) { +#else if( adapter_ptr != NULL ) { #endif ZmqLogger::Instance()->AppendDebugMethod( diff --git a/multimedia/libopenshot/files/patch-src_ScreenCaptureReader.cpp b/multimedia/libopenshot/files/patch-src_ScreenCaptureReader.cpp new file mode 100644 index 000000000000..c1e4a7788ad0 --- /dev/null +++ b/multimedia/libopenshot/files/patch-src_ScreenCaptureReader.cpp @@ -0,0 +1,90 @@ +--- src/ScreenCaptureReader.cpp.orig 2026-08-18 06:00:44 UTC ++++ src/ScreenCaptureReader.cpp +@@ -24,7 +24,7 @@ + #include + #include + +-#if defined(__linux__) ++#if defined(__unix__) + #include + #endif + +@@ -47,7 +47,7 @@ using namespace openshot; + + using namespace openshot; + +-#if defined(HAVE_WAYLAND_CAPTURE_PLUGIN) && defined(__linux__) ++#if defined(HAVE_WAYLAND_CAPTURE_PLUGIN) && defined(__unix__) + namespace + { + using WaylandBackendFactory = std::unique_ptr (*) ( +@@ -81,7 +81,7 @@ namespace + } + #endif + +-#if defined(__linux__) ++#if defined(__unix__) + class ScreenCaptureReader::SystemAudioCapture + { + public: +@@ -620,13 +620,13 @@ ScreenCaptureReader::ScreenCaptureReader(const ScreenC + } + ValidateSettings(); + PopulateInfo(); +-#if defined(__linux__) || defined(_WIN32) ++#if defined(__unix__) || defined(_WIN32) + if (settings.capture_audio) { + system_audio = std::make_unique(settings); + } + #endif + if (UsesWaylandPortal()) { +- #if defined(HAVE_WAYLAND_CAPTURE_PLUGIN) && defined(__linux__) ++ #if defined(HAVE_WAYLAND_CAPTURE_PLUGIN) && defined(__unix__) + std::string module_error; + backend_module = load_wayland_capture_backend(module_error); + if (!backend_module) { +@@ -663,7 +663,7 @@ ScreenCaptureReader::~ScreenCaptureReader() + ScreenCaptureReader::~ScreenCaptureReader() + { + Close(); +-#if defined(__linux__) ++#if defined(__unix__) + backend_reader.reset(); + if (backend_module) { + dlclose(backend_module); +@@ -680,7 +680,7 @@ bool ScreenCaptureReader::IsBackendSupported(ScreenCap + + bool ScreenCaptureReader::IsBackendSupported(ScreenCaptureBackend backend) + { +-#if defined(__linux__) ++#if defined(__unix__) + if (backend == SCREEN_CAPTURE_X11 || backend == SCREEN_CAPTURE_AUTO) { + return true; + } +@@ -702,7 +702,7 @@ bool ScreenCaptureReader::IsSystemAudioSupported(Scree + + bool ScreenCaptureReader::IsSystemAudioSupported(ScreenCaptureBackend backend) + { +-#if defined(__linux__) ++#if defined(__unix__) + if (backend == SCREEN_CAPTURE_AUTO) { + backend = DefaultBackend(); + } +@@ -719,7 +719,7 @@ ScreenCaptureBackend ScreenCaptureReader::DefaultBacke + + ScreenCaptureBackend ScreenCaptureReader::DefaultBackend() + { +-#if defined(__linux__) ++#if defined(__unix__) + const char* session = std::getenv("XDG_SESSION_TYPE"); + if (session && std::string(session) == "wayland" && IsBackendSupported(SCREEN_CAPTURE_WAYLAND)) { + return SCREEN_CAPTURE_WAYLAND; +@@ -1297,7 +1297,7 @@ void ScreenCaptureReader::SetJsonValue(const Json::Val + } + ValidateSettings(); + PopulateInfo(); +-#if defined(__linux__) || defined(_WIN32) ++#if defined(__unix__) || defined(_WIN32) + system_audio.reset(); + if (settings.capture_audio) { + system_audio = std::make_unique(settings); diff --git a/multimedia/libopenshot/pkg-message b/multimedia/libopenshot/pkg-message index f47d91cb3066..27093f62d63d 100644 --- a/multimedia/libopenshot/pkg-message +++ b/multimedia/libopenshot/pkg-message @@ -1,12 +1,7 @@ [ { type: install message: <