Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ggarra13/mrv2
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Mar 31, 2023
2 parents fd86f2f + 6e3aebc commit 7eab09c
Show file tree
Hide file tree
Showing 27 changed files with 323 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:

- name: Build mrv2
run: >
./runme.sh -v
./runme.sh -v clean
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/BuildFLTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include( ExternalProject )

# Stable TAG
set( FLTK_TAG 73a2ca5261ee7b0d0e33fc1e49611520d7b0e0cb )
set( FLTK_TAG 64ac7b47b81549bce8911422209c81b77a9232ba )
#set( FLTK_TAG master )


Expand All @@ -16,7 +16,7 @@ if (APPLE OR WIN32)
set( pango OFF )
else()
set( wayland ON ) # we'll leave it on, but it is way too
# buggy with Nvidia cards.
# buggy with, at least, Nvidia cards.
set( pango ON )
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function( is_system_lib TARGET ISSYSLIB )
#
# List of system libraries that should not be distributed
#
set( _syslibs libOpenGL libGL libEGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm librt libdl libxcb libasound libgpg-error libfontconfig libfreetype libxshmfence libc libstdc libgcc_s libselinux ld-linux )
set( _syslibs ld-linux libasound libc libdl libharfbuzz libfontconfig libfreetype libgcc_s libgpg-error libEGL libGL libGLdispatch libGLX libX nvidia libdrm2 libpthread libresolv libm libOpenGL libpulse libpulse-simple librt libselinux libxcb libxshmfence libstdc libz )


set( ${ISSYSLIB} 0 PARENT_SCOPE)
Expand Down
24 changes: 9 additions & 15 deletions mrv2/bin/environment.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,15 @@ export PYTHONPATH="${dir}/lib/@MRV2_PYTHON_VERSION@:/usr/local/lib64/@MRV2_PYTHO
# as Wayland is still too buggy.
#
if [[ "$XDG_SESSION_TYPE" == "wayland" && "$FLTK_BACKEND" == "" ]]; then
gfx_card=`lspci -k | grep -EA3 'VGA|3D|Display' | grep nvidia_drm`
if [[ $gfx_card != "" ]]; then
echo " Wayland support with NVidia drivers is currently buggy."
echo " If you still want to run FLTK applications with Wayland,"
echo " set the environment variable FLTK_BACKEND to wayland, like:"
echo " Wayland support is currently beta."
echo " If you still want to run FLTK applications with Wayland,"
echo " set the environment variable FLTK_BACKEND to wayland, like:"
echo ""
echo " export FLTK_BACKEND=wayland"
echo ""
if [[ "$FLTK_BACKEND" == "" ]]; then
echo " Setting the environment variable FLTK_BACKEND=x11."
echo ""
echo " export FLTK_BACKEND=wayland"
echo ""
if [[ "$FLTK_BACKEND" == "" ]]; then
echo " Setting the environment variable FLTK_BACKEND=x11."
echo ""
echo " However, we recommend you log in into an X11 server or"
echo " use the Xorg.org noveau drivers instead."
echo ""
export FLTK_BACKEND=x11
fi
export FLTK_BACKEND=x11
fi
fi
24 changes: 18 additions & 6 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
v0.3.8
------
- Added Python Doxygen documentation.
- Documented C++ code a lot.
- Changed language handling in preferences. Now the locale code is stored.
- Removed all languages except for English and Spanish. Note that on Windows,
if you had Spanish selected, it will revert to English. You will need to
change it once again.
- Added reporting of memory use to HUD.
- Added Chache in Gigabytes to Settings menu. When this is non-zero the
- Added Cache in Gigabytes to Settings Panel. When this is non-zero the
Read Ahead and the Read Behind are calculated automatically based on
the Gigabytes number set here. It divides it by image size, pixel type and
number of active movies.
the Gigabytes number set here. It divides it by image size, pixel type,
fps and number of active movies. It also takes into account audio, but
poorly.
- Fixed a resizing issue on Python Panel, not resizing the tile group.
- Documented Python API in both English and Spanish.
- Documented Python API in both English and Spanish, with Search browser.
- Fixed sorting of recent files so that they don't change order.
- Fixed reccent files to not list files that cannot be found on disk.
- Made recent files list the files in order of how they were loaded, with last
loaded first.
- Fixed original pixel lookups on clips that have a pixel aspect ratio != 1.0.
- Fixed original pixel lookups on YUV420P_U16, YUV444P_U16 format.
Missing testing YUV422P_U16, but it should work.
- Made audio volume and audio mute / track selection not active if the clip
has no audio.
- Added number of Cache Ahead and Behind Video and Audio frames to HUD.
If Ahead Video cache becomes 0 when playing forwards, playback will stop.
- Fixed Text tool input on Wayland.
- Removed libharfbuzz from the Linux distribution as it was causing trouble
with some newer Linux distros.
- Added a Render->Black Background option to quickly switch from a gray
background to a black background on images or movies that have an alpha
channel.

