4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef PACKAGINGENGINE_H
24 #define PACKAGINGENGINE_H
27 #include "packagingengine.inc"
28 #include "packagerenderer.h"
30 // Classes used for different packaging strategies, which allow for customary splitting of packages
31 // Used for renderfarm jobs
36 virtual ~PackagingEngine() {}
37 virtual int create_packages_single_farm(
39 Preferences *preferences,
42 double total_end) = 0;
43 virtual RenderPackage* get_package_single_farm(double frames_per_second,
45 int use_local_rate) = 0;
46 virtual int64_t get_progress_max() = 0;
47 virtual void get_package_paths(ArrayList<char*> *path_list) = 0;
48 virtual int get_asset_list(ArrayList<Indexable *> &idxbls) = 0;
49 virtual int packages_are_done() = 0;
52 // Classes used for different packaging strategies, which allow for customary splitting of packages
53 // Used for renderfarm jobs
55 class PackagingEngineDefault : public PackagingEngine
58 PackagingEngineDefault();
59 ~PackagingEngineDefault();
60 int create_packages_single_farm(
62 Preferences *preferences,
66 RenderPackage* get_package_single_farm(double frames_per_second,
69 int64_t get_progress_max();
70 void get_package_paths(ArrayList<char*> *path_list);
71 int get_asset_list(ArrayList<Indexable *> &idxbls);
72 int packages_are_done();
74 RenderPackage **packages;
75 int64_t total_allocated; // Total packages to test the existence of
76 int current_number; // The number being injected into the filename.
77 int number_start; // Character in the filename path at which the number begins
78 int total_digits; // Total number of digits including padding the user specified.
79 double package_len; // Target length of a single package
80 double min_package_len; // Minimum package length after load balancing
81 int64_t total_packages; // Total packages to base calculations on
82 int64_t audio_position;
83 int64_t video_position;
86 double current_position;
89 Preferences *preferences;