Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

pluginvclient.h

Go to the documentation of this file.
00001 #ifndef PLUGINVCLIENT_H
00002 #define PLUGINVCLIENT_H
00003 
00004 
00005 #include "maxbuffers.h"
00006 #include "pluginclient.h"
00007 #include "vframe.inc"
00008 
00009 
00010 // Maximum dimensions for a temporary frame a plugin should retain between 
00011 // process_buffer calls.  This allows memory conservation.
00012 #define PLUGIN_MAX_W 2000
00013 #define PLUGIN_MAX_H 1000
00014 
00015 
00016 
00017 class PluginVClient : public PluginClient
00018 {
00019 public:
00020         PluginVClient(PluginServer *server);
00021         virtual ~PluginVClient();
00022 
00023         int get_render_ptrs();
00024         int init_realtime_parameters();
00025         int delete_nonrealtime_parameters();
00026         int is_video();
00027 // Replaced by pull method
00028 /*
00029  *      void plugin_process_realtime(VFrame **input, 
00030  *              VFrame **output, 
00031  *              int64_t current_position,
00032  *              int64_t total_len);
00033  */
00034 // Multichannel buffer process for backwards compatibility
00035         virtual int process_realtime(VFrame **input, 
00036                 VFrame **output);
00037 // Single channel buffer process for backwards compatibility and transitions
00038         virtual int process_realtime(VFrame *input, 
00039                 VFrame *output);
00040 
00041 // Process buffer using pull method.  By default this loads the input into *frame
00042 //     and calls process_realtime with input and output pointing to frame.
00043 // start_position - requested position relative to frame rate. Relative
00044 //     to start of EDL.  End of buffer if reverse.
00045 // sample_rate - scale of start_position.
00046 // These should return 1 if error or 0 if success.
00047         virtual int process_buffer(VFrame **frame,
00048                 int64_t start_position,
00049                 double frame_rate);
00050         virtual int process_buffer(VFrame *frame,
00051                 int64_t start_position,
00052                 double frame_rate);
00053 
00054 // Called by plugin server to render the GUI with rendered data.
00055         void plugin_render_gui(void *data);
00056         virtual void render_gui(void *data) { };
00057 // Called by client to cause GUI to be rendered with data.
00058         void send_render_gui(void *data);
00059         virtual int process_loop(VFrame **buffers) { return 1; };
00060         virtual int process_loop(VFrame *buffer) { return 1; };
00061         int plugin_process_loop(VFrame **buffers, int64_t &write_length);
00062 
00063         int plugin_start_loop(int64_t start, 
00064                 int64_t end, 
00065                 int64_t buffer_size, 
00066                 int total_buffers);
00067         int plugin_get_parameters();
00068 
00069 // Called by non-realtime client to read frame for processing.
00070 // buffer - output frame
00071 // channel - channel of the plugin input for a multichannel plugin
00072 // start_position - start of frame in forward.  end of frame in reverse.  
00073 //     Relative to start of EDL.
00074         int read_frame(VFrame *buffer, 
00075                 int channel, 
00076                 int64_t start_position);
00077         int read_frame(VFrame *buffer, 
00078                 int64_t start_position);
00079 
00080 // Called by realtime plugin to read frame from previous entity
00081 // framerate - framerate start_position is relative to.  Used by preceeding plugiun
00082 //     to calculate output frame number.  Provided so the client can get data
00083 //     at a higher fidelity than provided by the EDL.
00084 // start_position - start of frame in forward.  end of frame in reverse.  
00085 //     Relative to start of EDL.
00086 // frame_rate - frame rate position is scaled to
00087         int read_frame(VFrame *buffer, 
00088                 int channel, 
00089                 int64_t start_position,
00090                 double frame_rate);
00091 
00092 // Called by user to allocate the temporary for the current process_buffer.  
00093 // It may be deleted after the process_buffer to conserve memory.
00094         VFrame* new_temp(int w, int h, int color_model);
00095 // Called by PluginServer after process_buffer to delete the temp if it's too
00096 // large.
00097         void age_temp();
00098 
00099 // Frame rate relative to EDL
00100         double get_project_framerate();
00101 // Frame rate requested
00102         double get_framerate();
00103 
00104         int64_t local_to_edl(int64_t position);
00105         int64_t edl_to_local(int64_t position);
00106 
00107 // Non realtime buffer pointers
00108 // Channels of arrays of frames that the client uses.
00109         VFrame ***video_in, ***video_out;
00110 
00111 // point to the start of the buffers
00112         ArrayList<VFrame***> input_ptr_master;
00113         ArrayList<VFrame***> output_ptr_master;
00114 // Pointers to the regions for a single render.
00115 // Arrays are channels of arrays of frames.
00116         VFrame ***input_ptr_render;
00117         VFrame ***output_ptr_render;
00118 
00119 // Frame rate of EDL
00120         double project_frame_rate;
00121 // Local parameters set by non realtime plugin about the file to be generated.
00122 // Retrieved by server to set output file format.
00123 // In realtime plugins, these are set before every process_buffer as the
00124 // requested rates.
00125         double frame_rate;
00126         int project_color_model;
00127         int use_float;   // Whether user wants floating point calculations.
00128         int use_alpha;   // Whether user wants alpha calculations.
00129         int use_interpolation;   // Whether user wants pixel interpolation.
00130         float aspect_w, aspect_h;  // Aspect ratio
00131 
00132 // Tempo
00133         VFrame *temp;
00134 };
00135 
00136 
00137 
00138 #endif

Generated on Sun Jan 8 13:38:59 2006 for Cinelerra-svn by  doxygen 1.4.4