From 5749fa5fca27935ce86b1cdb02a56587e22cca76 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 30 Aug 2024 11:44:23 +0200 Subject: [PATCH] Add a user data parameter to the keyframe callback to behave like other callbacks --- examples/raspberrypi/main.c | 2 +- src/peer_connection.c | 2 +- src/peer_connection.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/raspberrypi/main.c b/examples/raspberrypi/main.c index a1e0568..fee9e61 100644 --- a/examples/raspberrypi/main.c +++ b/examples/raspberrypi/main.c @@ -118,7 +118,7 @@ static void onmessasge(char *msg, size_t len, void *user_data) { } } -static void on_request_keyframe() { +static void on_request_keyframe(void *data) { printf("request keyframe\n"); } diff --git a/src/peer_connection.c b/src/peer_connection.c index 3d9cbfe..aec22d6 100644 --- a/src/peer_connection.c +++ b/src/peer_connection.c @@ -126,7 +126,7 @@ static void peer_connection_incoming_rtcp(PeerConnection *pc, uint8_t *buf, size LOGD("RTCP_PSFB %d", fmt); // PLI and FIR if ((fmt == 1 || fmt == 4) && pc->config.on_request_keyframe) { - pc->config.on_request_keyframe(); + pc->config.on_request_keyframe(pc->config.user_data); } } default: diff --git a/src/peer_connection.h b/src/peer_connection.h index e970ffc..0caca91 100644 --- a/src/peer_connection.h +++ b/src/peer_connection.h @@ -66,7 +66,7 @@ typedef struct PeerConfiguration { void (*onaudiotrack)(uint8_t *data, size_t size, void *userdata); void (*onvideotrack)(uint8_t *data, size_t size, void *userdata); - void (*on_request_keyframe)(); + void (*on_request_keyframe)(void *userdata); void *user_data; } PeerConfiguration;