Skip to content

Commit

Permalink
Merge pull request #112 from ela34/on_request_keyframe_userdata
Browse files Browse the repository at this point in the history
Add a user data parameter to the keyframe callback
  • Loading branch information
sepfy authored Aug 31, 2024
2 parents 78fc109 + 5749fa5 commit 68b3c5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/raspberrypi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion src/peer_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/peer_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 68b3c5a

Please sign in to comment.