Vuo
2.4.4
Loading...
Searching...
No Matches
node
vuo.blackmagic
VuoBlackmagicInputDevice.c
Go to the documentation of this file.
1
10
#include "
VuoBlackmagicInputDevice.h
"
11
13
#ifdef VUO_COMPILER
14
VuoModuleMetadata
({
15
"title"
:
"Blackmagic Input Device"
,
16
"description"
:
"Information about a Blackmagic video capture device."
,
17
"keywords"
: [ ],
18
"version"
:
"1.0.0"
,
19
"dependencies"
: [
20
"VuoBlackmagicConnection"
,
21
"VuoBlackmagicVideoMode"
,
22
"VuoDeinterlacing"
,
23
"VuoInteger"
,
24
"VuoText"
25
]
26
});
27
#endif
29
43
VuoBlackmagicInputDevice
VuoBlackmagicInputDevice_makeFromJson
(json_object * js)
44
{
45
return
(
VuoBlackmagicInputDevice
){
46
VuoJson_getObjectValue
(
VuoText
, js,
"name"
, NULL),
47
VuoJson_getObjectValue
(
VuoInteger
, js,
"subDevice"
, 0),
48
VuoJson_getObjectValue
(
VuoBlackmagicConnection
, js,
"connection"
, VuoBlackmagicConnection_Composite),
49
VuoJson_getObjectValue
(
VuoBlackmagicVideoMode
, js,
"videoMode"
, VuoBlackmagicVideoMode_NTSC),
50
VuoJson_getObjectValue
(
VuoDeinterlacing
, js,
"deinterlacing"
, VuoDeinterlacing_None),
51
};
52
}
53
57
json_object *
VuoBlackmagicInputDevice_getJson
(
const
VuoBlackmagicInputDevice
value)
58
{
59
json_object *js = json_object_new_object();
60
61
if
(value.name)
62
json_object_object_add(js,
"name"
,
VuoText_getJson
(value.name));
63
64
if
(value.subDevice)
65
json_object_object_add(js,
"subDevice"
,
VuoInteger_getJson
(value.subDevice));
66
67
json_object_object_add(js,
"connection"
,
VuoBlackmagicConnection_getJson
(value.connection));
68
69
json_object_object_add(js,
"videoMode"
,
VuoBlackmagicVideoMode_getJson
(value.videoMode));
70
71
json_object_object_add(js,
"deinterlacing"
,
VuoDeinterlacing_getJson
(value.deinterlacing));
72
73
return
js;
74
}
75
79
char
*
VuoBlackmagicInputDevice_getSummary
(
const
VuoBlackmagicInputDevice
value)
80
{
81
char
*connection =
VuoBlackmagicConnection_getSummary
(value.connection);
82
char
*mode =
VuoBlackmagicVideoMode_getSummary
(value.videoMode);
83
char
*deinterlacing =
VuoDeinterlacing_getSummary
(value.deinterlacing);
84
85
char
*summary;
86
if
(value.name)
87
summary =
VuoText_format
(
"%s<br>Sub-device %lld<br>Connection: %s<br>Mode: %s<br>Deinterlacing: %s"
,
88
value.name, value.subDevice, connection, mode, deinterlacing);
89
else
90
summary =
VuoText_format
(
"First available Blackmagic input device<br>Connection: %s<br>Mode: %s<br>Deinterlacing: %s"
,
91
connection, mode, deinterlacing);
92
93
free(connection);
94
free(mode);
95
free(deinterlacing);
96
return
summary;
97
}
98
102
char
*
VuoBlackmagicInputDevice_getShortSummary
(
const
VuoBlackmagicInputDevice
value)
103
{
104
if
(value.name)
105
return
VuoText_format
(
"%s, sub-device %lld"
, value.name, value.subDevice);
106
else
107
return
strdup(
"First available Blackmagic input device"
);
108
}
109
113
VuoBlackmagicInputDevice
VuoBlackmagicInputDevice_make
(
const
VuoText
name,
const
VuoInteger
subDevice,
const
VuoBlackmagicConnection
connection,
const
VuoBlackmagicVideoMode
videoMode,
const
VuoDeinterlacing
deinterlacing)
114
{
115
return
(
VuoBlackmagicInputDevice
){name, subDevice, connection, videoMode, deinterlacing};
116
}
117
121
bool
VuoBlackmagicInputDevice_areEqual
(
const
VuoBlackmagicInputDevice
value1,
const
VuoBlackmagicInputDevice
value2)
122
{
123
if
(!
VuoText_areEqual
(value1.name, value2.name))
124
return
false
;
125
126
if
(value1.subDevice != value2.subDevice)
127
return
false
;
128
129
if
(!
VuoBlackmagicConnection_areEqual
(value1.connection, value2.connection))
130
return
false
;
131
132
if
(!
VuoBlackmagicVideoMode_areEqual
(value1.videoMode, value2.videoMode))
133
return
false
;
134
135
if
(!
VuoDeinterlacing_areEqual
(value1.deinterlacing, value2.deinterlacing))
136
return
false
;
137
138
return
true
;
139
}
140
144
bool
VuoBlackmagicInputDevice_isLessThan
(
const
VuoBlackmagicInputDevice
a,
const
VuoBlackmagicInputDevice
b)
145
{
146
VuoType_returnInequality
(
VuoText
, a.name, b.name);
147
VuoType_returnInequality
(
VuoInteger
, a.subDevice, b.subDevice);
148
VuoType_returnInequality
(
VuoBlackmagicConnection
, a.connection, b.connection);
149
VuoType_returnInequality
(
VuoBlackmagicVideoMode
, a.videoMode, b.videoMode);
150
VuoType_returnInequality
(
VuoDeinterlacing
, a.deinterlacing, b.deinterlacing);
151
return
false
;
152
}
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8