mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
init
This commit is contained in:
30
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/Android.mk
vendored
Normal file
30
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/Android.mk
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
# =============================================================================
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
include $(MFX_HOME)/android/mfx_defs.mk
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
mfxloader.cpp \
|
||||
mfxparser.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := $(MFX_INCLUDES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(MFX_CFLAGS_INTERNAL) \
|
||||
-DMFX_PLUGINS_CONF_DIR=\"/vendor/etc\"
|
||||
LOCAL_CFLAGS_32 := \
|
||||
$(MFX_CFLAGS_INTERNAL_32) \
|
||||
-DMFX_MODULES_DIR=\"/system/vendor/lib\"
|
||||
LOCAL_CFLAGS_64 := \
|
||||
$(MFX_CFLAGS_INTERNAL_64) \
|
||||
-DMFX_MODULES_DIR=\"/system/vendor/lib64\"
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := libmfx_headers
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE := libmfx
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
121
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/CMakeLists.txt
vendored
Normal file
121
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
# Copyright (c) 2017 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
cmake_minimum_required( VERSION 3.6 FATAL_ERROR )
|
||||
project( mfx )
|
||||
|
||||
set( MFX_API_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/../../include )
|
||||
|
||||
# While equal to get_mfx_version in samples/builder, this function should remain separate to make this file self-sufficient
|
||||
function( get_api_version mfx_version_major mfx_version_minor )
|
||||
file(STRINGS ${MFX_API_FOLDER}/mfxdefs.h major REGEX "#define MFX_VERSION_MAJOR" LIMIT_COUNT 1)
|
||||
file(STRINGS ${MFX_API_FOLDER}/mfxdefs.h minor REGEX "#define MFX_VERSION_MINOR" LIMIT_COUNT 1)
|
||||
string(REPLACE "#define MFX_VERSION_MAJOR " "" major ${major})
|
||||
string(REPLACE "#define MFX_VERSION_MINOR " "" minor ${minor})
|
||||
set(${mfx_version_major} ${major} PARENT_SCOPE)
|
||||
set(${mfx_version_minor} ${minor} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
set( CMAKE_LIB_DIR ${CMAKE_BINARY_DIR}/__bin )
|
||||
|
||||
# If user did not override CMAKE_INSTALL_PREFIX, then set the default prefix
|
||||
# to /opt/intel/mediasdk instead of cmake's default
|
||||
if( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
|
||||
set( CMAKE_INSTALL_PREFIX /opt/intel/mediasdk CACHE PATH "Install Path Prefix" FORCE )
|
||||
endif( )
|
||||
message( STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" )
|
||||
|
||||
include( GNUInstallDirs )
|
||||
|
||||
if( NOT DEFINED MFX_PLUGINS_CONF_DIR )
|
||||
set( MFX_PLUGINS_CONF_DIR ${CMAKE_INSTALL_FULL_DATADIR}/mfx )
|
||||
endif( )
|
||||
add_definitions( -DMFX_PLUGINS_CONF_DIR="${MFX_PLUGINS_CONF_DIR}" )
|
||||
message( STATUS "MFX_PLUGINS_CONF_DIR=${MFX_PLUGINS_CONF_DIR}" )
|
||||
|
||||
if( NOT DEFINED MFX_MODULES_DIR )
|
||||
set( MFX_MODULES_DIR ${CMAKE_INSTALL_FULL_LIBDIR} )
|
||||
endif( )
|
||||
add_definitions( -DMFX_MODULES_DIR="${MFX_MODULES_DIR}" )
|
||||
message( STATUS "MFX_MODULES_DIR=${MFX_MODULES_DIR}" )
|
||||
|
||||
add_definitions(-DUNIX)
|
||||
add_definitions(-DMFX_DEPRECATED_OFF)
|
||||
|
||||
if( CMAKE_SYSTEM_NAME MATCHES Linux )
|
||||
add_definitions(-D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -DLINUX -DLINUX32)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-DLINUX64)
|
||||
endif( )
|
||||
endif( )
|
||||
|
||||
if( CMAKE_SYSTEM_NAME MATCHES Darwin )
|
||||
add_definitions(-DOSX)
|
||||
add_definitions(-DOSX32)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-DOSX64)
|
||||
endif( )
|
||||
endif( )
|
||||
|
||||
set(no_warnings "-Wno-unknown-pragmas -Wno-unused")
|
||||
set(warnings "-Wall -Wformat -Wformat-security")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -std=c++11 ${warnings} ${no_warnings}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
|
||||
|
||||
if (DEFINED CMAKE_FIND_ROOT_PATH)
|
||||
append("--sysroot=${CMAKE_FIND_ROOT_PATH} " LINK_FLAGS)
|
||||
endif (DEFINED CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
list(APPEND sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mfxloader.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mfxparser.cpp
|
||||
)
|
||||
|
||||
include_directories (
|
||||
${MFX_API_FOLDER}
|
||||
)
|
||||
|
||||
add_library(mfx SHARED ${sources})
|
||||
target_link_libraries(mfx dl)
|
||||
|
||||
get_api_version(MFX_VERSION_MAJOR MFX_VERSION_MINOR)
|
||||
|
||||
set_target_properties( mfx PROPERTIES LINK_FLAGS
|
||||
"-Wl,--no-undefined,-z,relro,-z,now,-z,noexecstack -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libmfx.map -fstack-protector")
|
||||
set_target_properties( mfx PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE} FOLDER mfx )
|
||||
set_target_properties( mfx PROPERTIES VERSION ${MFX_VERSION_MAJOR}.${MFX_VERSION_MINOR})
|
||||
set_target_properties( mfx PROPERTIES SOVERSION ${MFX_VERSION_MAJOR})
|
||||
|
||||
install(TARGETS mfx LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
set( PKG_CONFIG_FNAME "${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE}/lib${PROJECT_NAME}.pc")
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.cmake" ${PKG_CONFIG_FNAME} @ONLY)
|
||||
|
||||
install( FILES ${PKG_CONFIG_FNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
|
||||
install( DIRECTORY ${MFX_API_FOLDER}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mfx FILES_MATCHING PATTERN *.h )
|
||||
|
||||
# For backwards compatibility, create a relative symbolic link without the "lib"
|
||||
# prefix to the .pc file.
|
||||
set( PKG_CONFIG_LFNAME "${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}.pc" )
|
||||
add_custom_target(pc_link_target ALL COMMAND ${CMAKE_COMMAND} -E create_symlink lib${PROJECT_NAME}.pc ${PKG_CONFIG_LFNAME})
|
||||
install( FILES ${PKG_CONFIG_LFNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
|
||||
447
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/device_ids.h
vendored
Normal file
447
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/device_ids.h
vendored
Normal file
@@ -0,0 +1,447 @@
|
||||
// Copyright (c) 2022 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
enum eMFXHWType
|
||||
{
|
||||
MFX_HW_UNKNOWN = 0,
|
||||
MFX_HW_SNB = 0x300000,
|
||||
|
||||
MFX_HW_IVB = 0x400000,
|
||||
|
||||
MFX_HW_HSW = 0x500000,
|
||||
MFX_HW_HSW_ULT = 0x500001,
|
||||
|
||||
MFX_HW_VLV = 0x600000,
|
||||
|
||||
MFX_HW_BDW = 0x700000,
|
||||
|
||||
MFX_HW_CHT = 0x800000,
|
||||
|
||||
MFX_HW_SKL = 0x900000,
|
||||
|
||||
MFX_HW_APL = 0x1000000,
|
||||
|
||||
MFX_HW_KBL = 0x1100000,
|
||||
MFX_HW_GLK = MFX_HW_KBL + 1,
|
||||
MFX_HW_CFL = MFX_HW_KBL + 2,
|
||||
|
||||
MFX_HW_CNL = 0x1200000,
|
||||
|
||||
MFX_HW_ICL = 0x1400000,
|
||||
MFX_HW_ICL_LP = MFX_HW_ICL + 1,
|
||||
MFX_HW_JSL = 0x1500001,
|
||||
MFX_HW_EHL = 0x1500002,
|
||||
|
||||
MFX_HW_TGL_LP = 0x1600000,
|
||||
MFX_HW_RKL = MFX_HW_TGL_LP + 2,
|
||||
MFX_HW_DG1 = 0x1600003,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int device_id;
|
||||
eMFXHWType platform;
|
||||
} mfx_device_item;
|
||||
|
||||
// list of dev ID supported by legacy Media SDK
|
||||
const mfx_device_item msdkDevIDs[] = {
|
||||
/*IVB*/
|
||||
{ 0x0156, MFX_HW_IVB }, /* GT1 mobile */
|
||||
{ 0x0166, MFX_HW_IVB }, /* GT2 mobile */
|
||||
{ 0x0152, MFX_HW_IVB }, /* GT1 desktop */
|
||||
{ 0x0162, MFX_HW_IVB }, /* GT2 desktop */
|
||||
{ 0x015a, MFX_HW_IVB }, /* GT1 server */
|
||||
{ 0x016a, MFX_HW_IVB }, /* GT2 server */
|
||||
/*HSW*/
|
||||
{ 0x0402, MFX_HW_HSW }, /* GT1 desktop */
|
||||
{ 0x0412, MFX_HW_HSW }, /* GT2 desktop */
|
||||
{ 0x0422, MFX_HW_HSW }, /* GT2 desktop */
|
||||
{ 0x041e, MFX_HW_HSW }, /* Core i3-4130 */
|
||||
{ 0x040a, MFX_HW_HSW }, /* GT1 server */
|
||||
{ 0x041a, MFX_HW_HSW }, /* GT2 server */
|
||||
{ 0x042a, MFX_HW_HSW }, /* GT2 server */
|
||||
{ 0x0406, MFX_HW_HSW }, /* GT1 mobile */
|
||||
{ 0x0416, MFX_HW_HSW }, /* GT2 mobile */
|
||||
{ 0x0426, MFX_HW_HSW }, /* GT2 mobile */
|
||||
{ 0x0C02, MFX_HW_HSW }, /* SDV GT1 desktop */
|
||||
{ 0x0C12, MFX_HW_HSW }, /* SDV GT2 desktop */
|
||||
{ 0x0C22, MFX_HW_HSW }, /* SDV GT2 desktop */
|
||||
{ 0x0C0A, MFX_HW_HSW }, /* SDV GT1 server */
|
||||
{ 0x0C1A, MFX_HW_HSW }, /* SDV GT2 server */
|
||||
{ 0x0C2A, MFX_HW_HSW }, /* SDV GT2 server */
|
||||
{ 0x0C06, MFX_HW_HSW }, /* SDV GT1 mobile */
|
||||
{ 0x0C16, MFX_HW_HSW }, /* SDV GT2 mobile */
|
||||
{ 0x0C26, MFX_HW_HSW }, /* SDV GT2 mobile */
|
||||
{ 0x0A02, MFX_HW_HSW }, /* ULT GT1 desktop */
|
||||
{ 0x0A12, MFX_HW_HSW }, /* ULT GT2 desktop */
|
||||
{ 0x0A22, MFX_HW_HSW }, /* ULT GT2 desktop */
|
||||
{ 0x0A0A, MFX_HW_HSW }, /* ULT GT1 server */
|
||||
{ 0x0A1A, MFX_HW_HSW }, /* ULT GT2 server */
|
||||
{ 0x0A2A, MFX_HW_HSW }, /* ULT GT2 server */
|
||||
{ 0x0A06, MFX_HW_HSW }, /* ULT GT1 mobile */
|
||||
{ 0x0A16, MFX_HW_HSW }, /* ULT GT2 mobile */
|
||||
{ 0x0A26, MFX_HW_HSW }, /* ULT GT2 mobile */
|
||||
{ 0x0D02, MFX_HW_HSW }, /* CRW GT1 desktop */
|
||||
{ 0x0D12, MFX_HW_HSW }, /* CRW GT2 desktop */
|
||||
{ 0x0D22, MFX_HW_HSW }, /* CRW GT2 desktop */
|
||||
{ 0x0D0A, MFX_HW_HSW }, /* CRW GT1 server */
|
||||
{ 0x0D1A, MFX_HW_HSW }, /* CRW GT2 server */
|
||||
{ 0x0D2A, MFX_HW_HSW }, /* CRW GT2 server */
|
||||
{ 0x0D06, MFX_HW_HSW }, /* CRW GT1 mobile */
|
||||
{ 0x0D16, MFX_HW_HSW }, /* CRW GT2 mobile */
|
||||
{ 0x0D26, MFX_HW_HSW }, /* CRW GT2 mobile */
|
||||
{ 0x040B, MFX_HW_HSW }, /*HASWELL_B_GT1 *//* Reserved */
|
||||
{ 0x041B, MFX_HW_HSW }, /*HASWELL_B_GT2*/
|
||||
{ 0x042B, MFX_HW_HSW }, /*HASWELL_B_GT3*/
|
||||
{ 0x040E, MFX_HW_HSW }, /*HASWELL_E_GT1*//* Reserved */
|
||||
{ 0x041E, MFX_HW_HSW }, /*HASWELL_E_GT2*/
|
||||
{ 0x042E, MFX_HW_HSW }, /*HASWELL_E_GT3*/
|
||||
|
||||
{ 0x0C0B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT1*/ /* Reserved */
|
||||
{ 0x0C1B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT2*/
|
||||
{ 0x0C2B, MFX_HW_HSW }, /*HASWELL_SDV_B_GT3*/
|
||||
{ 0x0C0E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT1*//* Reserved */
|
||||
{ 0x0C1E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT2*/
|
||||
{ 0x0C2E, MFX_HW_HSW }, /*HASWELL_SDV_B_GT3*/
|
||||
|
||||
{ 0x0A0B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT1*/ /* Reserved */
|
||||
{ 0x0A1B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT2*/
|
||||
{ 0x0A2B, MFX_HW_HSW }, /*HASWELL_ULT_B_GT3*/
|
||||
{ 0x0A0E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT1*/ /* Reserved */
|
||||
{ 0x0A1E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT2*/
|
||||
{ 0x0A2E, MFX_HW_HSW }, /*HASWELL_ULT_E_GT3*/
|
||||
|
||||
{ 0x0D0B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT1*/ /* Reserved */
|
||||
{ 0x0D1B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT2*/
|
||||
{ 0x0D2B, MFX_HW_HSW }, /*HASWELL_CRW_B_GT3*/
|
||||
{ 0x0D0E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT1*/ /* Reserved */
|
||||
{ 0x0D1E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT2*/
|
||||
{ 0x0D2E, MFX_HW_HSW }, /*HASWELL_CRW_E_GT3*/
|
||||
|
||||
/* VLV */
|
||||
{ 0x0f30, MFX_HW_VLV }, /* VLV mobile */
|
||||
{ 0x0f31, MFX_HW_VLV }, /* VLV mobile */
|
||||
{ 0x0f32, MFX_HW_VLV }, /* VLV mobile */
|
||||
{ 0x0f33, MFX_HW_VLV }, /* VLV mobile */
|
||||
{ 0x0157, MFX_HW_VLV },
|
||||
{ 0x0155, MFX_HW_VLV },
|
||||
|
||||
/* BDW */
|
||||
/*GT3: */
|
||||
{ 0x162D, MFX_HW_BDW },
|
||||
{ 0x162A, MFX_HW_BDW },
|
||||
/*GT2: */
|
||||
{ 0x161D, MFX_HW_BDW },
|
||||
{ 0x161A, MFX_HW_BDW },
|
||||
/* GT1: */
|
||||
{ 0x160D, MFX_HW_BDW },
|
||||
{ 0x160A, MFX_HW_BDW },
|
||||
/* BDW-ULT */
|
||||
/* (16x2 - ULT, 16x6 - ULT, 16xB - Iris, 16xE - ULX) */
|
||||
/*GT3: */
|
||||
{ 0x162E, MFX_HW_BDW },
|
||||
{ 0x162B, MFX_HW_BDW },
|
||||
{ 0x1626, MFX_HW_BDW },
|
||||
{ 0x1622, MFX_HW_BDW },
|
||||
{ 0x1636, MFX_HW_BDW }, /* ULT */
|
||||
{ 0x163B, MFX_HW_BDW }, /* Iris */
|
||||
{ 0x163E, MFX_HW_BDW }, /* ULX */
|
||||
{ 0x1632, MFX_HW_BDW }, /* ULT */
|
||||
{ 0x163A, MFX_HW_BDW }, /* Server */
|
||||
{ 0x163D, MFX_HW_BDW }, /* Workstation */
|
||||
|
||||
/* GT2: */
|
||||
{ 0x161E, MFX_HW_BDW },
|
||||
{ 0x161B, MFX_HW_BDW },
|
||||
{ 0x1616, MFX_HW_BDW },
|
||||
{ 0x1612, MFX_HW_BDW },
|
||||
/* GT1: */
|
||||
{ 0x160E, MFX_HW_BDW },
|
||||
{ 0x160B, MFX_HW_BDW },
|
||||
{ 0x1606, MFX_HW_BDW },
|
||||
{ 0x1602, MFX_HW_BDW },
|
||||
|
||||
/* CHT */
|
||||
{ 0x22b0, MFX_HW_CHT },
|
||||
{ 0x22b1, MFX_HW_CHT },
|
||||
{ 0x22b2, MFX_HW_CHT },
|
||||
{ 0x22b3, MFX_HW_CHT },
|
||||
|
||||
/* SKL */
|
||||
/* GT1F */
|
||||
{ 0x1902, MFX_HW_SKL }, // DT, 2x1F, 510
|
||||
{ 0x1906, MFX_HW_SKL }, // U-ULT, 2x1F, 510
|
||||
{ 0x190A, MFX_HW_SKL }, // Server, 4x1F
|
||||
{ 0x190B, MFX_HW_SKL },
|
||||
{ 0x190E, MFX_HW_SKL }, // Y-ULX 2x1F
|
||||
/*GT1.5*/
|
||||
{ 0x1913, MFX_HW_SKL }, // U-ULT, 2x1.5
|
||||
{ 0x1915, MFX_HW_SKL }, // Y-ULX, 2x1.5
|
||||
{ 0x1917, MFX_HW_SKL }, // DT, 2x1.5
|
||||
/* GT2 */
|
||||
{ 0x1912, MFX_HW_SKL }, // DT, 2x2, 530
|
||||
{ 0x1916, MFX_HW_SKL }, // U-ULD 2x2, 520
|
||||
{ 0x191A, MFX_HW_SKL }, // 2x2,4x2, Server
|
||||
{ 0x191B, MFX_HW_SKL }, // DT, 2x2, 530
|
||||
{ 0x191D, MFX_HW_SKL }, // 4x2, WKS, P530
|
||||
{ 0x191E, MFX_HW_SKL }, // Y-ULX, 2x2, P510,515
|
||||
{ 0x1921, MFX_HW_SKL }, // U-ULT, 2x2F, 540
|
||||
/* GT3 */
|
||||
{ 0x1923, MFX_HW_SKL }, // U-ULT, 2x3, 535
|
||||
{ 0x1926, MFX_HW_SKL }, // U-ULT, 2x3, 540 (15W)
|
||||
{ 0x1927, MFX_HW_SKL }, // U-ULT, 2x3e, 550 (28W)
|
||||
{ 0x192A, MFX_HW_SKL }, // Server, 2x3
|
||||
{ 0x192B, MFX_HW_SKL }, // Halo 3e
|
||||
{ 0x192D, MFX_HW_SKL },
|
||||
/* GT4e*/
|
||||
{ 0x1932, MFX_HW_SKL }, // DT
|
||||
{ 0x193A, MFX_HW_SKL }, // SRV
|
||||
{ 0x193B, MFX_HW_SKL }, // Halo
|
||||
{ 0x193D, MFX_HW_SKL }, // WKS
|
||||
|
||||
/* APL */
|
||||
{ 0x0A84, MFX_HW_APL },
|
||||
{ 0x0A85, MFX_HW_APL },
|
||||
{ 0x0A86, MFX_HW_APL },
|
||||
{ 0x0A87, MFX_HW_APL },
|
||||
{ 0x1A84, MFX_HW_APL },
|
||||
{ 0x1A85, MFX_HW_APL },
|
||||
{ 0x5A84, MFX_HW_APL },
|
||||
{ 0x5A85, MFX_HW_APL },
|
||||
|
||||
/* KBL */
|
||||
{ 0x5902, MFX_HW_KBL }, // DT GT1
|
||||
{ 0x5906, MFX_HW_KBL }, // ULT GT1
|
||||
{ 0x5908, MFX_HW_KBL }, // HALO GT1F
|
||||
{ 0x590A, MFX_HW_KBL }, // SERV GT1
|
||||
{ 0x590B, MFX_HW_KBL }, // HALO GT1
|
||||
{ 0x590E, MFX_HW_KBL }, // ULX GT1
|
||||
{ 0x5912, MFX_HW_KBL }, // DT GT2
|
||||
{ 0x5913, MFX_HW_KBL }, // ULT GT1 5
|
||||
{ 0x5915, MFX_HW_KBL }, // ULX GT1 5
|
||||
{ 0x5916, MFX_HW_KBL }, // ULT GT2
|
||||
{ 0x5917, MFX_HW_KBL }, // ULT GT2 R
|
||||
{ 0x591A, MFX_HW_KBL }, // SERV GT2
|
||||
{ 0x591B, MFX_HW_KBL }, // HALO GT2
|
||||
{ 0x591C, MFX_HW_KBL }, // ULX GT2
|
||||
{ 0x591D, MFX_HW_KBL }, // WRK GT2
|
||||
{ 0x591E, MFX_HW_KBL }, // ULX GT2
|
||||
{ 0x5921, MFX_HW_KBL }, // ULT GT2F
|
||||
{ 0x5923, MFX_HW_KBL }, // ULT GT3
|
||||
{ 0x5926, MFX_HW_KBL }, // ULT GT3 15W
|
||||
{ 0x5927, MFX_HW_KBL }, // ULT GT3 28W
|
||||
{ 0x592A, MFX_HW_KBL }, // SERV GT3
|
||||
{ 0x592B, MFX_HW_KBL }, // HALO GT3
|
||||
{ 0x5932, MFX_HW_KBL }, // DT GT4
|
||||
{ 0x593A, MFX_HW_KBL }, // SERV GT4
|
||||
{ 0x593B, MFX_HW_KBL }, // HALO GT4
|
||||
{ 0x593D, MFX_HW_KBL }, // WRK GT4
|
||||
{ 0x87C0, MFX_HW_KBL }, // ULX GT2
|
||||
|
||||
/* GLK */
|
||||
{ 0x3184, MFX_HW_GLK },
|
||||
{ 0x3185, MFX_HW_GLK },
|
||||
|
||||
/* CFL */
|
||||
{ 0x3E90, MFX_HW_CFL },
|
||||
{ 0x3E91, MFX_HW_CFL },
|
||||
{ 0x3E92, MFX_HW_CFL },
|
||||
{ 0x3E93, MFX_HW_CFL },
|
||||
{ 0x3E94, MFX_HW_CFL },
|
||||
{ 0x3E96, MFX_HW_CFL },
|
||||
{ 0x3E98, MFX_HW_CFL },
|
||||
{ 0x3E99, MFX_HW_CFL },
|
||||
{ 0x3E9A, MFX_HW_CFL },
|
||||
{ 0x3E9C, MFX_HW_CFL },
|
||||
{ 0x3E9B, MFX_HW_CFL },
|
||||
{ 0x3EA5, MFX_HW_CFL },
|
||||
{ 0x3EA6, MFX_HW_CFL },
|
||||
{ 0x3EA7, MFX_HW_CFL },
|
||||
{ 0x3EA8, MFX_HW_CFL },
|
||||
{ 0x3EA9, MFX_HW_CFL },
|
||||
{ 0x87CA, MFX_HW_CFL },
|
||||
|
||||
/* WHL */
|
||||
{ 0x3EA0, MFX_HW_CFL },
|
||||
{ 0x3EA1, MFX_HW_CFL },
|
||||
{ 0x3EA2, MFX_HW_CFL },
|
||||
{ 0x3EA3, MFX_HW_CFL },
|
||||
{ 0x3EA4, MFX_HW_CFL },
|
||||
|
||||
|
||||
/* CML GT1 */
|
||||
{ 0x9b21, MFX_HW_CFL },
|
||||
{ 0x9baa, MFX_HW_CFL },
|
||||
{ 0x9bab, MFX_HW_CFL },
|
||||
{ 0x9bac, MFX_HW_CFL },
|
||||
{ 0x9ba0, MFX_HW_CFL },
|
||||
{ 0x9ba5, MFX_HW_CFL },
|
||||
{ 0x9ba8, MFX_HW_CFL },
|
||||
{ 0x9ba4, MFX_HW_CFL },
|
||||
{ 0x9ba2, MFX_HW_CFL },
|
||||
|
||||
/* CML GT2 */
|
||||
{ 0x9b41, MFX_HW_CFL },
|
||||
{ 0x9bca, MFX_HW_CFL },
|
||||
{ 0x9bcb, MFX_HW_CFL },
|
||||
{ 0x9bcc, MFX_HW_CFL },
|
||||
{ 0x9bc0, MFX_HW_CFL },
|
||||
{ 0x9bc5, MFX_HW_CFL },
|
||||
{ 0x9bc8, MFX_HW_CFL },
|
||||
{ 0x9bc4, MFX_HW_CFL },
|
||||
{ 0x9bc2, MFX_HW_CFL },
|
||||
{ 0x9bc6, MFX_HW_CFL },
|
||||
{ 0x9be6, MFX_HW_CFL },
|
||||
{ 0x9bf6, MFX_HW_CFL },
|
||||
|
||||
|
||||
/* CNL */
|
||||
{ 0x5A51, MFX_HW_CNL },
|
||||
{ 0x5A52, MFX_HW_CNL },
|
||||
{ 0x5A5A, MFX_HW_CNL },
|
||||
{ 0x5A40, MFX_HW_CNL },
|
||||
{ 0x5A42, MFX_HW_CNL },
|
||||
{ 0x5A4A, MFX_HW_CNL },
|
||||
{ 0x5A4C, MFX_HW_CNL },
|
||||
{ 0x5A50, MFX_HW_CNL },
|
||||
{ 0x5A54, MFX_HW_CNL },
|
||||
{ 0x5A59, MFX_HW_CNL },
|
||||
{ 0x5A5C, MFX_HW_CNL },
|
||||
{ 0x5A41, MFX_HW_CNL },
|
||||
{ 0x5A44, MFX_HW_CNL },
|
||||
{ 0x5A49, MFX_HW_CNL },
|
||||
|
||||
/* ICL LP */
|
||||
{ 0xFF05, MFX_HW_ICL_LP },
|
||||
{ 0x8A50, MFX_HW_ICL_LP },
|
||||
{ 0x8A51, MFX_HW_ICL_LP },
|
||||
{ 0x8A52, MFX_HW_ICL_LP },
|
||||
{ 0x8A53, MFX_HW_ICL_LP },
|
||||
{ 0x8A54, MFX_HW_ICL_LP },
|
||||
{ 0x8A56, MFX_HW_ICL_LP },
|
||||
{ 0x8A57, MFX_HW_ICL_LP },
|
||||
{ 0x8A58, MFX_HW_ICL_LP },
|
||||
{ 0x8A59, MFX_HW_ICL_LP },
|
||||
{ 0x8A5A, MFX_HW_ICL_LP },
|
||||
{ 0x8A5B, MFX_HW_ICL_LP },
|
||||
{ 0x8A5C, MFX_HW_ICL_LP },
|
||||
{ 0x8A5D, MFX_HW_ICL_LP },
|
||||
{ 0x8A70, MFX_HW_ICL_LP },
|
||||
{ 0x8A71, MFX_HW_ICL_LP }, // GT05, but 1 ok in this context
|
||||
|
||||
/* JSL */
|
||||
{ 0x4E51, MFX_HW_JSL },
|
||||
{ 0x4E55, MFX_HW_JSL },
|
||||
{ 0x4E61, MFX_HW_JSL },
|
||||
{ 0x4E71, MFX_HW_JSL },
|
||||
|
||||
/* EHL */
|
||||
{ 0x4500, MFX_HW_EHL },
|
||||
{ 0x4541, MFX_HW_EHL },
|
||||
{ 0x4551, MFX_HW_EHL },
|
||||
{ 0x4555, MFX_HW_EHL },
|
||||
{ 0x4569, MFX_HW_EHL },
|
||||
{ 0x4571, MFX_HW_EHL },
|
||||
|
||||
/* TGL */
|
||||
{ 0x9A40, MFX_HW_TGL_LP },
|
||||
{ 0x9A49, MFX_HW_TGL_LP },
|
||||
{ 0x9A59, MFX_HW_TGL_LP },
|
||||
{ 0x9A60, MFX_HW_TGL_LP },
|
||||
{ 0x9A68, MFX_HW_TGL_LP },
|
||||
{ 0x9A70, MFX_HW_TGL_LP },
|
||||
{ 0x9A78, MFX_HW_TGL_LP },
|
||||
|
||||
/* DG1/SG1 */
|
||||
{ 0x4905, MFX_HW_DG1 },
|
||||
{ 0x4906, MFX_HW_DG1 },
|
||||
{ 0x4907, MFX_HW_DG1 },
|
||||
{ 0x4908, MFX_HW_DG1 },
|
||||
|
||||
/* RKL */
|
||||
{ 0x4C80, MFX_HW_RKL }, // RKL-S
|
||||
{ 0x4C8A, MFX_HW_RKL }, // RKL-S
|
||||
{ 0x4C81, MFX_HW_RKL }, // RKL-S
|
||||
{ 0x4C8B, MFX_HW_RKL }, // RKL-S
|
||||
{ 0x4C90, MFX_HW_RKL }, // RKL-S
|
||||
{ 0x4C9A, MFX_HW_RKL }, // RKL-S
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int vendor_id;
|
||||
int device_id;
|
||||
eMFXHWType platform;
|
||||
} Device;
|
||||
|
||||
static inline eMFXHWType get_platform(int device_id) {
|
||||
for (unsigned i = 0; i < sizeof(msdkDevIDs) / sizeof(msdkDevIDs[0]); ++i) {
|
||||
if (msdkDevIDs[i].device_id == device_id) {
|
||||
return msdkDevIDs[i].platform;
|
||||
}
|
||||
}
|
||||
return MFX_HW_UNKNOWN;
|
||||
}
|
||||
|
||||
std::vector <Device> get_devices() {
|
||||
const char *dir = "/sys/class/drm";
|
||||
const char *device_id_file = "/device/device";
|
||||
const char *vendor_id_file = "/device/vendor";
|
||||
int i = 0;
|
||||
int err = 0;
|
||||
std::vector <Device> result;
|
||||
for (; i < 64; ++i) {
|
||||
Device device;
|
||||
std::string node_num = std::to_string(128 + i);
|
||||
std::string path = std::string(dir) + "/renderD" + node_num + vendor_id_file;
|
||||
FILE *file = fopen(path.c_str(), "r");
|
||||
if (!file) continue;
|
||||
err = fscanf(file, "%x", &device.vendor_id);
|
||||
fclose(file);
|
||||
if (err == EOF) continue;
|
||||
if (device.vendor_id != 0x8086) { // Filter out non-Intel devices
|
||||
continue;
|
||||
}
|
||||
path = std::string(dir) + "/renderD" + node_num + device_id_file;
|
||||
file = fopen(path.c_str(), "r");
|
||||
if (!file) continue;
|
||||
err = fscanf(file, "%x", &device.device_id);
|
||||
fclose(file);
|
||||
if (err == EOF) continue;
|
||||
|
||||
// if user only mapped /dev/dri/renderD129 in container, need to skip /dev/dri/renderD128
|
||||
path = "/dev/dri/renderD" + node_num;
|
||||
int fd = open(path.c_str(), O_RDWR);
|
||||
if (fd < 0) continue; //device not accessible
|
||||
close(fd);
|
||||
|
||||
device.platform = get_platform(device.device_id);
|
||||
result.emplace_back(device);
|
||||
}
|
||||
std::sort(result.begin(), result.end(), [](const Device &a, const Device &b) {
|
||||
return a.platform < b.platform;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
111
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/libmfx.map
vendored
Normal file
111
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/libmfx.map
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
LIBMFX_1.0 {
|
||||
global:
|
||||
MFXInit;
|
||||
MFXClose;
|
||||
MFXQueryIMPL;
|
||||
MFXQueryVersion;
|
||||
|
||||
MFXJoinSession;
|
||||
MFXDisjoinSession;
|
||||
MFXCloneSession;
|
||||
MFXSetPriority;
|
||||
MFXGetPriority;
|
||||
|
||||
MFXVideoCORE_SetBufferAllocator;
|
||||
MFXVideoCORE_SetFrameAllocator;
|
||||
MFXVideoCORE_SetHandle;
|
||||
MFXVideoCORE_GetHandle;
|
||||
MFXVideoCORE_SyncOperation;
|
||||
|
||||
MFXVideoENCODE_Query;
|
||||
MFXVideoENCODE_QueryIOSurf;
|
||||
MFXVideoENCODE_Init;
|
||||
MFXVideoENCODE_Reset;
|
||||
MFXVideoENCODE_Close;
|
||||
MFXVideoENCODE_GetVideoParam;
|
||||
MFXVideoENCODE_GetEncodeStat;
|
||||
MFXVideoENCODE_EncodeFrameAsync;
|
||||
|
||||
MFXVideoDECODE_Query;
|
||||
MFXVideoDECODE_DecodeHeader;
|
||||
MFXVideoDECODE_QueryIOSurf;
|
||||
MFXVideoDECODE_Init;
|
||||
MFXVideoDECODE_Reset;
|
||||
MFXVideoDECODE_Close;
|
||||
MFXVideoDECODE_GetVideoParam;
|
||||
MFXVideoDECODE_GetDecodeStat;
|
||||
MFXVideoDECODE_SetSkipMode;
|
||||
MFXVideoDECODE_GetPayload;
|
||||
MFXVideoDECODE_DecodeFrameAsync;
|
||||
|
||||
MFXVideoVPP_Query;
|
||||
MFXVideoVPP_QueryIOSurf;
|
||||
MFXVideoVPP_Init;
|
||||
MFXVideoVPP_Reset;
|
||||
MFXVideoVPP_Close;
|
||||
|
||||
MFXVideoVPP_GetVideoParam;
|
||||
MFXVideoVPP_GetVPPStat;
|
||||
MFXVideoVPP_RunFrameVPPAsync;
|
||||
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
LIBMFX_1.1 {
|
||||
global:
|
||||
MFXVideoUSER_Register;
|
||||
MFXVideoUSER_Unregister;
|
||||
MFXVideoUSER_ProcessFrameAsync;
|
||||
} LIBMFX_1.0;
|
||||
|
||||
LIBMFX_1.8 {
|
||||
global:
|
||||
MFXVideoUSER_Load;
|
||||
MFXVideoUSER_UnLoad;
|
||||
} LIBMFX_1.1;
|
||||
|
||||
LIBMFX_1.10 {
|
||||
global:
|
||||
MFXVideoENC_Query;
|
||||
MFXVideoENC_QueryIOSurf;
|
||||
MFXVideoENC_Init;
|
||||
MFXVideoENC_Reset;
|
||||
MFXVideoENC_Close;
|
||||
MFXVideoENC_ProcessFrameAsync;
|
||||
MFXVideoVPP_RunFrameVPPAsyncEx;
|
||||
|
||||
} LIBMFX_1.1;
|
||||
|
||||
LIBMFX_1.13 {
|
||||
global:
|
||||
MFXVideoPAK_Query;
|
||||
MFXVideoPAK_QueryIOSurf;
|
||||
MFXVideoPAK_Init;
|
||||
MFXVideoPAK_Reset;
|
||||
MFXVideoPAK_Close;
|
||||
MFXVideoPAK_ProcessFrameAsync;
|
||||
MFXVideoUSER_LoadByPath;
|
||||
} LIBMFX_1.10;
|
||||
|
||||
LIBMFX_1.14 {
|
||||
global:
|
||||
MFXInitEx;
|
||||
MFXDoWork;
|
||||
} LIBMFX_1.13;
|
||||
|
||||
LIBMFX_1.19 {
|
||||
global:
|
||||
MFXVideoENC_GetVideoParam;
|
||||
MFXVideoPAK_GetVideoParam;
|
||||
MFXVideoCORE_QueryPlatform;
|
||||
MFXVideoUSER_GetPlugin;
|
||||
} LIBMFX_1.14;
|
||||
|
||||
LIBMFXAUDIO_1.9 {
|
||||
global:
|
||||
MFXAudioUSER_Load;
|
||||
MFXAudioUSER_UnLoad;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
71
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxaudio_functions.h
vendored
Normal file
71
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxaudio_functions.h
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright (c) 2017 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//
|
||||
// WARNING:
|
||||
// this file doesn't contain an include guard by intension.
|
||||
// The file may be included into a source file many times.
|
||||
// That is why this header doesn't contain any include directive.
|
||||
// Please, do no try to fix it.
|
||||
//
|
||||
|
||||
//
|
||||
// API version 1.8 functions
|
||||
//
|
||||
|
||||
// Minor value should precedes the major value
|
||||
#define API_VERSION {{8, 1}}
|
||||
|
||||
// CORE interface functions
|
||||
FUNCTION(mfxStatus, MFXAudioCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait))
|
||||
|
||||
// ENCODE interface functions
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_Init, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_Close, (mfxSession session), (session))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioENCODE_EncodeFrameAsync, (mfxSession session, mfxAudioFrame *frame, mfxBitstream *buffer_out, mfxSyncPoint *syncp), (session, frame, buffer_out, syncp))
|
||||
|
||||
// DECODE interface functions
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_Query, (mfxSession session, mfxAudioParam *in, mfxAudioParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxAudioParam *par), (session, bs, par))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_Init, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_Reset, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_Close, (mfxSession session), (session))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_QueryIOSize, (mfxSession session, mfxAudioParam *par, mfxAudioAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_GetAudioParam, (mfxSession session, mfxAudioParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXAudioDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxAudioFrame *frame_out, mfxSyncPoint *syncp), (session, bs, frame_out, syncp))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
//
|
||||
// API version 1.9 functions
|
||||
//
|
||||
|
||||
#define API_VERSION {{9, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXAudioUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par))
|
||||
FUNCTION(mfxStatus, MFXAudioUSER_Unregister, (mfxSession session, mfxU32 type), (session, type))
|
||||
FUNCTION(mfxStatus, MFXAudioUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp))
|
||||
|
||||
|
||||
#undef API_VERSION
|
||||
621
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.cpp
vendored
Normal file
621
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.cpp
vendored
Normal file
@@ -0,0 +1,621 @@
|
||||
// Copyright (c) 2017-2020 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <assert.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
#include "mfxvideo.h"
|
||||
#include "mfxplugin.h"
|
||||
#include "mfxpak.h"
|
||||
|
||||
#include "mfxloader.h"
|
||||
|
||||
#include "device_ids.h"
|
||||
|
||||
namespace MFX {
|
||||
|
||||
#if defined(__i386__)
|
||||
#ifdef ANDROID
|
||||
#define LIBMFXSW "libmfxsw32.so"
|
||||
#define LIBMFXHW "libmfxhw32.so"
|
||||
#else
|
||||
#define LIBMFXSW "libmfxsw32.so.1"
|
||||
#define LIBMFXHW "libmfxhw32.so.1"
|
||||
#define ONEVPLRT "libmfx-gen.so.1.2"
|
||||
#endif
|
||||
#elif defined(__x86_64__)
|
||||
#ifdef ANDROID
|
||||
#define LIBMFXSW "libmfxsw64.so"
|
||||
#define LIBMFXHW "libmfxhw64.so"
|
||||
#else
|
||||
#define LIBMFXSW "libmfxsw64.so.1"
|
||||
#define LIBMFXHW "libmfxhw64.so.1"
|
||||
#define ONEVPLRT "libmfx-gen.so.1.2"
|
||||
#endif
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
|
||||
#undef FUNCTION
|
||||
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
|
||||
e##func_name,
|
||||
|
||||
enum Function
|
||||
{
|
||||
eMFXInit,
|
||||
eMFXInitEx,
|
||||
eMFXClose,
|
||||
eMFXJoinSession,
|
||||
#include "mfxvideo_functions.h"
|
||||
eFunctionsNum,
|
||||
eNoMoreFunctions = eFunctionsNum
|
||||
};
|
||||
|
||||
struct FunctionsTable
|
||||
{
|
||||
Function id;
|
||||
const char* name;
|
||||
mfxVersion version;
|
||||
};
|
||||
|
||||
#define VERSION(major, minor) {{minor, major}}
|
||||
|
||||
#undef FUNCTION
|
||||
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
|
||||
{ e##func_name, #func_name, API_VERSION },
|
||||
|
||||
static const FunctionsTable g_mfxFuncTable[] =
|
||||
{
|
||||
{ eMFXInit, "MFXInit", VERSION(1, 0) },
|
||||
{ eMFXInitEx, "MFXInitEx", VERSION(1, 14) },
|
||||
{ eMFXClose, "MFXClose", VERSION(1, 0) },
|
||||
{ eMFXJoinSession, "MFXJoinSession", VERSION(1, 1) },
|
||||
#include "mfxvideo_functions.h"
|
||||
{ eNoMoreFunctions }
|
||||
};
|
||||
|
||||
typedef mfxStatus (MFX_CDECL *CreatePluginPtr)(mfxPluginUID, mfxPlugin*);
|
||||
|
||||
class LoaderCtx;
|
||||
|
||||
class PluginCtx
|
||||
{
|
||||
public:
|
||||
PluginCtx(LoaderCtx& loader)
|
||||
: m_loader(loader)
|
||||
{}
|
||||
|
||||
mfxStatus Load(const mfxPluginUID& uid, mfxU32 version, const char *path);
|
||||
mfxStatus Unload();
|
||||
|
||||
inline mfxPluginUID getUID() const { return m_uid; }
|
||||
|
||||
private:
|
||||
LoaderCtx& m_loader;
|
||||
std::shared_ptr<void> m_dlh;
|
||||
CreatePluginPtr m_create_plugin = nullptr;
|
||||
mfxPluginUID m_uid{};
|
||||
mfxPlugin m_plugin{};
|
||||
mfxPluginParam m_plugin_param{};
|
||||
};
|
||||
|
||||
class LoaderCtx
|
||||
{
|
||||
public:
|
||||
mfxStatus Init(mfxInitParam& par);
|
||||
mfxStatus Close();
|
||||
|
||||
mfxStatus LoadPlugin(const mfxPluginUID& uid, mfxU32 version, const char *path);
|
||||
mfxStatus UnloadPlugin(const mfxPluginUID& uid);
|
||||
|
||||
inline void* getFunction(Function func) const {
|
||||
return m_table[func];
|
||||
}
|
||||
|
||||
inline mfxSession getSession() const {
|
||||
return m_session;
|
||||
}
|
||||
|
||||
inline mfxIMPL getImpl() const {
|
||||
return m_implementation;
|
||||
}
|
||||
|
||||
inline mfxVersion getVersion() const {
|
||||
return m_version;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<void> m_dlh;
|
||||
mfxVersion m_version{};
|
||||
mfxIMPL m_implementation{};
|
||||
mfxSession m_session = nullptr;
|
||||
void* m_table[eFunctionsNum]{};
|
||||
|
||||
std::mutex m_guard;
|
||||
std::list<PluginCtx> m_plugins;
|
||||
};
|
||||
|
||||
struct GlobalCtx
|
||||
{
|
||||
std::mutex m_mutex;
|
||||
std::list<PluginInfo> m_plugins;
|
||||
};
|
||||
|
||||
static GlobalCtx g_GlobalCtx;
|
||||
|
||||
std::shared_ptr<void> make_dlopen(const char* filename, int flags)
|
||||
{
|
||||
return std::shared_ptr<void>(
|
||||
dlopen(filename, flags),
|
||||
[] (void* handle) { if (handle) dlclose(handle); });
|
||||
}
|
||||
|
||||
mfxStatus LoaderCtx::Init(mfxInitParam& par)
|
||||
{
|
||||
if (par.Implementation & MFX_IMPL_AUDIO) {
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
eMFXHWType platform = MFX_HW_UNKNOWN;
|
||||
auto devices = get_devices();
|
||||
if (devices.size()) {
|
||||
platform = devices[devices.size() - 1].platform;
|
||||
}
|
||||
|
||||
std::vector<std::string> libs;
|
||||
|
||||
const char *selected_runtime = getenv("INTEL_MEDIA_RUNTIME");
|
||||
if (selected_runtime && strcmp(selected_runtime, "ONEVPL") == 0) {
|
||||
libs.emplace_back(ONEVPLRT);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT);
|
||||
} else if ((selected_runtime && strcmp(selected_runtime, "MSDK") == 0) || (platform != MFX_HW_UNKNOWN)) {
|
||||
if (MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO ||
|
||||
MFX_IMPL_BASETYPE(par.Implementation) == MFX_IMPL_AUTO_ANY) {
|
||||
libs.emplace_back(LIBMFXHW);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXHW);
|
||||
libs.emplace_back(LIBMFXSW);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXSW);
|
||||
} else if (par.Implementation & MFX_IMPL_HARDWARE ||
|
||||
par.Implementation & MFX_IMPL_HARDWARE_ANY) {
|
||||
libs.emplace_back(LIBMFXHW);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXHW);
|
||||
} else if (par.Implementation & MFX_IMPL_SOFTWARE) {
|
||||
libs.emplace_back(LIBMFXSW);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" LIBMFXSW);
|
||||
} else {
|
||||
return MFX_ERR_UNSUPPORTED;
|
||||
}
|
||||
} else {
|
||||
libs.emplace_back(ONEVPLRT);
|
||||
libs.emplace_back(MFX_MODULES_DIR "/" ONEVPLRT);
|
||||
}
|
||||
|
||||
mfxStatus mfx_res = MFX_ERR_UNSUPPORTED;
|
||||
|
||||
for (auto& lib: libs) {
|
||||
std::shared_ptr<void> hdl = make_dlopen(lib.c_str(), RTLD_LOCAL|RTLD_NOW);
|
||||
if (hdl) {
|
||||
do {
|
||||
/* Loading functions table */
|
||||
bool wrong_version = false;
|
||||
for (int i = 0; i < eFunctionsNum; ++i) {
|
||||
assert(i == g_mfxFuncTable[i].id);
|
||||
m_table[i] = dlsym(hdl.get(), g_mfxFuncTable[i].name);
|
||||
if (!m_table[i] && ((par.Version <= g_mfxFuncTable[i].version) ||
|
||||
(g_mfxFuncTable[i].version <= mfxVersion(VERSION(1, 14))))) {
|
||||
// this version of dispatcher requires MFXInitEx which appeared
|
||||
// in Media SDK API 1.14
|
||||
wrong_version = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wrong_version) {
|
||||
mfx_res = MFX_ERR_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Initializing loaded library */
|
||||
mfx_res = ((decltype(MFXInitEx)*)m_table[eMFXInitEx])(par, &m_session);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Below we just get some data and double check that we got what we have expected
|
||||
// to get. Some of these checks are done inside mediasdk init function
|
||||
mfx_res = ((decltype(MFXQueryVersion)*)m_table[eMFXQueryVersion])(m_session, &m_version);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_version < par.Version) {
|
||||
mfx_res = MFX_ERR_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
mfx_res = ((decltype(MFXQueryIMPL)*)m_table[eMFXQueryIMPL])(m_session, &m_implementation);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
mfx_res = MFX_ERR_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
} while(false);
|
||||
|
||||
if (MFX_ERR_NONE == mfx_res) {
|
||||
m_dlh = std::move(hdl);
|
||||
break;
|
||||
} else {
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
mfxStatus LoaderCtx::Close()
|
||||
{
|
||||
auto proc = (decltype(MFXClose)*)m_table[eMFXClose];
|
||||
mfxStatus mfx_res = (proc)? (*proc)(m_session): MFX_ERR_NONE;
|
||||
|
||||
m_implementation = {};
|
||||
m_version = {};
|
||||
m_session = nullptr;
|
||||
std::fill(std::begin(m_table), std::end(m_table), nullptr);
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
mfxStatus PluginCtx::Load(const mfxPluginUID& uid, mfxU32 version, const char *path)
|
||||
{
|
||||
if (!path) {
|
||||
return MFX_ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
mfxStatus mfx_res = MFX_ERR_NONE;
|
||||
std::shared_ptr<void> hdl = make_dlopen(path, RTLD_LOCAL|RTLD_NOW);
|
||||
|
||||
if (!hdl) {
|
||||
return MFX_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
do {
|
||||
m_uid = uid;
|
||||
m_create_plugin = (CreatePluginPtr)dlsym(hdl.get(), "CreatePlugin");
|
||||
if (!m_create_plugin) {
|
||||
mfx_res = MFX_ERR_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
mfx_res = m_create_plugin(m_uid, &m_plugin);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
break;
|
||||
}
|
||||
|
||||
mfx_res = m_plugin.GetPluginParam(m_plugin.pthis, &m_plugin_param);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
break;
|
||||
}
|
||||
|
||||
mfx_res = MFXVideoUSER_Register((mfxSession)&m_loader, m_plugin_param.Type, &m_plugin);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
break;
|
||||
}
|
||||
} while(false);
|
||||
|
||||
if (MFX_ERR_NONE == mfx_res) {
|
||||
m_dlh = std::move(hdl);
|
||||
} else {
|
||||
m_uid = {};
|
||||
m_create_plugin = nullptr;
|
||||
m_plugin = {};
|
||||
m_plugin_param = {};
|
||||
}
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
mfxStatus PluginCtx::Unload()
|
||||
{
|
||||
return MFXVideoUSER_Unregister((mfxSession)&m_loader, m_plugin_param.Type);
|
||||
}
|
||||
|
||||
mfxStatus LoaderCtx::LoadPlugin(const mfxPluginUID &uid, mfxU32 version, const char *path)
|
||||
{
|
||||
if (!path) return MFX_ERR_NULL_PTR;
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_guard);
|
||||
|
||||
for (auto& it: m_plugins) {
|
||||
if (it.getUID() == uid) return MFX_ERR_UNDEFINED_BEHAVIOR;
|
||||
}
|
||||
|
||||
PluginCtx ctx(*this);
|
||||
|
||||
mfxStatus mfx_res = ctx.Load(uid, version, path);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
m_plugins.emplace_back(std::move(ctx));
|
||||
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
mfxStatus LoaderCtx::UnloadPlugin(const mfxPluginUID& uid)
|
||||
{
|
||||
std::list<PluginCtx> ctx;
|
||||
{
|
||||
// We will move plugin ctx which we are going to delete to the
|
||||
// array allocated on stack. In this way we will move bottom half
|
||||
// of plugin ctx destroy, including potentially long dlclose, out
|
||||
// of the mutex.
|
||||
std::lock_guard<std::mutex> lock(m_guard);
|
||||
auto it = std::find_if(std::begin(m_plugins), std::end(m_plugins),
|
||||
[&uid](const PluginCtx& cur_ctx){ return cur_ctx.getUID() == uid; });
|
||||
|
||||
if (it != std::end(m_plugins)) {
|
||||
mfxStatus mfx_res = it->Unload();
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
return mfx_res;
|
||||
}
|
||||
ctx.splice(ctx.end(), m_plugins, it);
|
||||
}
|
||||
}
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
} // namespace MFX
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
mfxStatus MFXInit(mfxIMPL impl, mfxVersion *ver, mfxSession *session)
|
||||
{
|
||||
mfxInitParam par{};
|
||||
|
||||
par.Implementation = impl;
|
||||
if (ver) {
|
||||
par.Version = *ver;
|
||||
} else {
|
||||
par.Version = VERSION(MFX_VERSION_MAJOR, MFX_VERSION_MINOR);
|
||||
}
|
||||
|
||||
return MFXInitEx(par, session);
|
||||
}
|
||||
|
||||
mfxStatus MFXInitEx(mfxInitParam par, mfxSession *session)
|
||||
{
|
||||
if (!session) return MFX_ERR_NULL_PTR;
|
||||
|
||||
try {
|
||||
std::unique_ptr<MFX::LoaderCtx> loader;
|
||||
|
||||
loader.reset(new MFX::LoaderCtx{});
|
||||
|
||||
mfxStatus mfx_res = loader->Init(par);
|
||||
if (MFX_ERR_NONE == mfx_res) {
|
||||
*session = (mfxSession)loader.release();
|
||||
} else {
|
||||
*session = nullptr;
|
||||
}
|
||||
|
||||
return mfx_res;
|
||||
} catch(...) {
|
||||
return MFX_ERR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
mfxStatus MFXClose(mfxSession session)
|
||||
{
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE;
|
||||
|
||||
try {
|
||||
std::unique_ptr<MFX::LoaderCtx> loader((MFX::LoaderCtx*)session);
|
||||
mfxStatus mfx_res = loader->Close();
|
||||
|
||||
if (mfx_res == MFX_ERR_UNDEFINED_BEHAVIOR) {
|
||||
// It is possible, that there is an active child session.
|
||||
// Can't unload library in this case.
|
||||
loader.release();
|
||||
}
|
||||
return mfx_res;
|
||||
} catch(...) {
|
||||
return MFX_ERR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool IsEmbeddedPlugin(const mfxPluginUID *uid)
|
||||
{
|
||||
return (
|
||||
*uid == MFX_PLUGINID_HEVCD_HW ||
|
||||
*uid == MFX_PLUGINID_HEVCE_HW ||
|
||||
*uid == MFX_PLUGINID_VP8D_HW ||
|
||||
*uid == MFX_PLUGINID_VP8E_HW ||
|
||||
*uid == MFX_PLUGINID_VP9D_HW ||
|
||||
*uid == MFX_PLUGINID_VP9E_HW);
|
||||
}
|
||||
|
||||
mfxStatus MFXVideoUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version)
|
||||
{
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE;
|
||||
if (!uid) return MFX_ERR_NULL_PTR;
|
||||
if (IsEmbeddedPlugin(uid)) {
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
try {
|
||||
MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session;
|
||||
std::string path;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(MFX::g_GlobalCtx.m_mutex);
|
||||
|
||||
auto find_uid = [](const mfxPluginUID& puid) {
|
||||
return std::find_if(
|
||||
MFX::g_GlobalCtx.m_plugins.begin(),
|
||||
MFX::g_GlobalCtx.m_plugins.end(),
|
||||
[&puid](MFX::PluginInfo& item){ return item.getUID() == puid; }
|
||||
);
|
||||
};
|
||||
|
||||
if (MFX::g_GlobalCtx.m_plugins.empty()) {
|
||||
// Parsing plugin configuration file and loading information of
|
||||
// _all_ plugins registered on the system.
|
||||
parse(MFX_PLUGINS_CONF_DIR "/plugins.cfg", MFX::g_GlobalCtx.m_plugins);
|
||||
}
|
||||
|
||||
// search for plugin description
|
||||
auto it = find_uid(*uid);
|
||||
if (it == MFX::g_GlobalCtx.m_plugins.end()) {
|
||||
return MFX_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
path = it->getPath();
|
||||
}
|
||||
|
||||
return loader->LoadPlugin(*uid, version, path.c_str());
|
||||
} catch(...) {
|
||||
return MFX_ERR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
mfxStatus MFXVideoUSER_LoadByPath(mfxSession session, const mfxPluginUID *uid, mfxU32 version, const mfxChar *path, mfxU32 /*len*/)
|
||||
{
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE;
|
||||
if (!uid) return MFX_ERR_NULL_PTR;
|
||||
if (IsEmbeddedPlugin(uid)) {
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
try {
|
||||
MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session;
|
||||
return loader->LoadPlugin(*uid, version, path);
|
||||
} catch(...) {
|
||||
return MFX_ERR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
mfxStatus MFXVideoUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
|
||||
{
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE;
|
||||
if (!uid) return MFX_ERR_NULL_PTR;
|
||||
if (IsEmbeddedPlugin(uid)) {
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
try {
|
||||
MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session;
|
||||
return loader->UnloadPlugin(*uid);
|
||||
} catch(...) {
|
||||
return MFX_ERR_MEMORY_ALLOC;
|
||||
}
|
||||
}
|
||||
|
||||
mfxStatus MFXAudioUSER_Load(mfxSession session, const mfxPluginUID *uid, mfxU32 version)
|
||||
{
|
||||
return MFX_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
mfxStatus MFXAudioUSER_UnLoad(mfxSession session, const mfxPluginUID *uid)
|
||||
{
|
||||
return MFX_ERR_NOT_FOUND;
|
||||
}
|
||||
|
||||
mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
|
||||
{
|
||||
if (!session || !child_session) {
|
||||
return MFX_ERR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session;
|
||||
MFX::LoaderCtx* child_loader = (MFX::LoaderCtx*)child_session;
|
||||
|
||||
if (loader->getVersion().Version != child_loader->getVersion().Version) {
|
||||
return MFX_ERR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
auto proc = (decltype(MFXJoinSession)*)loader->getFunction(MFX::eMFXJoinSession);
|
||||
if (!proc) {
|
||||
return MFX_ERR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
return (*proc)(loader->getSession(), child_loader->getSession());
|
||||
}
|
||||
|
||||
mfxStatus MFXCloneSession(mfxSession session, mfxSession *clone)
|
||||
{
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE;
|
||||
|
||||
MFX::LoaderCtx* loader = (MFX::LoaderCtx*)session;
|
||||
// initialize the clone session
|
||||
mfxVersion version = loader->getVersion();
|
||||
mfxStatus mfx_res = MFXInit(loader->getImpl(), &version, clone);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
// join the sessions
|
||||
mfx_res = MFXJoinSession(session, *clone);
|
||||
if (MFX_ERR_NONE != mfx_res) {
|
||||
MFXClose(*clone);
|
||||
*clone = nullptr;
|
||||
return mfx_res;
|
||||
}
|
||||
|
||||
return MFX_ERR_NONE;
|
||||
}
|
||||
|
||||
#undef FUNCTION
|
||||
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list) \
|
||||
return_value MFX_CDECL func_name formal_param_list \
|
||||
{ \
|
||||
/* get the function's address and make a call */ \
|
||||
if (!session) return MFX_ERR_INVALID_HANDLE; \
|
||||
\
|
||||
MFX::LoaderCtx *loader = (MFX::LoaderCtx*) session; \
|
||||
\
|
||||
auto proc = (decltype(func_name)*)loader->getFunction(MFX::e##func_name); \
|
||||
if (!proc) return MFX_ERR_INVALID_HANDLE; \
|
||||
\
|
||||
/* get the real session pointer */ \
|
||||
session = loader->getSession(); \
|
||||
/* pass down the call */ \
|
||||
return (*proc) actual_param_list; \
|
||||
}
|
||||
|
||||
#include "mfxvideo_functions.h"
|
||||
|
||||
#undef FUNCTION
|
||||
#define FUNCTION(return_value, func_name, formal_param_list, actual_param_list)
|
||||
// as of now we don't expose audio support, but we still want to check certain
|
||||
// consistency of mfxaudio_functions.h file, so include it here
|
||||
|
||||
#include "mfxaudio_functions.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
104
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.h
vendored
Normal file
104
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxloader.h
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
// Copyright (c) 2017-2019 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#ifndef __MFXLOADER_H__
|
||||
#define __MFXLOADER_H__
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "mfxdefs.h"
|
||||
#include "mfxplugin.h"
|
||||
|
||||
inline bool operator == (const mfxPluginUID &lhs, const mfxPluginUID & rhs)
|
||||
{
|
||||
return !memcmp(lhs.Data, rhs.Data, sizeof(mfxPluginUID));
|
||||
}
|
||||
|
||||
inline bool operator != (const mfxPluginUID &lhs, const mfxPluginUID & rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
inline bool operator < (const mfxVersion &lhs, const mfxVersion & rhs)
|
||||
{
|
||||
return (lhs.Major < rhs.Major ||
|
||||
(lhs.Major == rhs.Major && lhs.Minor < rhs.Minor));
|
||||
}
|
||||
|
||||
inline bool operator <= (const mfxVersion &lhs, const mfxVersion & rhs)
|
||||
{
|
||||
return (lhs < rhs || (lhs.Major == rhs.Major && lhs.Minor == rhs.Minor));
|
||||
}
|
||||
|
||||
namespace MFX {
|
||||
|
||||
class PluginInfo : public mfxPluginParam
|
||||
{
|
||||
public:
|
||||
PluginInfo()
|
||||
: mfxPluginParam()
|
||||
, m_parsed()
|
||||
, m_path()
|
||||
, m_default()
|
||||
{}
|
||||
|
||||
inline bool isValid() {
|
||||
return m_parsed;
|
||||
}
|
||||
|
||||
inline mfxPluginUID getUID() {
|
||||
return PluginUID;
|
||||
}
|
||||
|
||||
inline std::string getPath() {
|
||||
return std::string(m_path);
|
||||
}
|
||||
|
||||
void Load(const char* name, const char* value);
|
||||
void Print();
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
PARSED_TYPE = 0x1,
|
||||
PARSED_CODEC_ID = 0x2,
|
||||
PARSED_UID = 0x4,
|
||||
PARSED_PATH = 0x8,
|
||||
PARSED_DEFAULT = 0x10,
|
||||
PARSED_VERSION = 0x20,
|
||||
PARSED_API_VERSION = 0x40,
|
||||
PARSED_NAME = 0x80,
|
||||
};
|
||||
|
||||
mfxU32 m_parsed;
|
||||
|
||||
char m_path[PATH_MAX];
|
||||
bool m_default;
|
||||
};
|
||||
|
||||
void parse(const char* file_name, std::list<PluginInfo>& all_records);
|
||||
|
||||
|
||||
} // namespace MFX
|
||||
|
||||
#endif
|
||||
215
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxparser.cpp
vendored
Normal file
215
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxparser.cpp
vendored
Normal file
@@ -0,0 +1,215 @@
|
||||
// Copyright (c) 2017-2019 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "mfxloader.h"
|
||||
|
||||
namespace MFX {
|
||||
|
||||
static bool parseGUID(const char* src, mfxPluginUID* uid)
|
||||
{
|
||||
mfxPluginUID plugin_uid{};
|
||||
mfxU8* p = plugin_uid.Data;
|
||||
|
||||
int res = sscanf(src,
|
||||
"%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
|
||||
p, p + 1, p + 2, p + 3, p + 4, p + 5, p + 6, p + 7,
|
||||
p + 8, p + 9, p + 10, p + 11, p + 12, p + 13, p + 14, p + 15);
|
||||
|
||||
if (res != sizeof(uid->Data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*uid = plugin_uid;
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::string printUID(const mfxPluginUID& uid)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << std::hex;
|
||||
for (auto c: uid.Data) ss << static_cast<unsigned>(c);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
static std::string printCodecId(mfxU32 id)
|
||||
{
|
||||
uint8_t* data = reinterpret_cast<uint8_t*>(&id);
|
||||
std::stringstream ss;
|
||||
for (size_t i=0; i < sizeof(id); ++i) ss << data[i];
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void PluginInfo::Load(const char* name, const char* value)
|
||||
{
|
||||
#ifdef LINUX64
|
||||
#define FIELD_FileName "FileName64"
|
||||
#else
|
||||
#define FIELD_FileName "FileName32"
|
||||
#endif
|
||||
|
||||
if (!strcmp(name, "Type")) {
|
||||
Type = atoi(value);
|
||||
m_parsed |= PARSED_TYPE;
|
||||
} else if (!strcmp(name, "CodecID")) {
|
||||
const int fourccLen = 4;
|
||||
if (strlen(value) == 0 || strlen(value) > fourccLen)
|
||||
return;
|
||||
|
||||
CodecId = MFX_MAKEFOURCC(' ',' ',' ',' ');
|
||||
char* id = reinterpret_cast<char*>(&CodecId);
|
||||
for (size_t i = 0; i < strlen(value); ++i)
|
||||
id[i] = value[i];
|
||||
|
||||
m_parsed |= PARSED_CODEC_ID;
|
||||
} else if (!strcmp(name, "GUID")) {
|
||||
if (!parseGUID(value, &PluginUID))
|
||||
return;
|
||||
|
||||
m_parsed |= PARSED_UID;
|
||||
} else if (!strcmp(name, "Path") || !strcmp(name, FIELD_FileName)) {
|
||||
// strip quotes
|
||||
std::string str_value(value);
|
||||
|
||||
if (!str_value.empty() && str_value.front() == '"' && str_value.back() == '"')
|
||||
{
|
||||
str_value.pop_back();
|
||||
|
||||
if (!str_value.empty())
|
||||
str_value.erase(0, 1);
|
||||
}
|
||||
|
||||
if (strlen(m_path) + strlen("/") + str_value.size() >= PATH_MAX)
|
||||
return;
|
||||
strncpy(m_path + strlen(m_path), str_value.c_str(), str_value.size() + 1);
|
||||
m_parsed |= PARSED_PATH;
|
||||
} else if (0 == strcmp(name, "Default")) {
|
||||
m_default = (0 != atoi(value));
|
||||
m_parsed |= PARSED_DEFAULT;
|
||||
} else if (0 == strcmp(name, "PluginVersion")) {
|
||||
PluginVersion = atoi(value);
|
||||
m_parsed |= PARSED_VERSION;
|
||||
} else if (0 == strcmp(name, "APIVersion")) {
|
||||
APIVersion.Version = atoi(value);
|
||||
m_parsed |= PARSED_API_VERSION;
|
||||
}
|
||||
}
|
||||
|
||||
void PluginInfo::Print()
|
||||
{
|
||||
printf("[%s]\n", printUID(PluginUID).c_str());
|
||||
printf(" GUID=%s\n", printUID(PluginUID).c_str());
|
||||
printf(" PluginVersion=%d\n", PluginVersion);
|
||||
printf(" APIVersion=%d\n", APIVersion.Version);
|
||||
printf(" Path=%s\n", m_path);
|
||||
printf(" Type=%d\n", Type);
|
||||
printf(" CodecID=%s\n", printCodecId(CodecId).c_str());
|
||||
printf(" Default=%d\n", m_default);
|
||||
}
|
||||
|
||||
const std::string space_search_pattern(" \f\n\r\t\v");
|
||||
// strip tailing spaces
|
||||
void strip(std::string & str)
|
||||
{
|
||||
static_assert(std::string::npos + 1 == 0, "");
|
||||
str.erase(str.find_last_not_of(space_search_pattern) + 1);
|
||||
}
|
||||
|
||||
// skip initial spaces
|
||||
void skip(std::string & str)
|
||||
{
|
||||
str.erase(0, str.find_first_not_of(space_search_pattern));
|
||||
}
|
||||
|
||||
void parse(const char* file_name, std::list<PluginInfo>& plugins)
|
||||
{
|
||||
#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)
|
||||
const char* mode = "re";
|
||||
#else
|
||||
const char* mode = "r";
|
||||
#endif
|
||||
|
||||
FILE* file = fopen(file_name, mode);
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
char c_line[PATH_MAX];
|
||||
PluginInfo plg;
|
||||
std::string line;
|
||||
|
||||
while(fgets(c_line, PATH_MAX, file))
|
||||
{
|
||||
line = c_line;
|
||||
|
||||
strip(line);
|
||||
skip(line);
|
||||
|
||||
if (line.find_first_not_of(";#") != 0)
|
||||
{
|
||||
// skip comments
|
||||
continue;
|
||||
}
|
||||
else if (line[0] == '[')
|
||||
{
|
||||
if (plg.isValid()) {
|
||||
plugins.push_back(std::move(plg));
|
||||
plg = PluginInfo{};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string name = line, value = line;
|
||||
|
||||
size_t pos = value.find_first_of("=:");
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
// Get left part relative to delimiter
|
||||
name.erase(pos);
|
||||
strip(name);
|
||||
|
||||
// Get right part relative to delimiter
|
||||
value.erase(0, pos + 1);
|
||||
skip(value);
|
||||
|
||||
static_assert(std::string::npos + 1 == 0, "");
|
||||
value.erase(value.find_last_not_of(";#") + 1);
|
||||
}
|
||||
if (!name.empty() && !value.empty()) {
|
||||
plg.Load(name.c_str(), value.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plg.isValid()) {
|
||||
plugins.push_back(std::move(plg));
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
|
||||
//print(plugins); // for debug
|
||||
}
|
||||
|
||||
} // namespace MFX
|
||||
148
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxvideo_functions.h
vendored
Normal file
148
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/mfxvideo_functions.h
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
// Copyright (c) 2017 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//
|
||||
// WARNING:
|
||||
// this file doesn't contain an include guard by intension.
|
||||
// The file may be included into a source file many times.
|
||||
// That is why this header doesn't contain any include directive.
|
||||
// Please, do no try to fix it.
|
||||
//
|
||||
|
||||
|
||||
|
||||
// Use define API_VERSION to set the API of functions listed further
|
||||
// When new functions are added new section with functions declarations must be started with updated define
|
||||
|
||||
//
|
||||
// API version 1.0 functions
|
||||
//
|
||||
|
||||
// API version where a function is added. Minor value should precedes the major value
|
||||
#define API_VERSION {{0, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXQueryIMPL, (mfxSession session, mfxIMPL *impl), (session, impl))
|
||||
FUNCTION(mfxStatus, MFXQueryVersion, (mfxSession session, mfxVersion *version), (session, version))
|
||||
|
||||
// CORE interface functions
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_SetBufferAllocator, (mfxSession session, mfxBufferAllocator *allocator), (session, allocator))
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_SetFrameAllocator, (mfxSession session, mfxFrameAllocator *allocator), (session, allocator))
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_SetHandle, (mfxSession session, mfxHandleType type, mfxHDL hdl), (session, type, hdl))
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_GetHandle, (mfxSession session, mfxHandleType type, mfxHDL *hdl), (session, type, hdl))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_SyncOperation, (mfxSession session, mfxSyncPoint syncp, mfxU32 wait), (session, syncp, wait))
|
||||
|
||||
// ENCODE interface functions
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_Init, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_Close, (mfxSession session), (session))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_GetEncodeStat, (mfxSession session, mfxEncodeStat *stat), (session, stat))
|
||||
FUNCTION(mfxStatus, MFXVideoENCODE_EncodeFrameAsync, (mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp), (session, ctrl, surface, bs, syncp))
|
||||
|
||||
// DECODE interface functions
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_DecodeHeader, (mfxSession session, mfxBitstream *bs, mfxVideoParam *par), (session, bs, par))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_Init, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_Reset, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_Close, (mfxSession session), (session))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_GetDecodeStat, (mfxSession session, mfxDecodeStat *stat), (session, stat))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_SetSkipMode, (mfxSession session, mfxSkipMode mode), (session, mode))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_GetPayload, (mfxSession session, mfxU64 *ts, mfxPayload *payload), (session, ts, payload))
|
||||
FUNCTION(mfxStatus, MFXVideoDECODE_DecodeFrameAsync, (mfxSession session, mfxBitstream *bs, mfxFrameSurface1 *surface_work, mfxFrameSurface1 **surface_out, mfxSyncPoint *syncp), (session, bs, surface_work, surface_out, syncp))
|
||||
|
||||
// VPP interface functions
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_Init, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_Reset, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_Close, (mfxSession session), (session))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_GetVPPStat, (mfxSession session, mfxVPPStat *stat), (session, stat))
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsync, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *out, mfxExtVppAuxData *aux, mfxSyncPoint *syncp), (session, in, out, aux, syncp))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
//
|
||||
// API version 1.1 functions
|
||||
//
|
||||
|
||||
#define API_VERSION {{1, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXDisjoinSession, (mfxSession session), (session))
|
||||
FUNCTION(mfxStatus, MFXSetPriority, (mfxSession session, mfxPriority priority), (session, priority))
|
||||
FUNCTION(mfxStatus, MFXGetPriority, (mfxSession session, mfxPriority *priority), (session, priority))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoUSER_Register, (mfxSession session, mfxU32 type, const mfxPlugin *par), (session, type, par))
|
||||
FUNCTION(mfxStatus, MFXVideoUSER_Unregister, (mfxSession session, mfxU32 type), (session, type))
|
||||
FUNCTION(mfxStatus, MFXVideoUSER_ProcessFrameAsync, (mfxSession session, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxSyncPoint *syncp), (session, in, in_num, out, out_num, syncp))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
//
|
||||
// API version 1.10 functions
|
||||
//
|
||||
|
||||
#define API_VERSION {{10, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoENC_Query,(mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session,in,out))
|
||||
FUNCTION(mfxStatus, MFXVideoENC_QueryIOSurf,(mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session,par,request))
|
||||
FUNCTION(mfxStatus, MFXVideoENC_Init,(mfxSession session, mfxVideoParam *par), (session,par))
|
||||
FUNCTION(mfxStatus, MFXVideoENC_Reset,(mfxSession session, mfxVideoParam *par), (session,par))
|
||||
FUNCTION(mfxStatus, MFXVideoENC_Close,(mfxSession session),(session))
|
||||
FUNCTION(mfxStatus, MFXVideoENC_ProcessFrameAsync,(mfxSession session, mfxENCInput *in, mfxENCOutput *out, mfxSyncPoint *syncp),(session,in,out,syncp))
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoVPP_RunFrameVPPAsyncEx, (mfxSession session, mfxFrameSurface1 *in, mfxFrameSurface1 *work, mfxFrameSurface1 **out, mfxSyncPoint *syncp), (session, in, work, out, syncp))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
#define API_VERSION {{13, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_Query, (mfxSession session, mfxVideoParam *in, mfxVideoParam *out), (session, in, out))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_QueryIOSurf, (mfxSession session, mfxVideoParam *par, mfxFrameAllocRequest *request), (session, par, request))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_Init, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_Reset, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_Close, (mfxSession session), (session))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_ProcessFrameAsync, (mfxSession session, mfxPAKInput *in, mfxPAKOutput *out, mfxSyncPoint *syncp), (session, in, out, syncp))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
#define API_VERSION {{14, 1}}
|
||||
|
||||
// FUNCTION(mfxStatus, MFXInitEx, (mfxInitParam par, mfxSession session), (par, session))
|
||||
FUNCTION(mfxStatus, MFXDoWork, (mfxSession session), (session))
|
||||
|
||||
#undef API_VERSION
|
||||
|
||||
#define API_VERSION {{19, 1}}
|
||||
|
||||
FUNCTION(mfxStatus, MFXVideoENC_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoPAK_GetVideoParam, (mfxSession session, mfxVideoParam *par), (session, par))
|
||||
FUNCTION(mfxStatus, MFXVideoCORE_QueryPlatform, (mfxSession session, mfxPlatform* platform), (session, platform))
|
||||
FUNCTION(mfxStatus, MFXVideoUSER_GetPlugin, (mfxSession session, mfxU32 type, mfxPlugin *par), (session, type, par))
|
||||
|
||||
#undef API_VERSION
|
||||
10
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config-shared.pc.cmake
vendored
Normal file
10
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config-shared.pc.cmake
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
Name: @PROJECT_NAME@
|
||||
Description: Intel(R) Media SDK Dispatcher
|
||||
Version: @MFX_VERSION_MAJOR@.@MFX_VERSION_MINOR@
|
||||
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
Libs: -L${libdir} -ldispatch_shared -lstdc++ -ldl
|
||||
Cflags: -I${includedir} -I${includedir}/mfx -DMFX_DISPATCHER_EXPOSED_PREFIX
|
||||
|
||||
9
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config.pc.cmake
vendored
Normal file
9
libs/hwcodec/externals/MediaSDK_22.5.4/api/mfx_dispatch/linux/pkg-config.pc.cmake
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
Name: @PROJECT_NAME@
|
||||
Description: Intel(R) Media SDK Dispatcher
|
||||
Version: @MFX_VERSION_MAJOR@.@MFX_VERSION_MINOR@
|
||||
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
Libs: -L${libdir} -lmfx -lstdc++ -ldl
|
||||
Cflags: -I${includedir} -I${includedir}/mfx
|
||||
Reference in New Issue
Block a user