4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "commonrender.h"
28 #include "mwindow.inc"
29 #include "overlayframe.inc"
30 #include "renderengine.inc"
34 class VRender : public CommonRender
37 VRender(RenderEngine *renderengine);
40 VirtualConsole* new_vconsole_object();
41 int get_total_tracks();
42 Module* new_module(Track *track);
44 // set up and start thread
45 int arm_playback(int64_t current_position,
47 int64_t module_render_fragment,
48 int64_t playback_buffer,
55 void wait_for_startup();
57 int start_playback(); // start the thread
60 // process frames to put in buffer_out
61 // use_opengl - used by nested render engines
62 int process_buffer(VFrame *video_out,
63 int64_t input_position,
65 // load an array of buffers for each track to send to the thread
66 int process_buffer(int64_t input_position,
68 // Flash the output on the display
70 // Determine if data can be copied directly from the file to the output device.
71 void get_render_strategy(Edit* &playable_edit,
77 int get_use_vconsole(VEdit **playable_edit,
80 int get_colormodel(VEdit *playable_edit,
83 int insert_timecode(Edit *playable_edit,
87 int64_t tounits(double position, int round);
88 double fromunits(int64_t position);
90 // frames since start of playback
91 int64_t session_frame;
95 // video device dimensions
96 int output_w, output_h;
97 // frames to send to console fragment
98 int64_t vmodule_render_fragment;
99 // frames to send to video device (1)
100 int64_t playback_buffer;
103 // Byte offset of video_out
104 int64_t output_offset;
106 // Temp frame for VModule loading
108 // Temp frame for VModule transitions
109 VFrame *transition_temp;
110 // Engine for camera and projector automation
111 OverlayFrame *overlayer;
115 // Total number of frames to render for transitions
116 int64_t source_length;
118 // Flag first frame to unlock audio
122 void init_device_buffers();
125 // for getting actual framerate
126 int64_t framerate_counter;
127 Timer framerate_timer;