From 863fb0ce806da1159b930876d2fc2b2c4e9b95ad Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 9 Jul 2022 16:30:25 +0000 Subject: [PATCH] h264-encoder: Add dtrace probes --- src/h264-encoder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/h264-encoder.c b/src/h264-encoder.c index 0b24066..5c69041 100644 --- a/src/h264-encoder.c +++ b/src/h264-encoder.c @@ -19,6 +19,7 @@ #include "fb.h" #include "sys/queue.h" #include "vec.h" +#include "usdt.h" #include #include @@ -347,6 +348,8 @@ static int h264_encoder__schedule_work(struct h264_encoder* self) if (!self->current_fb) return 0; + DTRACE_PROBE1(neatvnc, h264_encode_frame_begin, self->current_fb->pts); + self->current_frame_is_keyframe = self->next_frame_should_be_keyframe; self->next_frame_should_be_keyframe = false; @@ -437,6 +440,8 @@ static void h264_encoder__on_work_done(void* handle) nvnc_fb_unref(self->current_fb); self->current_fb = NULL; + DTRACE_PROBE1(neatvnc, h264_encode_frame_end, pts); + if (self->please_destroy) { vec_destroy(&self->current_packet); h264_encoder_destroy(self);