Skip to content

Commit

Permalink
Merge branch 'beta' of github.com:ggarra13/mrv2 into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Feb 27, 2024
2 parents d7a545a + 10f038a commit 3296e56
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 57 deletions.
4 changes: 4 additions & 0 deletions mrv2/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ v1.0.7
- Fixed saving a movie with annotations when the movie is bigger than the
viewport.
- Added GBR8/9/10/12 reading support for VPX.
- Fixed start and end timeline buttons not refreshing thumbnails in the Panels.
- Fixed image panel not refreshing its information when changing images and
the playback was stopped.
- Fixed Preferences->Positioning->Position/Size when both were used.


v1.0.6
Expand Down
3 changes: 2 additions & 1 deletion mrv2/lib/mrvCore/mrvFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ namespace mrv
}
return true;
}

} // namespace file

} // namespace mrv
3 changes: 1 addition & 2 deletions mrv2/lib/mrvCore/mrvFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ namespace mrv
*
* @return true if it exists and is readable, false if not.
*/
bool isReadable(const fs::path& p);

bool isReadable(const fs::path& path);

//! Returns an NDI filename for the current process
std::string NDI(ViewerUI* ui);
Expand Down
65 changes: 43 additions & 22 deletions mrv2/lib/mrvFl/mrvSaveMovie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ namespace mrv
view->flush();
Fl::check();
const auto& viewportSize = view->getViewportSize();
math::Size2i outputSize;
if (viewportSize.w >= renderSize.w &&
viewportSize.h >= renderSize.h)
{
Expand All @@ -301,33 +302,57 @@ namespace mrv
// flush is needed
Fl::flush();

X = (viewportSize.w - renderSize.w) / 2;
Y = (viewportSize.h - renderSize.h) / 2;
outputInfo.size = renderSize;
}
else
{
LOG_WARNING(_("Image too big for annotations. "
"Will scale to the viewport size."));

view->frameView();
renderSize.w = viewportSize.w;
renderSize.h = viewportSize.h;
outputInfo.size = renderSize;
LOG_WARNING(_("Image too big. "
"Will save the viewport size."));


double viewportRatio =
viewportSize.w /
static_cast<double>(viewportSize.h);
double imageRatio =
renderSize.w /
static_cast<double>(renderSize.h);

if (imageRatio < viewportRatio)
{
double factor = viewportSize.h /
static_cast<double>(renderSize.h);
outputInfo.size.w =
std::round(renderSize.w * factor);
outputInfo.size.h = viewportSize.h;
}
else
{
double factor = viewportSize.w /
static_cast<double>(renderSize.w);
outputInfo.size.h =
std::round(renderSize.h * factor);
outputInfo.size.w = viewportSize.w;
}
}

X = (viewportSize.w - outputInfo.size.w) / 2;
Y = (viewportSize.h - outputInfo.size.h) / 2;

std::string msg =
tl::string::Format(
_("Viewport Size: {0} Render Size: {1}"))
.arg(viewportSize)
.arg(renderSize);
LOG_INFO(msg);

msg = tl::string::Format("viewZoom: {2} X: {3} Y: {4}")
.arg(view->viewZoom())
.arg(X)
.arg(Y);
_("Viewport Size: {0} "))
.arg(viewportSize);
LOG_INFO(msg);
}


msg = tl::string::Format(_("Output info: {0} {1}"))
.arg(outputInfo.size)
.arg(outputInfo.pixelType);
LOG_INFO(msg);

outputInfo = writerPlugin->getWriteInfo(outputInfo);
if (image::PixelType::None == outputInfo.pixelType)
{
Expand Down Expand Up @@ -355,12 +380,6 @@ namespace mrv
image::PixelType::RGB_F32;
}


msg = tl::string::Format(_("Output info: {0} {1}"))
.arg(outputInfo.size)
.arg(outputInfo.pixelType);
LOG_INFO(msg);

outputImage = image::Image::create(outputInfo);
ioInfo.videoTime = videoTime;
ioInfo.video.push_back(outputInfo);
Expand Down Expand Up @@ -479,6 +498,8 @@ namespace mrv

while (running)
{
context->tick();

// If progress window is closed, exit loop.
if (!progress.tick())
break;
Expand Down
12 changes: 0 additions & 12 deletions mrv2/lib/mrvGL/mrvGLViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,6 @@ namespace mrv
CHECK_GL;
}

// Refresh media info panel if there's data window present
if (panel::imageInfoPanel && !p.videoData.empty() &&
!p.videoData[0].layers.empty() &&
p.videoData[0].layers[0].image)
{
const auto& tags =
p.videoData[0].layers[0].image->getTags();
image::Tags::const_iterator i = tags.find("Data Window");
if (i != tags.end())
panel::imageInfoPanel->refresh();
}

