X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fvdevicex11.C;h=9a67d238bf27337fda067745bd03d95f17605548;hp=ebdb520c57a7a7cfffd7915fa9b61d2d91b084ff;hb=ddfda6a8cc59bda4dc734973c1c5fecaa31ea487;hpb=307d7f624510fcca7a7f6c1e683796cb73637106 diff --git a/cinelerra-5.1/cinelerra/vdevicex11.C b/cinelerra-5.1/cinelerra/vdevicex11.C index ebdb520c..9a67d238 100644 --- a/cinelerra-5.1/cinelerra/vdevicex11.C +++ b/cinelerra-5.1/cinelerra/vdevicex11.C @@ -23,6 +23,7 @@ #include "autos.h" #include "bccapture.h" #include "bccmodels.h" +#include "bcdisplayinfo.h" #include "bcsignals.h" #include "canvas.h" #include "edl.h" @@ -51,6 +52,7 @@ VDeviceX11::VDeviceX11(VideoDevice *device, Canvas *output) { reset_parameters(); this->output = output; + opened = 0; } VDeviceX11::~VDeviceX11() @@ -90,7 +92,7 @@ int VDeviceX11::open_input() capture_bitmap->bars_on(SCREENCAP_PIXELS, SCREENCAP_COLOR, device->input_x, device->input_y, device->in_config->w, device->in_config->h); - + opened = 1; return 0; } @@ -105,6 +107,7 @@ int VDeviceX11::open_output() else output->start_single(); } + opened = 1; output->unlock_canvas(); return 0; } @@ -125,6 +128,7 @@ int VDeviceX11::output_visible() int VDeviceX11::close_all() { + if( !opened ) return 1; if( output ) { BC_WindowBase *window = output->lock_canvas("VDeviceX11::close_all"); @@ -145,12 +149,12 @@ int VDeviceX11::close_all() delete bitmap; bitmap = 0; delete output_frame; output_frame = 0; delete capture_bitmap; capture_bitmap = 0; + opened = 0; if( output ) output->unlock_canvas(); reset_parameters(); - return 0; } @@ -282,35 +286,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); } } @@ -545,6 +522,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); } @@ -580,6 +558,8 @@ void VDeviceX11::do_fade(VFrame *output_temp, float fade) bool VDeviceX11::can_mask(int64_t start_position_project, MaskAutos *keyframe_set) { + if( strncmp(BC_DisplayInfo::get_gl_shader_version(), "4.3", 3) < 0 ) + return 0; Auto *current = 0; MaskAuto *keyframe = (MaskAuto*)keyframe_set-> get_prev_auto(start_position_project, PLAY_FORWARD, current);