📄 pvrmpeg.c
字号:
/*!****************************************************************************
@File pvrmpeg.c
@Title Mpeg Services main module
@Author Imagination Technologies
@date 23rd Jan 2004
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
All rights reserved. No part of this software, either
material or conceptual may be copied or distributed,
transmitted, transcribed, stored in a retrieval system
or translated into any human or computer language in any
form by any means, electronic, mechanical, manual or
other-wise, or disclosed to third parties without the
express written permission of Imagination Technologies
Limited, Unit 8, HomePark Industrial Estate,
King's Langley, Hertfordshire, WD4 8LZ, U.K.
@Platform generic
@Description Main API entry for Mpeg Services
@DoxygenVer
******************************************************************************/
/******************************************************************************
Modifications :-
$Log: pvrmpeg.c $
*****************************************************************************/
#include "services_headers.h"
#ifdef SUPPORT_DEVCLASS_MPEG
/*----------------------------------------------------------------------------
Public functions
PVRSRVCreateMPEGContext
------------------------------------------------------------------------------*/
static IMG_BOOL ReleaseMPEGConnection(IMG_UINT32 ui32ProcessID, IMG_PVOID pvParam, IMG_UINT32 ui32Param);
/*!
******************************************************************************
@Function PVRSRVConnectMPEGApplication
@Description
Create an MPEG context for an application
@Input psDevInfo
@Input bConnect
@Return PVRSRV_ERROR :
******************************************************************************/
PVRSRV_ERROR PVRSRVConnectMPEGApplication(PVRSRV_DEV_DATA *psDevData, IMG_BOOL bConnect)
{
PVRSRV_ERROR eError = PVRSRV_OK;
PVRSRV_DEV_INFO *psDevInfo = psDevData->psDevInfoKM;
/* Valdate device class and type */
if(psDevInfo->sDevId.eDeviceClass != PVRSRV_DEVICE_CLASS_MPEG)
{
return(PVRSRV_ERROR_INVALID_DEVICE);
}
if(bConnect)
{
/*********************************************** Connect Application */
ResManRegisterRes((PRESMAN_ITEM)IMG_NULL, RESMAN_TYPE_MPEGCONNECT,
psDevInfo, 0, (RESMAN_FREE_FN)ReleaseMPEGConnection,
RESMAN_AUTOFREE_LEV1);
}
else
{
/******************************************** Disconnect application */
eError = ResManFreeResByCriteria(RESMAN_CRITERIA_RESTYPE,
RESMAN_TYPE_MPEGCONNECT, IMG_NULL, 0, 0);
}
return(eError);
}
/*----------------------------------------------------------------------------
<function>
FUNCTION : FreeDeviceMemCallBack
PURPOSE : ResMan call back to free device memory
PARAMETERS :
RETURNS : TRUE - successful, FALSE - failed
</function>
------------------------------------------------------------------------------*/
static PVRSRV_ERROR ReleaseMPEGConnection(IMG_UINT32 ui32ProcessID, IMG_PVOID pvParam, IMG_UINT32 ui32Param)
{
PVRSRV_DEV_INFO *psDevInfo = (PVRSRV_DEV_INFO *) pvParam;
UNREFERENCED_PARAMETER(ui32Param);
/* Ensure that this process does not have the MPEG device lock */
HostBreakResource(ui32ProcessID, &psDevInfo->sDeviceSpecific.sMpeg.hDeviceResource);
return(PVRSRV_OK);
}
#endif /* #ifdef SUPPORT_DEVCLASS_MPEG */
/*--------------------------------- end of file ------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -