diff --git a/src/server/distrenjob.c b/src/server/distrenjob.c --- a/src/server/distrenjob.c +++ b/src/server/distrenjob.c @@ -54,19 +54,25 @@ int distrenjob_new(struct distrenjob **d *distrenjob = dj; dj->next = NULL; + dj->jobnum = 0; /*< @todo there should be a central jobnum allocator and a way to save the maximum jobnumber allocated */ + dj->type = 1; dj->name = (char *)NULL; dj->submitter = (char *)NULL; - dj->jobnum = 0; /*< @todo there should be a central jobnum allocator and a way to save the maximum jobnumber allocated */ - dj->priority = 0; + + df->output_format = (char *)NULL; dj->width = 0; dj->height = 0; + + dj->priority = 0; dj->completed_frames = 0; dj->assigned_frames = 0; + dj->total_frames = 0; + dj->prev_frame_index = -1; + dj->total_render_time = 0; - dj->hibernate = 0; - dj->prev_frame_index = -1; dj->assigned_render_power = 0; dj->watchdog_forgiveness = 3600; // initialize watchdog forgiveness at 1 hour + dj->hibernate = 0; dj->frameset = (struct frameset *)NULL; /*< @todo does frameset need to be initialized here? */ return 0; @@ -280,6 +286,8 @@ int distrenjob_serialize(struct distrenj _distren_asprintf(&tmp, "%d", job->priority); xmlTextWriterWriteAttribute(writer, (xmlChar*)"priority", (xmlChar*)tmp); free(tmp); + xmlTextWriterWriteAttribute(writer, (xmlChar *)"output_format", (xmlChar *)job->output_format); + /** write resolution element and add its attributes */ diff --git a/src/server/distrenjob.h b/src/server/distrenjob.h --- a/src/server/distrenjob.h +++ b/src/server/distrenjob.h @@ -35,22 +35,25 @@ typedef unsigned int jobnum_t; struct distrenjob { struct distrenjob *next; /*< next will be NULL unless if there is another distrenjob */ + jobnum_t jobnum; short int type; /*< 1:Blender, 2:something else */ char *name; char *submitter; - jobnum_t jobnum; + + char *output_format; /*< currently is the file extension of the request output format. @todo make this mime-type based/not a string */ unsigned int width; /*< width in pixels of the frames to be rendered */ unsigned int height; /*< height in pixels of the frames to be rendered */ + unsigned int priority; /*< 1 is lowest, 10 is highest, 0 means the job is done */ unsigned int completed_frames; /*< number of completed frames for stats/etc */ unsigned int assigned_frames; /*< number of assigned frames (that are not yet completed) for stats/etc */ unsigned int total_frames; /*< how many frames are in the animation for stats/etc (unassigned frames) */ + int prev_frame_index; /*< the position in the array of the last frame that was assigned */ + + time_t total_render_time; /*< total seconds of time spent on all the completed frames */ + unsigned long int assigned_render_power; unsigned int watchdog_forgiveness; /*< how many seconds 'til the frame is re-assigned (if client computer crashes etc); */ short int hibernate; /*< @todo DOCUMENT THIS */ - int prev_frame_index; /*< the position in the array of the last frame that was assigned */ - time_t total_render_time; /*< total seconds of time spent on all the completed frames */ - char *output_format; /*< currently is the file extension of the request output format. @todo make this mime-type based/not a string */ - unsigned long int assigned_render_power; struct frameset *frameset; };