add libdav1d codec, add remap_a/v_codec option keywords
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / virtualconsole.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef COMMONRENDERTHREAD_H
23 #define COMMONRENDERTHREAD_H
24
25 #include "arraylist.h"
26 #include "commonrender.inc"
27 #include "module.inc"
28 #include "playabletracks.inc"
29 #include "renderengine.inc"
30 #include "track.inc"
31 #include "virtualnode.inc"
32
33 // Virtual console runs synchronously for audio and video in
34 // pull mode.
35 class VirtualConsole
36 {
37 public:
38         VirtualConsole(RenderEngine *renderengine,
39                 CommonRender *commonrender,
40                 int data_type);
41         virtual ~VirtualConsole();
42
43         virtual void create_objects();
44         virtual void get_playable_tracks();
45         int allocate_input_buffers();
46         virtual void new_input_buffer(int ring_buffer) { };
47         virtual void delete_input_buffer(int ring_buffer) { };
48         void start_playback();
49
50 // Called during each process buffer operation to reset the status
51 // of the attachments to unprocessed.
52         void reset_attachments();
53         void dump();
54
55
56 // Build the nodes
57         void build_virtual_console(int persistent_plugins);
58
59 // Create a new entry node in subclass of desired type.
60 // was new_toplevel_node
61         virtual VirtualNode* new_entry_node(Track *track,
62                 Module *module,
63                 int track_number);
64 // Append exit node to table when expansion hits the end of a tree.
65         void append_exit_node(VirtualNode *node);
66
67         Module* module_of(Track *track);
68         Module* module_number(int track_number);
69 // Test for reconfiguration.
70 // If reconfiguration is coming up, truncate length and reset last_playback.
71         int test_reconfigure(int64_t position,
72                 int64_t &length);
73
74
75         RenderEngine *renderengine;
76         CommonRender *commonrender;
77
78
79 // Total exit nodes.  Corresponds to the total playable tracks.
80 // Was total_tracks
81         int total_exit_nodes;
82 // Current exit node being processed.  Used to speed up video.
83         int current_exit_node;
84 // Entry node for each playable track
85 // Was toplevel_nodes
86         VirtualNode **entry_nodes;
87
88 // Exit node for each playable track.  Rendering starts here and data is pulled
89 // up the tree.  Every virtual module is an exit node.
90         ArrayList<VirtualNode*> exit_nodes;
91
92
93 // Order to process nodes
94 // Replaced by pull system
95 //      ArrayList<VirtualNode*> render_list;
96
97
98         int data_type;
99 // Store result of total_ring_buffers for destructor
100 // Pull method can't use ring buffers for input.
101 //      int ring_buffers;
102 // exit conditions
103         int interrupt;
104         int done;
105 // Trace the rendering path of the tree
106         int debug_tree;
107
108
109         virtual int init_rendering(int duplicate) { return 0; }
110 // Replaced by pull system
111 //      int sort_virtual_console();
112         void delete_virtual_console();
113
114 // Signal effects to deallocate any resources which must be deallocated
115 // after playback.
116
117         virtual int stop_rendering(int duplicate) { return 0; }
118         virtual int send_last_output_buffer() { return 0; }
119
120         PlayableTracks *playable_tracks;
121 };
122
123
124
125 #endif