⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compo_ov.c

📁 COMPO source code for reference
💻 C
📖 第 1 页 / 共 3 页
字号:
        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return Err;    }#endif    /* Update device */    if ((Overlay_p->WriteParams.Flags & STCOMPO_OVERLAY_MODE_DISABLE) == 0)    {        Device_p->UpdateComposition = TRUE;    }    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return Err;}/*******************************************************************************Name        : STCOMPO_SetOverlayConstantAlphaDescription : This function sets the global alpha for this surfaceParameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_SetOverlayConstantAlpha(STCOMPO_OverlayHandle_t Overlay, U8 ConstantAlpha){    stcompo_Overlay_t* Overlay_p = (stcompo_Overlay_t*)Overlay;    stcompo_Device_t*  Device_p  = (stcompo_Device_t*)Overlay_p->CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StOA:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    if (ConstantAlpha == 0x80)    {        /* Switch off alpha if possible */        if (!(Overlay_p->WriteParams.Flags & STCOMPO_OVERLAY_MODE_PERPIXEL_ALPHA))        {            Overlay_p->WriteParams.Flags &= ~(U32)STCOMPO_OVERLAY_MODE_CONSTANT_ALPHA;        }    }    else    {        Overlay_p->WriteParams.Flags |= STCOMPO_OVERLAY_MODE_CONSTANT_ALPHA;    }    /* Set Constant Alpha */    Overlay_p->WriteParams.ConstantAlpha = ConstantAlpha;    HALCOMPO_SetOverlayConstantAlpha(Overlay_p->HalOverlay, ConstantAlpha);    /* Set Hal Overlay flags */    HALCOMPO_SetOverlayFlags(Overlay_p->HalOverlay, Overlay_p->WriteParams.Flags);    /* Update device */    if ((Overlay_p->WriteParams.Flags & STCOMPO_OVERLAY_MODE_DISABLE) == 0)    {        Device_p->UpdateComposition = TRUE;    }    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*******************************************************************************Name        : STCOMPO_SetOverlayConstantAlpha1Description : This function sets the global alpha for this surface in case of ARGB1555 formatParameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_SetOverlayConstantAlpha1(STCOMPO_OverlayHandle_t Overlay, U8 ConstantAlpha1){    stcompo_Overlay_t* Overlay_p = (stcompo_Overlay_t*)Overlay;    stcompo_Device_t*  Device_p  = (stcompo_Device_t*)Overlay_p->CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StOA1:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    /* Set Constant Alpha */    Overlay_p->WriteParams.ConstantAlpha1 = ConstantAlpha1;    HALCOMPO_SetOverlayConstantAlpha1(Overlay_p->HalOverlay, ConstantAlpha1);    /* Update device */    if ((Overlay_p->WriteParams.Flags & STCOMPO_OVERLAY_MODE_DISABLE) == 0)    {        Device_p->UpdateComposition = TRUE;    }    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*******************************************************************************Name        : STCOMPO_EnableOverlayDescription : This function turns this overlay on or offParameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_EnableOverlay(STCOMPO_OverlayHandle_t Overlay, BOOL Enable){    stcompo_Overlay_t *Overlay_p = (stcompo_Overlay_t *)Overlay;    stcompo_Device_t*  Device_p  = (stcompo_Device_t*)Overlay_p->CompoHandle;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:EnOv:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    if (Enable == TRUE)    {        Overlay_p->WriteParams.Flags &= ~(U32)STCOMPO_OVERLAY_MODE_DISABLE;    }    else    {        Overlay_p->WriteParams.Flags |= STCOMPO_OVERLAY_MODE_DISABLE;    }    /* Set Hal Overlay flags */    HALCOMPO_SetOverlayFlags(Overlay_p->HalOverlay, Overlay_p->WriteParams.Flags);    /* Update device */    Device_p->UpdateComposition = TRUE;    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*******************************************************************************Name        : STCOMPO_GetOverlayParamsDescription : Returns the current operating mode of the overlayParameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_GetOverlayParams(STCOMPO_OverlayHandle_t    Overlay,                                        STCOMPO_OverlayParams_t*   Params_p){    stcompo_Overlay_t *Overlay_p = (stcompo_Overlay_t *)Overlay;    stcompo_Device_t*  Device_p  = (stcompo_Device_t*)Overlay_p->CompoHandle;    STCOMPO_QueueUsed_t QueueUsed;    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    if ((Device_p->HalComposeScreen) == HALCOMPO_ComposeScreenCQ)    {            QueueUsed = STCOMPO_MAIN;    }    else    {            QueueUsed = STCOMPO_AUX;    }    /* Get Hal Overlay params */    HALCOMPO_GetOverlayParams(Overlay_p->HalOverlay, Params_p, QueueUsed);    /*Params_p->SrcColorKey   = Overlay_p->WriteParams.;    Params_p->DstColorKey   = Overlay_p->WriteParams.; */    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return ST_NO_ERROR;}/*******************************************************************************Name        : STCOMPO_SetOverlaySourceDescription : Set the source of the overlayParameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_SetOverlaySource(STCOMPO_OverlayHandle_t  Overlay,                                        STCOMPO_Source_t*        Src_p){    ST_ErrorCode_t     Err = ST_NO_ERROR;    stcompo_Overlay_t* Overlay_p = (stcompo_Overlay_t*) Overlay;    stcompo_Device_t*  Device_p  = (stcompo_Device_t*)Overlay_p->CompoHandle;#ifdef COMPO_ENABLE_VIDEO_SOURCE_TRACE    if ((Src_p != NULL) && (Src_p->Bitmap1_p != NULL) &&        (Src_p->Bitmap1_p->BitmapType == STGXOBJ_BITMAP_TYPE_MB))    {        COMPO_TRACE("\r\nStt:VidSrc:0x%x:%d", Src_p->Bitmap1_p->Data1_p, time_now());    }#endif#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StOS:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    /* Set HAL Source bitmap  */#ifndef COMPO_DEBUG_CHECK_ERROR    HALCOMPO_SetOverlaySource(Overlay_p->HalOverlay, Src_p);#else    Err = HALCOMPO_SetOverlaySource(Overlay_p->HalOverlay, Src_p);    if ( Err != ST_NO_ERROR)    {        /* Data structure Protection */#ifdef ST_OS21        semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20        semaphore_signal (&Device_p->AccessControlSemaphore);#endif        return Err;    }#endif    /* Update device */    if ((Overlay_p->WriteParams.Flags & STCOMPO_OVERLAY_MODE_DISABLE) == 0)    {        if (HALCOMPO_DoesOverlayUseSSBA(Overlay_p->HalOverlay) == FALSE)        {            Device_p->UpdateComposition = TRUE;        }        /* else, there still may be an update detected by HALCOMPO_CommitComposition() (see its function description) */    }    /* Data structure Protection */#ifdef ST_OS21    semaphore_signal (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_signal (&Device_p->AccessControlSemaphore);#endif    return Err;}/*******************************************************************************Name        : STCOMPO_SetOverlayOrderDescription : Allows the caller to manipulate the overlay stacking. The reference              overlay is only required for position modifiers which are relative              to another overlay.Parameters  :Assumptions :Limitations :Returns     :*******************************************************************************/ST_ErrorCode_t STCOMPO_SetOverlayOrder(STCOMPO_OverlayHandle_t   Overlay,                                       STCOMPO_OverlayOrder_t  Where,                                       STCOMPO_OverlayHandle_t   ReferenceOverlay){    stcompo_Overlay_t* Overlay_p        = (stcompo_Overlay_t*)Overlay;    stcompo_Device_t*  Device_p         = (stcompo_Device_t*)Overlay_p->CompoHandle;    stcompo_Overlay_t* OverlayInfront_p = (stcompo_Overlay_t*)Overlay_p->WriteParams.Infront;    stcompo_Overlay_t* OverlayBehind_p  = (stcompo_Overlay_t*)Overlay_p->WriteParams.Behind;	stcompo_Overlay_t* ReferenceOverlay_p = (stcompo_Overlay_t*)ReferenceOverlay;		stcompo_Overlay_t* ReferenceOverlayInfront_p = (stcompo_Overlay_t*)ReferenceOverlay_p->WriteParams.Infront;    stcompo_Overlay_t* ReferenceOverlayBehind_p  = (stcompo_Overlay_t*)ReferenceOverlay_p->WriteParams.Behind;#ifdef COMPO_ENABLE_SETTINGS_TRACE    COMPO_TRACE("\r\nStt:Setting:StOO:%d",time_now());#endif    /* Data structure Protection */#ifdef ST_OS21    semaphore_wait (Device_p->AccessControlSemaphore_p);#endif#ifdef ST_OS20    semaphore_wait (&Device_p->AccessControlSemaphore);#endif    switch(Where)    {    case STCOMPO_OVERLAY_ORDER_MOVE_FORWARD:        if (OverlayInfront_p)        {            /* Remove ourselves from the list  : Update Overlay Behind (There is at least the BackgroundOverlay behind)*/            OverlayBehind_p->WriteParams.Infront = (STCOMPO_OverlayHandle_t)OverlayInfront_p;            OverlayInfront_p->WriteParams.Behind = (STCOMPO_OverlayHandle_t)OverlayBehind_p;            /* Set up our new infront and behind pointers */            OverlayBehind_p  = OverlayInfront_p;            OverlayInfront_p = (stcompo_Overlay_t*) OverlayBehind_p->WriteParams.Infront;            /* Add us into the list */            if (OverlayInfront_p)            {                OverlayInfront_p->WriteParams.Behind = (STCOMPO_OverlayHandle_t)Overlay_p;                Overlay_p->WriteParams.Infront       = (STCOMPO_OverlayHandle_t)OverlayInfront_p;            }            else            {                Device_p->WriteParams.Front_p   = Overlay_p;                Overlay_p->WriteParams.Infront  = (STCOMPO_OverlayHandle_t)NULL;            }            /* Update the overlay from where we move forward */            OverlayBehind_p->WriteParams.Infront = (STCOMPO_OverlayHandle_t)Overlay_p;            Overlay_p->WriteParams.Behind        = (STCOMPO_OverlayHandle_t)OverlayBehind_p;        }        break;    case STCOMPO_OVERLAY_ORDER_MOVE_BACK:        if (OverlayBehind_p != &(Device_p->BackgroundOverlay))        {            /* Remove ourselves from the list */            OverlayBehind_p->WriteParams.Infront = (STCOMPO_OverlayHandle_t)OverlayInfront_p;            if (OverlayInfront_p)            {                OverlayInfront_p->WriteParams.Behind = (STCOMPO_OverlayHandle_t)OverlayBehind_p;            }            else            {                Device_p->WriteParams.Front_p = OverlayBehind_p;            }            /* Set up our new infront and behind pointers */            OverlayInfront_p = OverlayBehind_p;            OverlayBehind_p  = (stcompo_Overlay_t*)OverlayInfront_p->WriteParams.Behind;            /* Add us into the list: Update OverlayBehind (There is at least the BackgroundOverlay behind) */            OverlayBehind_p->WriteParams.Infront = (STCOMPO_OverlayHandle_t)Overlay_p;            OverlayInfront_p->WriteParams.Behind = (STCOMPO_OverlayHandle_t)Overlay_p;            Overlay_p->WriteParams.Infront       = (STCOMPO_OverlayHandle_t)OverlayInfront_p;            Overlay_p->WriteParams.Behind        = (STCOMPO_OverlayHandle_t)OverlayBehind_p;        }        break;    case STCOMPO_OVERLAY_ORDER_SEND_TO_BACK:        if (OverlayBehind_p != &(Device_p->BackgroundOverlay))        {            stcompo_Overlay_t *Back_p;            /* Find the back of the list */            Back_p = OverlayBehind_p;            while (Back_p->WriteParams.Behind != (STCOMPO_OverlayHandle_t) &(Device_p->BackgroundOverlay))            {                Back_p = (stcompo_Overlay_t *)Back_p->WriteParams.Behind;            }            /* Remove ourselves from the list */            OverlayBehind_p->WriteParams.Infront = (STCOMPO_OverlayHandle_t)OverlayInfront_p;            if (OverlayInfront_p)            {                OverlayInfront_p->WriteParams.Behind = (STCOMPO_OverlayHandle_t)OverlayBehind_p;            }            else            {                Device_p->WriteParams.Front_p = OverlayBehind_p;            }            /* Add ourselves to the back of the list */            Back_p->WriteParams.Behind      = (STCOMPO_OverlayHandle_t)Overlay_p;            Overlay_p->WriteParams.Infront  = (STCOMPO_OverlayHandle_t)Back_p;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -