XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c
int XVprocSs_SetPictureDemoWindow(XVprocSs *InstancePtr,
	                              XVidC_VideoWindow *Win)
{
  u16 width, height;
  int status = XST_FAILURE;

  /* Verify arguments */
  Xil_AssertNonvoid(InstancePtr != NULL);
  Xil_AssertNonvoid(InstancePtr->CscPtr != NULL);
  Xil_AssertNonvoid(Win != NULL);

  if((InstancePtr->CscPtr) && (XV_CscIsDemoWindowEnabled(InstancePtr->CscPtr))) {
    width  = XV_csc_Get_HwReg_width(&InstancePtr->CscPtr->Csc);
	height = XV_csc_Get_HwReg_height(&InstancePtr->CscPtr->Csc);

	//Check if window is within the active frame resolution
	if((Win->StartX > width)   ||
	   (Win->StartY > height) ||
	   ((Win->StartX + Win->Width) > width) ||
	   ((Win->StartY + Win->Height) > height)) {
	  status = XST_FAILURE;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_CSC_BADWIN);
	} else {
	  status = XST_SUCCESS;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_CSC_SETWIN);
	}

	if(status == XST_SUCCESS) {
	  XV_CscSetDemoWindow(InstancePtr->CscPtr, Win);
	}
  }
  return(status);
}
/*****************************************************************************/
/**
* This function sets picture Demo Window.
* Post this function call all further picture settings will apply only within
* the defined window. Demo window gets reset everytime subsystem
* configuration changes
*
* @param  InstancePtr is a pointer to the Subsystem instance to be worked on.
* @param  Win is the pointer to window coordinates within which picture
*         settings should be applied
*
* @return XST_SUCCESS if window is valid else XST_FAILURE
*
* @note   Applicable only if CSC core is included in the subsystem and the
*         Demo Window is enabled
*
******************************************************************************/
This function sets picture Demo Window.
Post this function call all further picture settings will apply only within
the defined window. Demo window gets reset everytime subsystem
configuration changes
This function sets picture Demo Window . Post this function call all further picture settings will apply only within the defined window . Demo window gets reset everytime subsystem configuration changes
int XVprocSs_SetPictureDemoWindow(XVprocSs *InstancePtr,
	                              XVidC_VideoWindow *Win)
{
  u16 width, height;
  int status = XST_FAILURE;
  Xil_AssertNonvoid(InstancePtr != NULL);
  Xil_AssertNonvoid(InstancePtr->CscPtr != NULL);
  Xil_AssertNonvoid(Win != NULL);
  if((InstancePtr->CscPtr) && (XV_CscIsDemoWindowEnabled(InstancePtr->CscPtr))) {
    width  = XV_csc_Get_HwReg_width(&InstancePtr->CscPtr->Csc);
	height = XV_csc_Get_HwReg_height(&InstancePtr->CscPtr->Csc);
	if((Win->StartX > width)   ||
	   (Win->StartY > height) ||
	   ((Win->StartX + Win->Width) > width) ||
	   ((Win->StartY + Win->Height) > height)) {
	  status = XST_FAILURE;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_CSC_BADWIN);
	} else {
	  status = XST_SUCCESS;
      XVprocSs_LogWrite(InstancePtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_CSC_SETWIN);
	}
	if(status == XST_SUCCESS) {
	  XV_CscSetDemoWindow(InstancePtr->CscPtr, Win);
	}
  }
  return(status);
}
int XVprocSs_SetPictureDemoWindow ( XVprocSs * InstancePtr , XVidC_VideoWindow * Win ) { u16 width , height ; int status = XST_FAILURE ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( InstancePtr -> CscPtr != NULL ) ; Xil_AssertNonvoid ( Win != NULL ) ; if ( ( InstancePtr -> CscPtr ) && ( XV_CscIsDemoWindowEnabled ( InstancePtr -> CscPtr ) ) ) { width = XV_csc_Get_HwReg_width ( & InstancePtr -> CscPtr -> Csc ) ; height = XV_csc_Get_HwReg_height ( & InstancePtr -> CscPtr -> Csc ) ; if ( ( Win -> StartX > width ) || ( Win -> StartY > height ) || ( ( Win -> StartX + Win -> Width ) > width ) || ( ( Win -> StartY + Win -> Height ) > height ) ) { status = XST_FAILURE ; XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_CSC_BADWIN ) ; } else { status = XST_SUCCESS ; XVprocSs_LogWrite ( InstancePtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_CSC_SETWIN ) ; } if ( status == XST_SUCCESS ) { XV_CscSetDemoWindow ( InstancePtr -> CscPtr , Win ) ; } } return ( status ) ; }
This function sets picture Demo Window.
This function sets picture Demo Window .
/* Verify arguments */ //Check if window is within the active frame resolution