h264-encoder: Add dtrace probes

pull/65/head
Andri Yngvason 2022-07-09 16:30:25 +00:00
parent f20ffb5e1e
commit 863fb0ce80
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#include "fb.h" #include "fb.h"
#include "sys/queue.h" #include "sys/queue.h"
#include "vec.h" #include "vec.h"
#include "usdt.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
@ -347,6 +348,8 @@ static int h264_encoder__schedule_work(struct h264_encoder* self)
if (!self->current_fb) if (!self->current_fb)
return 0; 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->current_frame_is_keyframe = self->next_frame_should_be_keyframe;
self->next_frame_should_be_keyframe = false; 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); nvnc_fb_unref(self->current_fb);
self->current_fb = NULL; self->current_fb = NULL;
DTRACE_PROBE1(neatvnc, h264_encode_frame_end, pts);
if (self->please_destroy) { if (self->please_destroy) {
vec_destroy(&self->current_packet); vec_destroy(&self->current_packet);
h264_encoder_destroy(self); h264_encoder_destroy(self);