Skip to content

Commit

Permalink
API 1.32
Browse files Browse the repository at this point in the history
multi adapter support fixes
adds `MFX_PROFILE_HEVC_SCC`
  • Loading branch information
galinart authored and lu-zero committed Jun 5, 2020
1 parent 6c7fee3 commit 61807e1
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 21 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ([2.53])

AC_INIT([libmfx], [1.31])
AC_INIT([libmfx], [1.32])
AC_CONFIG_SRCDIR([src/mfx_dispatcher.cpp])
AM_INIT_AUTOMAKE([foreign subdir-objects])

Expand Down
4 changes: 2 additions & 2 deletions mfx/mfxdefs.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019 Intel Corporation
// Copyright (c) 2019-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
Expand All @@ -21,7 +21,7 @@
#define __MFXDEFS_H__

#define MFX_VERSION_MAJOR 1
#define MFX_VERSION_MINOR 31
#define MFX_VERSION_MINOR 32

// MFX_VERSION_NEXT is always +1 from last public release
// may be enforced by MFX_VERSION_USE_LATEST define
Expand Down
5 changes: 4 additions & 1 deletion mfx/mfxstructures.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2019 Intel Corporation
// Copyright (c) 2018-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
Expand Down Expand Up @@ -471,6 +471,9 @@ enum {
MFX_PROFILE_HEVC_MAIN10 =2,
MFX_PROFILE_HEVC_MAINSP =3,
MFX_PROFILE_HEVC_REXT =4,
#if (MFX_VERSION >= 1032)
MFX_PROFILE_HEVC_SCC =9,
#endif

MFX_LEVEL_HEVC_1 = 10,
MFX_LEVEL_HEVC_2 = 20,
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Intel Corporation
// Copyright (c) 2012-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
Expand Down Expand Up @@ -951,7 +951,7 @@ mfxStatus MFXJoinSession(mfxSession session, mfxSession child_session)
MFX_DISP_HANDLE *pChildHandle = (MFX_DISP_HANDLE *)child_session;

// get the function's address and make a call
if ((pHandle) && (pChildHandle) && (pHandle->apiVersion == pChildHandle->apiVersion))
if ((pHandle) && (pChildHandle) && (pHandle->actualApiVersion == pChildHandle->actualApiVersion))
{
/* check whether it is audio session or video */
int tableIndex = eMFXJoinSession;
Expand Down
51 changes: 38 additions & 13 deletions src/mfx_dispatcher.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Intel Corporation
// Copyright (c) 2012-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
Expand Down Expand Up @@ -488,7 +488,7 @@ mfxStatus MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAd
mfxStatus sts = InitDummySession(adapter_n - 1, dummy_session);
if (sts != MFX_ERR_NONE)
{
return sts;
continue;
}

mfxVideoParam stream_params, out;
Expand All @@ -498,12 +498,9 @@ mfxStatus MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAd

sts = MFXVideoDECODE_DecodeHeader(dummy_session.operator mfxSession(), bitstream, &stream_params);

if (sts == MFX_ERR_UNSUPPORTED) // Unsupported CodecId, try another adapter
continue;

if (sts != MFX_ERR_NONE)
{
return sts;
continue;
}

sts = MFXVideoDECODE_Query(dummy_session.operator mfxSession(), &stream_params, &out);
Expand All @@ -513,14 +510,28 @@ mfxStatus MFXQueryAdaptersDecode(mfxBitstream* bitstream, mfxU32 codec_id, mfxAd

mfxAdapterInfo info;
memset(&info, 0, sizeof(info));
sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform);

//WA for initialization when application built w/ new API, but lib w/ old one.
mfxVersion apiVersion;
sts = dummy_session.QueryVersion(&apiVersion);
if (sts != MFX_ERR_NONE)
continue;

if (apiVersion.Major >= 1 && apiVersion.Minor >= 19)
{
return sts;
sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform);

if (sts != MFX_ERR_NONE)
{
continue;
}
}
else
{
// for API versions greater than 1.19 Device id is set inside QueryPlatform call
info.Platform.DeviceId = static_cast<mfxU16>(DeviceID);
}

//info.Platform.DeviceId = DeviceID;
info.Number = adapter_n - 1;

obtained_info.push_back(info);
Expand Down Expand Up @@ -555,7 +566,7 @@ mfxStatus MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapte
mfxStatus sts = InitDummySession(adapter_n - 1, dummy_session);
if (sts != MFX_ERR_NONE)
{
return sts;
continue;
}

// If input_info is NULL just return all Intel adapters and information about them
Expand Down Expand Up @@ -595,14 +606,28 @@ mfxStatus MFXQueryAdapters(mfxComponentInfo* input_info, mfxAdaptersInfo* adapte

mfxAdapterInfo info;
memset(&info, 0, sizeof(info));
sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform);

//WA for initialization when application built w/ new API, but lib w/ old one.
mfxVersion apiVersion;
sts = dummy_session.QueryVersion(&apiVersion);
if (sts != MFX_ERR_NONE)
continue;

if (apiVersion.Major >= 1 && apiVersion.Minor >= 19)
{
sts = MFXVideoCORE_QueryPlatform(dummy_session.operator mfxSession(), &info.Platform);

if (sts != MFX_ERR_NONE)
{
continue;
}
}
else
{
return sts;
// for API versions greater than 1.19 Device id is set inside QueryPlatform call
info.Platform.DeviceId = static_cast<mfxU16>(DeviceID);
}

//info.Platform.DeviceId = DeviceID;
info.Number = adapter_n - 1;

obtained_info.push_back(info);
Expand Down
6 changes: 5 additions & 1 deletion src/mfx_dispatcher_log.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012-2019 Intel Corporation
// Copyright (c) 2012-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
Expand Down Expand Up @@ -254,6 +254,10 @@ class FileSink
friend class DSSingleTone<FileSink>;
public:
virtual void Write(int level, int opcode, const char * msg, va_list argptr);
FileSink()
: m_hdl(NULL)
{
}
~FileSink()
{
if (NULL != m_hdl)
Expand Down
2 changes: 1 addition & 1 deletion src/mfx_load_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace MFX
PluginModule module;
mfxPlugin plugin;
FactoryRecord ()
: plugin()
: plgParams(), plugin()
{}
FactoryRecord(const mfxPluginParam &plgParams,
PluginModule &module,
Expand Down

0 comments on commit 61807e1

Please sign in to comment.