diff -ur decode_display/src/ilclient.c decode_display.modified/src/ilclient.c --- decode_display/src/ilclient.c 2012-04-19 12:22:39.000000000 +0100 +++ decode_display.modified/src/ilclient.c 2012-08-10 15:14:33.000000000 +0100 @@ -80,6 +80,60 @@ #include #include + +#include +#include + +// Hackery to dynamically modify scaler resolution. +// After being called 100 times, it modifies the scaler input resolution to upscale +// part of the image rather than the whole image. Numbers are correct for 720p +// decoder output, for other resolutions this should just change it to produce +// something random (but still succeed). + +static IL_CLIENT_COMP_PRIVATE *hack_scaler_component; +static int hack_scaler_input_frames, hack_scaler_output_frames; + +static void hack_scaler_input_hook(IL_CLIENT_COMP_PRIVATE *comp) +{ + ++hack_scaler_input_frames; + printf("scaler input frame %d\n", hack_scaler_input_frames); + + if(hack_scaler_input_frames == 100) { + OMX_ERRORTYPE err; + OMX_CONFIG_VIDCHANNEL_RESOLUTION res; + + OMX_INIT_PARAM(&res); + res.eDir = OMX_DirInput; + res.nChId = 0; + res.Frm0Width = 640; + res.Frm0Height = 360; + res.Frm0Pitch = 1408; + res.Frm1Width = 0; + res.Frm1Height = 0; + res.Frm1Pitch = 0; + res.FrmStartX = 0; + res.FrmStartY = 0; + res.FrmCropWidth = 0; + res.FrmCropHeight = 0; + + err = OMX_SetConfig(comp->handle, + (OMX_INDEXTYPE) OMX_TI_IndexConfigVidChResolution, + &res); + if(err != OMX_ErrorNone) { + ERROR("failed to modify scaler input channel resolution\n"); + } else { + printf("successfully modified scaler input channel resolution\n"); + } + } +} +static void hack_scaler_output_hook(IL_CLIENT_COMP_PRIVATE *comp) +{ + ++hack_scaler_output_frames; + printf("scaler output frame %d\n", hack_scaler_output_frames); +} + + + OMX_U8 PADX; OMX_U8 PADY; extern void IL_ClientFbDevAppTask (void *threadsArg); @@ -273,6 +327,9 @@ OMX_ERRORTYPE eError = OMX_ErrorNone; int retVal = 0; + if(thisComp == hack_scaler_component) + hack_scaler_output_hook(thisComp); + /* get the pipe corrsponding to this port, portIndex is part of bufferheader structure */ outPortParamsPtr = @@ -499,6 +556,9 @@ pBufferIn->pMarkData = pipeMsg->bufHeader.pMarkData; pBufferIn->nTickCount = 0; + if(thisComp == hack_scaler_component) + hack_scaler_input_hook(thisComp); + /* call etb to the component */ err = OMX_EmptyThisBuffer (thisComp->handle, pBufferIn); return (err); @@ -817,6 +877,8 @@ } pAppData->scILComp->handle = pAppData->pScHandle; + hack_scaler_component = pAppData->scILComp; + printf (" scalar compoenent is created \n"); /* omx calls are made in this function for setting the parameters for scalar