fix popup_menu icon placement, add layout_name feature, preset edit resize wdw fix...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vdevicex11.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2017 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "assets.h"
23 #include "autos.h"
24 #include "bccapture.h"
25 #include "bccmodels.h"
26 #include "bcsignals.h"
27 #include "canvas.h"
28 #include "edl.h"
29 #include "edlsession.h"
30 #include "file.h"
31 #include "maskauto.h"
32 #include "maskautos.h"
33 #include "mwindow.h"
34 #include "mwindowgui.h"
35 #include "playback3d.h"
36 #include "playbackconfig.h"
37 #include "preferences.h"
38 #include "recordconfig.h"
39 #include "strategies.inc"
40 #include "vdevicex11.h"
41 #include "vframe.h"
42 #include "videodevice.h"
43 #include "videowindow.h"
44 #include "videowindowgui.h"
45
46 #include <string.h>
47 #include <unistd.h>
48
49 VDeviceX11::VDeviceX11(VideoDevice *device, Canvas *output)
50  : VDeviceBase(device)
51 {
52         reset_parameters();
53         this->output = output;
54 }
55
56 VDeviceX11::~VDeviceX11()
57 {
58         close_all();
59 }
60
61 int VDeviceX11::reset_parameters()
62 {
63         output_frame = 0;
64         window_id = 0;
65         bitmap = 0;
66         bitmap_type = 0;
67         bitmap_w = 0;
68         bitmap_h = 0;
69         output_x1 = 0;
70         output_y1 = 0;
71         output_x2 = 0;
72         output_y2 = 0;
73         canvas_x1 = 0;
74         canvas_y1 = 0;
75         canvas_x2 = 0;
76         canvas_y2 = 0;
77         capture_bitmap = 0;
78         color_model_selected = 0;
79         is_cleared = 0;
80         return 0;
81 }
82
83 int VDeviceX11::open_input()
84 {
85 //printf("VDeviceX11::open_input 1\n");
86         capture_bitmap = new BC_Capture(device->in_config->w,
87                 device->in_config->h,
88                 device->in_config->screencapture_display);
89 //printf("VDeviceX11::open_input 2\n");
90         capture_bitmap->bars_on(SCREENCAP_PIXELS, SCREENCAP_COLOR,
91                 device->input_x, device->input_y,
92                 device->in_config->w, device->in_config->h);
93
94         return 0;
95 }
96
97 int VDeviceX11::open_output()
98 {
99         if( output ) {
100                 output->lock_canvas("VDeviceX11::open_output");
101                 output->get_canvas()->lock_window("VDeviceX11::open_output");
102                 if( !device->single_frame )
103                         output->start_video();
104                 else
105                         output->start_single();
106                 output->get_canvas()->unlock_window();
107
108 // Enable opengl in the first routine that needs it, to reduce the complexity.
109                 output->unlock_canvas();
110         }
111         return 0;
112 }
113
114
115 int VDeviceX11::output_visible()
116 {
117         if( !output ) return 0;
118
119         output->lock_canvas("VDeviceX11::output_visible");
120         if( output->get_canvas()->get_hidden() ) {
121                 output->unlock_canvas();
122                 return 0;
123         }
124         else {
125                 output->unlock_canvas();
126                 return 1;
127         }
128 }
129
130
131 int VDeviceX11::close_all()
132 {
133         if( output ) {
134                 output->lock_canvas("VDeviceX11::close_all 1");
135                 output->get_canvas()->lock_window("VDeviceX11::close_all 1");
136                 int video_on = output->get_canvas()->get_video_on();
137 // Update the status bug
138                 if( !device->single_frame ) {
139                         output->stop_video();
140                 }
141                 else {
142                         output->stop_single();
143                 }
144                 if( output_frame ) {
145                         output->update_refresh(device, output_frame);
146 // if the last frame is good, don't draw over it
147                         if( !video_on || output->need_overlays() )
148                                 output->draw_refresh(1);
149                 }
150         }
151
152         delete bitmap;          bitmap = 0;
153         delete output_frame;    output_frame = 0;
154         delete capture_bitmap;  capture_bitmap = 0;
155
156         if( output ) {
157                 output->get_canvas()->unlock_window();
158                 output->unlock_canvas();
159         }
160
161         reset_parameters();
162
163         return 0;
164 }
165
166 int VDeviceX11::read_buffer(VFrame *frame)
167 {
168         capture_bitmap->bars_reposition(
169                 device->input_x, device->input_y,
170                 device->in_config->w, device->in_config->h);
171
172         capture_bitmap->capture_frame(frame,
173                 device->input_x, device->input_y, device->do_cursor);
174         return 0;
175 }
176
177
178 int VDeviceX11::get_best_colormodel(Asset *asset)
179 {
180         return File::get_best_colormodel(asset, SCREENCAPTURE);
181 //      return BC_RGB888;
182 }
183
184
185 int VDeviceX11::get_display_colormodel(int file_colormodel)
186 {
187         int result = -1;
188
189         if( device->out_config->driver == PLAYBACK_X11_GL ) {
190                 if( file_colormodel == BC_RGB888 ||
191                     file_colormodel == BC_RGBA8888 ||
192                     file_colormodel == BC_YUV888 ||
193                     file_colormodel == BC_YUVA8888 ||
194                     file_colormodel == BC_RGB_FLOAT ||
195                     file_colormodel == BC_RGBA_FLOAT ) {
196                         return file_colormodel;
197                 }
198
199                 return BC_RGB888;
200         }
201
202         if( !device->single_frame ) {
203                 switch( file_colormodel ) {
204                 case BC_YUV420P:
205                 case BC_YUV422P:
206                 case BC_YUV422:
207                         result = file_colormodel;
208                         break;
209                 }
210         }
211
212         if( result < 0 ) {
213                 switch( file_colormodel ) {
214                 case BC_RGB888:
215                 case BC_RGBA8888:
216                 case BC_YUV888:
217                 case BC_YUVA8888:
218                 case BC_RGB_FLOAT:
219                 case BC_RGBA_FLOAT:
220                         result = file_colormodel;
221                         break;
222
223                 default:
224                         output->lock_canvas("VDeviceX11::get_display_colormodel");
225                         result = output->get_canvas()->get_color_model();
226                         output->unlock_canvas();
227                         break;
228                 }
229         }
230
231         return result;
232 }
233
234
235 void VDeviceX11::new_output_buffer(VFrame **result, int file_colormodel, EDL *edl)
236 {
237 // printf("VDeviceX11::new_output_buffer %d hardware_scaling=%d\n",
238 // __LINE__, bitmap ? bitmap->hardware_scaling() : 0);
239         output->lock_canvas("VDeviceX11::new_output_buffer");
240         output->get_canvas()->lock_window("VDeviceX11::new_output_buffer 1");
241
242 // Get the best colormodel the display can handle.
243         int display_colormodel = get_display_colormodel(file_colormodel);
244
245 //printf("VDeviceX11::new_output_buffer %d file_colormodel=%d display_colormodel=%d\n",
246 // __LINE__, file_colormodel, display_colormodel);
247 // Only create OpenGL Pbuffer and texture.
248         if( device->out_config->driver == PLAYBACK_X11_GL ) {
249 // Create bitmap for initial load into texture.
250 // Not necessary to do through Playback3D.....yet
251                 if( !output_frame ) {
252                         output_frame = new VFrame(device->out_w, device->out_h, file_colormodel);
253                 }
254
255                 window_id = output->get_canvas()->get_id();
256                 output_frame->set_opengl_state(VFrame::RAM);
257         }
258         else {
259                 output->get_transfers(edl,
260                         output_x1, output_y1, output_x2, output_y2,
261                         canvas_x1, canvas_y1, canvas_x2, canvas_y2,
262 // Canvas may be a different size than the temporary bitmap for pure software
263                         -1, -1);
264                 canvas_w = canvas_x2 - canvas_x1;
265                 canvas_h = canvas_y2 - canvas_y1;
266 // can the direct frame be used?
267                 int direct_supported =
268                         device->out_config->use_direct_x11 &&
269                         !output->xscroll && !output->yscroll &&
270                         output_x1 == 0 && output_x2 == device->out_w &&
271                         output_y1 == 0 && output_y2 == device->out_h;
272
273 // file wants direct frame but we need a temp
274                 if( !direct_supported && file_colormodel == BC_BGR8888 )
275                         file_colormodel = BC_RGB888;
276
277 // Conform existing bitmap to new colormodel and output size
278                 if( bitmap ) {
279 // printf("VDeviceX11::new_output_buffer %d bitmap=%dx%d canvas=%dx%d canvas=%dx%d\n",
280 // __LINE__, bitmap->get_w(), bitmap->get_h(), canvas_w, canvas_h,);
281                         int size_change = (
282                                 bitmap->get_w() != canvas_w ||
283                                 bitmap->get_h() != canvas_h );
284
285 // Restart if output size changed or output colormodel changed.
286 // May have to recreate if transferring between windowed and fullscreen.
287                         if( !color_model_selected ||
288                             file_colormodel != output_frame->get_color_model() ||
289                             (!bitmap->hardware_scaling() && size_change) ) {
290 //printf("VDeviceX11::new_output_buffer %d file_colormodel=%d prev "
291 // "file_colormodel=%d bitmap=%p output_frame=%p\n", __LINE__,
292 // file_colormodel, output_frame->get_color_model(), bitmap, output_frame);
293                                 delete bitmap;        bitmap = 0;
294                                 delete output_frame;  output_frame = 0;
295 // Clear borders if size changed
296                                 if( size_change ) {
297 //printf("VDeviceX11::new_output_buffer %d w=%d h=%d "
298 // "canvas_x1=%d canvas_y1=%d canvas_x2=%d canvas_y2=%d\n",
299 // __LINE__, // (int)output->w, (int)output->h,
300 // (int)canvas_x1, (int)canvas_y1, (int)canvas_x2, (int)canvas_y2);
301                                         output->get_canvas()->set_color(BLACK);
302
303                                         if( canvas_y1 > 0 ) {
304                                                 output->get_canvas()->draw_box(0, 0, output->w, canvas_y1);
305                                                 output->get_canvas()->flash(0, 0, output->w, canvas_y1);
306                                         }
307
308                                         if( canvas_y2 < output->h ) {
309                                                 output->get_canvas()->draw_box(0, canvas_y2, output->w, output->h - canvas_y2);
310                                                 output->get_canvas()->flash(0, canvas_y2, output->w, output->h - canvas_y2);
311                                         }
312
313                                         if( canvas_x1 > 0 ) {
314                                                 output->get_canvas()->draw_box(0, canvas_y1, canvas_x1, canvas_y2 - canvas_y1);
315                                                 output->get_canvas()->flash(0, canvas_y1, canvas_x1, canvas_y2 - canvas_y1);
316                                         }
317
318                                         if( canvas_x2 < output->w ) {
319                                                 output->get_canvas()->draw_box(canvas_x2, canvas_y1,
320                                                         output->w - canvas_x2, canvas_y2 - canvas_y1);
321                                                 output->get_canvas()->flash(canvas_x2, canvas_y1,
322                                                         output->w - canvas_x2, canvas_y2 - canvas_y1);
323                                         }
324                                 }
325                         }
326                 }
327
328 // Create new bitmap
329                 if( !bitmap ) {
330                         int use_direct = 0;
331                         bitmap_type = BITMAP_TEMP;
332 //printf("VDeviceX11::new_output_buffer %d file_colormodel=%d display_colormodel=%d\n",
333 // __LINE__, file_colormodel, display_colormodel);
334
335 // Try hardware accelerated
336                         switch( display_colormodel ) {
337 // blit from the codec directly to the window, using the standard X11 color model.
338 // Must scale in the codec.  No cropping
339                         case BC_BGR8888:
340                                 if( direct_supported ) {
341                                         bitmap_type = BITMAP_PRIMARY;
342                                         use_direct = 1;
343                                 }
344                                 break;
345
346                         case BC_YUV420P:
347                                 if( device->out_config->driver == PLAYBACK_X11_XV &&
348                                     output->get_canvas()->accel_available(display_colormodel, 0) &&
349                                     !output->use_scrollbars )
350                                         bitmap_type = BITMAP_PRIMARY;
351                                 break;
352
353                         case BC_YUV422P:
354                                 if( device->out_config->driver == PLAYBACK_X11_XV &&
355                                     output->get_canvas()->accel_available(display_colormodel, 0) &&
356                                     !output->use_scrollbars )
357                                         bitmap_type = BITMAP_PRIMARY;
358                                 else if( device->out_config->driver == PLAYBACK_X11_XV &&
359                                     output->get_canvas()->accel_available(BC_YUV422, 0) ) {
360                                         bitmap = new BC_Bitmap(output->get_canvas(),
361                                                 device->out_w, device->out_h, BC_YUV422, 1);
362                                 }
363                                 break;
364
365                         case BC_YUV422:
366                                 if( device->out_config->driver == PLAYBACK_X11_XV &&
367                                     output->get_canvas()->accel_available(display_colormodel, 0) &&
368                                     !output->use_scrollbars ) {
369                                         bitmap_type = BITMAP_PRIMARY;
370                                 }
371                                 else if( device->out_config->driver == PLAYBACK_X11_XV &&
372                                     output->get_canvas()->accel_available(BC_YUV422P, 0) ) {
373                                         bitmap = new BC_Bitmap(output->get_canvas(),
374                                                 device->out_w, device->out_h, BC_YUV422P, 1);
375                                 }
376                                 break;
377                         }
378                         if( bitmap_type == BITMAP_PRIMARY ) {
379                                 int bitmap_w = use_direct ? canvas_w : device->out_w;
380                                 int bitmap_h = use_direct ? canvas_h : device->out_h;
381                                 bitmap = new BC_Bitmap(output->get_canvas(),
382                                         bitmap_w, bitmap_h,  display_colormodel, -1);
383                                 output_frame = new VFrame(bitmap,
384                                         bitmap_w, bitmap_h, display_colormodel, -1);
385                         }
386 // Make an intermediate frame
387                         if( !bitmap ) {
388                                 display_colormodel = output->get_canvas()->get_color_model();
389 // printf("VDeviceX11::new_output_buffer %d creating temp display_colormodel=%d "
390 // "file_colormodel=%d %dx%d %dx%d %dx%d\n", __LINE__,
391 // display_colormodel, file_colormodel, device->out_w, device->out_h,
392 // output->get_canvas()->get_w(), output->get_canvas()->get_h(), canvas_w, canvas_h);
393                                 bitmap = new BC_Bitmap(output->get_canvas(),
394                                         canvas_w, canvas_h, display_colormodel, 1);
395                                 bitmap_type = BITMAP_TEMP;
396                         }
397
398                         if( bitmap_type == BITMAP_TEMP ) {
399 // Intermediate frame
400 //printf("VDeviceX11::new_output_buffer %d creating output_frame\n", __LINE__);
401                                 output_frame = new VFrame(device->out_w, device->out_h, file_colormodel);
402                         }
403                         color_model_selected = 1;
404                 }
405                 else if( bitmap_type == BITMAP_PRIMARY ) {
406                         output_frame->set_memory(bitmap);
407                 }
408         }
409
410         *result = output_frame;
411 //printf("VDeviceX11::new_output_buffer 10 %d\n", output->get_canvas()->get_window_lock());
412
413         output->get_canvas()->unlock_window();
414         output->unlock_canvas();
415 }
416
417
418 int VDeviceX11::start_playback()
419 {
420 // Record window is initialized when its monitor starts.
421         if( !device->single_frame )
422                 output->start_video();
423         return 0;
424 }
425
426 int VDeviceX11::stop_playback()
427 {
428         if( !device->single_frame )
429                 output->stop_video();
430 // Record window goes back to monitoring
431 // get the last frame played and store it in the video_out
432         return 0;
433 }
434
435 int VDeviceX11::write_buffer(VFrame *output_channels, EDL *edl)
436 {
437         output->lock_canvas("VDeviceX11::write_buffer");
438         output->get_canvas()->lock_window("VDeviceX11::write_buffer 1");
439 //      if( device->out_config->driver == PLAYBACK_X11_GL &&
440 //          output_frame->get_color_model() != BC_RGB888 ) {
441 // this is handled by overlay call in virtualvnode, using flatten alpha
442 // invoked when is_nested = -1 is passed to vdevicex11->overlay(...)
443 //      }
444
445 // printf("VDeviceX11::write_buffer %d %d bitmap_type=%d\n",
446 // __LINE__,
447 // output->get_canvas()->get_video_on(),
448 // bitmap_type);
449
450 //      int use_bitmap_extents = 0;
451 //      canvas_w = -1;  canvas_h = -1;
452 // // Canvas may be a different size than the temporary bitmap for pure software
453 //      if( bitmap_type == BITMAP_TEMP && !bitmap->hardware_scaling() ) {
454 //              canvas_w = bitmap->get_w();
455 //              canvas_h = bitmap->get_h();
456 //      }
457 //
458 //      output->get_transfers(edl,
459 //              output_x1, output_y1, output_x2, output_y2,
460 //              canvas_x1, canvas_y1, canvas_x2, canvas_y2,
461 //              canvas_w, canvas_h);
462
463 // Convert colormodel
464         if( bitmap_type == BITMAP_TEMP ) {
465 // printf("VDeviceX11::write_buffer 1 %d %d, %d %d %d %d -> %d %d %d %d\n",
466 //   output->w, output->h, in_x, in_y, in_w, in_h, out_x, out_y, out_w, out_h);
467 // fflush(stdout);
468
469 // printf("VDeviceX11::write_buffer %d output_channels=%p\n", __LINE__, output_channels);
470 // printf("VDeviceX11::write_buffer %d input color_model=%d output color_model=%d\n",
471 // __LINE__, output_channels->get_color_model(), bitmap->get_color_model());
472                 if( bitmap->hardware_scaling() ) {
473                         BC_CModels::transfer(bitmap->get_row_pointers(), output_channels->get_rows(), 0, 0, 0,
474                                 output_channels->get_y(), output_channels->get_u(), output_channels->get_v(),
475                                 0, 0, output_channels->get_w(), output_channels->get_h(),
476                                 0, 0, bitmap->get_w(), bitmap->get_h(),
477                                 output_channels->get_color_model(), bitmap->get_color_model(),
478                                 -1, output_channels->get_w(), bitmap->get_w());
479                 }
480                 else {
481                         BC_CModels::transfer(bitmap->get_row_pointers(), output_channels->get_rows(), 0, 0, 0,
482                                 output_channels->get_y(), output_channels->get_u(), output_channels->get_v(),
483                                 (int)output_x1, (int)output_y1, (int)(output_x2 - output_x1), (int)(output_y2 - output_y1),
484                                 0, 0, (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
485                                 output_channels->get_color_model(), bitmap->get_color_model(),
486                                 -1, output_channels->get_w(), bitmap->get_w());
487                 }
488         }
489
490 //printf("VDeviceX11::write_buffer 4 %p\n", bitmap);
491 //for( i = 0; i < 1000; i += 4 ) bitmap->get_data()[i] = 128;
492 //printf("VDeviceX11::write_buffer 2 %d %d %d\n", bitmap_type,
493 //      bitmap->get_color_model(),
494 //      output->get_color_model());fflush(stdout);
495
496 // printf("VDeviceX11::write_buffer %d %dx%d %f %f %f %f -> %f %f %f %f\n",
497 // __LINE__, // output->w, output->h,
498 // output_x1, output_y1, output_x2, output_y2,
499 // canvas_x1, canvas_y1, canvas_x2, canvas_y2);
500
501 // Cause X server to display it
502         if( device->out_config->driver == PLAYBACK_X11_GL ) {
503 // Output is drawn in close_all if no video.
504                 if( output->get_canvas()->get_video_on() ) {
505                         canvas_w = -1;  canvas_h = -1;
506 // Canvas may be a different size than the temporary bitmap for pure software
507                         if( bitmap_type == BITMAP_TEMP &&
508                                 !bitmap->hardware_scaling() ) {
509                                 canvas_w = bitmap->get_w();
510                                 canvas_h = bitmap->get_h();
511                         }
512
513                         output->get_transfers(edl,
514                                 output_x1, output_y1, output_x2, output_y2,
515                                 canvas_x1, canvas_y1, canvas_x2, canvas_y2,
516                                 canvas_w, canvas_h);
517
518 //printf("VDeviceX11::write_buffer %d\n", __LINE__);
519 // Draw output frame directly.  Not used for compositing.
520                         output->get_canvas()->unlock_window();
521                         output->unlock_canvas();
522                         output->mwindow->playback_3d->write_buffer(output, output_frame,
523                                 output_x1, output_y1, output_x2, output_y2,
524                                 canvas_x1, canvas_y1, canvas_x2, canvas_y2,
525                                 is_cleared);
526                         is_cleared = 0;
527                         output->lock_canvas("VDeviceX11::write_buffer 2");
528                         output->get_canvas()->lock_window("VDeviceX11::write_buffer 2");
529                 }
530         }
531         else {
532                 if( bitmap->hardware_scaling() ) {
533                         output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
534                                 (int)canvas_x1, (int)canvas_y1,
535                                 (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
536                                 (int)output_x1, (int)output_y1,
537                                 (int)(output_x2 - output_x1), (int)(output_y2 - output_y1),
538                                 0);
539                 }
540                 else {
541 //printf("VDeviceX11::write_buffer %d x=%d y=%d w=%d h=%d\n",
542 // __LINE__, (int)canvas_x1, (int)canvas_y1,
543 // output->get_canvas()->get_w(), output->get_canvas()->get_h());
544                         output->get_canvas()->draw_bitmap(bitmap, !device->single_frame,
545                                 (int)canvas_x1, (int)canvas_y1,
546                                 (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
547                                 0, 0,
548                                 (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1),
549                                 0);
550 //printf("VDeviceX11::write_buffer %d bitmap=%p\n", __LINE__, bitmap);
551                 }
552                 if( !output->get_canvas()->get_video_on() )
553                         output->get_canvas()->flash(0);
554         }
555
556         output->get_canvas()->unlock_window();
557         output->unlock_canvas();
558         return 0;
559 }
560
561
562 void VDeviceX11::clear_output()
563 {
564         is_cleared = 1;
565         output->mwindow->playback_3d->clear_output(output, 0);
566         output->mwindow->playback_3d->clear_output(output, output_frame);
567 }
568
569
570 void VDeviceX11::clear_input(VFrame *frame)
571 {
572         this->output->mwindow->playback_3d->clear_input(this->output, frame);
573 }
574
575 void VDeviceX11::convert_cmodel(VFrame *output, int dst_cmodel)
576 {
577         this->output->mwindow->playback_3d->convert_cmodel(this->output,
578                 output, 
579                 dst_cmodel);
580 }
581
582 void VDeviceX11::do_camera(VFrame *output, VFrame *input,
583         float in_x1, float in_y1, float in_x2, float in_y2,
584         float out_x1, float out_y1, float out_x2, float out_y2)
585 {
586         this->output->mwindow->playback_3d->do_camera(this->output,
587                 output, input,
588                 in_x1, in_y1, in_x2, in_y2,
589                 out_x1, out_y1, out_x2, out_y2);
590 }
591
592
593 void VDeviceX11::do_fade(VFrame *output_temp, float fade)
594 {
595         this->output->mwindow->playback_3d->do_fade(this->output, output_temp, fade);
596 }
597
598 bool VDeviceX11::can_mask(int64_t start_position_project, MaskAutos *keyframe_set)
599 {
600         Auto *current = 0;
601         MaskAuto *keyframe = (MaskAuto*)keyframe_set->
602                 get_prev_auto(start_position_project, PLAY_FORWARD, current);
603         return keyframe->disable_opengl_masking ? 0 : 1;
604 }
605
606 void VDeviceX11::do_mask(VFrame *output_temp, int64_t start_position_project,
607                 MaskAutos *keyframe_set, MaskAuto *keyframe, MaskAuto *default_auto)
608 {
609         this->output->mwindow->playback_3d->do_mask(output, output_temp,
610                 start_position_project, keyframe_set, keyframe, default_auto);
611 }
612
613 void VDeviceX11::overlay(VFrame *output_frame, VFrame *input,
614                 float in_x1, float in_y1, float in_x2, float in_y2,
615                 float out_x1, float out_y1, float out_x2, float out_y2,
616                 float alpha, int mode, EDL *edl, int is_nested)
617 {
618         int interpolation_type = edl->session->interpolation_type;
619         output->mwindow->playback_3d->overlay(output, input,
620                 in_x1, in_y1, in_x2, in_y2,
621                 out_x1, out_y1, out_x2, out_y2, alpha, // 0 - 1
622                 mode, interpolation_type, output_frame, is_nested);
623 }
624
625 void VDeviceX11::run_plugin(PluginClient *client)
626 {
627         output->mwindow->playback_3d->run_plugin(output, client);
628 }
629
630 void VDeviceX11::copy_frame(VFrame *dst, VFrame *src)
631 {
632         output->mwindow->playback_3d->copy_from(output, dst, src, 1);
633 }
634