From: Good Guy Date: Fri, 3 May 2019 01:50:29 +0000 (-0600) Subject: build tweaks for fc30, glFinish fix X-Git-Tag: 2019-08~59 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=017728ea68874203d45b3f16050626d540608e35;p=goodguy%2Fcinelerra.git build tweaks for fc30, glFinish fix --- diff --git a/cinelerra-5.1/blds/bld_prepare.sh b/cinelerra-5.1/blds/bld_prepare.sh index 7c1eec81..b82c5169 100755 --- a/cinelerra-5.1/blds/bld_prepare.sh +++ b/cinelerra-5.1/blds/bld_prepare.sh @@ -35,6 +35,9 @@ case "$dir" in yum -y install /tmp/$yasm rm -f /tmp/$yasm ;; +#"fedora30") +# dnf group install "Development Tools" +# ... lzma-sdk-devel ... "fedora") dnf install groups "Development Tools" dnf -y --best --allowerasing \ @@ -51,7 +54,7 @@ case "$dir" in ivtv-firmware libvorbis-devel texinfo xz-devel lzma-devel cmake git \ ctags patch gcc-c++ perl-XML-XPath libtiff-devel python dvdauthor \ gettext-devel inkscape udftools autoconf automake numactl-devel \ - jbigkit-devel libvdpau-devel libva-devel gtk2-devel + jbigkit-devel libvdpau-devel libva-devel gtk2-devel mesa-vdpau-drivers ;; "suse" | "leap") zypper -n install nasm gcc gcc-c++ zlib-devel texinfo libpng16-devel \ diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index d536cb1f..707c95c0 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -731,7 +731,6 @@ void Canvas::create_canvas() int video_on = 0; lock_canvas("Canvas::create_canvas"); - if(!get_fullscreen()) // Enter windowed { @@ -891,7 +890,6 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) if( use_opengl ) { get_canvas()->unlock_window(); unlock_canvas(); - mwindow->playback_3d->copy_from(this, refresh_frame, output_frame, 0); lock_canvas(" Canvas::output_refresh"); get_canvas()->lock_window(" Canvas::output_refresh"); diff --git a/cinelerra-5.1/cinelerra/cwindowgui.C b/cinelerra-5.1/cinelerra/cwindowgui.C index b62bd09b..7b3e9198 100644 --- a/cinelerra-5.1/cinelerra/cwindowgui.C +++ b/cinelerra-5.1/cinelerra/cwindowgui.C @@ -1128,20 +1128,11 @@ void CWindowCanvas::draw_refresh(int flush) if( get_canvas() && !get_canvas()->get_video_on() ) { clear(0); if( mwindow->uses_opengl() ) { - get_canvas()->unlock_window(); - get_canvas()->flush(); - get_canvas()->sync_display(); // this code is to idle rendering before drawing overlays on refresh frame // if this is not done, occationally opengl finishs late, and overwrites // the x11 refresh frame and the overlay is not visible. Rarely happens. -// bug in gl libs may segv if glfinish is called, workaround is no finish - static int cin_finish = -1; - if( cin_finish < 0 ) { - const char *cp = getenv("CIN_FINISH"); - cin_finish = !cp ? 1 : atoi(cp); - } - if( cin_finish ) - mwindow->playback_3d->finish_output(); + get_canvas()->unlock_window(); + mwindow->playback_3d->finish_output(this); get_canvas()->lock_window("CWindowCanvas::draw_refresh"); } if( refresh_frame && refresh_frame->get_w()>0 && refresh_frame->get_h()>0 ) { diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index e86eb4b8..d563ca69 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -3629,9 +3629,7 @@ void MWindow::update_project(int load_mode) gui->unlock_window(); init_brender(); - cwindow->gui->lock_window("MWindow::update_project 1"); cwindow->update(0, 0, 1, 1, 1); - cwindow->gui->unlock_window(); if(debug) PRINT_TRACE diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index ebcaeb51..fc0ee88e 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1982,8 +1982,8 @@ void MWindow::redo_entry(BC_WindowBase *calling_window_gui) gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 1); gui->update_proxy_toggle(); gui->unlock_window(); - cwindow->update(1, 1, 1, 1, 1); cwindow->gui->unlock_window(); + cwindow->update(1, 1, 1, 1, 1); for( int i=0; i < vwindows.size(); ++i ) { if( vwindows.get(i)->is_running() ) { @@ -2257,8 +2257,8 @@ void MWindow::undo_entry(BC_WindowBase *calling_window_gui) gui->update(1, FORCE_REDRAW, 1, 1, 1, 1, 1); gui->update_proxy_toggle(); gui->unlock_window(); - cwindow->update(1, 1, 1, 1, 1); cwindow->gui->unlock_window(); + cwindow->update(1, 1, 1, 1, 1); for( int i=0; iis_running() ) { diff --git a/cinelerra-5.1/cinelerra/playback3d.C b/cinelerra-5.1/cinelerra/playback3d.C index 24f8cf70..0f5e84fe 100644 --- a/cinelerra-5.1/cinelerra/playback3d.C +++ b/cinelerra-5.1/cinelerra/playback3d.C @@ -769,16 +769,24 @@ void Playback3D::init_frame(Playback3DCommand *command, int is_yuv) } -void Playback3D::finish_output() +void Playback3D::finish_output(Canvas *canvas) { Playback3DCommand command; + command.canvas = canvas; command.command = Playback3DCommand::FINISH_OUTPUT; send_command(&command); } void Playback3D::finish_output_sync(Playback3DCommand *command) { - glFinish(); +#ifdef HAVE_GL + command->canvas->lock_canvas("Playback3D::clear_output_sync"); + if( command->canvas->get_canvas() ) { + command->canvas->get_canvas()->enable_opengl(); + glFinish(); + } + command->canvas->unlock_canvas(); +#endif } diff --git a/cinelerra-5.1/cinelerra/playback3d.h b/cinelerra-5.1/cinelerra/playback3d.h index 1f3dd59a..6a38d7aa 100644 --- a/cinelerra-5.1/cinelerra/playback3d.h +++ b/cinelerra-5.1/cinelerra/playback3d.h @@ -280,7 +280,7 @@ public: void clear_output(Canvas *canvas, VFrame *output); // Finish all active opengl requests - void finish_output(); + void finish_output(Canvas *canvas); void do_fade(Canvas *canvas, VFrame *frame, float fade); void convert_cmodel(Canvas *canvas, VFrame *output, int dst_cmodel); diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index 52eab8b9..97fe7a27 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -3880,7 +3880,6 @@ int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode) delete video_cache; mwindow->cwindow->gui->lock_window("TrackCanvas::render_handle_frame 0"); Canvas *canvas = mwindow->cwindow->gui->canvas; - canvas->lock_canvas("TrackCanvas::render_handle_frame 1"); int w = canvas->w, h = canvas->h, w2 = w/2, h2 = h/2; int lx = 0, ly = h2/2, rx = w2, ry = h2/2; BC_WindowBase *window = canvas->get_canvas(); @@ -3889,7 +3888,6 @@ int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode) window->draw_vframe(&vlt, lx,ly, w2,h2, 0,0,vlt.get_w(),vlt.get_h()); window->draw_vframe(&vrt, rx,ry, w2,h2, 0,0,vrt.get_w(),vrt.get_h()); window->flash(1); - canvas->unlock_canvas(); mwindow->cwindow->gui->unlock_window(); break; } case 1: diff --git a/cinelerra-5.1/cinelerra/vdevicex11.C b/cinelerra-5.1/cinelerra/vdevicex11.C index c43f1c04..8cd64fe6 100644 --- a/cinelerra-5.1/cinelerra/vdevicex11.C +++ b/cinelerra-5.1/cinelerra/vdevicex11.C @@ -144,8 +144,11 @@ int VDeviceX11::close_all() if( output_frame ) { output->update_refresh(device, output_frame); // if the last frame is good, don't draw over it - if( !video_on || output->need_overlays() ) + if( !video_on || output->need_overlays() ) { + output->unlock_canvas(); output->draw_refresh(1); + output->lock_canvas("VDeviceX11::close_all 2"); + } } } diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index bb41ed93..408ed8e7 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -11,7 +11,9 @@ AC_PROG_CXX CFG_CFLAGS+=" -fno-omit-frame-pointer -fno-math-errno -fno-signed-zeros" CFG_CFLAGS+=" -pthread -Wall" # misguided pedantic warnings +# this is extra work, not a gain... CFG_CFLAGS+=" -Wno-unknown-warning" +CFG_CFLAGS+=" -Wno-attributes" CFG_CFLAGS+=" -Wno-unused-result" CFG_CFLAGS+=" -Wno-stringop-overflow" CFG_CFLAGS+=" -Wno-format-truncation"