00001 #ifndef COMMONRENDERTHREAD_H 00002 #define COMMONRENDERTHREAD_H 00003 00004 #include "arraylist.h" 00005 #include "commonrender.inc" 00006 #include "module.inc" 00007 #include "playabletracks.inc" 00008 #include "renderengine.inc" 00009 #include "track.inc" 00010 #include "virtualnode.inc" 00011 00012 // Virtual console runs synchronously for audio and video in 00013 // pull mode. 00014 class VirtualConsole 00015 { 00016 public: 00017 VirtualConsole(RenderEngine *renderengine, 00018 CommonRender *commonrender, 00019 int data_type); 00020 virtual ~VirtualConsole(); 00021 00022 virtual void create_objects(); 00023 virtual void get_playable_tracks(); 00024 int allocate_input_buffers(); 00025 virtual void new_input_buffer(int ring_buffer) { }; 00026 virtual void delete_input_buffer(int ring_buffer) { }; 00027 void start_playback(); 00028 00029 // Called during each process buffer operation to reset the status 00030 // of the attachments to unprocessed. 00031 void reset_attachments(); 00032 void dump(); 00033 00034 00035 // Build the nodes 00036 void build_virtual_console(int persistent_plugins); 00037 00038 // Create a new entry node in subclass of desired type. 00039 // was new_toplevel_node 00040 virtual VirtualNode* new_entry_node(Track *track, 00041 Module *module, 00042 int track_number); 00043 // Append exit node to table when expansion hits the end of a tree. 00044 void append_exit_node(VirtualNode *node); 00045 00046 Module* module_of(Track *track); 00047 Module* module_number(int track_number); 00048 // Test for reconfiguration. 00049 // If reconfiguration is coming up, truncate length and reset last_playback. 00050 int test_reconfigure(int64_t position, 00051 int64_t &length, 00052 int &last_playback); 00053 00054 00055 RenderEngine *renderengine; 00056 CommonRender *commonrender; 00057 00058 00059 // Total exit nodes. Corresponds to the total playable tracks. 00060 // Was total_tracks 00061 int total_exit_nodes; 00062 // Current exit node being processed. Used to speed up video. 00063 int current_exit_node; 00064 // Entry node for each playable track 00065 // Was toplevel_nodes 00066 VirtualNode **entry_nodes; 00067 00068 // Exit node for each playable track. Rendering starts here and data is pulled 00069 // up the tree. Every virtual module is an exit node. 00070 ArrayList<VirtualNode*> exit_nodes; 00071 00072 00073 // Order to process nodes 00074 // Replaced by pull system 00075 // ArrayList<VirtualNode*> render_list; 00076 00077 00078 int data_type; 00079 // Store result of total_ring_buffers for destructor 00080 // Pull method can't use ring buffers for input. 00081 // int ring_buffers; 00082 // exit conditions 00083 int interrupt; 00084 int done; 00085 // Trace the rendering path of the tree 00086 int debug_tree; 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 virtual int init_rendering(int duplicate) {}; 00100 // Replaced by pull system 00101 // int sort_virtual_console(); 00102 int delete_virtual_console(); 00103 00104 // Signal effects to deallocate any resources which must be deallocated 00105 // after playback. 00106 virtual int stop_rendering(int duplicate) {}; 00107 00108 virtual int send_last_output_buffer() {}; 00109 00110 00111 PlayableTracks *playable_tracks; 00112 }; 00113 00114 00115 00116 #endif
1.5.5