From 4bafe0c39d70f0ef2e564bf58ec1ce477f382245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 6 May 2024 09:23:24 -0300 Subject: [PATCH 1/4] Added bin/runme_ffmpeg_exr.sh to quickly debug issues. --- bin/runme_ffmpeg_exr.sh | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 bin/runme_ffmpeg_exr.sh diff --git a/bin/runme_ffmpeg_exr.sh b/bin/runme_ffmpeg_exr.sh new file mode 100755 index 0000000000..dbce8712e5 --- /dev/null +++ b/bin/runme_ffmpeg_exr.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: BSD-3-Clause +# mrv2 +# Copyright Contributors to the mrv2 Project. All rights reserved. + + +# +# +# Small build script for mrv2. Run it from the root of the mrv2 dir, like: +# +# ./bin/runme_small.sh +# +# It builds all dependencies and will install +# the main executable on BUILD_DIR (by default +# BUILD-OS-ARCH/BUILD_TYPE/install/bin). +# +# The small build does not have Python, USD, PDF, NDI or NETWORK support. +# It is intended for solo artists. +# +# +# On Linux and macOS, it will also create a mrv2 or mrv2-dbg symbolic link +# in $HOME/bin if the directory exists. +# +# It will also log the compilation on $BUILD_DIR/compile.log +# + + +# +# Store the parameters for passing them later +# +params=$* + +# +# Find out our build dir +# +. etc/build_dir.sh + + +# +# Clear the flags, as they will be set by runme_nolog.sh. +# +export FLAGS="" +export CMAKE_FLAGS="" + +# +# Common flags +# +export BUILD_PYTHON=OFF + +# +# These are some of the expensive mrv2 options +# +export BUILD_PYTHON=OFF +export MRV2_PYFLTK=OFF +export MRV2_PYBIND11=OFF +export MRV2_NETWORK=OFF +export MRV2_PDF=OFF + +# +# These are some of the expensive TLRENDER options +# +export TLRENDER_AV1=OFF +export TLRENDER_FFMPEG=ON +export TLRENDER_FFMPEG_MINIMAL=ON +export TLRENDER_EXR=ON +export TLRENDER_JPEG=OFF +export TLRENDER_NDI=OFF +export TLRENDER_NET=OFF +export TLRENDER_RAW=OFF +export TLRENDER_SGI=OFF +export TLRENDER_STB=OFF +export TLRENDER_TIFF=OFF +export TLRENDER_USD=OFF +export TLRENDER_VPX=OFF +export TLRENDER_WAYLAND=ON +export TLRENDER_X11=ON +export TLRENDER_YASM=ON + +echo +echo "Saving compile log to $BUILD_DIR/compile.log ..." +echo +cmd="./runme_nolog.sh --ask $params 2>&1 | tee $BUILD_DIR/compile.log" +run_cmd $cmd From ce63d4de4d535e85423c9bbf30be5ee9b975256f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 6 May 2024 10:26:23 -0300 Subject: [PATCH 2/4] Updated Edit Viewport for macOS. --- cmake/version.cmake | 2 +- mrv2/docs/HISTORY.md | 7 ++++++- mrv2/lib/mrvEdit/mrvEditCallbacks.cpp | 12 ++++++------ mrv2/lib/mrvFl/mrvPreferences.cpp | 2 ++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 20898b8208..9c7ab27fd7 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,7 +5,7 @@ set( mrv2_VERSION_MAJOR 1 ) set( mrv2_VERSION_MINOR 1 ) -set( mrv2_VERSION_PATCH 5 ) +set( mrv2_VERSION_PATCH 6 ) set( mrv2_VERSION "${mrv2_VERSION_MAJOR}.${mrv2_VERSION_MINOR}.${mrv2_VERSION_PATCH}" ) diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index 21910009c5..3915e197ac 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -8,9 +8,14 @@ v1.1.6 default. - Cleaned up source code of passing ui pointer to several classes, using App::ui instead. -- Removed .po python plug-in files from distribution. +- Removed .po python plug-in files from package distribution. - Improved missing_translate.py script and added searching for plug-in translations too. +- Fixed Edit Viewport Clip Info and Device Info not respecting the device + pixel ratio when the Edit button was pressed. +- Fixed macOS crashes with preview thumbnail. +- Respect last configuration of Timeline/ClipInfo and Timeline/TrackInfo. + v1.1.5 ====== diff --git a/mrv2/lib/mrvEdit/mrvEditCallbacks.cpp b/mrv2/lib/mrvEdit/mrvEditCallbacks.cpp index 84bb14b8e7..773b2bbc26 100644 --- a/mrv2/lib/mrvEdit/mrvEditCallbacks.cpp +++ b/mrv2/lib/mrvEdit/mrvEditCallbacks.cpp @@ -2276,8 +2276,9 @@ namespace mrv int calculate_edit_viewport_size(ViewerUI* ui) { // Some constants, as Darby does not expose this in tlRender. - const int kTrackInfoHeight = 21; - const int kClipInfoHeight = 21; + const float pixels_unit = ui->uiTimeline->pixels_per_unit(); + const int kTrackInfoHeight = 21 * pixels_unit; + const int kClipInfoHeight = 21 * pixels_unit; const int kTransitionsHeight = 30; const int kAudioGapOnlyHeight = 20; const int kMarkerHeight = 24; @@ -2425,7 +2426,7 @@ namespace mrv { if (ui->uiView->getPresentationMode()) return; - + Fl_Button* b = ui->uiEdit; bool active = (mode == EditMode::kFull || mode == EditMode::kSaved); @@ -2452,8 +2453,7 @@ namespace mrv int tileH = tile->h(); int H = kMinEditModeH; // timeline height int viewH = H; - bool showTimeline = ui->uiMain->visible() && - mode != EditMode::kNone; + bool showTimeline = ui->uiMain->visible() && mode != EditMode::kNone; auto player = ui->uiView->getTimelinePlayer(); if (mode == EditMode::kFull && player) { @@ -2487,7 +2487,7 @@ namespace mrv if (showTimeline) ui->uiTimeline->show(); - + int newY = tileY + tileH - H; view->resize(view->x(), view->y(), view->w(), tileH - viewH); diff --git a/mrv2/lib/mrvFl/mrvPreferences.cpp b/mrv2/lib/mrvFl/mrvPreferences.cpp index 488460ffcc..d1b6e3052f 100644 --- a/mrv2/lib/mrvFl/mrvPreferences.cpp +++ b/mrv2/lib/mrvFl/mrvPreferences.cpp @@ -1571,6 +1571,8 @@ namespace mrv break; } options.waveformHeight = options.thumbnailHeight / 2; + options.trackInfo = settings->getValue("Timeline/TrackInfo"); + options.clipInfo = settings->getValue("Timeline/ClipInfo"); ui->uiTimeline->setItemOptions(options); if (uiPrefs->uiPrefsTimeline->value()) From a6ee29c52d0ca94c2a09d6dff31b4ff0df27ecc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 6 May 2024 15:11:48 -0300 Subject: [PATCH 3/4] macOS fix. --- cmake/version.cmake | 2 +- mrv2/lib/mrvGL/mrvTimelineWidget.cpp | 85 ++++++++++++++-------------- mrv2/lib/mrvGL/mrvTimelineWidget.h | 5 ++ 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 9c7ab27fd7..20898b8208 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -5,7 +5,7 @@ set( mrv2_VERSION_MAJOR 1 ) set( mrv2_VERSION_MINOR 1 ) -set( mrv2_VERSION_PATCH 6 ) +set( mrv2_VERSION_PATCH 5 ) set( mrv2_VERSION "${mrv2_VERSION_MAJOR}.${mrv2_VERSION_MINOR}.${mrv2_VERSION_PATCH}" ) diff --git a/mrv2/lib/mrvGL/mrvTimelineWidget.cpp b/mrv2/lib/mrvGL/mrvTimelineWidget.cpp index b534940a2e..28b2fd3ca0 100644 --- a/mrv2/lib/mrvGL/mrvTimelineWidget.cpp +++ b/mrv2/lib/mrvGL/mrvTimelineWidget.cpp @@ -339,7 +339,7 @@ namespace mrv !p.timelineWidget->isEditable()) { p.timeRange = p.player->player()->getTimeRange(); - auto time = _posToTime(X); + const auto& time = _posToTime(X); p.player->seek(time); return 1; } @@ -544,10 +544,12 @@ namespace mrv _p->timelineWidget->setItemOptions(value); } - void TimelineWidget::_initializeGLResources() + void TimelineWidget::_initializeGL() { TLRENDER_P(); + gl::initGLAD(); + if (auto context = p.context.lock()) { try @@ -592,39 +594,23 @@ namespace mrv "mrv::mrvTimelineWidget", e.what(), log::Type::Error); } + _sizeHintEvent(); p.vao.reset(); p.vbo.reset(); p.buffer.reset(); } } - void TimelineWidget::_initializeGL() - { - gl::initGLAD(); - - CHECK_GL; - refresh(); - CHECK_GL; - - _initializeGLResources(); - CHECK_GL; - } - void TimelineWidget::resize(int X, int Y, int W, int H) { TLRENDER_P(); Fl_Gl_Window::resize(X, Y, W, H); - const float devicePixelRatio = this->pixels_per_unit(); - ui::SizeHintEvent sizeHintEvent( - p.style, p.iconLibrary, p.fontSystem, devicePixelRatio); - _sizeHintEvent(p.timelineWindow, sizeHintEvent); - - const math::Box2i geometry(0, 0, _toUI(W), _toUI(H)); - p.timelineWindow->setGeometry(geometry); + _setGeometry(); - _clipEvent(p.timelineWindow, geometry, false); + _sizeHintEvent(); + _clipEvent(); p.vbo.reset(); p.vao.reset(); @@ -1361,34 +1347,19 @@ namespace mrv //! destruction? if (_p) { - ui::TickEvent tickEvent(p.style, p.iconLibrary, p.fontSystem); - _tickEvent(p.timelineWindow, true, true, tickEvent); + _tickEvent(); if (_getSizeUpdate(p.timelineWindow)) { - const float devicePixelRatio = this->pixels_per_unit(); - ui::SizeHintEvent sizeHintEvent( - p.style, p.iconLibrary, p.fontSystem, devicePixelRatio); - _sizeHintEvent(p.timelineWindow, sizeHintEvent); - - const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h())); - p.timelineWindow->setGeometry(geometry); - - _clipEvent(p.timelineWindow, geometry, false); + _sizeHintEvent(); + _setGeometry(); + _clipEvent(); + // updateGeometry(); // Qt function? } if (_getDrawUpdate(p.timelineWindow)) { -#ifdef DEBUG_TIMELINE_CALLBACK - std::cerr << "R" << std::endl; redraw(); -#endif - } - else - { -#ifdef DEBUG_TIMELINE_CALLBACK - std::cerr << "." << std::endl; -#endif } } Fl::repeat_timeout(kTimeout, (Fl_Timeout_Handler)timerEvent_cb, this); @@ -1570,6 +1541,13 @@ namespace mrv edit_move_clip_annotations(moves, p.ui); } + void TimelineWidget::_tickEvent() + { + TLRENDER_P(); + ui::TickEvent tickEvent(p.style, p.iconLibrary, p.fontSystem); + _tickEvent(_p->timelineWindow, true, true, tickEvent); + } + void TimelineWidget::_tickEvent( const std::shared_ptr& widget, bool visible, bool enabled, const ui::TickEvent& event) @@ -1603,6 +1581,15 @@ namespace mrv return out; } + void TimelineWidget::_sizeHintEvent() + { + TLRENDER_P(); + const float devicePixelRatio = this->pixels_per_unit(); + ui::SizeHintEvent sizeHintEvent( + p.style, p.iconLibrary, p.fontSystem, devicePixelRatio); + _sizeHintEvent(p.timelineWindow, sizeHintEvent); + } + void TimelineWidget::_sizeHintEvent( const std::shared_ptr& widget, const ui::SizeHintEvent& event) @@ -1614,6 +1601,20 @@ namespace mrv widget->sizeHintEvent(event); } + void TimelineWidget::_setGeometry() + { + TLRENDER_P(); + const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h())); + p.timelineWindow->setGeometry(geometry); + } + + void TimelineWidget::_clipEvent() + { + TLRENDER_P(); + const math::Box2i geometry(0, 0, _toUI(w()), _toUI(h())); + _clipEvent(p.timelineWindow, geometry, false); + } + void TimelineWidget::_clipEvent( const std::shared_ptr& widget, const math::Box2i& clipRect, bool clipped) diff --git a/mrv2/lib/mrvGL/mrvTimelineWidget.h b/mrv2/lib/mrvGL/mrvTimelineWidget.h index b515b31dd2..891e324c26 100644 --- a/mrv2/lib/mrvGL/mrvTimelineWidget.h +++ b/mrv2/lib/mrvGL/mrvTimelineWidget.h @@ -166,14 +166,19 @@ namespace mrv void _setTimeUnits(tl::timeline::TimeUnits); + void _tickEvent(); void _tickEvent( const std::shared_ptr&, bool visible, bool enabled, const ui::TickEvent&); bool _getSizeUpdate(const std::shared_ptr&) const; + void _sizeHintEvent(); void _sizeHintEvent( const std::shared_ptr&, const ui::SizeHintEvent&); + void _setGeometry(); + + void _clipEvent(); void _clipEvent( const std::shared_ptr&, const math::Box2i&, bool clipped); From 2a066e3818fa3efd32c7e9de82ab7f62b8e58af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Garramu=C3=B1o?= Date: Mon, 6 May 2024 15:20:58 -0300 Subject: [PATCH 4/4] Removed useless function. --- mrv2/lib/mrvGL/mrvTimelineWidget.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mrv2/lib/mrvGL/mrvTimelineWidget.h b/mrv2/lib/mrvGL/mrvTimelineWidget.h index 891e324c26..7b22aaba8b 100644 --- a/mrv2/lib/mrvGL/mrvTimelineWidget.h +++ b/mrv2/lib/mrvGL/mrvTimelineWidget.h @@ -145,9 +145,6 @@ namespace mrv void moveCallback(const std::vector&); protected: - void _initializeGL(); - void _initializeGLResources(); - int enterEvent(); int leaveEvent(); int mousePressEvent(); @@ -161,6 +158,8 @@ namespace mrv void timerEvent(); private: + void _initializeGL(); + void _createThumbnailWindow(); void _getThumbnailPosition(int& X, int& Y);