Skip to content

Commit 14167fa

Browse files
committed
chore: update ndi sdk
1 parent 56bd931 commit 14167fa

16 files changed

+866
-229
lines changed

src/modules/newtek/interop/Processing.NDI.DynamicLoad.h

Lines changed: 261 additions & 214 deletions
Large diffs are not rendered by default.

src/modules/newtek/interop/Processing.NDI.Find.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including

src/modules/newtek/interop/Processing.NDI.FrameSync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including

src/modules/newtek/interop/Processing.NDI.Lib.cplusplus.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including
@@ -77,6 +77,9 @@ inline NDIlib_metadata_frame_t::NDIlib_metadata_frame_t(int length_, int64_t tim
7777
inline NDIlib_tally_t::NDIlib_tally_t(bool on_program_, bool on_preview_)
7878
: on_program(on_program_), on_preview(on_preview_) {}
7979

80+
inline NDIlib_listener_event::NDIlib_listener_event(void)
81+
: p_uuid(NULL), p_name(NULL), p_value(NULL) {}
82+
8083
inline NDIlib_routing_create_t::NDIlib_routing_create_t(const char* p_ndi_name_, const char* p_groups_)
8184
: p_ndi_name(p_ndi_name_), p_groups(p_groups_) {}
8285

@@ -114,6 +117,25 @@ inline NDIlib_audio_frame_interleaved_32s_t::NDIlib_audio_frame_interleaved_32s_
114117
inline NDIlib_audio_frame_interleaved_32f_t::NDIlib_audio_frame_interleaved_32f_t(int sample_rate_, int no_channels_, int no_samples_, int64_t timecode_, float* p_data_)
115118
: sample_rate(sample_rate_), no_channels(no_channels_), no_samples(no_samples_), timecode(timecode_), p_data(p_data_) {}
116119

120+
inline NDIlib_recv_advertiser_create_t::NDIlib_recv_advertiser_create_t(const char* p_url_address)
121+
: p_url_address(p_url_address) {}
122+
123+
inline NDIlib_recv_listener_create_t::NDIlib_recv_listener_create_t(const char* p_url_address)
124+
: p_url_address(p_url_address) {}
125+
126+
inline NDIlib_receiver_t::NDIlib_receiver_t(void)
127+
: p_uuid(NULL), p_name(NULL), p_input_uuid(NULL), p_input_name(NULL), p_address(NULL),
128+
p_streams(NULL), num_streams(0), p_commands(NULL), num_commands(0), events_subscribed(false) {}
129+
130+
inline NDIlib_send_advertiser_create_t::NDIlib_send_advertiser_create_t(const char* p_url_address)
131+
: p_url_address(p_url_address) {}
132+
133+
inline NDIlib_send_listener_create_t::NDIlib_send_listener_create_t(const char* p_url_address)
134+
: p_url_address(p_url_address) {}
135+
136+
inline NDIlib_sender_t::NDIlib_sender_t(void)
137+
: p_uuid(NULL), p_name(NULL), p_metadata(NULL), p_address(NULL), port(0), p_groups(NULL), num_groups(0), events_subscribed(false) {}
138+
117139
#ifdef __clang__
118140
#pragma clang diagnostic pop
119141
#endif

src/modules/newtek/interop/Processing.NDI.Lib.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including
@@ -135,9 +135,21 @@ bool NDIlib_is_supported_CPU(void);
135135
// Extensions to support PTZ control, etc...
136136
#include "Processing.NDI.Recv.ex.h"
137137

138+
// The receiver advertiser API.
139+
#include "Processing.NDI.RecvAdvertiser.h"
140+
141+
// The receiver listener API.
142+
#include "Processing.NDI.RecvListener.h"
143+
138144
// The sending video API.
139145
#include "Processing.NDI.Send.h"
140146

147+
// The sender advertiser API.
148+
#include "Processing.NDI.SendAdvertiser.h"
149+
150+
// The sender listener API.
151+
#include "Processing.NDI.SendListener.h"
152+
141153
// The routing of inputs API.
142154
#include "Processing.NDI.Routing.h"
143155

src/modules/newtek/interop/Processing.NDI.Recv.ex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including

src/modules/newtek/interop/Processing.NDI.Recv.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
//***********************************************************************************************************
1010
//
11-
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
11+
// Copyright (C) 2023-2026 Vizrt NDI AB. All rights reserved.
1212
//
1313
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
1414
// associated documentation files(the "Software"), to deal in the Software without restriction, including
@@ -51,7 +51,7 @@ typedef enum NDIlib_recv_color_format_e {
5151
// When there is an alpha channel, this mode delivers BGRA.
5252
NDIlib_recv_color_format_UYVY_BGRA = 1,
5353

54-
// When there is no alpha channel, this mode delivers BGRX.
54+
// When there is no alpha channel, this mode delivers RGBX.
5555
// When there is an alpha channel, this mode delivers RGBA.
5656
NDIlib_recv_color_format_RGBX_RGBA = 2,
5757

@@ -285,3 +285,13 @@ int NDIlib_recv_get_no_connections(NDIlib_recv_instance_t p_instance);
285285
// when the NDILib_recv_capture* call would return NDIlib_frame_type_status_change.
286286
PROCESSINGNDILIB_API
287287
const char* NDIlib_recv_get_web_control(NDIlib_recv_instance_t p_instance);
288+
289+
// Retrieve the name of the current NDI source that the NDI receiver is connected to. This will return false
290+
// if there has been no change in the source information since the last call. If p_source_name is NULL, then
291+
// the name of the current NDI source will not be returned. If p_source_name is not NULL, then the name of
292+
// the current source will be returned, however, the returned value can be NULL if the NDI receiver is
293+
// currently not connected to a source. If the returned pointer is not NULL, then you should call
294+
// NDIlib_recv_free_string to free the string that is returned by this function. A timeout value can be given
295+
// to wait until a change occurs. If waiting is not desired, then use a timeout of 0.
296+
PROCESSINGNDILIB_API
297+
bool NDIlib_recv_get_source_name(NDIlib_recv_instance_t p_instance, const char** p_source_name, uint32_t timeout_in_ms NDILIB_CPP_DEFAULT_VALUE(0));
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#pragma once
2+
3+
// NOTE : The following MIT license applies to this file ONLY and not to the SDK as a whole. Please review
4+
// the SDK documentation for the description of the full license terms, which are also provided in the file
5+
// "NDI License Agreement.pdf" within the SDK or online at http://ndi.link/ndisdk_license. Your use of any
6+
// part of this SDK is acknowledgment that you agree to the SDK license terms. The full NDI SDK may be
7+
// downloaded at http://ndi.video/
8+
//
9+
//***********************************************************************************************************
10+
//
11+
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
12+
//
13+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
14+
// associated documentation files(the "Software"), to deal in the Software without restriction, including
15+
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16+
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
17+
// following conditions :
18+
//
19+
// The above copyright notice and this permission notice shall be included in all copies or substantial
20+
// portions of the Software.
21+
//
22+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
23+
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
24+
// EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
26+
// THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+
//
28+
//***********************************************************************************************************
29+
30+
// The type instance for a receiver advertiser.
31+
struct NDIlib_recv_advertiser_instance_type;
32+
typedef struct NDIlib_recv_advertiser_instance_type* NDIlib_recv_advertiser_instance_t;
33+
34+
typedef struct NDIlib_recv_advertiser_create_t {
35+
// The URL address of the NDI Discovery Server to connect to. If NULL, then the default NDI discovery
36+
// server will be used. If there is no discovery server available, then the receiver advertiser will not
37+
// be able to be instantiated and the create function will return NULL. The format of this field is
38+
// expected to be the hostname or IP address, optionally followed by a colon and a port number. If the
39+
// port number is not specified, then port 5959 will be used. For example,
40+
// 127.0.0.1:5959
41+
// or
42+
// 127.0.0.1
43+
// or
44+
// hostname:5959
45+
// This field can also specify multiple addresses separated by commas for redundancy support.
46+
const char* p_url_address;
47+
48+
#if NDILIB_CPP_DEFAULT_CONSTRUCTORS
49+
NDIlib_recv_advertiser_create_t(
50+
const char* p_url_address = NULL
51+
);
52+
#endif // NDILIB_CPP_DEFAULT_CONSTRUCTORS
53+
} NDIlib_recv_advertiser_create_t;
54+
55+
// Create an instance of the receiver advertiser. This will return NULL if it fails to create the advertiser.
56+
PROCESSINGNDILIB_API
57+
NDIlib_recv_advertiser_instance_t NDIlib_recv_advertiser_create(const NDIlib_recv_advertiser_create_t* p_create_settings NDILIB_CPP_DEFAULT_VALUE(NULL));
58+
59+
// Destroy an instance of the receiver advertiser.
60+
PROCESSINGNDILIB_API
61+
void NDIlib_recv_advertiser_destroy(NDIlib_recv_advertiser_instance_t p_instance);
62+
63+
// Add the receiver to the list of receivers that are being advertised. Returns false if the receiver has
64+
// been previously registered.
65+
PROCESSINGNDILIB_API
66+
bool NDIlib_recv_advertiser_add_receiver(
67+
NDIlib_recv_advertiser_instance_t p_instance,
68+
NDIlib_recv_instance_t p_receiver,
69+
bool allow_controlling, bool allow_monitoring,
70+
const char* p_input_group_name NDILIB_CPP_DEFAULT_VALUE(NULL)
71+
);
72+
73+
// Remove the receiver from the list of receivers that are being advertised. Returns false if the receiver
74+
// was not previously registered.
75+
PROCESSINGNDILIB_API
76+
bool NDIlib_recv_advertiser_del_receiver(
77+
NDIlib_recv_advertiser_instance_t p_instance,
78+
NDIlib_recv_instance_t p_receiver
79+
);
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
#pragma once
2+
3+
// NOTE : The following MIT license applies to this file ONLY and not to the SDK as a whole. Please review
4+
// the SDK documentation for the description of the full license terms, which are also provided in the file
5+
// "NDI License Agreement.pdf" within the SDK or online at http://ndi.link/ndisdk_license. Your use of any
6+
// part of this SDK is acknowledgment that you agree to the SDK license terms. The full NDI SDK may be
7+
// downloaded at http://ndi.video/
8+
//
9+
//***********************************************************************************************************
10+
//
11+
// Copyright (C) 2023-2024 Vizrt NDI AB. All rights reserved.
12+
//
13+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
14+
// associated documentation files(the "Software"), to deal in the Software without restriction, including
15+
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16+
// copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
17+
// following conditions :
18+
//
19+
// The above copyright notice and this permission notice shall be included in all copies or substantial
20+
// portions of the Software.
21+
//
22+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
23+
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
24+
// EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
26+
// THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27+
//
28+
//***********************************************************************************************************
29+
30+
// The type instance for a receiver listener.
31+
struct NDIlib_recv_listener_instance_type;
32+
typedef struct NDIlib_recv_listener_instance_type* NDIlib_recv_listener_instance_t;
33+
34+
typedef struct NDIlib_recv_listener_create_t {
35+
// The URL address of the NDI Discovery Server to connect to. If NULL, then the default NDI discovery
36+
// server will be used. If there is no discovery server available, then the receiver listener will not
37+
// be able to be instantiated and the create function will return NULL. The format of this field is
38+
// expected to be the hostname or IP address, optionally followed by a colon and a port number. If the
39+
// port number is not specified, then port 5959 will be used. For example,
40+
// 127.0.0.1:5959
41+
// or
42+
// 127.0.0.1
43+
// or
44+
// hostname:5959
45+
// If this field is a comma-separated list, then only the first address will be used.
46+
const char* p_url_address;
47+
48+
#if NDILIB_CPP_DEFAULT_CONSTRUCTORS
49+
NDIlib_recv_listener_create_t(
50+
const char* p_url_address = NULL
51+
);
52+
#endif // NDILIB_CPP_DEFAULT_CONSTRUCTORS
53+
} NDIlib_recv_listener_create_t;
54+
55+
// Create an instance of the receiver listener. This will return NULL if it fails to create the listener.
56+
PROCESSINGNDILIB_API
57+
NDIlib_recv_listener_instance_t NDIlib_recv_listener_create(const NDIlib_recv_listener_create_t* p_create_settings NDILIB_CPP_DEFAULT_VALUE(NULL));
58+
59+
// Destroy an instance of the receiver listener.
60+
PROCESSINGNDILIB_API
61+
void NDIlib_recv_listener_destroy(NDIlib_recv_listener_instance_t p_instance);
62+
63+
// Returns true if the receiver listener is actively connected to the configured NDI Discovery Server.
64+
PROCESSINGNDILIB_API
65+
bool NDIlib_recv_listener_is_connected(NDIlib_recv_listener_instance_t p_instance);
66+
67+
// Retrieve the URL address of the NDI Discovery Server that the receiver listener is connected to. This can
68+
// return NULL if the instance pointer is invalid.
69+
PROCESSINGNDILIB_API
70+
const char* NDIlib_recv_listener_get_server_url(NDIlib_recv_listener_instance_t p_instance);
71+
72+
// The types of streams that a receiver can receive from the source it's connected to.
73+
typedef enum NDIlib_receiver_type_e {
74+
NDIlib_receiver_type_none = 0,
75+
NDIlib_receiver_type_metadata = 1,
76+
NDIlib_receiver_type_video = 2,
77+
NDIlib_receiver_type_audio = 3,
78+
79+
// Make sure this is a 32-bit enumeration.
80+
NDIlib_receiver_type_max = 0x7fffffff
81+
} NDIlib_receiver_type_e;
82+
83+
// The types of commands that a receiver can process.
84+
typedef enum NDIlib_receiver_command_e {
85+
NDIlib_receiver_command_none = 0,
86+
87+
// A receiver can be told to connect to a specific source.
88+
NDIlib_receiver_command_connect = 1,
89+
90+
// Make sure this is a 32-bit enumeration.
91+
NDIlib_receiver_command_max = 0x7fffffff
92+
} NDIlib_receiver_command_e;
93+
94+
// Describes a receiver that has been discovered.
95+
typedef struct NDIlib_receiver_t {
96+
// The unique identifier for the receiver on the network.
97+
const char* p_uuid;
98+
99+
// The human-readable name of the receiver.
100+
const char* p_name;
101+
102+
// The unique identifier for the input group that the receiver belongs to.
103+
const char* p_input_uuid;
104+
105+
// The human-readable name of the input group that the receiver belongs to.
106+
const char* p_input_name;
107+
108+
// The known IP address of the receiver.
109+
const char* p_address;
110+
111+
// An array of streams that the receiver is set to receive. The last entry in this list will be
112+
// NDIlib_receiver_type_none.
113+
NDIlib_receiver_type_e* p_streams;
114+
115+
// How many elements are in the p_streams array, excluding the NDIlib_receiver_type_none entry.
116+
uint32_t num_streams;
117+
118+
// An array of commands that the receiver can process. The last entry in this list will be
119+
// NDIlib_receiver_command_none.
120+
NDIlib_receiver_command_e* p_commands;
121+
122+
// How many elements are in the p_commands array, excluding the NDIlib_receiver_command_none entry.
123+
uint32_t num_commands;
124+
125+
// Are we currently subscribed for receiver events?
126+
bool events_subscribed;
127+
128+
#if NDILIB_CPP_DEFAULT_CONSTRUCTORS
129+
NDIlib_receiver_t(void);
130+
#endif // NDILIB_CPP_DEFAULT_CONSTRUCTORS
131+
} NDIlib_receiver_t;
132+
133+
// Retrieves the current list of advertised receivers. The memory for the returned structure is only valid
134+
// until the next call or when destroy is called. For a given NDIlib_recv_listener_instance_t, do not call
135+
// NDIlib_recv_listener_get_receivers asynchronously.
136+
PROCESSINGNDILIB_API
137+
const NDIlib_receiver_t* NDIlib_recv_listener_get_receivers(NDIlib_recv_listener_instance_t p_instance, uint32_t* p_num_receivers);
138+
139+
// This will allow you to wait until the number of online receivers has changed.
140+
PROCESSINGNDILIB_API
141+
bool NDIlib_recv_listener_wait_for_receivers(NDIlib_recv_listener_instance_t p_instance, uint32_t timeout_in_ms);
142+
143+
// This will subscribe this listener instance to begin receiving events from the specified receiver.
144+
PROCESSINGNDILIB_API
145+
void NDIlib_recv_listener_subscribe_events(NDIlib_recv_listener_instance_t p_instance, const char* p_receiver_uuid);
146+
147+
// This will unsubscribe this listener instance from receiving events from the specified receiver.
148+
PROCESSINGNDILIB_API
149+
void NDIlib_recv_listener_unsubscribe_events(NDIlib_recv_listener_instance_t p_instance, const char* p_receiver_uuid);
150+
151+
// For backwards compatibility.
152+
typedef NDIlib_listener_event NDIlib_recv_listener_event;
153+
154+
// Returns a list of the currently pending events for the listener. The events are returned in the order that
155+
// they were received. The timeout value is the amount of time in milliseconds that the function will wait
156+
// for events to be received. If the timeout is 0, then the function will return immediately with any events
157+
// that are currently pending. If the timeout is -1, then the function will wait indefinitely for events to
158+
// be received. The function will return NULL if no events were received within the timeout period. The
159+
// returned events should be freed using NDIlib_recv_listener_free_events().
160+
PROCESSINGNDILIB_API
161+
const NDIlib_recv_listener_event* NDIlib_recv_listener_get_events(NDIlib_recv_listener_instance_t p_instance, uint32_t* p_num_events, uint32_t timeout_in_ms);
162+
163+
// Frees the memory allocated for the events returned by NDIlib_recv_listener_get_events().
164+
PROCESSINGNDILIB_API
165+
void NDIlib_recv_listener_free_events(NDIlib_recv_listener_instance_t p_instance, const NDIlib_recv_listener_event* p_events);
166+
167+
// Trigger the "connect" command to be sent from the listener to the receiver. This will return false if the
168+
// command could not be sent, receiver is unknown, or some other error occurred. If p_source_name is NULL,
169+
// then this would indicate that the receiver should disconnect from its current source. Note that this
170+
// should only be called for a receiver that has NDIlib_receiver_command_connect in its list of commands that
171+
// it can respond to.
172+
PROCESSINGNDILIB_API
173+
bool NDIlib_recv_listener_send_connect(NDIlib_recv_listener_instance_t p_instance, const char* p_receiver_uuid, const char* p_source_name);

0 commit comments

Comments
 (0)