Linux screen cap. compile fixes

+ mark the original X11 as such (alongside with PipeWire)
This commit is contained in:
Martin Pulec
2023-02-13 16:38:18 +01:00
parent 183cb3298a
commit eef7170d01
3 changed files with 12 additions and 21 deletions

View File

@@ -3,7 +3,7 @@
* @author Martin Pulec <pulec@cesnet.cz>
*/
/*
* Copyright (c) 2011-2022 CESNET, z. s. p. o.
* Copyright (c) 2011-2023 CESNET, z. s. p. o.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,9 +38,6 @@
#ifndef LIB_COMMON_H
#define LIB_COMMON_H
#include "config_unix.h"
#include "config_win32.h"
#include "host.h" // UNIQUE_LABEL
/** @brief This macro causes that this module will be statically linked with UltraGrid. */

View File

@@ -856,21 +856,13 @@ static void run_screencast(screen_cast_session *session_ptr) {
session.portal->run_loop();
}
static struct vidcap_type * vidcap_screen_pw_probe(bool verbose, void (**deleter)(void *))
static void vidcap_screen_pw_probe(struct device_info **available_devices, int *count, void (**deleter)(void *))
{
UNUSED(verbose);
struct vidcap_type* vt;
*deleter = free;
vt = (struct vidcap_type *) calloc(1, sizeof(struct vidcap_type));
if (vt == nullptr) {
return nullptr;
}
vt->name = "screen_pw";
vt->description = "Grabbing screen using PipeWire";
return vt;
*count = 1;
*available_devices = (struct device_info *) calloc(*count, sizeof(struct device_info));
// (*available_devices)[0].dev can be "" since screen cap. doesn't require parameters
snprintf((*available_devices)[0].name, sizeof (*available_devices)[0].name, "Screen capture PipeWire");
}
static void show_help() {
@@ -984,7 +976,9 @@ static const struct video_capture_info vidcap_screen_pw_info = {
vidcap_screen_pw_init,
vidcap_screen_pw_done,
vidcap_screen_pw_grab,
true,
"[screen_pw] ",
};
REGISTER_MODULE(screen_pw, &vidcap_screen_pw_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
REGISTER_MODULE(screen_pw, &vidcap_screen_pw_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
/* vim: set expandtab sw=8: */

View File

@@ -257,7 +257,7 @@ static void vidcap_screen_x11_probe(struct device_info **available_devices, int
*count = 1;
*available_devices = calloc(*count, sizeof(struct device_info));
// (*available_devices)[0].dev can be "" since screen cap. doesn't require parameters
snprintf((*available_devices)[0].name, sizeof (*available_devices)[0].name, "Screen capture");
snprintf((*available_devices)[0].name, sizeof (*available_devices)[0].name, "Screen capture X11");
int framerates[] = {24, 30, 60};
@@ -488,5 +488,5 @@ static const struct video_capture_info vidcap_screen_x11_info = {
VIDCAP_NO_GENERIC_FPS_INDICATOR,
};
REGISTER_MODULE(screen, &vidcap_screen_x11_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);
REGISTER_MODULE(screen_x11, &vidcap_screen_x11_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION);