[Cin] current set of my patches
Andrew Randrianasulu
randrianasulu at gmail.com
Tue Jan 9 03:46:59 CET 2024
So, I tried to clarify a bit that we have display aspect ratio selectable,
updated cingg team copyright year, added even more finegrained sar/dar
reporting (guessed, container detected, codec detected).
I tried to use libavutil function for reporting SAR in setformat.C but it
need some dynamic gui subwindow/object, not static BCTitle... so just
prototype that does not update as you update window, only calculated on
window objects create time, so each time you reopen set format window.
3 new git diff patches hopefully for application
0003 should be applied on top of
0001-Add-guessed-detected-SAR-DAR-values-to-ffmpeg-asset-.patch
from another thread
one plain diff patch just for showing where SAR info might surface if I
ever learn now to create dynamic text subwindows :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240109/3f8fe0ac/attachment.htm>
-------------- next part --------------
diff --git a/cinelerra-5.1/cinelerra/setformat.C b/cinelerra-5.1/cinelerra/setformat.C
index 4d96a607..9de59765 100644
--- a/cinelerra-5.1/cinelerra/setformat.C
+++ b/cinelerra-5.1/cinelerra/setformat.C
@@ -45,6 +45,10 @@
#include "vwindow.h"
#include "vwindowgui.h"
+extern "C"
+{
+#include <libavutil/rational.h>
+}
SetFormat::SetFormat(MWindow *mwindow)
@@ -454,6 +458,21 @@ void SetFormatWindow::create_objects()
(ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
mwindow->theme->setformat_x4 + textbox->get_w(), y));
y += mwindow->theme->setformat_margin;
+
+
+ char sar_string[BCTEXTLEN];
+ float aspect_w = thread->new_settings->session->aspect_w;
+ float aspect_h = thread->new_settings->session->aspect_h;
+ int w = thread->dimension[0];
+ int h = thread->dimension[1];
+ int sar_num = (aspect_w/aspect_h)*w;
+ int sar_den = (aspect_w/aspect_h)*h;
+ int s_num = 0, s_den = 0;
+ int ret = av_reduce(&s_num, &s_den, sar_num, sar_den, 1000);
+ sprintf(sar_string, "SAR: %i:%i \n", s_num, s_den);
+ add_subwindow(new BC_Title(mwindow->theme->setformat_x3,
+ y,
+ (const char *)sar_string));
BC_OKTextButton *ok;
BC_CancelTextButton *cancel;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Clarify-in-setformat.C-that-we-have-Display-aspect-r.patch
Type: application/x-patch
Size: 922 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240109/3f8fe0ac/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Update-cingg-team-copyright-info-for-2024.patch
Type: application/x-patch
Size: 994 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240109/3f8fe0ac/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-diff-between-codec-sar-dar-and-container-sar-dar.patch
Type: application/x-patch
Size: 2667 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240109/3f8fe0ac/attachment-0002.bin>
More information about the Cin
mailing list