license header for review
[cinelerra_cv/ct.git] / cinelerra / packagerenderer.h
blobb2fe282f52380fb0fb034875e553a0f91ca1e6b4
1 #ifndef PACKAGERENDERER_H
2 #define PACKAGERENDERER_H
5 #include "assets.inc"
6 #include "bcwindowbase.inc"
7 #include "cache.inc"
8 #include "edit.inc"
9 #include "edl.inc"
10 #include "file.inc"
11 #include "maxchannels.h"
12 #include "mwindow.inc"
13 #include "playabletracks.inc"
14 #include "playbackconfig.inc"
15 #include "pluginserver.inc"
16 #include "preferences.inc"
17 #include "renderengine.inc"
18 #include "track.inc"
19 #include "transportque.inc"
20 #include "vframe.inc"
21 #include "videodevice.inc"
24 #include <stdint.h>
26 class RenderPackage
28 public:
29 RenderPackage();
30 ~RenderPackage();
32 // Path of output without remote prefix
33 char path[BCTEXTLEN];
35 // Range not including preroll
36 int64_t audio_start;
37 int64_t audio_end;
38 int64_t video_start;
39 int64_t video_end;
40 int done;
41 int use_brender;
42 int video_do;
43 int audio_do;
49 // Used by Render and BRender to do packages.
50 class PackageRenderer
52 public:
53 PackageRenderer();
54 ~PackageRenderer();
56 // Initialize stuff which is reused between packages
57 int initialize(MWindow *mwindow,
58 EDL *edl,
59 Preferences *preferences,
60 Asset_GC default_asset,
61 ArrayList<PluginServer*> *plugindb);
63 // Aborts and returns 1 if an error is encountered.
64 int render_package(RenderPackage *package);
66 int direct_copy_possible(EDL *edl,
67 int64_t current_position,
68 Track* playable_track, // The one track which is playable
69 Edit* &playable_edit, // The edit which is playing
70 File *file); // Output file
71 int direct_frame_copy(EDL *edl,
72 int64_t &video_position,
73 File *file,
74 int &result);
76 // Invoke behavior for master node
77 virtual int get_master();
78 // Get result status from server
79 virtual int get_result();
80 virtual void set_result(int value);
81 virtual void set_progress(int64_t total_samples);
82 // Used by background rendering to mark a frame as finished.
83 // If the GUI is locked for a long time this may abort,
84 // assuming the server crashed.
85 virtual int set_video_map(int64_t position, int value);
86 virtual int progress_cancelled();
88 void create_output();
89 void create_engine();
90 void do_audio();
91 void do_video();
92 void stop_engine();
93 void stop_output();
94 void close_output();
97 // Passed in from outside
98 EDL *edl;
99 Preferences *preferences;
100 Asset_GC default_asset;
101 ArrayList<PluginServer*> *plugindb;
103 // Created locally
104 Asset_GC asset;
105 double **audio_output;
106 int64_t audio_position;
107 int64_t audio_preroll;
108 int64_t audio_read_length;
109 File *file;
110 // This is 1 if an error is encountered.
111 int result;
112 VFrame ***video_output;
113 // A nonzero mwindow signals master render engine to the engine.
114 // A zero mwindow signals client or non interactive.
115 MWindow *mwindow;
116 double *audio_output_ptr[MAX_CHANNELS];
117 CICache *audio_cache;
118 CICache *video_cache;
119 VFrame *compressed_output;
120 AudioOutConfig *aconfig;
121 VideoOutConfig *vconfig;
122 // PlaybackConfig *playback_config;
123 PlayableTracks *playable_tracks;
124 RenderEngine *render_engine;
125 RenderPackage *package;
126 TransportCommand *command;
127 int direct_frame_copying;
128 VideoDevice *video_device;
129 VFrame *video_output_ptr;
130 int64_t video_preroll;
131 int64_t video_position;
132 int64_t video_read_length;
133 int64_t video_write_length;
134 int64_t video_write_position;
140 #endif
142 // Local Variables:
143 // mode: C++
144 // c-file-style: "linux"
145 // End: