bg/clr color tweaks, clear borders rework, fc31 depends
authorGood Guy <[email protected]>
Wed, 6 Nov 2019 23:00:38 +0000 (16:00 -0700)
committerGood Guy <[email protected]>
Wed, 6 Nov 2019 23:00:38 +0000 (16:00 -0700)
cinelerra-5.1/blds/bld_prepare.sh
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/canvas.h
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/playback3d.C
cinelerra-5.1/cinelerra/playbackengine.C
cinelerra-5.1/cinelerra/playbackengine.h
cinelerra-5.1/cinelerra/vdevicex11.C

index 9c6f2dcdbbeccf378d895da099c727cc96c4d27d..0064bdfb758268661c3600fe99afa780a973b807 100755 (executable)
@@ -39,7 +39,7 @@ case "$dir" in
 #  dnf group install "Development Tools"
 #  ... lzma-sdk-devel libtool ...
 "fedora")
-  dnf install groups "Development Tools"
+  dnf group install "Development Tools"
   dnf -y --best --allowerasing \
     install nasm yasm libavc1394-devel libusbx-devel flac-devel \
     libjpeg-devel libdv-devel libdvdnav-devel libdvdread-devel \
@@ -51,7 +51,7 @@ case "$dir" in
     libpng-devel bzip2-devel zlib-devel kernel-headers libavc1394 \
     festival-devel libdc1394-devel libiec61883-devel esound-devel \
     flac-devel libsndfile-devel libtheora-devel linux-firmware \
-    ivtv-firmware libvorbis-devel texinfo xz-devel lzma-devel cmake git \
+    ivtv-firmware libvorbis-devel texinfo xz-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 mesa-vdpau-drivers
index 125472aeec3b643daf2465b62497538326ab3e27..cd59b62ce7d12c03bf33d9bbcd42eb737016775e 100644 (file)
@@ -898,17 +898,61 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame)
 
 void Canvas::clear(int flash)
 {
-       BC_WindowBase *cwdw = get_canvas();
-       if( !cwdw )  return;
-       cwdw->set_bg_color(get_clear_color());
-       cwdw->clear_box(0,0, cwdw->get_w(), cwdw->get_h());
-       if( flash ) cwdw->flash();
+       BC_WindowBase *window = get_canvas();
+       if( !window ) return;
+       window->set_bg_color(get_clear_color());
+       window->clear_box(0,0, window->get_w(), window->get_h());
+       if( flash ) window->flash();
+}
+
+void Canvas::clear_borders(EDL *edl)
+{
+       BC_WindowBase *window = get_canvas();
+       if( !window ) return;
+
+       int window_w = window->get_w();
+       int window_h = window->get_h();
+       float output_x1,output_y1, output_x2,output_y2;
+       float canvas_x1,canvas_y1, canvas_x2,canvas_y2;
+       get_transfers(edl,
+               output_x1, output_y1, output_x2, output_y2,
+               canvas_x1, canvas_y1, canvas_x2, canvas_y2);
+       int color = get_clear_color();
+       window->set_color(color);
+
+       if( canvas_y1 > 0 ) {
+               window->draw_box(0, 0, window_w, canvas_y1);
+               window->flash(0, 0, window_w, canvas_y1);
+       }
+
+       if( canvas_y2 < window_h ) {
+               window->draw_box(0, canvas_y2, window_w, window_h-canvas_y2);
+               window->flash(0, canvas_y2, window_w, window_h-canvas_y2);
+       }
+
+       if( canvas_x1 > 0 ) {
+               window->draw_box(0, canvas_y1, canvas_x1, canvas_y2-canvas_y1);
+               window->flash(0, canvas_y1, canvas_x1, canvas_y2-canvas_y1);
+       }
+
+       if( canvas_x2 < window_w ) {
+               window->draw_box(canvas_x2, canvas_y1,
+                       window_w-canvas_x2, canvas_y2-canvas_y1);
+               window->flash(canvas_x2, canvas_y1,
+                       window_w-canvas_x2, canvas_y2-canvas_y1);
+       }
 }
 
+int Canvas::get_clear_color()
+{
+       BC_WindowBase *cwdw = get_canvas();
+       if( !cwdw ) return 0;
+       return cwdw->get_bg_color();
+}
 
 CanvasOutput::CanvasOutput(Canvas *canvas,
     int x, int y, int w, int h)
