📄 o_drm_certification.c
字号:
/****************************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: o_drm_certification.c
*
* Description: Project definition of the MSO_DRM_CERTIFICATION
* =========
*
****************************************************************************************************/
#include "Config.h" // Global Configuration - do not remove!
#include "include\sysdefs.h" // Global definition - do not remove!
#ifdef AVI_DRM_SUPPORT
/****************************************************************************************************
* INCLUDE FILES
****************************************************************************************************/
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\osd_rendering.h"
#include "GUI\Menu_system\ms_send_op.h"
#include "gui\menu_system\ms_object.h"
#include "gui\menu_system\ms_container.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_menu.h "
#include "Playcore\ScPad\SCMGR.h"
#include "Font\fonts.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "GUI\Object_class\Confirm\mso_confirm.h"
#include "Components\Drm\o_drm_certification.h"
#include "Menu\menu_operation_def.h"
#include "CoreAPI\CoreAPI.h"
#include "Library\String_generate.h"
#include "Services\Include\_heap.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\Drm\o_drm_certification_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\Drm\o_drm_certification_custom.h"
/****************************************************************************************************
* DECLARATION: Private (STATIC) functions
****************************************************************************************************/
STATIC MS_OP _Operation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC void _DRMRentalAction(BOOL bConfirmed);
STATIC void _DRMErrorAction(BOOL bConfirmed);
STATIC void _GetVODRentalLine1Text(FORMATED_UNICODE_STRING __NEAR* pFormUniStr, UINT32 wParam);
/**************************************************************************
* Display functions
***************************************************************************/
/***************************************************************************************
* Include customization file.
****************************************************************************************/
// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Drm\o_drm_certification_custom.c"
// Include configuration file: constants.
#include "Components\Drm\o_drm_certification_config.c"
/**************************************************************************
* Utility functions
***************************************************************************/
/**************************************************************************
* Operation functions
***************************************************************************/
/**************************************************************************
* Function : _Operation
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
STATIC MS_OP _Operation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MS_OP InputMsOp = MsOp;
MSO_DRM_CERTIFICATION __NEAR* pDRMCerti;
pDRMCerti = (MSO_DRM_CERTIFICATION __NEAR*)pThis;
switch(MsOp)
{
case MS_OP_INIT:
//fall through
case MS_OP_ON_DEFROST:
if (pThis->mpDescriptor == (MS_DESCRIPTOR*)&oDRMRentalConfirmDescriptor)
{
pDRMCerti->moParam.mScFormUniStr = OSDR_MallocScFormUniStr();
if (NULL_HANDLE != pDRMCerti->moParam.mScFormUniStr)
{
FORMATED_UNICODE_STRING oFormUniStr;
oFormUniStr.mtFontIndex = FONT_0;
_GetVODRentalLine1Text((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, 0);
//OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr);
OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, ((MSO_DRM_CERTIFICATION __NEAR*)pThis)->moParam.mScFormUniStr);
}
}
break;
case MS_OP_PREPARE_FOR_FREEZE:
case MS_OP_EMPTY:
if (pThis->mpDescriptor == (MS_DESCRIPTOR*)&oDRMRentalConfirmDescriptor)
{
if (NULL_HANDLE != pDRMCerti->moParam.mScFormUniStr)
{
OSDR_FreeScFormUniStr(pDRMCerti->moParam.mScFormUniStr);
pDRMCerti->moParam.mScFormUniStr = NULL_HANDLE;
}
}
break;
case MS_OP_CORE_CLOSE_DRM_MENU:
case MS_OP_STOP:
case MS_OP_EJECT:
case MS_OP_SKIPB:
case MS_OP_SKIPF:
// TODO: SETUP should open, need to return to browser.
case MS_OP_SETUP:
MsOp = MS_OP_BUTTON_NO;
break;
}
// TODO: Layout switch need do before OCONFIRM_Operation,otherwise core may has less memory than it need.
MsOp = OCONFIRM_Operation(pThis, MsOp, lParam);
switch(MsOp)
{
case MS_OP_BUTTON_YES:
if (pThis->mpDescriptor == (MS_DESCRIPTOR*)&oDRMRentalConfirmDescriptor)
{
#ifdef D_GUI_SINGLE_LINE_COMPONENT
MS_SendOpObject(MS_MenuGetActive(),MS_OP_MENU_CLIPS_SET_LAYOUT_RUNTIME,0);
#endif// D_GUI_SINGLE_LINE_COMPONENT
MsOp = MS_OP_NONE;
break;
}
//fall through
case MS_OP_BUTTON_NO:
#ifdef D_DIVX6_SUPPORT
if (CoreAPI_IsDivX6DRMWaitUI())
{
#ifdef D_GUI_SINGLE_LINE_COMPONENT
MS_SendOpObject(MS_MenuGetActive(),MS_OP_MENU_CLIPS_SET_LAYOUT_RUNTIME,0);
#endif// D_GUI_SINGLE_LINE_COMPONENT
MsOp = MS_OP_NONE;
break;
}
#endif
MsOp = MS_OP_DIVX_DRM_STOP;
break;
}
if (InputMsOp == MS_OP_EJECT || InputMsOp == MS_OP_SETUP)
return InputMsOp;
else
return MsOp;
}
/**************************************************************************
* Display functions
***************************************************************************/
/***************************************************************************************
* Function : _DRMRentalAction
*
* In : bConfirmed = user confirmed or not
*
* Out : None
*
* Return : none
*
* Desc : Executes the operation for the confirm menu
*
****************************************************************************************/
#pragma argsused
STATIC void _DRMRentalAction(BOOL bConfirmed)
{
if (bConfirmed)
{
CoreAPI_ConfirmDRMRental(TRUE);
}
else
{
CoreAPI_ConfirmDRMRental(FALSE);
//usleep(150000L);
//MS_SendOperation((MSO_OBJECT __NEAR*)gpScreen, MS_OP_DIVX_DRM_STOP, 0);
}
}
/***************************************************************************************
* Function : _DRMErrorAction
*
* In : bConfirmed = user confirmed or not
*
* Out : None
*
* Return : none
*
* Desc : Executes the operation for the confirm menu
*
****************************************************************************************/
#pragma argsused
STATIC void _DRMErrorAction(BOOL bConfirmed)
{
#ifdef D_DIVX6_SUPPORT
CoreAPI_ConfirmDRMRental(FALSE);
#endif
//MSO_OBJECT __NEAR* pObject = MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)gpScreen, (MS_DESCRIPTOR*)&);
//MS_SendOperation((MSO_OBJECT __NEAR*)gpScreen, MS_OP_DIVX_DRM_STOP, 0);
}
/**************************************************************************
* Function : _GetVODRentalLine1Text
* In :
* Out :
* Desc :
***************************************************************************/
STATIC void _GetVODRentalLine1Text(FORMATED_UNICODE_STRING __NEAR* pFormUniStr, UINT32 wParam)
{
// This function uses the "wParam" to hold the character count.
// We have to construct a "views remaining" string.
// Construct the string:
if (pFormUniStr->mszUniStr != NULL)
{
wParam = STR_GenerateOSDMESSAGEString(S_VIDEO_HAS, pFormUniStr->mszUniStr, 0, UNISTR_LENGTH_MAX);
wParam = STR_GenerateNumericValue((INT32)CoreAPI_GetDRMRentalsLeft(), pFormUniStr->mszUniStr, (UINT8)wParam, UNISTR_LENGTH_MAX);
wParam = STR_GenerateOSDMESSAGEString(S_VIEWS, pFormUniStr->mszUniStr, (UINT8)wParam, UNISTR_LENGTH_MAX);
// Format the string:
OSDR_FormatUniString(pFormUniStr);
}
}
#endif //AVI_DRM_SUPPORT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -