d/vf: Add tracing support

This commit is contained in:
Jakob Bornecrantz 2021-07-13 20:48:46 +01:00 committed by Jakob Bornecrantz
parent a6a5b3dda6
commit fb92a3f27f
2 changed files with 10 additions and 3 deletions

View file

@ -255,7 +255,7 @@ if(XRT_BUILD_DRIVER_VF)
) )
add_library(drv_vf STATIC ${VF_SOURCE_FILES}) 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}) target_include_directories(drv_vf PRIVATE ${GST_INCLUDE_DIRS})
MESSAGE("GST include ${GST_INCLUDE_DIRS}") MESSAGE("GST include ${GST_INCLUDE_DIRS}")
list(APPEND ENABLED_DRIVERS vf) list(APPEND ENABLED_DRIVERS vf)

View file

@ -18,6 +18,7 @@
#include "util/u_format.h" #include "util/u_format.h"
#include "util/u_frame.h" #include "util/u_frame.h"
#include "util/u_logging.h" #include "util/u_logging.h"
#include "util/u_trace_marker.h"
#include "vf_interface.h" #include "vf_interface.h"
@ -140,6 +141,8 @@ vf_frame(struct xrt_frame *xf)
static void static void
vf_frame_destroy(struct xrt_frame *xf) vf_frame_destroy(struct xrt_frame *xf)
{ {
SINK_TRACE_MARKER();
struct vf_frame *vff = vf_frame(xf); struct vf_frame *vff = vf_frame(xf);
gst_video_frame_unmap(&vff->frame); gst_video_frame_unmap(&vff->frame);
@ -163,6 +166,8 @@ vf_frame_destroy(struct xrt_frame *xf)
static void static void
vf_fs_frame(struct vf_fs *vid, GstSample *sample) vf_fs_frame(struct vf_fs *vid, GstSample *sample)
{ {
SINK_TRACE_MARKER();
// Noop. // Noop.
if (!vid->sink) { if (!vid->sink) {
return; return;
@ -285,8 +290,10 @@ on_source_message(GstBus *bus, GstMessage *message, struct vf_fs *vid)
} }
static void * static void *
run_play_thread(void *ptr) vf_fs_mainloop(void *ptr)
{ {
SINK_TRACE_MARKER();
struct vf_fs *vid = (struct vf_fs *)ptr; struct vf_fs *vid = (struct vf_fs *)ptr;
VF_DEBUG(vid, "Let's run!"); 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_bus_add_watch(bus, (GstBusFunc)on_source_message, vid);
gst_object_unref(bus); 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) { if (ret != 0) {
VF_ERROR(vid, "Failed to start thread '%i'", ret); VF_ERROR(vid, "Failed to start thread '%i'", ret);
g_main_loop_unref(vid->loop); g_main_loop_unref(vid->loop);