- : BC_SubWindow(x, y, w, h, BLACK)
+ : BC_SubWindow(x, y, w, h, canvas->get_clear_color())
 {
        this->canvas = canvas;
 }
@@ -950,7 +994,7 @@ int CanvasOutput::keypress_event()
 
 
 CanvasFullScreen::CanvasFullScreen(Canvas *canvas, int w, int h)
- : BC_FullScreen(canvas->subwindow, w, h, BLACK, 0, 0, 0)
+ : BC_FullScreen(canvas->subwindow, w, h, canvas->get_clear_color(), 0, 0, 0)
 {
        this->canvas = canvas;
 }
index 53f6ee8b1b4f9672c92c41495ca3f4a78d94a677..8d30dcccd19c77f6edfaca718d6a6887cd76efbc 100644 (file)
@@ -86,7 +86,7 @@ public:
        virtual void toggle_controls() {}
        virtual int get_cwindow_controls() { return 0; }
        virtual int get_fullscreen();
-       virtual int get_clear_color() { return 0; }
+       virtual int get_clear_color();
        virtual void set_fullscreen(int value);
 
        int cursor_leave_event_base(BC_WindowBase *caller);
@@ -123,6 +123,7 @@ public:
 // Updates the stores
        virtual void update_zoom(int x, int y, float zoom) {};
        void check_boundaries(EDL *edl, int &x, int &y, float &zoom);
+       void clear_borders(EDL *edl);
        void update_scrollbars(int flush);
 // Get scrollbar positions relative to output.
 // No correction is done if output is smaller than canvas
index 13ac058bbfe60677e242d9337030a106907fb786..ebc6997e248fb7700d7948e23a9344b5933e6173 100644 (file)
@@ -3535,7 +3535,7 @@ int CWindowCanvas::get_cwindow_controls()
 int CWindowCanvas::get_clear_color()
 {
        int color = mwindow->edl->session->cwindow_clear_color;
-       if( color < 0 ) color = get_canvas()->get_bg_color();
+       if( color < 0 ) color = Canvas::get_clear_color();
        return color;
 }
 
index 1844f808ef3aade81a87ecdf28f54049a4f01961..295ce6fe0a028816217b90f020572eb9a1f715b7 100644 (file)
@@ -728,7 +728,11 @@ void Playback3D::draw_output(Playback3DCommand *command, int flip_y)
                if(!command->is_cleared)
                {
 // If we get here, the virtual console was not used.
-                       color_frame(command, 0,0,0,0);
+                       int color = command->canvas->get_clear_color();
+                       int r = (color>>16) & 0xff; // always rgb
+                       int g = (color>>8) & 0xff;
+                       int b = (color>>0) & 0xff;
+                       color_frame(command, r/255.f, g/255.f, b/255.f, 0.f);
                }
 
 // Texture
@@ -802,11 +806,14 @@ void Playback3D::clear_output_sync(Playback3DCommand *command)
 // Using pbuffer for refresh frame.
                if( command->frame ) {
                        command->frame->enable_opengl();
+                       command->frame->set_opengl_state(VFrame::SCREEN);
                        color = command->frame->get_clear_color();
                        alpha = command->frame->get_clear_alpha();
                        int color_model = command->canvas->mwindow->edl->session->color_model;
                        is_yuv = BC_CModels::is_yuv(color_model);
                }
+               else
+                       color = command->canvas->get_clear_color();
                int a = alpha;
                int r = (color>>16) & 0xff;
                int g = (color>>8) & 0xff;
index fcbeeb1d083bc79df2b01ccf077eef8a3fc04ed3..917e0470b2fd19914e36215d9e8e32cd76d973c0 100644 (file)
@@ -41,6 +41,8 @@
 #include "mainsession.h"
 #include "trackcanvas.h"
 #include "transportque.h"
+#include "videodevice.h"
+#include "vdevicex11.h"
 #include "vrender.h"
 
 
@@ -412,11 +414,7 @@ void PlaybackEngine::run()
 // Start tracking after arming so the tracking position doesn't change.
 // The tracking for a single frame command occurs during PAUSE
                        init_tracking();
