From fb92a3f27f5d9e0839bdc375e6f3dc9cb17b6a57 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 13 Jul 2021 20:48:46 +0100 Subject: [PATCH] d/vf: Add tracing support --- src/xrt/drivers/CMakeLists.txt | 2 +- src/xrt/drivers/vf/vf_driver.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/xrt/drivers/CMakeLists.txt b/src/xrt/drivers/CMakeLists.txt index 32a5b293d..b8ce298cc 100644 --- a/src/xrt/drivers/CMakeLists.txt +++ b/src/xrt/drivers/CMakeLists.txt @@ -255,7 +255,7 @@ if(XRT_BUILD_DRIVER_VF) ) add_library(drv_vf STATIC ${VF_SOURCE_FILES}) - target_link_libraries(drv_vf PRIVATE xrt-interfaces aux_os ${GST_LIBRARIES}) + target_link_libraries(drv_vf PRIVATE xrt-interfaces aux_os aux_util ${GST_LIBRARIES}) target_include_directories(drv_vf PRIVATE ${GST_INCLUDE_DIRS}) MESSAGE("GST include ${GST_INCLUDE_DIRS}") list(APPEND ENABLED_DRIVERS vf) diff --git a/src/xrt/drivers/vf/vf_driver.c b/src/xrt/drivers/vf/vf_driver.c index 62072b29d..6ab0169e5 100644 --- a/src/xrt/drivers/vf/vf_driver.c +++ b/src/xrt/drivers/vf/vf_driver.c @@ -18,6 +18,7 @@ #include "util/u_format.h" #include "util/u_frame.h" #include "util/u_logging.h" +#include "util/u_trace_marker.h" #include "vf_interface.h" @@ -140,6 +141,8 @@ vf_frame(struct xrt_frame *xf) static void vf_frame_destroy(struct xrt_frame *xf) { + SINK_TRACE_MARKER(); + struct vf_frame *vff = vf_frame(xf); gst_video_frame_unmap(&vff->frame); @@ -163,6 +166,8 @@ vf_frame_destroy(struct xrt_frame *xf) static void vf_fs_frame(struct vf_fs *vid, GstSample *sample) { + SINK_TRACE_MARKER(); + // Noop. if (!vid->sink) { return; @@ -285,8 +290,10 @@ on_source_message(GstBus *bus, GstMessage *message, struct vf_fs *vid) } static void * -run_play_thread(void *ptr) +vf_fs_mainloop(void *ptr) { + SINK_TRACE_MARKER(); + struct vf_fs *vid = (struct vf_fs *)ptr; VF_DEBUG(vid, "Let's run!"); @@ -468,7 +475,7 @@ alloc_and_init_common(struct xrt_frame_context *xfctx, // gst_bus_add_watch(bus, (GstBusFunc)on_source_message, vid); gst_object_unref(bus); - ret = os_thread_helper_start(&vid->play_thread, run_play_thread, vid); + ret = os_thread_helper_start(&vid->play_thread, vf_fs_mainloop, vid); if (ret != 0) { VF_ERROR(vid, "Failed to start thread '%i'", ret); g_main_loop_unref(vid->loop);