v0.3.7
------
Expand Down
13 changes: 7 additions & 6 deletions mrv2/lib/mrvApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,23 +1042,24 @@ namespace mrv
const auto& video = ioInfo.video[0];
auto pixelType = video.pixelType;
std::size_t size = imaging::getDataByteCount(video);
double frames = bytes / (double)size;
double frames = bytes / static_cast<double>(size);
seconds = frames / player->defaultSpeed();
}
if (ioInfo.audio.isValid())
{
const auto& audio = ioInfo.audio;
size_t channelCount = audio.channelCount;
size_t byteCount = audio::getByteCount(audio.dataType);
size_t sampleRate = audio.sampleRate;
std::size_t channelCount = audio.channelCount;
std::size_t byteCount = audio::getByteCount(audio.dataType);
std::size_t sampleRate = audio.sampleRate;
uint64_t size = sampleRate * byteCount * channelCount;
seconds -= size / 1024.0 / 1024.0;
}

constexpr double defaultReadAhead =
timeline::PlayerCacheOptions().readAhead.value();
constexpr double defaultReadBehind =
timeline::PlayerCacheOptions().readBehind.value();
// 0.5 creates stutters on macOS audio:
// timeline::PlayerCacheOptions().readBehind.value();
constexpr double defaultReadBehind = 1.0;
constexpr double totalTime = defaultReadAhead + defaultReadBehind;
constexpr double readAhead = defaultReadAhead / totalTime;
constexpr double readBehind = defaultReadBehind / totalTime;
Expand Down
39 changes: 24 additions & 15 deletions mrv2/lib/mrvApp/mrvMainControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ namespace mrv
c->uiFrame->activate();
c->uiStartFrame->activate();
c->uiEndFrame->activate();
c->uiVolume->activate();
c->uiAudioTracks->activate();
c->uiFPS->activate();
c->uiStartButton->activate();
c->uiEndButton->activate();
Expand Down Expand Up @@ -198,22 +196,33 @@ namespace mrv
const auto timeline = player->timeline();
const auto ioinfo = timeline->getIOInfo();
const auto audio = ioinfo.audio;
const auto name = audio.name;
int mode = FL_MENU_RADIO;
c->uiAudioTracks->add(_("Mute"), 0, 0, 0, mode);
int idx = c->uiAudioTracks->add(
name.c_str(), 0, 0, 0, mode | FL_MENU_VALUE);
if (audio.isValid())
{
const auto name = audio.name;
int mode = FL_MENU_RADIO;
c->uiAudioTracks->add(_("Mute"), 0, 0, 0, mode);
int idx = c->uiAudioTracks->add(
name.c_str(), 0, 0, 0, mode | FL_MENU_VALUE);

c->uiVolume->activate();
c->uiAudioTracks->activate();

if (player->isMuted())
{
c->uiAudioTracks->value(0);
}
c->uiAudioTracks->do_callback();
c->uiAudioTracks->redraw();

if (player->isMuted())
// Set the audio volume
c->uiVolume->value(player->volume());
c->uiVolume->redraw();
}
else
{
c->uiAudioTracks->value(0);
delete c->uiAudioTracks->image();
c->uiAudioTracks->image(mrv::load_svg("Mute.svg"));
}
c->uiAudioTracks->do_callback();
c->uiAudioTracks->redraw();

