no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / packagedispatcher.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * Copyright (C) 2003-2016 Cinelerra CV contributors
6  *
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.
11  *
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.
16  *
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
20  *
21  */
22
23 #ifndef PACKAGEDISPATCHER_H
24 #define PACKAGEDISPATCHER_H
25
26
27 #include "arraylist.h"
28 #include "assets.inc"
29 #include "edl.inc"
30 #include "mutex.inc"
31 #include "mwindow.inc"
32 #include "packagerenderer.inc"
33 #include "preferences.inc"
34 #include "packagingengine.h"
35
36
37
38 // Allocates fragments given a total start and total end.
39 // Checks the existence of every file.
40 // Adjusts package size for load.
41 class PackageDispatcher
42 {
43 public:
44         PackageDispatcher();
45         ~PackageDispatcher();
46
47         int create_packages(MWindow *mwindow,
48                 EDL *edl,
49                 Preferences *preferences,
50                 int strategy,
51                 Asset *default_asset,
52                 double total_start,
53                 double total_end,
54                 int test_overwrite);
55 // Supply a frame rate of the calling node.  If the client number is -1
56 // the frame rate isn't added to the preferences table.
57         RenderPackage* get_package(double frames_per_second,
58                 int client_number,
59                 int use_local_rate);
60 // Return a new path list of what was rendered.
61         void get_package_paths(ArrayList<char*> *path_list);
62 // Return a new asset list of what was rendered.
63         int get_asset_list(ArrayList<Indexable*> &idxbls);
64
65         RenderPackage* get_package(int number);
66         int get_total_packages();
67         int64_t get_progress_max();
68         int packages_are_done();
69
70 private:
71         EDL *edl;
72         int64_t audio_position;
73         int64_t video_position;
74         int64_t audio_end;
75         int64_t video_end;
76         double total_start;
77         double total_end;
78         double total_len;
79         int strategy;
80         Asset *default_asset;
81         Preferences *preferences;
82         int current_number;    // The number being injected into the filename.
83         int number_start;      // Character in the filename path at which the number begins
84         int total_digits;      // Total number of digits including padding the user specified.
85         double package_len;    // Target length of a single package
86         double min_package_len; // Minimum package length after load balancing
87         int64_t total_packages;   // Total packages to base calculations on
88         int64_t total_allocated;  // Total packages to test the existence of
89         int nodes;
90         MWindow *mwindow;
91         RenderPackage **packages;
92         int current_package;
93         Mutex *package_lock;
94
95         PackagingEngine *packaging_engine;
96 };
97
98
99 #endif
100
101