4 * Copyright (C) 1997-2011 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
22 #ifndef PACKAGERENDERER_H
23 #define PACKAGERENDERER_H
27 #include "bctimer.inc"
28 #include "bcwindowbase.inc"
33 #include "maxchannels.h"
34 #include "mwindow.inc"
35 #include "playabletracks.inc"
36 #include "playbackconfig.inc"
37 #include "pluginserver.inc"
38 #include "preferences.inc"
39 #include "renderengine.inc"
40 #include "samples.inc"
42 #include "transportque.inc"
44 #include "videodevice.inc"
55 // Path of output without remote prefix
58 // Range not including preroll
72 // Used by Render and BRender to do packages.
79 // Initialize stuff which is reused between packages
80 int initialize(MWindow *mwindow,
82 Preferences *preferences,
83 Asset *default_asset);
85 // Aborts and returns 1 if an error is encountered.
86 int render_package(RenderPackage *package);
88 int direct_copy_possible(EDL *edl,
89 int64_t current_position,
90 Track* &playable_track, // The one track which is playable
91 Edit* &playable_edit, // The edit which is playing
92 File *file); // Output file
93 int direct_frame_copy(EDL *edl,
94 int64_t &video_position,
98 // Invoke behavior for master node
99 virtual int get_master();
100 // Get result status from server
101 virtual int get_result();
102 virtual void set_result(int value);
103 virtual void set_progress(int64_t total_samples);
104 // Used by background rendering to mark a frame as finished.
105 // If the GUI is locked for a long time this may abort,
106 // assuming the server crashed.
107 virtual int set_video_map(int64_t position, int value);
108 virtual int progress_cancelled();
110 void create_output();
111 void create_engine();
119 // Passed in from outside
121 Preferences *preferences;
122 Asset *default_asset;
126 // Calculate frames per second for the renderfarm table.
127 float frames_per_second;
128 int64_t total_samples_rendered;
130 Samples **audio_output;
131 int64_t audio_position;
132 int64_t audio_preroll;
133 int64_t audio_read_length;
135 // This is 1 if an error is encountered.
137 VFrame ***video_output;
138 // A nonzero mwindow signals master render engine to the engine.
139 // A zero mwindow signals client or non interactive.
141 Samples *audio_output_ptr[MAX_CHANNELS];
142 CICache *audio_cache;
143 CICache *video_cache;
144 VFrame *compressed_output;
145 AudioOutConfig *aconfig;
146 VideoOutConfig *vconfig;
147 // PlaybackConfig *playback_config;
148 PlayableTracks *playable_tracks;
149 RenderEngine *render_engine;
150 RenderPackage *package;
151 TransportCommand *command;
152 int direct_frame_copying;
153 VideoDevice *video_device;
154 VFrame *video_output_ptr;
155 int64_t video_preroll;
156 int64_t video_position;
157 int64_t video_read_length;
158 int64_t video_write_length;
159 int64_t video_write_position;