if (p.dataWindow)
_drawDataWindow();
CHECK_GL;
Expand Down
24 changes: 21 additions & 3 deletions mrv2/lib/mrvGL/mrvTimelineViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,29 @@ namespace mrv
p.lastVideoData = value;
}
}


}

// Refresh media info panel if there's data window present
if (panel::imageInfoPanel && !p.videoData.empty() &&
!p.videoData[0].layers.empty() &&
p.videoData[0].layers[0].image)
{
bool refresh = false;
if (sender->playback() == timeline::Playback::Stop)
refresh = true;

const auto& tags =
p.videoData[0].layers[0].image->getTags();
image::Tags::const_iterator i = tags.find("Data Window");
if (i != tags.end())
refresh = true;

if (refresh)
panel::imageInfoPanel->refresh();
}

if (p.selection.max.x != -1)
{
if (!value.layers.empty())
Expand Down Expand Up @@ -1130,9 +1151,6 @@ namespace mrv
{
posX = (int)uiPrefs->uiWindowXPosition->value();
posY = (int)uiPrefs->uiWindowYPosition->value();

maxW = maxW - posX + minx;
maxH = maxH - posY + miny;
}
else
{
Expand Down
5 changes: 2 additions & 3 deletions mrv2/lib/mrvPanels/mrvImageInfoPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,6 @@ namespace mrv
char buf[1024];
m_curr = add_browser(m_image);

DBGM1("m_curr=" << m_curr);
const auto tplayer = player->player();
if (!tplayer)
return;
Expand All @@ -1695,7 +1694,7 @@ namespace mrv

const auto path = player->path();
const auto directory = path.getDirectory();

const auto audioPath = player->audioPath();
const otime::RationalTime& time = player->currentTime();

Expand Down Expand Up @@ -1793,7 +1792,7 @@ namespace mrv
const auto& size = video.size;

add_text(_("Name"), _("Name"), video.name);

if (videoData.size() > i && !videoData[i].layers.empty() &&
videoData[i].layers[0].image)
{
Expand Down
12 changes: 5 additions & 7 deletions mrv2/lib/mrvWidgets/mrViewer.fl
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,8 @@ ui->uiView->take_focus();}
label {@|<}
user_data this user_data_type {ViewerUI*}
callback {const auto& player = ui->uiView->getTimelinePlayer();
if (!player) return;
const auto& timeRange = player->inOutRange();
player->seek( timeRange.start_time() );}
if (!player) return;
player->start();}
tooltip {Go to the beginning of the sequence.} xywh {102 3 28 24} labelcolor 19
class {mrv::Button}
}
Expand Down Expand Up @@ -522,9 +521,8 @@ ui->uiView->take_focus();}
label {@>|}
user_data this user_data_type {ViewerUI*}
callback {const auto& player = ui->uiView->getTimelinePlayer();
if (!player) return;
const auto& timeRange = player->inOutRange();
player->seek( timeRange.end_time_inclusive() );}
if (!player) return;
player->end();} selected
tooltip {Go to the end of the sequence.} xywh {270 3 28 24} labelcolor 19
class {mrv::Button}
}
Expand Down Expand Up @@ -553,7 +551,7 @@ ui->uiMain->fill_menu( ui->uiMenuBar );
auto player = ui->uiView->getTimelinePlayer();
if( !player ) return;

player->setLoop( loop );} selected
player->setLoop( loop );}
tooltip {Looping mode (Loop, Once, Ping-Pong)} xywh {309 3 24 24} labelcolor 19
code0 {o->image( mrv::load_svg( "LoopMode.svg" ) );}
class {mrv::StateButton}
Expand Down
7 changes: 2 additions & 5 deletions mrv2/lib/mrvWidgets/mrvSaveMovieOptionsUI.fl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class SaveMovieOptionsUI {open
} {
decl {bool cancel = false;} {public local
}
Function {SaveMovieOptionsUI(bool hasAudio = true, bool audioOnly = false)} {open
} {
Function {SaveMovieOptionsUI(bool hasAudio = true, bool audioOnly = false)} {} {
Fl_Window uiMain {
label {Save Movie Options} open
xywh {729 146 465 537} type Double align 0 modal visible
Expand Down Expand Up @@ -444,11 +443,9 @@ std::string codec = item->label();
v->clear();


if (codec == "None" || codec == "MJPEG")
if (codec == "None" || codec == "MPEG4")
{
v->add("YUV_420P");
v->add("YUV_422P");
v->add("YUV_444P");
}
else if (codec == "H264")
{
Expand Down
2 changes: 1 addition & 1 deletion mrv2/presets/none-worst.pst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# These settings were provided by https://academysoftwarefoundation.github.io/EncodingGuidelines/EncodeProres.html
# These settings were provided by ChatGPT.
qscale:31
2 changes: 1 addition & 1 deletion tlRender

0 comments on commit 3296e56

Please sign in to comment.