diff options
author | Mikhail Burakov <mburakov@mailbox.org> | 2023-04-12 07:07:28 +0200 |
---|---|---|
committer | Mikhail Burakov <mburakov@mailbox.org> | 2023-04-12 07:07:28 +0200 |
commit | 0b3848db08cf78c6c5396f7b03a32d6074a0c48b (patch) | |
tree | 9c17d2b9433c4cf66a8881afdf231e8b246d1b06 /main.c | |
parent | 71c1a8a02a3f33d1e49d8c6cf0a4b23016b63bc0 (diff) |
Restructure gpu frames interface and handling
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -143,10 +143,9 @@ static void OnTimerExpire(void* user) { } if (!contexts->encode_context) { - uint32_t width, height; - GpuFrameGetSize(captured_frame, &width, &height); - contexts->encode_context = EncodeContextCreate(contexts->gpu_context, width, - height, colorspace, range); + contexts->encode_context = + EncodeContextCreate(contexts->gpu_context, captured_frame->width, + captured_frame->height, colorspace, range); if (!contexts->encode_context) { LOG("Failed to create encode context"); goto drop_client; @@ -159,12 +158,11 @@ static void OnTimerExpire(void* user) { LOG("Failed to get encoded frame"); goto drop_client; } - if (!GpuFrameConvert(captured_frame, encoded_frame)) { + if (!GpuContextConvertFrame(contexts->gpu_context, captured_frame, + encoded_frame)) { LOG("Failed to convert frame"); goto drop_client; } - - GpuContextSync(contexts->gpu_context); if (!EncodeContextEncodeFrame(contexts->encode_context, contexts->client_fd)) { LOG("Failed to encode frame"); |