Skip to content

Commit

Permalink
Update naming in dispatcher test tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mav-intel committed Nov 29, 2023
1 parent 0468b4e commit 506dfd6
Showing 12 changed files with 30 additions and 29 deletions.
9 changes: 5 additions & 4 deletions libvpl/src/windows/mfx_dispatcher.h
Original file line number Diff line number Diff line change
@@ -140,10 +140,11 @@ struct MFX_DISP_HANDLE : public _mfxSession {
// dispatchers incompatible. Think of different modules (e.g. MFT filters)
// within a single application.
//
// FOR VPL: order should not matter. Dispatcher is now built as a DLL and installed
// in %WINDIR%\system32. Thus all applications on the system should use same dispatcher.
// Even if an app loads a different dispatcher version, initializing an mfxSession
// with one library then using it in a different library is not a supported use case.
// FOR THIS IMPLEMENTATION: order should not matter. Dispatcher is now built
// as a DLL and installed in %WINDIR%\system32. Thus all applications on the
// system should use same dispatcher. Even if an app loads a different
// dispatcher version, initializing an mfxSession with one library then
// using it in a different library is not a supported use case.

// Library's implementation type (hardware or software)
eMfxImplType implType;
2 changes: 1 addition & 1 deletion libvpl/test/val-surface-sharing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ if(MSVC)
endif()
endif()

# link VPL import library
# link import library
find_package(VPL REQUIRED)
target_link_libraries(${TARGET} PRIVATE VPL::dispatcher)

2 changes: 1 addition & 1 deletion libvpl/test/val-surface-sharing/README.md
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ This is automation script utilizing `val-surface-sharing` tool and validates Sur
All the test list is defined in the script which is composing the command line options.
## Preparation
You need to prepare VPL environment from install directory, for example:
You need to prepare the environment from install directory, for example:
On Windows
```
2 changes: 1 addition & 1 deletion libvpl/test/val-surface-sharing/src/decode.cpp
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ mfxStatus CDecodeTest::Init(int tIndex, Options *opts, std::vector<mfxU32> *adap
sts = m_pDevCtx->InitDevice(0, &handleType, &handle);
VERIFY((MFX_ERR_NONE == sts) && (handle != nullptr), "ERROR: InitDevice", sts);

// pass device handle to VPL RT
// pass device handle to runtime
sts = MFXVideoCORE_SetHandle(m_session, handleType, handle);
VERIFY(MFX_ERR_NONE == sts, "ERROR: SetHandle", sts);

2 changes: 1 addition & 1 deletion libvpl/test/val-surface-sharing/src/encode.cpp
Original file line number Diff line number Diff line change
@@ -160,7 +160,7 @@ mfxStatus CEncodeTest::Init(int tIndex, Options *opts, std::vector<mfxU32> *adap
sts = m_pDevCtx->InitDevice(0, &handleType, &handle);
VERIFY((MFX_ERR_NONE == sts) && (handle != nullptr), "ERROR: InitDevice", sts);

// pass device handle to VPL RT
// pass device handle to runtime
sts = MFXVideoCORE_SetHandle(m_session, handleType, handle);
VERIFY(MFX_ERR_NONE == sts, "ERROR: SetHandle", sts);

4 changes: 2 additions & 2 deletions libvpl/test/val-surface-sharing/src/hw-device-d3d11.cpp
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ mfxStatus DevCtxD3D11::InitDevice(mfxU32 nAdapterNum, mfxHandleType *pHandleType
}

ID3D11Device *DevCtxD3D11::GetVideoDeviceFromFrameSurface(mfxFrameSurface1 *pSrf) {
// get handle of internal device created by VPL RT, use same device for rendering
// get handle of internal device created by runtime, use same device for rendering
mfxHDL device_handle = nullptr;
mfxHandleType device_type = {};

@@ -69,7 +69,7 @@ ID3D11Device *DevCtxD3D11::GetVideoDeviceFromFrameSurface(mfxFrameSurface1 *pSrf
}

ID3D11Texture2D *DevCtxD3D11::GetVideoTextureFromFrameSurface(mfxFrameSurface1 *pSrf) {
// get native handle of texture created by VPL RT
// get native handle of texture created by runtime
mfxHDL frame_handle = nullptr;
mfxResourceType res_type = {};

4 changes: 2 additions & 2 deletions libvpl/test/val-surface-sharing/src/vpp.cpp
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ mfxStatus CVPPTest::Init(int tIndex, Options *opts, std::vector<mfxU32> *adapter
sts = m_pDevCtx->InitDevice(0, &handleType, &handle);
VERIFY((MFX_ERR_NONE == sts) && (handle != nullptr), "ERROR: InitDevice", sts);

// pass device handle to VPL RT
// pass device handle to runtime
sts = MFXVideoCORE_SetHandle(m_session, handleType, handle);
VERIFY(MFX_ERR_NONE == sts, "ERROR: SetHandle", sts);

@@ -405,7 +405,7 @@ mfxStatus CVPPTest::ProcessStreamVPP() {
descOfExport.SurfaceType = m_pOpts->surfaceType;
descOfExport.SurfaceFlags = m_pOpts->surfaceFlag;

// export mfxFrameSurface1 from VPL to a D3D11 texture
// export mfxFrameSurface1 to a D3D11 texture
mfxSurfaceHeader *exportedSurfaceGeneral = nullptr;
mfxStatus stsSurf = pmfxVPPOutSurface->FrameInterface->Export(
pmfxVPPOutSurface,
2 changes: 1 addition & 1 deletion libvpl/test/val-surface-sharing/val_surface_sharing_api.py
Original file line number Diff line number Diff line change
@@ -154,7 +154,7 @@ def report_result(self, test_stats: TestStats):
VAL_APP = r"val-surface-sharing"
print(INPUT_CONTENT)
else:
raise SystemExit("VPL env is not ready!")
raise SystemExit("environment is not ready!")


def display_adapters():
2 changes: 1 addition & 1 deletion libvpl/test/vpl-import-export/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ if(MSVC)
endif()
endif()

# link VPL import library
# link import library
find_package(VPL REQUIRED)
target_link_libraries(${TARGET} PRIVATE VPL::dispatcher)

14 changes: 7 additions & 7 deletions libvpl/test/vpl-import-export/src/decode-vpp.cpp
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ static int ProcessStreamDecodeVPP(mfxSession session, FileInfo *fileInfo, Decode
#endif
VPL_TOTAL_TIME_START(totalExportTime);

// export mfxFrameSurface1 from VPL to a D3D11 or VAAPI surface
// export mfxFrameSurface1 from oneVPL to a D3D11 or VAAPI surface
sts = pmfxVPPOutSurface->FrameInterface->Export(pmfxVPPOutSurface, export_header, (mfxSurfaceHeader **)&extSurf);
VERIFY(MFX_ERR_NONE == sts, "ERROR: Export");

@@ -267,7 +267,7 @@ static int ProcessStreamDecodeVPP(mfxSession session, FileInfo *fileInfo, Decode

VPL_TOTAL_TIME_START(totalExportTime);

// export surface from VPL runtime (output of VPP) as an OCL surface (input to OCL kernel)
// export surface from oneVPL runtime (output of VPP) as an OCL surface (input to OCL kernel)
mfxSurfaceOpenCLImg2D *extSurfOCL = nullptr;
sts = pmfxVPPOutSurface->FrameInterface->Export(pmfxVPPOutSurface, export_header, (mfxSurfaceHeader **)&extSurfOCL);
VERIFY(MFX_ERR_NONE == sts, "ERROR: Export (OpenCL)");
@@ -420,7 +420,7 @@ int RunDecodeVPP(Params *params, FileInfo *fileInfo) {
decCtx.surfaceFlags = MFX_SURFACE_FLAG_EXPORT_COPY;

// create HW device context
// automatically released when devCtx goes out of scope (make sure this happens after closing VPL session)
// automatically released when devCtx goes out of scope (make sure this happens after closing session)
DevCtx devCtx = {};
mfxHandleType handleType = {};
mfxHDL handle = nullptr;
@@ -429,7 +429,7 @@ int RunDecodeVPP(Params *params, FileInfo *fileInfo) {
VERIFY((MFX_ERR_NONE == sts) && (handle != nullptr), "ERROR: InitDevice");
decCtx.devCtx = &devCtx;

// specify required capabilities for VPL session creation
// specify required capabilities for session creation
std::list<SurfaceCaps> surfaceCapsList;

// VPP output - native type
@@ -453,12 +453,12 @@ int RunDecodeVPP(Params *params, FileInfo *fileInfo) {
surfaceCapsList.push_back(scOCL);
}

// initalize VPL session
// initialize session
VPLSession vplSession = {};
sts = vplSession.Open(surfaceCapsList);
VERIFY(MFX_ERR_NONE == sts, "ERROR: not able to create VPL session");
VERIFY(MFX_ERR_NONE == sts, "ERROR: unable to create session");

// pass device handle to VPL RT
// pass device handle to runtime
sts = MFXVideoCORE_SetHandle(vplSession.GetSession(), handleType, handle);
VERIFY(MFX_ERR_NONE == sts, "ERROR: SetHandle");

12 changes: 6 additions & 6 deletions libvpl/test/vpl-import-export/src/encode.cpp
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ static int ProcessStreamEncode(mfxSession session, FrameInfo *frameInfo, FileInf
sts = cc->CaptureFrame(pTex2D);
VERIFY(sts == MFX_ERR_NONE, "ERROR: CaptureFrame");

// import D3D11 surface into mfxFrameSurface1 for VPL
// import D3D11 surface into mfxFrameSurface1
// set header.surfaceType, device, and texture2D, all other fields should be empty
mfxSurfaceD3D11Tex2D extSurfD3D11 = {};
extSurfD3D11.SurfaceInterface.Header.SurfaceType = MFX_SURFACE_TYPE_D3D11_TEX2D;
@@ -355,7 +355,7 @@ int RunEncode(Params *params, FileInfo *fileInfo) {
encCtx.surfaceFlags = MFX_SURFACE_FLAG_IMPORT_COPY;

// create HW device context
// automatically released when devCtx goes out of scope (make sure this happens after closing VPL session)
// automatically released when devCtx goes out of scope (make sure this happens after closing session)
DevCtx devCtx = {};
mfxHandleType handleType = {};
mfxHDL handle = nullptr;
@@ -364,7 +364,7 @@ int RunEncode(Params *params, FileInfo *fileInfo) {
VERIFY((MFX_ERR_NONE == sts) && (handle != nullptr), "ERROR: InitDevice");
encCtx.devCtx = &devCtx;

// specify required capabilities for VPL session creation
// specify required capabilities for session creation
std::list<SurfaceCaps> surfaceCapsList;

// encode - native type
@@ -388,12 +388,12 @@ int RunEncode(Params *params, FileInfo *fileInfo) {
surfaceCapsList.push_back(scOCL);
}

// initialize VPL session
// initialize session
VPLSession vplSession = {};
sts = vplSession.Open(surfaceCapsList);
VERIFY(MFX_ERR_NONE == sts, "ERROR: not able to create VPL session");
VERIFY(MFX_ERR_NONE == sts, "ERROR: unable to create session");

// pass device handle to VPL RT
// pass device handle to runtime
sts = MFXVideoCORE_SetHandle(vplSession.GetSession(), handleType, handle);
VERIFY(MFX_ERR_NONE == sts, "ERROR: SetHandle");

4 changes: 2 additions & 2 deletions libvpl/test/vpl-import-export/src/hw-device-d3d11.cpp
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ mfxStatus DevCtxD3D11::InitDevice(mfxU32 nAdapterNum, mfxHandleType *pHandleType
}

ID3D11Device *DevCtxD3D11::GetVideoDeviceFromFrameSurface(mfxFrameSurface1 *pSrf) {
// get handle of internal device created by VPL RT, use same device for rendering
// get handle of internal device created by runtime, use same device for rendering
mfxHDL device_handle = nullptr;
mfxHandleType device_type = {};

@@ -77,7 +77,7 @@ ID3D11Device *DevCtxD3D11::GetVideoDeviceFromFrameSurface(mfxFrameSurface1 *pSrf
}

ID3D11Texture2D *DevCtxD3D11::GetVideoTextureFromFrameSurface(mfxFrameSurface1 *pSrf) {
// get native handle of texture created by VPL RT
// get native handle of texture created by runtime
mfxHDL frame_handle = nullptr;
mfxResourceType res_type = {};

0 comments on commit 506dfd6

Please sign in to comment.