// Set the audio volume
c->uiVolume->value(player->volume());
c->uiVolume->redraw();
}
else
{
Expand Down
15 changes: 14 additions & 1 deletion mrv2/lib/mrvApp/mrvSettingsObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <tlCore/StringFormat.h>
#include <tlTimeline/TimelinePlayer.h>

#include "mrvCore/mrvMemory.h"

#include "mrvFl/mrvIO.h"

#include "mrvApp/mrvSettingsObject.h"
Expand All @@ -35,9 +37,20 @@ namespace mrv
{
TLRENDER_P();

uint64_t totalVirtualMem = 0;
uint64_t virtualMemUsed = 0;
uint64_t virtualMemUsedByMe = 0;
uint64_t totalPhysMem = 0;
uint64_t physMemUsed = 0;
uint64_t physMemUsedByMe = 0;
memory_information(
totalVirtualMem, virtualMemUsed, virtualMemUsedByMe, totalPhysMem,
physMemUsed, physMemUsedByMe);
totalPhysMem /= 1024;

p.defaultValues["Timeline/Thumbnails"] = 1;
p.defaultValues["Timeline/StopOnScrub"] = 0;
p.defaultValues["Cache/GBytes"] = 0;
p.defaultValues["Cache/GBytes"] = static_cast<int>(totalPhysMem / 2);
p.defaultValues["Cache/ReadAhead"] =
timeline::PlayerCacheOptions().readAhead.value();
p.defaultValues["Cache/ReadBehind"] =
Expand Down
7 changes: 5 additions & 2 deletions mrv2/lib/mrvCore/mrvHotkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace mrv

Hotkey kToggleOnePanelOnly(false, false, false, false, 'p');

Hotkey kToggleBlackBackground(false, false, false, false, 0);

Hotkey kFitScreen(false, false, false, false, 'f');
Hotkey kResizeMainWindow(false, false, false, true, 'w');
Hotkey kFitAll(false, false, false, false, 0);
Expand Down Expand Up @@ -127,8 +129,8 @@ namespace mrv
Hotkey kCircleMode(false, false, false, true, 'c');
Hotkey kTextMode(false, false, false, true, 't');

Hotkey kPenSizeMore(false, false, false, false, 0, "]");
Hotkey kPenSizeLess(false, false, false, false, 0, "[");
Hotkey kPenSizeMore(false, false, false, false, 0, "+");
Hotkey kPenSizeLess(false, false, false, false, 0, "-");

Hotkey kUndoDraw(false, true, false, false, 'z');
Hotkey kRedoDraw(false, true, false, true, 'z');
Expand Down Expand Up @@ -385,6 +387,7 @@ namespace mrv
HotkeyEntry(_("Gamma Less"), kGammaLess),
HotkeyEntry(_("Set In Point"), kSetInPoint),
HotkeyEntry(_("Set Out Point"), kSetOutPoint),
HotkeyEntry(_("Toggle Black Background"), kToggleBlackBackground, true),
HotkeyEntry(_("Toggle One Panel Only"), kToggleOnePanelOnly),
HotkeyEntry(_("Toggle Files Panel"), kToggleReel),
HotkeyEntry(_("Toggle Media Info Panel"), kToggleMediaInfo),
Expand Down
5 changes: 4 additions & 1 deletion mrv2/lib/mrvCore/mrvHotkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ namespace mrv
extern Hotkey kFitAll;
extern Hotkey kTextureFiltering;

// @todo:
extern Hotkey kSafeAreas;

// @todo:
extern Hotkey kDisplayWindow;
extern Hotkey kDataWindow;

extern Hotkey kToggleBlackBackground;

extern Hotkey kCompareWipe;
extern Hotkey kCompareOverlay;
extern Hotkey kCompareDifference;
Expand Down
Loading

0 comments on commit 7eab09c

Please sign in to comment.