4 * Copyright (C) 2008 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 COMMONRENDERTHREAD_H
23 #define COMMONRENDERTHREAD_H
25 #include "arraylist.h"
26 #include "commonrender.inc"
28 #include "playabletracks.inc"
29 #include "renderengine.inc"
31 #include "virtualnode.inc"
33 // Virtual console runs synchronously for audio and video in
38 VirtualConsole(RenderEngine *renderengine,
39 CommonRender *commonrender,
41 virtual ~VirtualConsole();
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();
50 // Called during each process buffer operation to reset the status
51 // of the attachments to unprocessed.
52 void reset_attachments();
57 void build_virtual_console(int persistent_plugins);
59 // Create a new entry node in subclass of desired type.
60 // was new_toplevel_node
61 virtual VirtualNode* new_entry_node(Track *track,
64 // Append exit node to table when expansion hits the end of a tree.
65 void append_exit_node(VirtualNode *node);
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,
75 RenderEngine *renderengine;
76 CommonRender *commonrender;
79 // Total exit nodes. Corresponds to the total playable tracks.
82 // Current exit node being processed. Used to speed up video.
83 int current_exit_node;
84 // Entry node for each playable track
86 VirtualNode **entry_nodes;
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;
93 // Order to process nodes
94 // Replaced by pull system
95 // ArrayList<VirtualNode*> render_list;
99 // Store result of total_ring_buffers for destructor
100 // Pull method can't use ring buffers for input.
105 // Trace the rendering path of the tree
109 virtual int init_rendering(int duplicate) { return 0; }
110 // Replaced by pull system
111 // int sort_virtual_console();
112 void delete_virtual_console();
114 // Signal effects to deallocate any resources which must be deallocated
117 virtual int stop_rendering(int duplicate) { return 0; }
118 virtual int send_last_output_buffer() { return 0; }
120 PlayableTracks *playable_tracks;