mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 01:52:46 +08:00
[osal]: add environment detection function
1. add software runtime detection 2. add hardware platform detection Change-Id: I75736ae85130325029023d948e4d756e27953af8 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
62
osal/mpp_platform.cpp
Normal file
62
osal/mpp_platform.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2015 Rockchip Electronics Co. LTD
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mpp_platform.h"
|
||||
|
||||
RK_U32 mpp_get_vcodec_hw_flag(void)
|
||||
{
|
||||
RK_U32 flag = 0;
|
||||
|
||||
#ifdef RKPLATFORM
|
||||
/* NOTE: current only support vpu2 */
|
||||
if (!access("/dev/vpu_service", F_OK))
|
||||
flag |= HAVE_VPU2;
|
||||
|
||||
/* for rk3288 / rk3368 /rk312x hevc decoder */
|
||||
if (!access("/dev/hevc_service", F_OK))
|
||||
flag |= HAVE_HEVC_DEC;
|
||||
|
||||
/* for rk3228 / rk3229 / rk3399 decoder */
|
||||
if (!access("/dev/rkvdec", F_OK))
|
||||
flag |= HAVE_RKVDEC;
|
||||
|
||||
/* for rk1108 encoder */
|
||||
if (!access("/dev/rkvenc", F_OK))
|
||||
flag |= HAVE_RKVENC;
|
||||
#endif
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
RK_U32 mpp_get_2d_hw_flag(void)
|
||||
{
|
||||
RK_U32 flag = 0;
|
||||
|
||||
#ifdef RKPLATFORM
|
||||
|
||||
if (!access("/dev/rga", F_OK))
|
||||
flag |= HAVE_RGA;
|
||||
|
||||
if (!access("/dev/iep", F_OK))
|
||||
flag |= HAVE_IEP;
|
||||
#endif
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user