7 #include "maskauto.inc"
8 #include "maskautos.inc"
9 #include "pluginclient.inc"
11 #include "vdevicebase.h"
13 // output_frame is the same one written to device
14 #define BITMAP_PRIMARY 0
15 // output_frame is a temporary converted to the device format
18 class VDeviceX11
: public VDeviceBase
21 VDeviceX11(VideoDevice
*device
, Canvas
*output
);
26 int read_buffer(VFrame
*frame
);
27 int reset_parameters();
28 // User always gets the colormodel requested
29 void new_output_buffer(VFrame
**output
, int colormodel
);
35 // After loading the bitmap with a picture, write it
36 int write_buffer(VFrame
*result
, EDL
*edl
);
37 // Get best colormodel for recording
38 int get_best_colormodel(Asset
*asset
);
41 //=========================== compositing stages ===============================
42 // For compositing with OpenGL, must clear the frame buffer
43 // before overlaying tracks.
46 // Called by VModule::import_frame
47 void do_camera(VFrame
*output
,
58 // Called by VModule::import_frame for cases with no media.
59 void clear_input(VFrame
*frame
);
61 void do_fade(VFrame
*output_temp
, float fade
);
63 // Hardware version of MaskEngine
64 void do_mask(VFrame
*output_temp
,
65 int64_t start_position_project
,
66 MaskAutos
*keyframe_set
,
68 MaskAuto
*default_auto
);
70 // The idea is to composite directly in the frame buffer if OpenGL.
71 // OpenGL can do all the blending using the frame buffer.
72 // Unfortunately if the output is lower resolution than the frame buffer, the
73 // rendered output is the resolution of the frame buffer, not the output.
74 // Also, the frame buffer has to be copied back to textures for nonstandard
75 // blending equations and blended at the framebuffer resolution.
76 // If the frame buffer is higher resolution than the
77 // output frame, like a 2560x1600 display, it could cause unnecessary slowness.
78 // Finally, there's the problem of updating the refresh frame.
79 // It requires recompositing the previous frame in software every time playback was
80 // stops, a complicated operation.
81 void overlay(VFrame
*output_frame
,
95 // For plugins, lock the canvas, enable opengl, and run a function in the
96 // plugin client in the synchronous thread. The user must override the
97 // pluginclient function.
98 void run_plugin(PluginClient
*client
);
100 // For multichannel plugins, copy from the temporary pbuffer to
101 // the plugin output texture.
102 // Set the output OpenGL state to TEXTURE.
103 void copy_frame(VFrame
*dst
, VFrame
*src
);
106 // Closest colormodel the hardware can do for playback.
107 // Only used by VDeviceX11::new_output_buffer. The value from File::get_best_colormodel
108 // is passed to this to create the VFrame to which the output is rendered.
109 // For OpenGL, it creates the array of row pointers used to upload the video
110 // frame to the texture, the texture, and the PBuffer.
111 int get_best_colormodel(int colormodel
);
113 // Bitmap to be written to device
115 // Wrapper for bitmap or intermediate buffer for user to write to
116 VFrame
*output_frame
;
117 // Type of output_frame
119 // dimensions of buffers written to window
120 int bitmap_w
, bitmap_h
;
121 ArrayList
<int> render_strategies
;
124 // Parameters the output texture conforms to, for OpenGL
125 // window_id is probably not going to be used
130 int color_model_selected
;
131 // Transfer coordinates from the output frame to the canvas
132 // for last frame rendered.
133 // These stick the last frame to the display.
134 // Must be floats to support OpenGL
135 float output_x1
, output_y1
, output_x2
, output_y2
;
136 float canvas_x1
, canvas_y1
, canvas_x2
, canvas_y2
;
138 BC_Capture
*capture_bitmap
;
139 // Set when OpenGL rendering has cleared the frame buffer before write_buffer