/** * \brief OIL job initialisation function. * * This function is called to prepare the RIP for an incoming job. It requires that the * OIL be in the \c OIL_Sys_Active state when the function is entered. * \param[in] eNextState The system state that is required by the end of the call; * expected to be \c OIL_Sys_JobActive. * \return Returns TRUE if the job initialization is successfully performed and * the system is placed in the requested state, FALSE otherwise. */ int JobInit(OIL_eTySystemState eNextState) { uint8 * pConfigPS; HQASSERT(OIL_Sys_Active == g_SystemState.eCurrentState, "job_init entered in invalid state"); GG_SHOW(GG_SHOW_OIL, "JobInit:\n"); /* log the job start time */ GGglobal_timing(SW_TRACE_OIL_JOBSTART, 0); /* Tell RIP we are starting a job */ pConfigPS = GetConfigPS( g_pstCurrentJob->ePDLType ); /* ready to start the page */ GGglobal_timing(SW_TRACE_OIL_PAGESTART, 0); /* Set state now as a PS job completes during execution of SwLeJobStart */ g_SystemState.eCurrentState = eNextState; if ( ! SwLeJobStart ( (uint32)strlen((char*)pConfigPS), pConfigPS, NULL) ) { /* SwLeJobStart can return false in case of bad input, but nevertheless job is now active */ GG_SHOW(GG_SHOW_OIL, "job_init: Failed to start job \n"); } /* return TRUE if now in requested state */ return (g_SystemState.eCurrentState == eNextState); }
void OIL_PageDone(OIL_TyPage *ptPMSPage) #endif { OIL_ProbeLog(SW_TRACE_OIL_PAGEDONE, SW_TRACETYPE_ENTER, (intptr_t)0); #ifdef PMS_OIL_MERGE_DISABLE GG_SHOW(GG_SHOW_OIL, "Received PAGEDONE: JobID: %d, PageID: %d \n ", ptPMSPage->JobId, ptPMSPage->PageId); GGglobal_timing(SW_TRACE_OIL_PAGEDONE, ptPMSPage->PageId); /* free the OIL memory associated with the page */ ProcessPageDone(ptPMSPage->JobId, ptPMSPage->PageId); /* free the PMS memory associated with the page */ DeletePMSPage(ptPMSPage); #else GG_SHOW(GG_SHOW_OIL, "Received PAGEDONE: JobID: %d, PageID: %d \n ", ptPMSPage->pstJob->uJobId, ptPMSPage->uPageNo); GGglobal_timing(SW_TRACE_OIL_PAGEDONE, ptPMSPage->uPageNo); /* free the OIL memory associated with the page */ ProcessPageDone(ptPMSPage->pstJob->uJobId, ptPMSPage->uPageNo); #endif OIL_ProbeLog(SW_TRACE_OIL_PAGEDONE, SW_TRACETYPE_EXIT, (intptr_t)0); }
/** * \brief OIL job exit function. * * This function is called to notify the RIP that a job has completed and * that the resources claimed by the job can now be freed. It requires that * the system be in one of \c OIL_Sys_JobCancel, \c OIL_Sys_JobActive or * \c OIL_Sys_Inactive states when the function is entered.\n * This function: * \arg requests that the RIP end the current job; * \arg discards remaining pages in the job; * \arg cleans up any partial pages; * \arg deletes the job; * \arg configures the RIP according to the settings in the next job, if any, and * \arg places the system into the next requested state, if it is not already inactive. * * This function does not cause the RIP to exit. * * \param[in] eNextState The system state that is required by the end of the call. * \return Returns TRUE if the post-job cleanup is successful and the OIL is * placed in the requested state, FALSE otherwise. */ int JobExit(OIL_eTySystemState eNextState) { char szJobName[OIL_MAX_JOBNAME_LENGTH]; int GPSPlotCloseretval; int GPSSinCloseretval ; int GPSSoutCloseretval; int GPSSoutFlushretval; int GPSSoutWriteretval; long len,i; int fin = GPS_INTERP_FIN_NORMAL, uel_found=1; HQASSERT(OIL_Sys_JobCancel == g_SystemState.eCurrentState || OIL_Sys_JobActive == g_SystemState.eCurrentState || OIL_Sys_Inactive == g_SystemState.eCurrentState, "job_exit entered in invalid state"); GG_SHOW(GG_SHOW_OIL, "JobExit:\n"); /* release resources */ while (g_ulGGtiming_pagecount != 0) { /* wait - until all the pages have been output */ OIL_RelinquishTimeSlice(); } /* free(g_pstCurrentJob); */ { if (!SwLeJobEnd()) { /* Report this error */ GG_SHOW(GG_SHOW_OIL, "job_exit: Failed to finish job \n"); } } if(OIL_Sys_Inactive != g_SystemState.eCurrentState) { g_SystemState.eCurrentState = eNextState; } /* At this point RIPping must have completed and oil should have received data for all pages from the RIP*/ g_pstCurrentJob->eJobStatus = OIL_Job_RipDone; /* keep the jobname safe for use in timing log before deleting job */ strcpy(szJobName, g_pstCurrentJob->szJobName); /* Wait for all pages to be removed */ while(g_pstCurrentJob->pPage!=NULL) { OIL_RelinquishTimeSlice(); } /* check for incomplete pages which can be a result of job cancel */ if (g_pstCurrentPage) { DeleteOILPage(g_pstCurrentPage); g_pstCurrentPage = 0; } if(event_Cancel_flag == TRUE) { gpsInterpNotifyState(&gps_client, GPS_INTERP_STATE_FLUSHING); gpsFrameCancel(&gps_client,gps_frameid); gpsPlotCancel(&gps_client, PlotSet_plotid); fin = GPS_INTERP_FIN_CANCEL; } #ifndef PMS_OIL_MERGE_DISABLE_JS /***********Call to gpsflush and gpswrite for buffer1***************************/ if(*buffer1!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } len=0; for(i=0;buffer1[i]!='\0';i++) len++; printf(" 1 size of hostbuff = %d\n",sizeof(host_outBuff)); GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer1,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff2***************************/ if(*buffer2!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 2 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer2[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer2,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff3***************************/ if(*buffer3!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 3 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer3[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer3,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff4***************************/ if(*buffer4!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 4 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer4[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer4,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to gpsflush and gpswrite for buff5***************************/ if(*buffer5!=NULL) { if(host_outBuff) { GPSSoutFlushretval=GPS_SoutFlush(host_outBuff); if(GPSSoutFlushretval==0) { printf("GPS_SoutFlush : Success\n"); } else { printf("GPS_SoutFlush : Failed\n"); } } printf(" 5 size of hostbuff = %d\n",sizeof(host_outBuff)); len=0; for(i=0;buffer5[i]!='\0';i++) len++; GPSSoutWriteretval=GPS_SoutWrite(host_outBuff,buffer5,len,GPS_HOST_NONBLOCK); if(GPSSoutWriteretval >= 0) { printf("GPS_SoutWrite : Success\n"); } else { printf("GPS_SoutWrite : Failed\n"); } } /***********Call to GpsPlotclose***************************/ /* AppendJob = True. Don't close the Output channel, next job uses same. AppendJob = False. Close the Output channel, job ends here. */ if(AppendJob == 0) { GPSPlotCloseretval = GPS_PlotClose(gps_client, PlotSet_plotid); if(GPSPlotCloseretval>=0) { printf("GPS_PlotClose : Success\n"); } else { printf("GPS_PlotClose : Failed\n"); } PlotSet_plotid = -1; /***********Call to GpsSinclose***************************/ if (host_inBuff || host_outBuff) { GPSSinCloseretval=GPS_SinClose(host_inBuff); if(GPSSinCloseretval==0) { printf("GPS_SinClose : Success\n"); host_inBuff = NULL; } else { printf("GPS_SinClose : Failed\n"); } /***********Call to GpsSoutclose***************************/ GPSSoutCloseretval=GPS_SoutClose(host_outBuff); if(GPSSoutCloseretval==0) { printf("GPS_SoutClose : Success\n"); host_outBuff = NULL; } else { printf("GPS_SoutClose : Failed\n"); } /***********Call to GpsInterpfinishProcdata***************************/ GPS_InterpFinishProcData(gps_client, 1, fin, uel_found); } else { gpsInterpFinishTestprint(gps_client, jobid); } /*************Call to gpsInterpNotifyState()*************************************/ GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_FLUSHING); // Review - it should be GPS_INTERP_STATE_IDLE ? } #endif /* Delete the job */ DeleteOILJob(g_pstCurrentJob->uJobId); g_pstCurrentJob = NULL; /* Reconfigure the features */ g_ConfigurableFeatures.g_ePaperSelectMode = g_NextJobConfiguration.g_ePaperSelectMode; g_ConfigurableFeatures.g_uGGShow = g_NextJobConfiguration.g_uGGShow; /* print out the timing data */ if(g_bLogTiming) { GGglobal_timing_dumplog((unsigned char*)szJobName); } /* reset data for next job */ GGglobal_timing(SW_TRACE_OIL_RESET, 0); current_pdlid=0; g_tJob.eTestPage = OIL_TESTPAGE_NONE; /* return TRUE if now in requested state */ return (g_SystemState.eCurrentState == eNextState); }
/** * \brief OIL system initialization function. * * Calling this function initializes the OIL and starts the RIP. The function * first checks to ensure that the OIL is not in the \c OIL_Sys_JobActive or * \c OIL_Sys_Uninitialised states. This function: * \arg sets up the callback functions used by the Skin to allocate and free memory. * \n In addition, if the system is currently in the \c OIL_Sys_Inactive state and the next state * requested is the \c OIL_Sys_Active state, this function: * \arg allocates and initializes RIP memory; * \arg provides a list of embedded devices to the RIP; * \arg provides exit and reboot callback functions to the RIP; * \arg starts the RIP; * \arg registers resources, RIP modules and streams as required, and * \arg places the system into the \c OIL_Sys_Active state. * \n If the system is currently in the \c OIL_Sys_Suspended state, and the next state * requested is the \c OIL_Sys_Active state, this function: * \arg places the system into the \c OIL_Sys_Active state. * * During this call the RIP is started and claims * \c g_SystemState.cbRIPMemory bytes of memory. * * \param[in] eNextState The system state that is required by the end of the call; * expected to be \c OIL_Sys_Active. * \return Returns TRUE if the system is successfully initialized (as necessary) * and placed in the requested state, FALSE otherwise. */ int SysInit(OIL_eTySystemState eNextState) { struct SysMemFns tSkinMemoryFns; HQASSERT((OIL_Sys_JobActive != g_SystemState.eCurrentState), ("sys_init entered in state: OIL_Sys_JobActive")); HQASSERT((OIL_Sys_Uninitialised != g_SystemState.eCurrentState), ("sys_init entered in state: OIL_Sys_Uninitialised")); /* Initialise the memory helper functions */ /* - these are the memory allocation functions to be used by skin */ tSkinMemoryFns.pAllocFn = SysAllocFnCallback; tSkinMemoryFns.pFreeFn = SysFreeFnCallback; GG_SHOW(GG_SHOW_OIL, "SysInit:\n"); if ( g_profile_scope != NULL && !SwLeProfileOption(NULL, g_profile_scope) ) { oil_printf("sys_init: Invalid profile scope %s\n", g_profile_scope); return 0; } /* log the job start time */ GGglobal_timing(SW_TRACE_OIL_SYSSTART, 0); if ((g_SystemState.eCurrentState == OIL_Sys_Inactive) && (eNextState == OIL_Sys_Active)) { uint8 *reasonText ; /* allocate memory for the RIP, all systems ready for a job */ g_SystemState.pRIPMemory = NULL; #ifdef PMS_OIL_MERGE_DISABLE_MEM g_SystemState.pRIPMemory = OIL_malloc(OILMemoryPoolSys, OIL_MemBlock, g_SystemState.cbRIPMemory); #else g_SystemState.pRIPMemory = mmalloc(g_SystemState.cbRIPMemory); #endif if(g_SystemState.pRIPMemory == NULL) /*Bad Pointer*/ { oil_printf("sys_init: Failed to allocate RIP Memory\n"); return 0; } (void)SwLeInitRuntime(NULL) ; MemLogInit(g_mps_log, g_mps_telemetry) ; /* It is assumed that pthreads has been initialised. This is done earlier in the OIL boot process. */ /* initialize the SDK support libraries */ g_SystemState.cbmaxAddressSpace = g_SystemState.cbRIPMemory; if ( !SwLeSDKStart(&g_SystemState.cbmaxAddressSpace, &g_SystemState.cbRIPMemory, g_SystemState.pRIPMemory, &tSkinMemoryFns, &reasonText) ) { GG_SHOW(GG_SHOW_OIL, "sys_init: %s.\n", (char *)reasonText) ; return FALSE ; } /* Set number of RIP renderer threads */ SwLeSetRipRendererThreads( g_ConfigurableFeatures.nRendererThreads ); SwLeMemInit(g_SystemState.cbmaxAddressSpace, g_SystemState.cbRIPMemory, 0, g_SystemState.pRIPMemory); /* set MultipleCopies pgbdev param to true so that we get just 1 copy in rastercallback */ SwLePgbSetMultipleCopies(TRUE); SwLeSetRasterCallbacks(OIL_RasterStride, OIL_RasterRequirements, OIL_RasterDestination, OIL_RasterCallback); /* Add embedded devices to list passed to RIP */ SwLeAddCustomDevices( sizeof(ppEmbeddedDevices) / sizeof(ppEmbeddedDevices[0]), ppEmbeddedDevices ); /* set RIP exit callback */ SwLeSetRipExitFunction( OIL_RipExitCallback ); /* set RIP reboot callback */ SwLeSetRipRebootFunction( OIL_RipRebootCallback ); if (!oil_progress_init()) { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to start progress timeline \n"); return FALSE; } /* Start RIP */ if ( SwLeStart( g_SystemState.cbmaxAddressSpace, g_SystemState.cbRIPMemory, 0, g_SystemState.pRIPMemory, (SwLeMONITORCALLBACK *)OIL_MonitorCallback ) ) { g_SystemState.eCurrentState = eNextState; } else { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to start RIP \n"); return FALSE; } /* Report job processing times */ progevts_enable_times(); oil_events_initialise(); if(!RegisterResources()) { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to register resources\n"); return FALSE; } if(!RegisterRIPModules()) { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to register RIP modules\n"); return FALSE; } if(!Stream_Register()) { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to register Stream\n"); return FALSE; } } if ( !libjpeg_register() || !libjpegturbo_register() ) { GG_SHOW(GG_SHOW_OIL, "sys_init: Failed to register libjpeg\n"); return FALSE; } if ((g_SystemState.eCurrentState == OIL_Sys_Suspended) && (eNextState == OIL_Sys_Active)) { GG_SHOW(GG_SHOW_OIL, "**RIP awakes\n"); g_SystemState.eCurrentState = eNextState; return TRUE; } /* Reset the job error status */ g_JobErrorData.Code = 0; g_JobErrorData.bErrorPageComplete = FALSE; /* return TRUE if now in requested state */ return (g_SystemState.eCurrentState == eNextState); }
/** * \brief Submit a fully rendered page to the PMS. * * This function is called once the OIL page is completely rendered. Before submitting * the page to the PMS, various conditions are checked. The page will not be submitted * if it is outside the range of pages to be printed for the job, or if it a blank page * and blank page suppression has been activated. A page which is does not pass these * tests is deleted. * * If fewer planes have been created for the page than expected for the colorant family, blank * planes will be generated as required, or the job forced to monochrome in the case of a * CMYK job with blank color planes, if this functionality has been activated. * * Finally, if the page is to be submitted to the PMS, the completed OIL page structure * is used to create a PMS page, which is passed to PMS_CheckinPage(). If the page is * not to be submitted to the PMS, then the page is deleted immediately as the PMS * will not call the OIL function to indicate that the page has been output. */ void SubmitPageToPMS(void) { OIL_TyPage **ptLastPage; #ifdef PMS_OIL_MERGE_DISABLE PMS_TyPage *ptPMSPage; #endif int bSubmitPage = TRUE; #ifndef PMS_OIL_MERGE_DISABLE_JS gps_pageinfo_t pageinfo; int GPSFramePrintretval; int FP_force=GPS_PRINT_NORMAL; int FP_frameid=1; #endif #ifdef DIRECTPRINTPCLOUT PMS_TySystem ptPMSSysInfo; #endif g_pstCurrentJob->uPagesParsed++; #ifdef DIRECTPRINTPCLOUT PMS_GetSystemInfo(&ptPMSSysInfo , PMS_CurrentSettings); if((ptPMSSysInfo.eOutputType == PMS_DIRECT_PRINT) || (ptPMSSysInfo.eOutputType == PMS_DIRECT_PRINTXL)) { GGglobal_timing(SW_TRACE_OIL_CHECKIN, 0); GGglobal_timing(SW_TRACE_OIL_PAGEDONE, 0); return; } #endif OIL_ProbeLog(SW_TRACE_OIL_SUBMITPAGETOPMS, SW_TRACETYPE_ENTER, (intptr_t)g_pstCurrentJob->uPagesParsed); #ifdef USE_PJL bSubmitPage = OIL_PjlShouldOutputPage(g_pstCurrentJob->uPagesParsed, g_pstCurrentJob); #endif #ifndef PMS_OIL_MERGE_DISABLE_JS // memset(&pageinfo, 0, sizeof(pageinfo)); #endif if (bSubmitPage) { if ((!g_pstCurrentPage) || (g_pstCurrentPage->nBlankPage == TRUE)) { if (g_pstCurrentJob->bSuppressBlank == TRUE) { /* if blank pages are to be suppressed, then do not create the blank page. */ bSubmitPage = FALSE; } else { /* we have no CurrentPage - because this is a blank page */ GG_SHOW(GG_SHOW_OIL, "Blank page detected: create a blank page. \n "); g_pstCurrentPage = CreateOILBlankPage(g_pstCurrentPage, NULL); if(!g_pstCurrentPage) { /* There was some problem creating the blank page. Already would have been asserted */ return; } } } } if (bSubmitPage) { g_pstCurrentPage->pstJob = g_pstCurrentJob; /* attach the page at the tail of the page list of current job */ ptLastPage = &g_pstCurrentJob->pPage; while(*ptLastPage != NULL) { ptLastPage = (OIL_TyPage **)&(*ptLastPage)->pNext; } *ptLastPage = g_pstCurrentPage; g_pstCurrentJob->uPagesToPrint++; g_pstCurrentJob->uPagesInOIL++; #ifdef PMS_OIL_MERGE_DISABLE /* create PMS page from the oil page */ ptPMSPage = CreatePMSPage(g_pstCurrentPage); g_pstCurrentPage->ptPMSpage = ptPMSPage ; #endif GGglobal_timing(SW_TRACE_OIL_CHECKIN, g_pstCurrentJob->uPagesToPrint); /* There is no data attached to the page structure when using the push band delivery methods. Instead the checksum is computed in the SubmitBandToPMS function above. */ if(g_bPageChecksum && (g_ConfigurableFeatures.eBandDeliveryType != OIL_PUSH_BAND) && (g_ConfigurableFeatures.eBandDeliveryType != OIL_PUSH_BAND_DIRECT_SINGLE) && (g_ConfigurableFeatures.eBandDeliveryType != OIL_PUSH_BAND_DIRECT_FRAME) ) { uint8 *px; uint32 uBand; uint32 uColorant; uint32 uPageChecksum = 0; uint32 uBandSizeChecksum = 0; /* Record start of checksum calculation */ OIL_ProbeLog(SW_TRACE_OIL_PAGECHECKSUM, SW_TRACETYPE_ENTER, (intptr_t)uPageChecksum); for(uColorant = 0; uColorant < OIL_MAX_PLANES_COUNT; uColorant++) { #ifdef PMS_OIL_MERGE_DISABLE if(ptPMSPage->atPlane[uColorant].ePlaneColorant != PMS_INVALID_COLOURANT) { for(uBand = 0; uBand < ptPMSPage->atPlane[uColorant].uBandTotal; uBand++) { for(px = (uint8 *)ptPMSPage->atPlane[uColorant].atBand[uBand].pBandRaster; px < (uint8 *)(ptPMSPage->atPlane[uColorant].atBand[uBand].pBandRaster + ptPMSPage->atPlane[uColorant].atBand[uBand].cbBandSize); px++) { uPageChecksum+=*px; } uBandSizeChecksum+=ptPMSPage->atPlane[uColorant].atBand[uBand].cbBandSize; } } #else if(g_pstCurrentPage->atPlane[uColorant].ePlaneColorant != OIL_InvalidColor) { for(uBand = 0; uBand < g_pstCurrentPage->atPlane[uColorant].uBandTotal; uBand++) { for(px = (uint8 *)g_pstCurrentPage->atPlane[uColorant].atBand[uBand].pBandRaster; px < (uint8 *)(g_pstCurrentPage->atPlane[uColorant].atBand[uBand].pBandRaster + g_pstCurrentPage->atPlane[uColorant].atBand[uBand].cbBandSize); px++) { uPageChecksum+=*px; } uBandSizeChecksum+=g_pstCurrentPage->atPlane[uColorant].atBand[uBand].cbBandSize; } } #endif } GG_SHOW(GG_SHOW_CHECKSUM, "Raster checksum: %d, 0x%08X\n", g_pstCurrentJob->uPagesToPrint, uPageChecksum); GG_SHOW(GG_SHOW_CHECKSUM, "Band size checksum: %d, 0x%08X\n", g_pstCurrentJob->uPagesToPrint, uBandSizeChecksum); /* Record end of checksum calculation */ OIL_ProbeLog(SW_TRACE_OIL_PAGECHECKSUM, SW_TRACETYPE_EXIT, (intptr_t)uPageChecksum); /* Record checksum value */ OIL_ProbeLog(SW_TRACE_OIL_PAGECHECKSUM, SW_TRACETYPE_MARK, (intptr_t)uPageChecksum); } /* checkin the page */ #ifdef PMS_OIL_MERGE_DISABLE PMS_CheckinPage(ptPMSPage); #else #ifdef PMS_OIL_MERGE_DISABLE_JS PMS_CheckinPage(g_pstCurrentPage); #else /*PMS_CheckinPage(ptPMSPage);*/ /***************************Call to gpsFramePrint***********************************/ GPSFramePrintretval = GPS_FramePrint(gps_client, FP_frameid, &pageinfo, FP_force); if(!GPSFramePrintretval) { printf("GPS_FramePrint : Success\n"); } else { printf("GPS_FramePrint : Failed\n"); } #endif #endif /* ready to start the page */ GGglobal_timing(SW_TRACE_OIL_PAGESTART, 0); } else if (g_pstCurrentPage) { DeleteOILPage(g_pstCurrentPage); g_pstCurrentPage = NULL; } OIL_ProbeLog(SW_TRACE_OIL_SUBMITPAGETOPMS, SW_TRACETYPE_EXIT, (intptr_t)g_pstCurrentJob->uPagesParsed); }
int OIL_Init(void (**apfn_funcs[])()) { char *pSrc, *pDst; char szProbeOptions[MAX_PROBE_ARG_LEN + 1]; /* hook up the HQNc-standard assertion handlers */ HqAssertHandlers_t assert_handlers = { HqCustomAssert, HqCustomTrace } ; SetHqAssertHandlers(&assert_handlers) ; /*Start pthreads if not part of the OS. */ if (! OIL_Init_platform()) return 0; /* Initialise bare essential structures, this memory will never be released */ g_pstCurrentJob = NULL; g_SystemState.eCurrentState = OIL_Sys_Uninitialised; #ifndef PMS_OIL_MERGE_DISABLE_JS Call_gps_InterpNotifyState(g_SystemState.eCurrentState); #endif g_SystemState.pUserData = NULL; g_SystemState.bJobCancelReq = FALSE; g_ConfigurableFeatures.bGenoaCompliance = TRUE; g_ConfigurableFeatures.bScalableConsumption = FALSE; g_ConfigurableFeatures.bImageDecimation = FALSE; g_ConfigurableFeatures.bPixelInterleaving = FALSE; g_bLogTiming = FALSE; g_bPageChecksum = FALSE; /* Initialise g_nTimeInit = 0 to be used inside OIL_TimeInMilliSecs */ g_nTimeInit = 0; g_nTimeInit = OIL_TimeInMilliSecs(); /* all parameters initialized here must also be set in JobExit() */ g_ConfigurableFeatures.g_eShutdownMode = g_NextJobConfiguration.g_eShutdownMode = OIL_RIPShutdownPartial; /* initialise GG_SHOW control param to output only oil version messages - for all msgs set to 0xffff */ g_ConfigurableFeatures.g_uGGShow = GG_SHOW_OILVER; if((g_tSystemInfo.nOILconfig & 0x40) != 0) g_ConfigurableFeatures.g_uGGShow |= GG_SHOW_JOBCFG; g_NextJobConfiguration.g_uGGShow = g_ConfigurableFeatures.g_uGGShow; g_ConfigurableFeatures.fEbdTrapping = 0.0f; g_ConfigurableFeatures.uColorManagement = 0; /* Color management disabled */ g_ConfigurableFeatures.bRetainedRaster = FALSE; /* Set to TRUE to enable */ g_ConfigurableFeatures.bRasterByteSWap = FALSE; /* Set to TRUE to enable */ #if USE_RAM_SW_FOLDER g_ConfigurableFeatures.bSWinRAM = 1; #else g_ConfigurableFeatures.bSWinRAM = 0; #endif #if defined(USE_UFST5) g_ConfigurableFeatures.bUseUFST5 = 1; #else g_ConfigurableFeatures.bUseUFST5 = 0; #endif #if defined(USE_UFST7) g_ConfigurableFeatures.bUseUFST7 = 1; #else g_ConfigurableFeatures.bUseUFST7 = 0; #endif #ifdef USE_FF g_ConfigurableFeatures.bUseFF = 1; #else g_ConfigurableFeatures.bUseFF = 0; #endif /* initialize the PMS callback pointers */ *g_apfn_pms_calls = (void *)apfn_funcs; g_SystemState.eCurrentState = OIL_Sys_Inactive; #ifndef PMS_OIL_MERGE_DISABLE_JS Call_gps_InterpNotifyState(g_SystemState.eCurrentState); #endif GGglobal_timing(SW_TRACE_OIL_RESET, 0); /* Configure some configurable features from PMS */ GetPMSSystemInfo(); GetRIPFeatures(&stRIPFeatures); g_NextJobConfiguration.g_ePaperSelectMode = g_ConfigurableFeatures.g_ePaperSelectMode; /* Enable Scalable Consumption rip configuration */ if(g_SystemState.nOILconfig & 0x01) { g_ConfigurableFeatures.bScalableConsumption = TRUE; } /* if OIL timing enabled, set flag */ if(g_SystemState.nOILconfig & 0x02) { g_bLogTiming = TRUE; g_ConfigurableFeatures.g_uGGShow = g_NextJobConfiguration.g_uGGShow |= GG_SHOW_TIMING; } /* if page checksum enable, set flag */ if(g_SystemState.nOILconfig & 0x04) { g_bPageChecksum = TRUE; g_ConfigurableFeatures.g_uGGShow = g_NextJobConfiguration.g_uGGShow |= GG_SHOW_CHECKSUM; } /* if Genoa compliance bit set, disable genoa settings */ if(g_SystemState.nOILconfig & 0x08) { g_ConfigurableFeatures.bGenoaCompliance = FALSE; } /* if Image Decimation bit set, disable Image Decimation * Image Decimation command line control is disabled until further notice. if(g_SystemState.nOILconfig & 0x10) { g_ConfigurableFeatures.bImageDecimation = FALSE; } */ /* if retained raster bit is set, enable retained raster settings */ if((g_SystemState.nOILconfig & 0x20) && (stRIPFeatures.bPDF == TRUE)) { g_ConfigurableFeatures.bRetainedRaster = TRUE; } /* if raster byte swap bit is set, enable raster byte swap setting */ if(g_SystemState.nOILconfig & 0x80) { g_ConfigurableFeatures.bRasterByteSWap = TRUE; } if((g_ConfigurableFeatures.szProbeTrace[0] != '\0') || g_bLogTiming) { /* initialise probe handler function pointers */ OIL_ProbeLogInit("-b", "ebdprobe.log") ; } if(g_ConfigurableFeatures.szProbeTrace[0] != '\0') { pSrc = &g_ConfigurableFeatures.szProbeTrace[0]; pDst = &szProbeOptions[0]; for(; *pSrc; pSrc++) { if(*pSrc=='\"') continue; else if(*pSrc==' ') { *pDst++ = '\0'; while(*pSrc && *pSrc==' ') pSrc++; if(!*pSrc) break; pSrc--; } else *pDst++=*pSrc; } *pDst++='\0'; *pDst='\0'; for(pSrc = &szProbeOptions[0]; *pSrc; pSrc++) { /* Probe logging feature using default handler in skinkit */ if ( !OIL_ProbeOption(NULL, pSrc) ) { OIL_ProbeOptionUsage() ; OIL_ProbeLogFinish() ; break; } pSrc+=strlen(pSrc); } } GG_SHOW(GG_SHOW_OILVER, "OIL Version: %s - ", OILVersion); ShowRIPFeatures(); GG_SHOW(GG_SHOW_OILVER, "\r\n"); #ifdef USE_PJL OIL_PjlInit(); #endif return 1; }