5 #include "edlsession.h"
7 #include "playabletracks.h"
8 #include "preferences.h"
9 #include "renderengine.h"
11 #include "transportque.h"
12 #include "vdevicex11.h"
14 #include "videodevice.h"
15 #include "virtualvconsole.h"
16 #include "virtualvnode.h"
21 VirtualVConsole::VirtualVConsole(RenderEngine *renderengine, VRender *vrender)
22 : VirtualConsole(renderengine, vrender, TRACK_VIDEO)
24 this->vrender = vrender;
28 VirtualVConsole::~VirtualVConsole()
36 VDeviceBase* VirtualVConsole::get_vdriver()
38 return renderengine->video->get_output_base();
41 void VirtualVConsole::get_playable_tracks()
44 playable_tracks = new PlayableTracks(renderengine,
45 commonrender->current_position,
50 VirtualNode* VirtualVConsole::new_entry_node(Track *track,
54 return new VirtualVNode(renderengine,
62 // start of buffer in project if forward / end of buffer if reverse
63 int VirtualVConsole::process_buffer(int64_t input_position)
70 // The use of single frame is determined in RenderEngine::arm_command
71 use_opengl = (renderengine->video &&
72 renderengine->video->out_config->driver == PLAYBACK_X11_GL);
73 // printf("VirtualVConsole::process_buffer %p %d %d\n",
74 // renderengine->video,
75 // renderengine->video->out_config->driver,
79 printf("VirtualVConsole::process_buffer begin exit_nodes=%d\n",
85 // clear hardware framebuffer
87 ((VDeviceX11*)get_vdriver())->clear_output();
89 // que OpenGL driver that everything is overlaid in the framebuffer
90 vrender->video_out->set_opengl_state(VFrame::SCREEN);
95 // clear device buffer
96 vrender->video_out->clear_frame();
104 // Reset plugin rendering status
108 // Render exit nodes from bottom to top
109 for(current_exit_node = exit_nodes.total - 1; current_exit_node >= 0; current_exit_node--)
111 VirtualVNode *node = (VirtualVNode*)exit_nodes.values[current_exit_node];
112 Track *track = node->track;
114 // Create temporary output to match the track size, which is acceptable since
115 // most projects don't have variable track sizes.
116 // If the project has variable track sizes, this object is recreated for each track.
123 (output_temp->get_w() != track->track_w ||
124 output_temp->get_h() != track->track_h))
133 // Texture is created on demand
134 output_temp = new VFrame(0,
137 renderengine->edl->session->color_model,
141 // Reset OpenGL state
143 output_temp->set_opengl_state(VFrame::RAM);
146 // Assume openGL is used for the final stage and let console
148 output_temp->clear_stacks();
149 result |= node->render(output_temp,
150 input_position + track->nudge,
151 renderengine->edl->session->frame_rate,
155 //printf("VirtualVConsole::process_buffer timer=%lld\n", timer.get_difference());
157 if(debug_tree) printf("VirtualVConsole::process_buffer end\n");