Commit 5c2ff2fb authored by Clement Guedez's avatar Clement Guedez

Use include and def from Intel Media SDK

Use include and def from Intel Media SDK:
- header file from Intel MSDK have another name chart
- rename our internal MSDK_CHECK_RESULT as it was also
  defined in Intel MSDK
parent 24f27633
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
#endif #endif
} }
#include "mfx/mfxvideo++.h" #include "mfxvideo++.h"
#define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x)) #define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x))
#define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16 #define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16
...@@ -45,19 +45,22 @@ extern "C" { ...@@ -45,19 +45,22 @@ extern "C" {
#endif // #if defined(WIN32) || defined(WIN64) #endif // #if defined(WIN32) || defined(WIN64)
#if D3D_SURFACES_SUPPORT #if D3D_SURFACES_SUPPORT
#include "d3dAllocator.hpp" #include "d3d_allocator.h"
#include "d3d11Allocator.hpp" #include "d3d11_allocator.h"
#include "d3dDevice.hpp"
#include "d3d11Device.hpp" #include "d3d_device.h"
#include "d3d11_device.h"
#endif #endif
#ifdef LIBVA_SUPPORT #ifdef LIBVA_SUPPORT
#include "vaapiAllocator.hpp" #include "vaapi_allocator.h"
#include "vaapiDevice.hpp" #include "vaapi_device.h"
#undef Status
#undef None
#endif #endif
#include "sysMemAllocator.hpp" #include "sysmem_allocator.h"
namespace VideoStitch { namespace VideoStitch {
namespace Output { namespace Output {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "videoDecoder.hpp" #include "videoDecoder.hpp"
#include "buffering.hpp" #include "mfx_buffering.h"
#include "libvideostitch/logging.hpp" #include "libvideostitch/logging.hpp"
...@@ -20,7 +20,7 @@ extern "C" { ...@@ -20,7 +20,7 @@ extern "C" {
#endif #endif
} }
#include "mfx/mfxvideo++.h" #include "mfxvideo++.h"
#include <thread> #include <thread>
...@@ -31,7 +31,7 @@ static const std::string QSVtag("QSV Decoder"); ...@@ -31,7 +31,7 @@ static const std::string QSVtag("QSV Decoder");
#define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x)) #define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x))
#define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16 #define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16
#define MSDK_ALIGN32(value) (((value + 31) >> 5) << 5) // round up to a multiple of 32 #define MSDK_ALIGN32(value) (((value + 31) >> 5) << 5) // round up to a multiple of 32
#define MSDK_CHECK_RESULT(P, X, ERR) \ #define IMSDK_CHECK_RESULT(P, X, ERR) \
{ \ { \
if ((X) > (P)) { \ if ((X) > (P)) { \
Logger::warning(QSVtag) << __FUNCTION__ << " line " << __LINE__ << "return with error code " << ERR; \ Logger::warning(QSVtag) << __FUNCTION__ << " line " << __LINE__ << "return with error code " << ERR; \
...@@ -56,19 +56,20 @@ static const std::string QSVtag("QSV Decoder"); ...@@ -56,19 +56,20 @@ static const std::string QSVtag("QSV Decoder");
#endif // #if defined(WIN32) || defined(WIN64) #endif // #if defined(WIN32) || defined(WIN64)
#if D3D_SURFACES_SUPPORT #if D3D_SURFACES_SUPPORT
#include "d3dAllocator.hpp" #include "d3d_allocator.h"
#include "d3d11Allocator.hpp" #include "d3d11_allocator.h"
#include "d3dDevice.hpp" #include "d3d_device.h"
#include "d3d11Device.hpp" #include "d3d11_device.h"
#endif #endif
#ifdef LIBVA_SUPPORT #ifdef LIBVA_SUPPORT
#include "vaapiAllocator.hpp" #include "vaapi_allocator.h"
#include "vaapiDevice.hpp" #include "vaapi_device.h"
#endif #endif
#include "sysMemAllocator.hpp" #include "sysmem_allocator.h"
const static mfxU8 start_seq[] = {0, 0, 0, 1}; const static mfxU8 start_seq[] = {0, 0, 0, 1};
...@@ -590,7 +591,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -590,7 +591,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
if (SYSTEM_MEMORY != memType) { if (SYSTEM_MEMORY != memType) {
#if D3D_SURFACES_SUPPORT #if D3D_SURFACES_SUPPORT
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
mfxHDL hdl = NULL; mfxHDL hdl = NULL;
mfxHandleType hdl_t = mfxHandleType hdl_t =
...@@ -600,14 +601,14 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -600,14 +601,14 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
MFX_HANDLE_D3D9_DEVICE_MANAGER; MFX_HANDLE_D3D9_DEVICE_MANAGER;
sts = hwdev->GetHandle(hdl_t, &hdl); sts = hwdev->GetHandle(hdl_t, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// handle is needed for HW library only // handle is needed for HW library only
mfxIMPL impl = 0; mfxIMPL impl = 0;
session->QueryIMPL(&impl); session->QueryIMPL(&impl);
if (impl != MFX_IMPL_SOFTWARE) { if (impl != MFX_IMPL_SOFTWARE) {
sts = session->SetHandle(hdl_t, hdl); sts = session->SetHandle(hdl_t, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
// create D3D allocator // create D3D allocator
...@@ -638,21 +639,21 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -638,21 +639,21 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
thus we demonstrate "external allocator" usage model. thus we demonstrate "external allocator" usage model.
Call SetAllocator to pass allocator to Media SDK */ Call SetAllocator to pass allocator to Media SDK */
sts = session->SetFrameAllocator(allocator); sts = session->SetFrameAllocator(allocator);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
externalAlloc = true; externalAlloc = true;
#endif #endif
#ifdef LIBVA_SUPPORT #ifdef LIBVA_SUPPORT
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
/* It's possible to skip failed result here and switch to SW implementation, /* It's possible to skip failed result here and switch to SW implementation,
but we don't process this way */ but we don't process this way */
mfxHDL hdl = nullptr; mfxHDL hdl = nullptr;
sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl); sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// provide device manager to MediaSDK // provide device manager to MediaSDK
sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl); sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// create VAAPI allocator // create VAAPI allocator
allocator = new vaapiFrameAllocator; allocator = new vaapiFrameAllocator;
MSDK_CHECK_POINTER(allocator, MFX_ERR_MEMORY_ALLOC); MSDK_CHECK_POINTER(allocator, MFX_ERR_MEMORY_ALLOC);
...@@ -667,7 +668,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -667,7 +668,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
thus we demonstrate "external allocator" usage model. thus we demonstrate "external allocator" usage model.
Call SetAllocator to pass allocator to mediasdk */ Call SetAllocator to pass allocator to mediasdk */
sts = session->SetFrameAllocator(allocator); sts = session->SetFrameAllocator(allocator);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
externalAlloc = true; externalAlloc = true;
#endif #endif
...@@ -679,14 +680,14 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -679,14 +680,14 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
if (MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(impl)) { if (MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(impl)) {
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
mfxHDL hdl = NULL; mfxHDL hdl = NULL;
sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl); sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// provide device manager to MediaSDK // provide device manager to MediaSDK
sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl); sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
#endif #endif
...@@ -703,7 +704,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -703,7 +704,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
// initialize memory allocator // initialize memory allocator
sts = allocator->Init(allocatorParams); sts = allocator->Init(allocatorParams);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
return MFX_ERR_NONE; return MFX_ERR_NONE;
} }
...@@ -752,7 +753,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -752,7 +753,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
// prepare mfxFrameSurface1 array for decoder // prepare mfxFrameSurface1 array for decoder
sts = AllocBuffers(nSurfNum); sts = AllocBuffers(nSurfNum);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
for (int i = 0; i < nSurfNum; i++) { for (int i = 0; i < nSurfNum; i++) {
// initating each frame: // initating each frame:
...@@ -766,7 +767,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering { ...@@ -766,7 +767,7 @@ class QSVDecoder : public VideoDecoder, private CBuffering {
m_pSurfaces[i].frame.Data.MemId = resp.mids[i]; m_pSurfaces[i].frame.Data.MemId = resp.mids[i];
} else { } else {
sts = allocator->Lock(allocator->pthis, resp.mids[i], &(m_pSurfaces[i].frame.Data)); sts = allocator->Lock(allocator->pthis, resp.mids[i], &(m_pSurfaces[i].frame.Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
} }
return MFX_ERR_NONE; return MFX_ERR_NONE;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "qsvEncoder.hpp" #include "qsvEncoder.hpp"
#include "ptvMacro.hpp" #include "ptvMacro.hpp"
#define MSDK_CHECK_RESULT(P, X, ERR) \ #define IMSDK_CHECK_RESULT(P, X, ERR) \
{ \ { \
if ((X) > (P)) { \ if ((X) > (P)) { \
std::stringstream msg; \ std::stringstream msg; \
...@@ -133,7 +133,7 @@ mfxStatus QSVEncoder::init(int width, int height, FrameRate framerate, mfxU16 pr ...@@ -133,7 +133,7 @@ mfxStatus QSVEncoder::init(int width, int height, FrameRate framerate, mfxU16 pr
encoder = new MFXVideoENCODE(*session); encoder = new MFXVideoENCODE(*session);
sts = allocFrames(); sts = allocFrames();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
sts = encoder->Init(&params); sts = encoder->Init(&params);
if (sts == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM) { if (sts == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM) {
...@@ -168,7 +168,7 @@ mfxStatus QSVEncoder::init(int width, int height, FrameRate framerate, mfxU16 pr ...@@ -168,7 +168,7 @@ mfxStatus QSVEncoder::init(int width, int height, FrameRate framerate, mfxU16 pr
videoParams.NumExtParam = 1; videoParams.NumExtParam = 1;
sts = encoder->GetVideoParam(&videoParams); sts = encoder->GetVideoParam(&videoParams);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
if (sts == MFX_ERR_NONE) { if (sts == MFX_ERR_NONE) {
memcpy(extSPSPPS.SPSBuffer + extSPSPPS.SPSBufSize, extSPSPPS.PPSBuffer, extSPSPPS.PPSBufSize); memcpy(extSPSPPS.SPSBuffer + extSPSPPS.SPSBufSize, extSPSPPS.PPSBuffer, extSPSPPS.PPSBufSize);
headPkt.resize(extSPSPPS.SPSBufSize + extSPSPPS.PPSBufSize); headPkt.resize(extSPSPPS.SPSBufSize + extSPSPPS.PPSBufSize);
...@@ -193,7 +193,7 @@ bool QSVEncoder::encode(const Frame& videoFrame, std::vector<VideoStitch::IO::Da ...@@ -193,7 +193,7 @@ bool QSVEncoder::encode(const Frame& videoFrame, std::vector<VideoStitch::IO::Da
if (externalAlloc) { if (externalAlloc) {
// if we share allocator with Media SDK we need to call Lock to access surface data // if we share allocator with Media SDK we need to call Lock to access surface data
sts = allocator->Lock(allocator->pthis, surf->Data.MemId, &(surf->Data)); sts = allocator->Lock(allocator->pthis, surf->Data.MemId, &(surf->Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, false); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, false);
} }
mfxFrameInfo& pInfo = surf->Info; mfxFrameInfo& pInfo = surf->Info;
mfxFrameData& pData = surf->Data; mfxFrameData& pData = surf->Data;
...@@ -228,7 +228,7 @@ bool QSVEncoder::encode(const Frame& videoFrame, std::vector<VideoStitch::IO::Da ...@@ -228,7 +228,7 @@ bool QSVEncoder::encode(const Frame& videoFrame, std::vector<VideoStitch::IO::Da
} }
if (externalAlloc) { if (externalAlloc) {
sts = allocator->Unlock(allocator->pthis, surf->Data.MemId, &(surf->Data)); sts = allocator->Unlock(allocator->pthis, surf->Data.MemId, &(surf->Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, false); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, false);
} }
sts = encoder->EncodeFrameAsync(nullptr, surf, &bits, &syncp); sts = encoder->EncodeFrameAsync(nullptr, surf, &bits, &syncp);
...@@ -454,7 +454,7 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -454,7 +454,7 @@ mfxStatus QSVEncoder::createAllocator() {
if (D3D9_MEMORY == memType || D3D11_MEMORY == memType) { if (D3D9_MEMORY == memType || D3D11_MEMORY == memType) {
#if D3D_SURFACES_SUPPORT #if D3D_SURFACES_SUPPORT
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
mfxHDL hdl = NULL; mfxHDL hdl = NULL;
mfxHandleType hdl_t = mfxHandleType hdl_t =
...@@ -464,14 +464,14 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -464,14 +464,14 @@ mfxStatus QSVEncoder::createAllocator() {
MFX_HANDLE_D3D9_DEVICE_MANAGER; MFX_HANDLE_D3D9_DEVICE_MANAGER;
sts = hwdev->GetHandle(hdl_t, &hdl); sts = hwdev->GetHandle(hdl_t, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// handle is needed for HW library only // handle is needed for HW library only
mfxIMPL impl = 0; mfxIMPL impl = 0;
session->QueryIMPL(&impl); session->QueryIMPL(&impl);
if (impl != MFX_IMPL_SOFTWARE) { if (impl != MFX_IMPL_SOFTWARE) {
sts = session->SetHandle(hdl_t, hdl); sts = session->SetHandle(hdl_t, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
// create D3D allocator // create D3D allocator
...@@ -502,22 +502,22 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -502,22 +502,22 @@ mfxStatus QSVEncoder::createAllocator() {
thus we demonstrate "external allocator" usage model. thus we demonstrate "external allocator" usage model.
Call SetAllocator to pass allocator to Media SDK */ Call SetAllocator to pass allocator to Media SDK */
sts = session->SetFrameAllocator(allocator); sts = session->SetFrameAllocator(allocator);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
externalAlloc = true; externalAlloc = true;
#endif #endif
#ifdef LIBVA_SUPPORT #ifdef LIBVA_SUPPORT
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
/* It's possible to skip failed result here and switch to SW implementation, /* It's possible to skip failed result here and switch to SW implementation,
but we don't process this way */ but we don't process this way */
mfxHDL hdl = nullptr; mfxHDL hdl = nullptr;
sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl); sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// provide device manager to MediaSDK // provide device manager to MediaSDK
sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl); sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// create VAAPI allocator // create VAAPI allocator
allocator = new vaapiFrameAllocator; allocator = new vaapiFrameAllocator;
...@@ -533,7 +533,7 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -533,7 +533,7 @@ mfxStatus QSVEncoder::createAllocator() {
thus we demonstrate "external allocator" usage model. thus we demonstrate "external allocator" usage model.
Call SetAllocator to pass allocator to mediasdk */ Call SetAllocator to pass allocator to mediasdk */
sts = session->SetFrameAllocator(allocator); sts = session->SetFrameAllocator(allocator);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
externalAlloc = true; externalAlloc = true;
#endif #endif
...@@ -545,14 +545,14 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -545,14 +545,14 @@ mfxStatus QSVEncoder::createAllocator() {
if (MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(impl)) { if (MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(impl)) {
sts = createHWDevice(); sts = createHWDevice();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
mfxHDL hdl = NULL; mfxHDL hdl = NULL;
sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl); sts = hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// provide device manager to MediaSDK // provide device manager to MediaSDK
sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl); sts = session->SetHandle(MFX_HANDLE_VA_DISPLAY, hdl);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
#endif #endif
...@@ -567,7 +567,7 @@ mfxStatus QSVEncoder::createAllocator() { ...@@ -567,7 +567,7 @@ mfxStatus QSVEncoder::createAllocator() {
// initialize memory allocator // initialize memory allocator
sts = allocator->Init(allocatorParams); sts = allocator->Init(allocatorParams);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
return MFX_ERR_NONE; return MFX_ERR_NONE;
} }
...@@ -589,7 +589,7 @@ mfxStatus QSVEncoder::allocFrames() { ...@@ -589,7 +589,7 @@ mfxStatus QSVEncoder::allocFrames() {
// To achieve better performance we provide extra surfaces. // To achieve better performance we provide extra surfaces.
// 1 extra surface at input allows to get 1 extra output. // 1 extra surface at input allows to get 1 extra output.
mfxStatus sts = encoder->QueryIOSurf(&params, &req); mfxStatus sts = encoder->QueryIOSurf(&params, &req);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
if (req.NumFrameSuggested < params.AsyncDepth) return MFX_ERR_MEMORY_ALLOC; if (req.NumFrameSuggested < params.AsyncDepth) return MFX_ERR_MEMORY_ALLOC;
...@@ -606,7 +606,7 @@ mfxStatus QSVEncoder::allocFrames() { ...@@ -606,7 +606,7 @@ mfxStatus QSVEncoder::allocFrames() {
// alloc frames for encoder // alloc frames for encoder
sts = allocator->Alloc(allocator->pthis, &req, &resp); sts = allocator->Alloc(allocator->pthis, &req, &resp);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// prepare mfxFrameSurface1 array for encoder // prepare mfxFrameSurface1 array for encoder
encSurfaces = new mfxFrameSurface1[resp.NumFrameActual]; encSurfaces = new mfxFrameSurface1[resp.NumFrameActual];
...@@ -625,7 +625,7 @@ mfxStatus QSVEncoder::allocFrames() { ...@@ -625,7 +625,7 @@ mfxStatus QSVEncoder::allocFrames() {
} else { } else {
// get YUV pointers // get YUV pointers
sts = allocator->Lock(allocator->pthis, resp.mids[i], &(encSurfaces[i].Data)); sts = allocator->Lock(allocator->pthis, resp.mids[i], &(encSurfaces[i].Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts); IMSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
} }
} }
return MFX_ERR_NONE; return MFX_ERR_NONE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment