From nobody Sat Apr 29 17:19:05 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q7x620XFZz481xL; Sat, 29 Apr 2023 17:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q7x620MjCz4cSC; Sat, 29 Apr 2023 17:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682788746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zKD390azCCqhPMSBMl+CSVyL8Si0Zcr+O9uZpeK/pxo=; b=wpulHZgnKMd8jLtDqPzhHD/l0F1WJ3I8TQZFViPKwlFwVcwMd+/EVmrB9saGi3VBJAHVy8 +bB0Mt2mNKSeNY6WhflOUROwj0RJ6j4mgxUOg/RM4vCiuHZYRlDlbx13gM4soer6hz3lgN UAQvckvlZpucQe2xA/Ik5wb3H0MsKXxxTthdEd9sGRB63pmokjliSA+udLhVi8qqPHg9J4 zO57gQX96hfP70bXy+UkZZvGcgefYJ+BIB/DXavdKnvTIAVNF1fAmBOdjmlGeyEIab7oqy fZ9W4HKzhB/Tepl7lO6elIUdSk32jcJXzepLww+E3uaFstnzySO/yBmPRe6pTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682788746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zKD390azCCqhPMSBMl+CSVyL8Si0Zcr+O9uZpeK/pxo=; b=qodtGjAddSga7uKbW1YTN7gtVNeByPrnesPIR65koLs9IQj/D9KiPfS94nqDN7M3Z2zT6b +PxPzb6Hd0hpme3ZmJMfQne5fWmrhK7AXh8jmIGD9gEF1FLro9jUDjGv7jXTh5mEEa2sZg 4AHC+wkgoRvJBQtvDIST9neej00u4rIOKbi4yxhhSYeZBvpw3APyl8ZFRsrBwwRBikSRkk k+2tCDE3kpGAnuVNj6bB99Vm+Ahcs6AhtOKZ2+RmG2gN/iQnUm32OHGz92xlTMll6NP83+ 9PxpB/vdXbiKkRrRsdFeVYrBIOBi8uh9xEeEzxPXGdYD6pX1vcCAwUnCgAy9sQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682788746; a=rsa-sha256; cv=none; b=oBlZzFP3vf+1VlzHTfmjAyq6oAENzOhU4GsTeYHBOIn6vdegkQFSvOWvzDrXG72VWtvxSS 6ybVRoHfEayFKhoeSnfqMdyrGn8c2j1fSHUdAUq7FU++bSldU+CHbJeiH/IOqjKqCwGpDf DVbLnGZaVwNL36A+kGGCPRYcZnVhGzcf1bXBGAEci0lkyL0W6XmXQ9E8yZ1IzSQVnPZC54 0QAXML/XTfur+5JjUOPV8GC40CPgDlN4r7IZII/CrP7/W/Brf2MXUrG2eRZtsxi/Xjbecm ZrOdgJwB5bVqlrhOWkaUlimP1T+eTx8iRf70P6wTt/ueFyJv3y113qziEiTylA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q7x616ZhKzqqH; Sat, 29 Apr 2023 17:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33THJ54P019743; Sat, 29 Apr 2023 17:19:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33THJ5sP019742; Sat, 29 Apr 2023 17:19:05 GMT (envelope-from git) Date: Sat, 29 Apr 2023 17:19:05 GMT Message-Id: <202304291719.33THJ5sP019742@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Fernando=20Apestegu=C3=ADa?= Subject: git: 183fb0ff4251 - main - multimedia/libopenshot: Update to 0.3.2 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 183fb0ff4251abbd31a0a151556108b5c2e1d190 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/ports/commit/?id=183fb0ff4251abbd31a0a151556108b5c2e1d190 commit 183fb0ff4251abbd31a0a151556108b5c2e1d190 Author: Tatsuki Makino AuthorDate: 2023-04-26 13:10:59 +0000 Commit: Fernando Apesteguía CommitDate: 2023-04-29 17:14:12 +0000 multimedia/libopenshot: Update to 0.3.2 ChangeLog: https://www.openshot.org/blog/2023/04/20/new_openshot_release_311/ PR: 271074 Reported by: tatsuki_makino@hotmail.com (maintainer) --- multimedia/libopenshot/Makefile | 3 +- multimedia/libopenshot/distinfo | 6 +- .../libopenshot/files/patch-src_KeyFrame.cpp | 309 +++++++++++++++++++++ multimedia/libopenshot/files/patch-src_KeyFrame.h | 31 +++ multimedia/libopenshot/pkg-plist | 4 +- 5 files changed, 346 insertions(+), 7 deletions(-) diff --git a/multimedia/libopenshot/Makefile b/multimedia/libopenshot/Makefile index 228906e7b9fd..7b00d3c4ba82 100644 --- a/multimedia/libopenshot/Makefile +++ b/multimedia/libopenshot/Makefile @@ -1,7 +1,6 @@ PORTNAME= libopenshot DISTVERSIONPREFIX= v -DISTVERSION= 0.3.1 -PORTREVISION= 3 +DISTVERSION= 0.3.2 CATEGORIES= multimedia PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/multimedia/libopenshot/distinfo b/multimedia/libopenshot/distinfo index 221087b79125..ab17d896ff93 100644 --- a/multimedia/libopenshot/distinfo +++ b/multimedia/libopenshot/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1681095600 -SHA256 (OpenShot-libopenshot-v0.3.1_GH0.tar.gz) = 239f9df1f5b547257d5e76062c3177ff3ff372b8cda336637d752141a5a8e625 -SIZE (OpenShot-libopenshot-v0.3.1_GH0.tar.gz) = 26131959 +TIMESTAMP = 1682218800 +SHA256 (OpenShot-libopenshot-v0.3.2_GH0.tar.gz) = 58765cfc8aec199814346e97ce31a5618a261260b380670a6fb2bf6f68733638 +SIZE (OpenShot-libopenshot-v0.3.2_GH0.tar.gz) = 26132237 diff --git a/multimedia/libopenshot/files/patch-src_KeyFrame.cpp b/multimedia/libopenshot/files/patch-src_KeyFrame.cpp new file mode 100644 index 000000000000..8a8b80337b50 --- /dev/null +++ b/multimedia/libopenshot/files/patch-src_KeyFrame.cpp @@ -0,0 +1,309 @@ +--- src/KeyFrame.cpp.orig 2023-04-19 22:01:02 UTC ++++ src/KeyFrame.cpp +@@ -15,12 +15,12 @@ + + #include // For std::lower_bound, std::move_backward + #include // For std::less, std::less_equal, etc… +-#include // For std::swap +-#include // For std::accumulate +-#include // For assert() +-#include // For fabs, round +-#include // For std::cout +-#include // For std::setprecision ++#include // For std::swap ++#include // For std::accumulate ++#include // For assert() ++#include // For fabs, round ++#include // For std::cout ++#include // For std::setprecision + + using namespace std; + using namespace openshot; +@@ -122,8 +122,8 @@ Keyframe::Keyframe(const std::vector& + + // Destructor + Keyframe::~Keyframe() { +- Points.clear(); +- Points.shrink_to_fit(); ++ Points.clear(); ++ Points.shrink_to_fit(); + } + + // Add a new point on the key-frame. Each point has a primary coordinate, +@@ -291,41 +291,27 @@ int64_t Keyframe::GetLong(int64_t index) const { + // Get the direction of the curve at a specific index (increasing or decreasing) + bool Keyframe::IsIncreasing(int index) const + { +- if (index <= 1) { +- // Determine direction of frame 1 (and assume previous frames have same direction) +- index = 1; +- } else if (index >= GetLength()) { +- // Determine direction of last valid frame # (and assume next frames have same direction) +- index = GetLength() - 1; ++ if (index < 1 || (index + 1) >= GetLength()) { ++ return true; + } +- +- // Get current index value +- const double current_value = GetValue(index); +- +- // Iterate from current index to next significant value change +- int attempts = 1; +- while (attempts < 600 && index + attempts <= GetLength()) { +- // Get next value +- const double next_value = GetValue(index + attempts); +- +- // Is value significantly different +- const double diff = next_value - current_value; +- if (fabs(diff) > 0.0001) { +- if (diff < 0.0) { +- // Decreasing value found next +- return false; +- } else { +- // Increasing value found next +- return true; +- } +- } +- +- // increment attempt +- attempts++; ++ std::vector::const_iterator candidate = ++ std::lower_bound(begin(Points), end(Points), static_cast(index), IsPointBeforeX); ++ if (candidate == end(Points)) { ++ return false; // After the last point, thus constant. + } +- +- // If no next value found, assume increasing values +- return true; ++ if ((candidate->co.X == index) || (candidate == begin(Points))) { ++ ++candidate; ++ } ++ int64_t const value = GetLong(index); ++ do { ++ if (value < round(candidate->co.Y)) { ++ return true; ++ } else if (value > round(candidate->co.Y)) { ++ return false; ++ } ++ ++candidate; ++ } while (candidate != end(Points)); ++ return false; + } + + // Generate JSON string of this object +@@ -388,12 +374,116 @@ void Keyframe::SetJsonValue(const Json::Value root) { + } + } + ++// Get the fraction that represents how many times this value is repeated in the curve ++// This is depreciated and will be removed soon. ++Fraction Keyframe::GetRepeatFraction(int64_t index) const { ++ // Frame numbers (index) outside of the "defined" range of this ++ // keyframe result in a 1/1 default value. ++ if (index < 1 || (index + 1) >= GetLength()) { ++ return Fraction(1,1); ++ } ++ assert(Points.size() > 1); // Due to ! ((index + 1) >= GetLength) there are at least two points! ++ ++ // First, get the value at the given frame and the closest point ++ // to the right. ++ int64_t const current_value = GetLong(index); ++ std::vector::const_iterator const candidate = ++ std::lower_bound(begin(Points), end(Points), static_cast(index), IsPointBeforeX); ++ assert(candidate != end(Points)); // Due to the (index + 1) >= GetLength check above! ++ ++ // Calculate how many of the next values are going to be the same: ++ int64_t next_repeats = 0; ++ std::vector::const_iterator i = candidate; ++ // If the index (frame number) is the X coordinate of the closest ++ // point, then look at the segment to the right; the "current" ++ // segement is not interesting because we're already at the last ++ // value of it. ++ if (i->co.X == index) { ++ ++i; ++ } ++ // Skip over "constant" (when rounded) segments. ++ bool all_constant = true; ++ for (; i != end(Points); ++i) { ++ if (current_value != round(i->co.Y)) { ++ all_constant = false; ++ break; ++ } ++ } ++ if (! all_constant) { ++ // Found a point which defines a segment which will give a ++ // different value than the current value. This means we ++ // moved at least one segment to the right, thus we cannot be ++ // at the first point. ++ assert(i != begin(Points)); ++ Point const left = *(i - 1); ++ Point const right = *i; ++ int64_t change_at; ++ if (current_value < round(i->co.Y)) { ++ change_at = SearchBetweenPoints(left, right, current_value, std::less_equal{}); ++ } else { ++ assert(current_value > round(i->co.Y)); ++ change_at = SearchBetweenPoints(left, right, current_value, std::greater_equal{}); ++ } ++ next_repeats = change_at - index; ++ } else { ++ // All values to the right are the same! ++ next_repeats = Points.back().co.X - index; ++ } ++ ++ // Now look to the left, to the previous values. ++ all_constant = true; ++ i = candidate; ++ if (i != begin(Points)) { ++ // The binary search below assumes i to be the left point; ++ // candidate is the right point of the current segment ++ // though. So change this if possible. If this branch is NOT ++ // taken, then we're at/before the first point and all is ++ // constant! ++ --i; ++ } ++ int64_t previous_repeats = 0; ++ // Skip over constant (when rounded) segments! ++ for (; i != begin(Points); --i) { ++ if (current_value != round(i->co.Y)) { ++ all_constant = false; ++ break; ++ } ++ } ++ // Special case when skipped until the first point, but the first ++ // point is actually different. Will not happen if index is ++ // before the first point! ++ if (current_value != round(i->co.Y)) { ++ assert(i != candidate); ++ all_constant = false; ++ } ++ if (! all_constant) { ++ // There are at least two points, and we're not at the end, ++ // thus the following is safe! ++ Point const left = *i; ++ Point const right = *(i + 1); ++ int64_t change_at; ++ if (current_value > round(left.co.Y)) { ++ change_at = SearchBetweenPoints(left, right, current_value, std::less{}); ++ } else { ++ assert(current_value < round(left.co.Y)); ++ change_at = SearchBetweenPoints(left, right, current_value, std::greater{}); ++ } ++ previous_repeats = index - change_at; ++ } else { ++ // Every previous value is the same (rounded) as the current ++ // value. ++ previous_repeats = index; ++ } ++ int64_t total_repeats = previous_repeats + next_repeats; ++ return Fraction(previous_repeats, total_repeats); ++} ++ + // Get the change in Y value (from the previous Y value) + double Keyframe::GetDelta(int64_t index) const { +- if (index < 1) return 0.0; +- if (index == 1 && !Points.empty()) return Points[0].co.Y; +- if (index >= GetLength()) return 0.0; +- return GetValue(index) - GetValue(index - 1); ++ if (index < 1) return 0; ++ if (index == 1 && ! Points.empty()) return Points[0].co.Y; ++ if (index >= GetLength()) return 0; ++ return GetLong(index) - GetLong(index - 1); + } + + // Get a point at a specific index +@@ -410,7 +500,7 @@ Point const & Keyframe::GetPoint(int64_t index) const + int64_t Keyframe::GetLength() const { + if (Points.empty()) return 0; + if (Points.size() == 1) return 1; +- return round(Points.back().co.X); ++ return round(Points.back().co.X) + 1; + } + + // Get the number of points (i.e. # of points) +@@ -461,46 +551,50 @@ void Keyframe::UpdatePoint(int64_t index, Point p) { + } + + void Keyframe::PrintPoints(std::ostream* out) const { +- *out << std::right << std::setprecision(4) << std::setfill(' '); +- for (const auto& p : Points) { +- *out << std::defaultfloat +- << std::setw(6) << p.co.X +- << std::setw(14) << std::fixed << p.co.Y +- << '\n'; +- } +- *out << std::flush; ++ *out << std::right << std::setprecision(4) << std::setfill(' '); ++ for (const auto& p : Points) { ++ *out << std::defaultfloat ++ << std::setw(6) << p.co.X ++ << std::setw(14) << std::fixed << p.co.Y ++ << '\n'; ++ } ++ *out << std::flush; + } + + void Keyframe::PrintValues(std::ostream* out) const { +- // Column widths +- std::vector w{10, 12, 8, 11, 19}; ++ // Column widths ++ std::vector w{10, 12, 8, 11, 19}; + +- *out << std::right << std::setfill(' ') << std::setprecision(4); +- // Headings +- *out << "│" +- << std::setw(w[0]) << "Frame# (X)" << " │" +- << std::setw(w[1]) << "Y Value" << " │" +- << std::setw(w[2]) << "Delta Y" << " │ " +- << std::setw(w[3]) << "Increasing?" << std::right +- << "│\n"; +- // Divider +- *out << "├───────────" +- << "┼─────────────" +- << "┼─────────" +- << "┼────────────┤\n"; ++ *out << std::right << std::setfill(' ') << std::setprecision(4); ++ // Headings ++ *out << "│" ++ << std::setw(w[0]) << "Frame# (X)" << " │" ++ << std::setw(w[1]) << "Y Value" << " │" ++ << std::setw(w[2]) << "Delta Y" << " │ " ++ << std::setw(w[3]) << "Increasing?" << " │ " ++ << std::setw(w[4]) << std::left << "Repeat Fraction" << std::right ++ << "│\n"; ++ // Divider ++ *out << "├───────────" ++ << "┼─────────────" ++ << "┼─────────" ++ << "┼─────────────" ++ << "┼────────────────────┤\n"; + +- for (int64_t i = 1; i <= GetLength(); ++i) { +- *out << "│" +- << std::setw(w[0]-2) << std::defaultfloat << i +- << (Contains(Point(i, 1)) ? " *" : " ") << " │" +- << std::setw(w[1]) << std::fixed << GetValue(i) << " │" +- << std::setw(w[2]) << std::defaultfloat << std::showpos +- << GetDelta(i) << " │ " << std::noshowpos +- << std::setw(w[3]) +- << (IsIncreasing(i) ? "true" : "false") << std::right << "│\n"; +- } +- *out << " * = Keyframe point (non-interpolated)\n"; +- *out << std::flush; ++ for (int64_t i = 1; i < GetLength(); ++i) { ++ *out << "│" ++ << std::setw(w[0]-2) << std::defaultfloat << i ++ << (Contains(Point(i, 1)) ? " *" : " ") << " │" ++ << std::setw(w[1]) << std::fixed << GetValue(i) << " │" ++ << std::setw(w[2]) << std::defaultfloat << std::showpos ++ << GetDelta(i) << " │ " << std::noshowpos ++ << std::setw(w[3]) ++ << (IsIncreasing(i) ? "true" : "false") << " │ " ++ << std::setw(w[4]) << std::left << GetRepeatFraction(i) ++ << std::right << "│\n"; ++ } ++ *out << " * = Keyframe point (non-interpolated)\n"; ++ *out << std::flush; + } + + diff --git a/multimedia/libopenshot/files/patch-src_KeyFrame.h b/multimedia/libopenshot/files/patch-src_KeyFrame.h new file mode 100644 index 000000000000..45aec4e0c498 --- /dev/null +++ b/multimedia/libopenshot/files/patch-src_KeyFrame.h @@ -0,0 +1,31 @@ +--- src/KeyFrame.h.orig 2023-04-19 22:01:02 UTC ++++ src/KeyFrame.h +@@ -16,6 +16,7 @@ + #include + #include + ++#include "Fraction.h" + #include "Point.h" + #include "Json.h" + +@@ -66,8 +67,8 @@ namespace openshot { + /// Constructor which adds a supplied vector of Points + Keyframe(const std::vector& points); + +- /// Destructor +- ~Keyframe(); ++ /// Destructor ++ ~Keyframe(); + + /// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle. + void AddPoint(Point p); +@@ -92,6 +93,9 @@ namespace openshot { + + /// Get the rounded LONG value at a specific index + int64_t GetLong(int64_t index) const; ++ ++ /// Get the fraction that represents how many times this value is repeated in the curve ++ Fraction GetRepeatFraction(int64_t index) const; + + /// Get the change in Y value (from the previous Y value) + double GetDelta(int64_t index) const; diff --git a/multimedia/libopenshot/pkg-plist b/multimedia/libopenshot/pkg-plist index 5e82b8c0aecc..6b1f5a7cbd52 100644 --- a/multimedia/libopenshot/pkg-plist +++ b/multimedia/libopenshot/pkg-plist @@ -97,8 +97,8 @@ include/libopenshot/effects/Wave.h include/libopenshot/sort_filter/Hungarian.h include/libopenshot/sort_filter/KalmanTracker.h lib/libopenshot.so -lib/libopenshot.so.0.3.1 -lib/libopenshot.so.24 +lib/libopenshot.so.0.3.2 +lib/libopenshot.so.25 %%PYTHON_SITELIBDIR%%/_openshot.so %%PYTHON_SITELIBDIR%%/openshot.py %%RUBY%%%%RUBY_VENDORARCHLIBDIR%%/openshot.so