1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-20 00:21:35 +00:00

multimedia/intel-media-sdk: enable tracer

This commit is contained in:
Jan Beich 2020-07-14 18:40:41 +00:00
parent 655bba3a1f
commit def44bad96
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=542231
6 changed files with 87 additions and 9 deletions

View File

@ -3,8 +3,12 @@
PORTNAME= intel-media-sdk
DISTVERSIONPREFIX= intel-mediasdk-
DISTVERSION= 20.2.0
PORTREVISION= 1
CATEGORIES= multimedia
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+= 51602d7a5f5e.patch:-p1 # https://github.com/Intel-Media-SDK/MediaSDK/pull/2214
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Hardware video decoding/encoding/filtering on Intel GPUs

View File

@ -1,3 +1,5 @@
TIMESTAMP = 1593712248
SHA256 (Intel-Media-SDK-MediaSDK-intel-mediasdk-20.2.0_GH0.tar.gz) = accfd0358fbc5d62cf1f27f88f30de4226864a9dfd5ec5fb43c78fa36e4723ac
SIZE (Intel-Media-SDK-MediaSDK-intel-mediasdk-20.2.0_GH0.tar.gz) = 10898869
SHA256 (51602d7a5f5e.patch) = 3e2ee680440148ca0442890432fb42cfe40156437786514eb780c5759f84fb63
SIZE (51602d7a5f5e.patch) = 2246

View File

@ -0,0 +1,49 @@
In file included from tools/tracer/dumps/dump_mfxstructures.cpp:32:
In file included from tools/tracer/dumps/../loggers/log.h:24:
In file included from tools/tracer/dumps/../loggers/log_console.h:23:
In file included from tools/tracer/dumps/../loggers/ilog.h:25:
tools/tracer/dumps/../loggers/thread_info.h:38:34: error: use of undeclared identifier 'SYS_gettid'
return (long)syscall(SYS_gettid);
^
--- tools/tracer/loggers/thread_info.h.orig 2020-07-02 17:50:48 UTC
+++ tools/tracer/loggers/thread_info.h
@@ -24,8 +24,18 @@
#include <windows.h>
#else
#include <unistd.h>
+#if defined(__linux__)
#include <sys/syscall.h>
+#elif defined(__DragonFly__) || defined(__FreeBSD__)
+#include <pthread_np.h>
+#elif defined(__NetBSD__)
+#include <lwp.h>
+#elif defined(__sun)
+#include <thread.h>
+#else
+#include <stdint.h>
#endif
+#endif
class ThreadInfo
{
@@ -34,8 +44,18 @@ class ThreadInfo (public)
{
#if defined(_WIN32) || defined(_WIN64)
return (long)GetCurrentThreadId();
- #else
+ #elif defined(__linux__)
return (long)syscall(SYS_gettid);
+ #elif defined(__DragonFly__) || defined(__FreeBSD__)
+ return (long)pthread_getthreadid_np();
+ #elif defined(__NetBSD__)
+ return (long)_lwp_self();
+ #elif defined(__OpenBSD__)
+ return (long)getthrid();
+ #elif defined(__sun)
+ return (long)thr_self()();
+ #else
+ return (long)(uintptr_t)pthread_self();
#endif
};

View File

@ -1,9 +0,0 @@
https://github.com/Intel-Media-SDK/MediaSDK/issues/2209
--- tools/CMakeLists.txt.orig 2020-07-02 17:50:48 UTC
+++ tools/CMakeLists.txt
@@ -21,4 +21,3 @@
add_subdirectory(asg-hevc)
add_subdirectory(bs_parser_hevc)
add_subdirectory(bs_parser_hevc/tools/hevc_fei_extractor)
-add_subdirectory(tracer)

View File

@ -0,0 +1,28 @@
RTLD_DEEPBIND isn't available on non-Linux.
tools/tracer/tracer/tracer_linux.cpp:82:65: error: use of undeclared identifier 'RTLD_DEEPBIND'
loader->dlhandle = dlopen(g_mfxlib, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND);
^
tools/tracer/tracer/tracer_linux.cpp:84:76: error: use of undeclared identifier 'RTLD_DEEPBIND'
loader->dlhandle = dlopen(g_mfxlib_in_dir, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND);
^
tools/tracer/tracer/tracer_linux.cpp:188:65: error: use of undeclared identifier 'RTLD_DEEPBIND'
loader->dlhandle = dlopen(g_mfxlib, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND);
^
tools/tracer/tracer/tracer_linux.cpp:190:76: error: use of undeclared identifier 'RTLD_DEEPBIND'
loader->dlhandle = dlopen(g_mfxlib_in_dir, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND);
^
--- tools/tracer/tracer/tracer_linux.cpp.orig 2020-07-02 17:50:48 UTC
+++ tools/tracer/tracer/tracer_linux.cpp
@@ -40,6 +40,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF S
#error Unsupported architecture
#endif
+#if !defined(RTLD_DEEPBIND)
+ #define RTLD_DEEPBIND 0
+#endif
+
static const char* g_mfxlib;
static const char* g_mfxlib_in_dir;

View File

@ -1,5 +1,6 @@
bin/asg-hevc
bin/hevc_fei_extractor
bin/mfx-tracer-config
include/mfx/mfxadapter.h
include/mfx/mfxastructures.h
include/mfx/mfxaudio++.h
@ -28,6 +29,9 @@ include/mfx/mfxvideo.h
include/mfx/mfxvp8.h
include/mfx/mfxvp9.h
include/mfx/mfxvstructures.h
lib/libmfx-tracer.so
lib/libmfx-tracer.so.1
lib/libmfx-tracer.so.1.33
lib/libmfx.so
lib/libmfx.so.1
lib/libmfx.so.1.33