-                       if( !command->single_frame() ) {
-                               EDL *edl = command->get_edl();
-                               if( edl && edl->tracks->playable_video_tracks() )
-                                       clear_output();
-                       }
+                       clear_borders();
 // Dispatch the command
                        start_render_engine();
                        break;
@@ -425,13 +423,22 @@ void PlaybackEngine::run()
        }
 }
 
-void PlaybackEngine::clear_output()
+void PlaybackEngine::clear_borders()
 {
-       BC_WindowBase *cwdw = output->get_canvas();
-       if( !cwdw ) return;
-       cwdw->lock_window("PlaybackEngine::clear_output");
-       output->clear();
-       cwdw->unlock_window();
+       EDL *edl = command->get_edl();
+       if( render_engine ) {
+               PlaybackConfig *config = edl->session->playback_config;
+               if( config->vconfig->driver == PLAYBACK_X11_GL ) {
+                       VDeviceBase *vdriver = render_engine->video->get_output_base();
+                       ((VDeviceX11*)vdriver)->clear_output();
+                       return;
+               }
+       }
+       BC_WindowBase *window = output->get_canvas();
+       if( !window ) return;
+       window->lock_window("PlaybackEngine::clear_output");
+       output->clear_borders(edl);
+       window->unlock_window();
 }
 
 void PlaybackEngine::stop_playback(int wait_tracking)
index 048dc7a206fa5b9cf2fdcbd1156a344030665fbe..ed646b06e2d3fbd74c269eb1834f67c33476c202 100644 (file)
@@ -55,7 +55,7 @@ public:
        void create_cache();
        void perform_change();
        void sync_parameters(EDL *edl);
-       void clear_output();
+       void clear_borders();
 // Set wait_tracking for events that change the cursor location but
 // be sure to unlock the windows
        void interrupt_playback(int wait_tracking = 0);
index 24d1be0268fb34fd6937afa1db11f4c756df2429..8db5af1fcd224da092a316df9561168ed9a89078 100644 (file)
@@ -283,35 +283,8 @@ void VDeviceX11::new_output_buffer(VFrame **result, int file_colormodel, EDL *ed
                                delete bitmap;        bitmap = 0;
                                delete output_frame;  output_frame = 0;
 // Clear borders if size changed
-                               if( size_change ) {
-//printf("VDeviceX11::new_output_buffer %d w=%d h=%d "
-// "canvas_x1=%d canvas_y1=%d canvas_x2=%d canvas_y2=%d\n",
-// __LINE__, // (int)output->w, (int)output->h,
-// (int)canvas_x1, (int)canvas_y1, (int)canvas_x2, (int)canvas_y2);
-                                       window->set_color(BLACK);
-
-                                       if( canvas_y1 > 0 ) {
-                                               window->draw_box(0, 0, output->w, canvas_y1);
-                                               window->flash(0, 0, output->w, canvas_y1);
-                                       }
-
-                                       if( canvas_y2 < output->h ) {
-                                               window->draw_box(0, canvas_y2, output->w, output->h - canvas_y2);
-                                               window->flash(0, canvas_y2, output->w, output->h - canvas_y2);
-                                       }
-
-                                       if( canvas_x1 > 0 ) {
-                                               window->draw_box(0, canvas_y1, canvas_x1, canvas_y2 - canvas_y1);
-                                               window->flash(0, canvas_y1, canvas_x1, canvas_y2 - canvas_y1);
-                                       }
-
-                                       if( canvas_x2 < output->w ) {
-                                               window->draw_box(canvas_x2, canvas_y1,
-                                                       output->w - canvas_x2, canvas_y2 - canvas_y1);
-                                               window->flash(canvas_x2, canvas_y1,
-                                                       output->w - canvas_x2, canvas_y2 - canvas_y1);
-                                       }
-                               }
+                               if( size_change )
+                                       output->clear_borders(edl);
                        }
                }
 
@@ -546,6 +519,7 @@ int VDeviceX11::write_buffer(VFrame *output_channels, EDL *edl)
 void VDeviceX11::clear_output()
 {
        is_cleared = 1;
+// clear front and back buffers
        output->mwindow->playback_3d->clear_output(output, 0);
        output->mwindow->playback_3d->clear_output(output, output_frame);
 }