mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 02:40:26 +00:00
video_capture API: const struct to init
the init should accept rather the ptr to const struct with init params
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
* would be otherwise referenced directly (audio_capture_channels).
|
* would be otherwise referenced directly (audio_capture_channels).
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2023 CESNET z.s.p.o.
|
* Copyright (c) 2017-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -43,14 +43,14 @@
|
|||||||
#include "video_display.h"
|
#include "video_display.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
__declspec(dllimport) int vidcap_aja_init(struct vidcap_params *params, void **state);
|
__declspec(dllimport) int vidcap_aja_init(const struct vidcap_params *params, void **state);
|
||||||
__declspec(dllimport) void vidcap_aja_done(void *state);
|
__declspec(dllimport) void vidcap_aja_done(void *state);
|
||||||
__declspec(dllimport) struct video_frame *vidcap_aja_grab(void *state, struct audio_frame **audio);
|
__declspec(dllimport) struct video_frame *vidcap_aja_grab(void *state, struct audio_frame **audio);
|
||||||
__declspec(dllimport) void vidcap_aja_probe(struct device_info **available_cards, int *count, void (**deleter)(void *));
|
__declspec(dllimport) void vidcap_aja_probe(struct device_info **available_cards, int *count, void (**deleter)(void *));
|
||||||
__declspec(dllimport) unsigned int *aja_audio_capture_channels;
|
__declspec(dllimport) unsigned int *aja_audio_capture_channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_aja_init_proxy(struct vidcap_params *params, void **state) {
|
static int vidcap_aja_init_proxy(const struct vidcap_params *params, void **state) {
|
||||||
aja_audio_capture_channels = &audio_capture_channels;
|
aja_audio_capture_channels = &audio_capture_channels;
|
||||||
return vidcap_aja_init(params, state);
|
return vidcap_aja_init(params, state);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* @ingroup vidcap
|
* @ingroup vidcap
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005-2024 CESNET
|
* Copyright (c) 2005-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* Copyright (c) 2002 University of Southern California
|
* Copyright (c) 2002 University of Southern California
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "video_capture_params.h"
|
#include "video_capture_params.h"
|
||||||
|
|
||||||
#define VIDEO_CAPTURE_ABI_VERSION 13
|
#define VIDEO_CAPTURE_ABI_VERSION 14
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -136,7 +136,7 @@ struct video_capture_info {
|
|||||||
* @param[out] state returned capture state
|
* @param[out] state returned capture state
|
||||||
* @returns one of @ref vidcap_retval
|
* @returns one of @ref vidcap_retval
|
||||||
*/
|
*/
|
||||||
int (*init) (struct vidcap_params *param, void **state);
|
int (*init) (const struct vidcap_params *param, void **state);
|
||||||
void (*done) (void *state);
|
void (*done) (void *state);
|
||||||
struct video_frame *(*grab) (void *state, struct audio_frame **audio);
|
struct video_frame *(*grab) (void *state, struct audio_frame **audio);
|
||||||
const char *generic_fps_indicator_prefix; ///< display name, eg. "[gl] ",
|
const char *generic_fps_indicator_prefix; ///< display name, eg. "[gl] ",
|
||||||
|
|||||||
@@ -824,7 +824,7 @@ static void vidcap_dshow_should_exit(void *state) {
|
|||||||
WakeConditionVariable(&s->grabWaitCV);
|
WakeConditionVariable(&s->grabWaitCV);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_dshow_init(struct vidcap_params *params, void **state) {
|
static int vidcap_dshow_init(const struct vidcap_params *params, void **state) {
|
||||||
#define HANDLE_ERR(msg, ...) \
|
#define HANDLE_ERR(msg, ...) \
|
||||||
HANDLE_ERR_ACTION(res, goto error, \
|
HANDLE_ERR_ACTION(res, goto error, \
|
||||||
"vidcap_dshow_init: " msg __VA_OPT__(, ) __VA_ARGS__)
|
"vidcap_dshow_init: " msg __VA_OPT__(, ) __VA_ARGS__)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @brief Aggregate video capture driver
|
* @brief Aggregate video capture driver
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2023 CESNET z.s.p.o.
|
* Copyright (c) 2012-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -88,7 +88,7 @@ static void vidcap_aggregate_probe(struct device_info **cards, int *count, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_aggregate_init(struct vidcap_params *params, void **state)
|
vidcap_aggregate_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap_aggregate_state *s;
|
struct vidcap_aggregate_state *s;
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ vidcap_aggregate_init(struct vidcap_params *params, void **state)
|
|||||||
|
|
||||||
|
|
||||||
s->devices_cnt = 0;
|
s->devices_cnt = 0;
|
||||||
struct vidcap_params *tmp = params;
|
const struct vidcap_params *tmp = params;
|
||||||
while((tmp = vidcap_params_get_next(tmp))) {
|
while((tmp = vidcap_params_get_next(tmp))) {
|
||||||
if (vidcap_params_get_driver(tmp) != NULL)
|
if (vidcap_params_get_driver(tmp) != NULL)
|
||||||
s->devices_cnt++;
|
s->devices_cnt++;
|
||||||
@@ -125,12 +125,16 @@ vidcap_aggregate_init(struct vidcap_params *params, void **state)
|
|||||||
tmp = params;
|
tmp = params;
|
||||||
for (int i = 0; i < s->devices_cnt; ++i) {
|
for (int i = 0; i < s->devices_cnt; ++i) {
|
||||||
tmp = vidcap_params_get_next(tmp);
|
tmp = vidcap_params_get_next(tmp);
|
||||||
|
struct vidcap_params *copy = vidcap_params_copy(tmp);
|
||||||
|
|
||||||
if (vidcap_params_get_flags(tmp) == 0 && vidcap_params_get_flags(params) != 0) {
|
if (vidcap_params_get_flags(tmp) == 0 && vidcap_params_get_flags(params) != 0) {
|
||||||
vidcap_params_set_flags(tmp, vidcap_params_get_flags(params));
|
vidcap_params_set_flags(copy, vidcap_params_get_flags(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = initialize_video_capture(vidcap_params_get_parent(params), (struct vidcap_params *) tmp, &s->devices[i]);
|
const int ret = initialize_video_capture(
|
||||||
|
vidcap_params_get_parent(params),
|
||||||
|
(struct vidcap_params *) copy, &s->devices[i]);
|
||||||
|
vidcap_params_free_struct(copy);
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
fprintf(stderr, "[aggregate] Unable to initialize device %d (%s:%s).\n",
|
fprintf(stderr, "[aggregate] Unable to initialize device %d (%s:%s).\n",
|
||||||
i, vidcap_params_get_driver(tmp),
|
i, vidcap_params_get_driver(tmp),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Based on AJA samples ntv2framegrabber, ntv2capture and ntv2llburn (Ping-Pong)
|
* Based on AJA samples ntv2framegrabber, ntv2capture and ntv2llburn (Ping-Pong)
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2024 CESNET
|
* Copyright (c) 2015-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -1090,7 +1090,7 @@ static void show_help() {
|
|||||||
col() << "\n";
|
col() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
LINK_SPEC int vidcap_aja_init(struct vidcap_params *params, void **state)
|
LINK_SPEC int vidcap_aja_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
unordered_map<string, string> parameters_map;
|
unordered_map<string, string> parameters_map;
|
||||||
char *tmp = strdup(vidcap_params_get_fmt(params));
|
char *tmp = strdup(vidcap_params_get_fmt(params));
|
||||||
|
|||||||
@@ -773,7 +773,7 @@ parse_fmt(char *fmt)
|
|||||||
return init_params;
|
return init_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_avfoundation_init(struct vidcap_params *params, void **state)
|
static int vidcap_avfoundation_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
if (avfoundation_usage(vidcap_params_get_fmt(params))) {
|
if (avfoundation_usage(vidcap_params_get_fmt(params))) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2025 CESNET
|
* Copyright (c) 2017-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -135,7 +135,7 @@ static float get_fps(struct vidcap_state_bitflow *s) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_bitflow_init(struct vidcap_params *params, void **state)
|
static int vidcap_bitflow_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2023 CESNET, z. s. p. o.
|
* Copyright (c) 2015-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -764,7 +764,7 @@ static void parse_fmt(struct vidcap_bluefish444_state *s, char *fmt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_bluefish444_init(struct vidcap_params *params, void **state)
|
vidcap_bluefish444_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap_bluefish444_state *s;
|
struct vidcap_bluefish444_state *s;
|
||||||
ULONG InputChannels[4] = {
|
ULONG InputChannels[4] = {
|
||||||
|
|||||||
@@ -1457,7 +1457,7 @@ bool device_state::init(struct vidcap_decklink_state *s, struct tile *t, BMDAudi
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_decklink_init(struct vidcap_params *params, void **state)
|
vidcap_decklink_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
const char *fmt = vidcap_params_get_fmt(params);
|
const char *fmt = vidcap_params_get_fmt(params);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
* @sa deltacast_common.hpp for common DELTACAST information
|
* @sa deltacast_common.hpp for common DELTACAST information
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011-2025 CESNET
|
* Copyright (c) 2011-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -428,7 +428,7 @@ static bool parse_fmt(struct vidcap_deltacast_state *s, char *init_fmt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_deltacast_init(struct vidcap_params *params, void **state)
|
vidcap_deltacast_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
#define HANDLE_ERROR vidcap_deltacast_done(s); return VIDCAP_INIT_FAIL;
|
#define HANDLE_ERROR vidcap_deltacast_done(s); return VIDCAP_INIT_FAIL;
|
||||||
struct vidcap_deltacast_state *s = nullptr;
|
struct vidcap_deltacast_state *s = nullptr;
|
||||||
|
|||||||
@@ -484,7 +484,7 @@ static bool load_custom_edid(const char *filename, BYTE *pEEDIDBuffer, ULONG *pE
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_deltacast_dvi_init(struct vidcap_params *params, void **state)
|
vidcap_deltacast_dvi_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap_deltacast_dvi_state *s;
|
struct vidcap_deltacast_dvi_state *s;
|
||||||
ULONG Width = 0, Height = 0, RefreshRate = 0;
|
ULONG Width = 0, Height = 0, RefreshRate = 0;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
|
* Ian Wesley-Smith <iwsmith@cct.lsu.edu>
|
||||||
*
|
*
|
||||||
* Copyright (c) 2001-2003 University of Southern California
|
* Copyright (c) 2001-2003 University of Southern California
|
||||||
* Copyright (c) 2005-2023 CESNET z.s.p.o.
|
* Copyright (c) 2005-2026 CESNET, zájmové sdružení právnických osob
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, is permitted provided that the following conditions
|
* modification, is permitted provided that the following conditions
|
||||||
@@ -230,7 +230,7 @@ static void show_help(void)
|
|||||||
|
|
||||||
/* External API ***********************************************************************************/
|
/* External API ***********************************************************************************/
|
||||||
|
|
||||||
static int vidcap_dvs_init(struct vidcap_params *params, void **state)
|
static int vidcap_dvs_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap_dvs_state *s;
|
struct vidcap_dvs_state *s;
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Libavformat demuxer and decompress
|
* Libavformat demuxer and decompress
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2025 CESNET
|
* Copyright (c) 2019-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -771,7 +771,7 @@ static int get_ach_count(int file_channels) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK(call) { int ret = call; if (ret != 0) abort(); }
|
#define CHECK(call) { int ret = call; if (ret != 0) abort(); }
|
||||||
static int vidcap_file_init(struct vidcap_params *params, void **state) {
|
static int vidcap_file_init(const struct vidcap_params *params, void **state) {
|
||||||
bool opportunistic_audio = false; // do not fail if audio requested but not found
|
bool opportunistic_audio = false; // do not fail if audio requested but not found
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
char errbuf[1024] = "";
|
char errbuf[1024] = "";
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ static void stop_grab_workers(vidcap_gpustitch_state *s){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_gpustitch_init(struct vidcap_params *params, void **state)
|
vidcap_gpustitch_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
printf("vidcap_gpustitch_init\n");
|
printf("vidcap_gpustitch_init\n");
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2023 CESNET, z. s. p. o.
|
* Copyright (c) 2012-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -507,7 +507,7 @@ static bool initialize_import(struct vidcap_import_state *s, char *tmp, FILE **i
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_import_init(struct vidcap_params *params, void **state)
|
vidcap_import_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
char *tmp = strdup(vidcap_params_get_fmt(params));
|
char *tmp = strdup(vidcap_params_get_fmt(params));
|
||||||
if (strlen(tmp) == 0 || strcmp(tmp, "help") == 0) {
|
if (strlen(tmp) == 0 || strcmp(tmp, "help") == 0) {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ static void show_help(struct vidcap_state_ndi *s) {
|
|||||||
s->NDIlib->find_destroy(pNDI_find);
|
s->NDIlib->find_destroy(pNDI_find);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_ndi_init(struct vidcap_params *params, void **state)
|
static int vidcap_ndi_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
NDI_PRINT_COPYRIGHT(void);
|
NDI_PRINT_COPYRIGHT(void);
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* hardware or do not wish to transmit. This fits the interface of the other
|
* hardware or do not wish to transmit. This fits the interface of the other
|
||||||
* capture devices, but never produces any video.
|
* capture devices, but never produces any video.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2025 CESNET
|
* Copyright (c) 2005-2026 CESNET, zájmové sdružení právických osob
|
||||||
* Copyright (c) 2004 University of Glasgow
|
* Copyright (c) 2004 University of Glasgow
|
||||||
* Copyright (c) 2003 University of Southern California
|
* Copyright (c) 2003 University of Southern California
|
||||||
*
|
*
|
||||||
@@ -62,7 +62,7 @@ struct vidcap_params;
|
|||||||
|
|
||||||
static int capture_state = 0;
|
static int capture_state = 0;
|
||||||
|
|
||||||
static int vidcap_null_init(struct vidcap_params *params, void **state)
|
static int vidcap_null_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* @author Martin Piatka <piatka@cesnet.cz>
|
* @author Martin Piatka <piatka@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2023 CESNET z.s.p.o.
|
* Copyright (c) 2023-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -499,7 +499,7 @@ static void show_generic_help(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int parse_params(struct vidcap_params *params, vcap_pw_state *s) {
|
static int parse_params(const struct vidcap_params *params, vcap_pw_state *s) {
|
||||||
if(const char *fmt = vidcap_params_get_fmt(params)) {
|
if(const char *fmt = vidcap_params_get_fmt(params)) {
|
||||||
std::istringstream params_stream(fmt);
|
std::istringstream params_stream(fmt);
|
||||||
|
|
||||||
@@ -543,7 +543,7 @@ static int parse_params(struct vidcap_params *params, vcap_pw_state *s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DBUS_SCREENCAST
|
#ifdef HAVE_DBUS_SCREENCAST
|
||||||
static int vidcap_screen_pw_init(struct vidcap_params *params, void **state)
|
static int vidcap_screen_pw_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
@@ -585,7 +585,7 @@ static int vidcap_screen_pw_init(struct vidcap_params *params, void **state)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int vidcap_pw_init(struct vidcap_params *params, void **state)
|
static int vidcap_pw_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Martin German <martin.german@i2cat.net>
|
* Martin German <martin.german@i2cat.net>
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2010 Fundació i2CAT, Internet I Innovació Digital a Catalunya
|
* Copyright (c) 2005-2010 Fundació i2CAT, Internet I Innovació Digital a Catalunya
|
||||||
* Copyright (c) 2015-2025 CESNET
|
* Copyright (c) 2015-2026 CESNET, zájmové sdružení právických osob
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, is permitted provided that the following conditions
|
* modification, is permitted provided that the following conditions
|
||||||
@@ -588,7 +588,7 @@ check_uri(size_t uri_len, char *uri)
|
|||||||
return VIDCAP_INIT_FAIL;
|
return VIDCAP_INIT_FAIL;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_rtsp_init(struct vidcap_params *params, void **state) {
|
vidcap_rtsp_init(const struct vidcap_params *params, void **state) {
|
||||||
char fmt[STR_LEN];
|
char fmt[STR_LEN];
|
||||||
snprintf(fmt, sizeof fmt, "%s", vidcap_params_get_fmt(params));
|
snprintf(fmt, sizeof fmt, "%s", vidcap_params_get_fmt(params));
|
||||||
if (strcmp(fmt, "help") == 0 || strcmp(fmt, "fullhelp") == 0) {
|
if (strcmp(fmt, "help") == 0 || strcmp(fmt, "fullhelp") == 0) {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ contains_dev_spec(char *fmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_screen_avf_init(struct vidcap_params *params, void **state)
|
vidcap_screen_avf_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
const char *fmt = vidcap_params_get_fmt(params);
|
const char *fmt = vidcap_params_get_fmt(params);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* X11/PipeWire screen capture abstraction
|
* X11/PipeWire screen capture abstraction
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2023-2025 CESNET
|
* Copyright (c) 2023-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -62,7 +62,7 @@ static void vidcap_screen_linux_probe(struct device_info **cards, int *count, vo
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_screen_linux_init(struct vidcap_params *params, void **state)
|
vidcap_screen_linux_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap *device = NULL;
|
struct vidcap *device = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ static void vidcap_screen_osx_probe(struct device_info **available_cards, int *c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_screen_osx_init(struct vidcap_params *params, void **state)
|
static int vidcap_screen_osx_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct vidcap_screen_osx_state *s;
|
struct vidcap_screen_osx_state *s;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* - load the dll even if working directory is not the dir with the DLL
|
* - load the dll even if working directory is not the dir with the DLL
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2025 CESNET
|
* Copyright (c) 2019-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -461,7 +461,7 @@ static int run_child_process() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_screen_win_init(struct vidcap_params *params, void **state)
|
static int vidcap_screen_win_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
const char *cfg = vidcap_params_get_fmt(params);
|
const char *cfg = vidcap_params_get_fmt(params);
|
||||||
bool child = false; // to prevent fork bombs if error
|
bool child = false; // to prevent fork bombs if error
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2025 CESNET, zájmové sdružení právnických osob
|
* Copyright (c) 2012-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -323,7 +323,7 @@ static _Bool parse_fmt(struct vidcap_screen_x11_state *s, char *fmt) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_screen_x11_init(struct vidcap_params *params, void **state)
|
static int vidcap_screen_x11_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
printf("vidcap_screen_init\n");
|
printf("vidcap_screen_init\n");
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ check_lib()
|
|||||||
printf("SpoutLibrary vtable doesn't seem to be corrupted.\n");
|
printf("SpoutLibrary vtable doesn't seem to be corrupted.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_spout_init(struct vidcap_params *params, void **state)
|
static int vidcap_spout_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
|
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ parse_fmt(struct vidcap_switcher_state *s, char *cfg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_switcher_init(struct vidcap_params *params, void **state)
|
vidcap_switcher_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
verbose_msg("vidcap_switcher_init\n");
|
verbose_msg("vidcap_switcher_init\n");
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ vidcap_switcher_init(struct vidcap_params *params, void **state)
|
|||||||
s->mod.cls = MODULE_CLASS_DATA;
|
s->mod.cls = MODULE_CLASS_DATA;
|
||||||
module_register(&s->mod, vidcap_params_get_parent(params));
|
module_register(&s->mod, vidcap_params_get_parent(params));
|
||||||
s->devices_cnt = 0;
|
s->devices_cnt = 0;
|
||||||
struct vidcap_params *tmp = params;
|
const struct vidcap_params *tmp = params;
|
||||||
while((tmp = vidcap_params_get_next(tmp))) {
|
while((tmp = vidcap_params_get_next(tmp))) {
|
||||||
if (vidcap_params_get_driver(tmp) == NULL) {
|
if (vidcap_params_get_driver(tmp) == NULL) {
|
||||||
break;
|
break;
|
||||||
@@ -232,11 +232,13 @@ vidcap_switcher_init(struct vidcap_params *params, void **state)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vidcap_params_get_flags(tmp) == 0 && vidcap_params_get_flags(params) != 0) {
|
struct vidcap_params *copy = vidcap_params_copy(tmp);
|
||||||
vidcap_params_set_flags(tmp, vidcap_params_get_flags(params));
|
if (vidcap_params_get_flags(copy) == 0 && vidcap_params_get_flags(params) != 0) {
|
||||||
|
vidcap_params_set_flags(copy, vidcap_params_get_flags(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = initialize_video_capture(&s->mod, tmp, &s->devices[i]);
|
int ret = initialize_video_capture(&s->mod, copy, &s->devices[i]);
|
||||||
|
vidcap_params_free_struct(copy);
|
||||||
if(ret != 0) {
|
if(ret != 0) {
|
||||||
MSG(ERROR,
|
MSG(ERROR,
|
||||||
"Unable to initialize device %d (%s:%s).\n",
|
"Unable to initialize device %d (%s:%s).\n",
|
||||||
@@ -246,7 +248,7 @@ vidcap_switcher_init(struct vidcap_params *params, void **state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s->params = params;
|
s->params = vidcap_params_copy(tmp);
|
||||||
|
|
||||||
vidcap_switcher_register_keyboard_ctl(s);
|
vidcap_switcher_register_keyboard_ctl(s);
|
||||||
|
|
||||||
@@ -276,6 +278,7 @@ vidcap_switcher_done(void *state)
|
|||||||
module_done(&s->mod);
|
module_done(&s->mod);
|
||||||
free(s->devices);
|
free(s->devices);
|
||||||
free(s->device_names);
|
free(s->device_names);
|
||||||
|
vidcap_params_free_struct(s->params);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2023 CESNET z.s.p.o.
|
* Copyright (c) 2012-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -1083,7 +1083,7 @@ static bool parse(struct vidcap_swmix_state *s, struct video_desc *desc, char *f
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vidcap_swmix_init(struct vidcap_params *params, void **state)
|
vidcap_swmix_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
GLenum format;
|
GLenum format;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2023 CESNET, z. s. p. o.
|
* Copyright (c) 2017-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -442,7 +442,7 @@ static int vidcap_syphon_init_common(char *opts, struct state_vidcap_syphon **ou
|
|||||||
return VIDCAP_INIT_OK;
|
return VIDCAP_INIT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_syphon_init(struct vidcap_params *params, void **state)
|
static int vidcap_syphon_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
|
if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005-2006 University of Glasgow
|
* Copyright (c) 2005-2006 University of Glasgow
|
||||||
* Copyright (c) 2005-2025 CESNET
|
* Copyright (c) 2005-2026 CESNET, zájmové sdružení právických osob
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, is permitted provided that the following conditions
|
* modification, is permitted provided that the following conditions
|
||||||
@@ -505,7 +505,7 @@ validate_settings(struct testcard_state *s, struct video_desc desc)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_testcard_init(struct vidcap_params *params, void **state)
|
static int vidcap_testcard_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct testcard_state *s = NULL;
|
struct testcard_state *s = NULL;
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* Merge to mainline testcard.
|
* Merge to mainline testcard.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2011-2025 CESNET, zájmové sdružení právnických osob
|
* Copyright (c) 2011-2026 CESNET, zájmové sdružení právnických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -314,7 +314,7 @@ get_sdl_render_font()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int vidcap_testcard2_init(struct vidcap_params *params, void **state)
|
static int vidcap_testcard2_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_fmt(params) == NULL || strcmp(vidcap_params_get_fmt(params), "help") == 0) {
|
if (vidcap_params_get_fmt(params) == NULL || strcmp(vidcap_params_get_fmt(params), "help") == 0) {
|
||||||
usage();
|
usage();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <pulec@cesnet.cz>
|
* @author Martin Pulec <pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2023 CESNET, z. s. p. o.
|
* Copyright (c) 2014-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -138,7 +138,7 @@ parse_fmt(char *fmt, uint16_t *port, codec_t *decode_to)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_ug_input_init(struct vidcap_params *cap_params, void **state)
|
static int vidcap_ug_input_init(const struct vidcap_params *cap_params, void **state)
|
||||||
{
|
{
|
||||||
uint16_t port = 5004;
|
uint16_t port = 5004;
|
||||||
codec_t decode_to = VIDEO_CODEC_NONE;
|
codec_t decode_to = VIDEO_CODEC_NONE;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2025 CESNET
|
* Copyright (c) 2012-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -586,7 +586,7 @@ parse_fmt(char *fmt, struct parsed_opts *opts)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vidcap_v4l2_init(struct vidcap_params *params, void **state)
|
static int vidcap_v4l2_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
struct parsed_opts opts = { .buffer_count = DEFAULT_BUF_COUNT };
|
struct parsed_opts opts = { .buffer_count = DEFAULT_BUF_COUNT };
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
* @author Martin Pulec <martin.pulec@cesnet.cz>
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019-2025 CESNET
|
* Copyright (c) 2019-2026 CESNET, zájmové sdružení právických osob
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -231,7 +231,7 @@ static int vidcap_ximea_parse_params(struct state_vidcap_ximea *s, char *cfg) {
|
|||||||
goto error; \
|
goto error; \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
static int vidcap_ximea_init(struct vidcap_params *params, void **state)
|
static int vidcap_ximea_init(const struct vidcap_params *params, void **state)
|
||||||
{
|
{
|
||||||
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) {
|
||||||
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
return VIDCAP_INIT_AUDIO_NOT_SUPPORTED;
|
||||||
|
|||||||
Reference in New Issue
Block a user