NvNmos
nvnmos.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
58 #ifndef NVNMOS_H
59 #define NVNMOS_H
60 
61 #if defined(NVNMOS_EXPORTS)
62 
63 #if defined(_WIN32) || defined(__CYGWIN__)
64 #define NVNMOS_API __declspec(dllexport)
65 #elif defined(__GNUC__) && (__GNUC__ >= 4)
66 #define NVNMOS_API __attribute__ ((visibility("default")))
67 #else
68 #define NVNMOS_API
69 #endif
70 
71 #elif defined(NVNMOS_STATIC)
72 
73 #define NVNMOS_API
74 
75 #else
76 
77 #if defined(_WIN32) || defined(__CYGWIN__)
78 #define NVNMOS_API __declspec(dllimport)
79 #elif defined(__GNUC__) && (__GNUC__ >= 4)
80 #define NVNMOS_API
81 #else
82 #define NVNMOS_API
83 #endif
84 
85 #endif
86 
87 #include <stdbool.h>
88 
89 #ifdef __cplusplus
90 extern "C"
91 {
92 #endif
93 
94 typedef struct _NvNmosNodeServer NvNmosNodeServer;
95 
122  NvNmosNodeServer *server,
123  const char *id,
124  const char *sdp);
125 
130 enum {
144  NVNMOS_LOG_FATAL = 40
145 };
146 
158 typedef void (* nmos_logging_callback)(
159  NvNmosNodeServer *server,
160  const char *categories,
161  int level,
162  const char *message);
163 
167 
172 typedef struct _NvNmosNodeConfig
173 {
177  const char *host_name;
182  const char **host_addresses;
184  unsigned int num_host_addresses;
187  unsigned int http_port;
188 
191  const char* label;
194  const char* description;
195 
198 
201  const char *seed;
202 
207  unsigned int num_receivers;
212  unsigned int num_senders;
213 
217 
225  const char **log_categories;
227  unsigned int num_log_categories;
229 
234 typedef struct _NvNmosAssetConfig
235 {
237  const char* manufacturer;
239  const char* product;
242  const char* instance_id;
245  const char** functions;
247  unsigned int num_functions;
249 
254 typedef struct _NvNmosReceiverConfig
255 {
266  const char *sdp;
268 
273 typedef struct _NvNmosSenderConfig
274 {
286  const char *sdp;
288 
294 typedef struct _NvNmosNodeServer
295 {
301  void *user_data;
305  void *impl;
307 
318 NVNMOS_API
320  const NvNmosNodeConfig *config,
321  NvNmosNodeServer *server);
322 
332 NVNMOS_API
334  NvNmosNodeServer *server);
335 
346 NVNMOS_API
348  NvNmosNodeServer *server,
349  const NvNmosReceiverConfig* config);
350 
361 NVNMOS_API
363  NvNmosNodeServer *server,
364  const char* id);
365 
376 NVNMOS_API
378  NvNmosNodeServer *server,
379  const NvNmosSenderConfig* config);
380 
391 NVNMOS_API
393  NvNmosNodeServer *server,
394  const char* id);
395 
422 NVNMOS_API
424  NvNmosNodeServer *server,
425  const char *id,
426  const char *sdp);
427 
428 #ifdef __cplusplus
429 }
430 #endif
431 
432 #endif
433 
NVNMOS_API bool remove_nmos_sender_from_node_server(NvNmosNodeServer *server, const char *id)
bool(* nmos_connection_rtp_activation_callback)(NvNmosNodeServer *server, const char *id, const char *sdp)
Definition: nvnmos.h:121
NVNMOS_API bool add_nmos_sender_to_node_server(NvNmosNodeServer *server, const NvNmosSenderConfig *config)
NVNMOS_API bool destroy_nmos_node_server(NvNmosNodeServer *server)
void(* nmos_logging_callback)(NvNmosNodeServer *server, const char *categories, int level, const char *message)
Definition: nvnmos.h:158
struct _NvNmosNodeServer NvNmosNodeServer
Definition: nvnmos.h:94
NVNMOS_API bool create_nmos_node_server(const NvNmosNodeConfig *config, NvNmosNodeServer *server)
struct _NvNmosNodeConfig NvNmosNodeConfig
struct _NvNmosReceiverConfig NvNmosReceiverConfig
Definition: nvnmos.h:165
NVNMOS_API bool nmos_connection_rtp_activate(NvNmosNodeServer *server, const char *id, const char *sdp)
NVNMOS_API bool add_nmos_receiver_to_node_server(NvNmosNodeServer *server, const NvNmosReceiverConfig *config)
NVNMOS_API bool remove_nmos_receiver_from_node_server(NvNmosNodeServer *server, const char *id)
struct _NvNmosAssetConfig NvNmosAssetConfig
Definition: nvnmos.h:164
struct _NvNmosSenderConfig NvNmosSenderConfig
Definition: nvnmos.h:166
@ NVNMOS_LOG_SEVERE
Definition: nvnmos.h:142
@ NVNMOS_LOG_DEVEL
Definition: nvnmos.h:132
@ NVNMOS_LOG_WARNING
Definition: nvnmos.h:138
@ NVNMOS_LOG_ERROR
Definition: nvnmos.h:140
@ NVNMOS_LOG_VERBOSE
Definition: nvnmos.h:134
@ NVNMOS_LOG_FATAL
Definition: nvnmos.h:144
@ NVNMOS_LOG_INFO
Definition: nvnmos.h:136
Definition: nvnmos.h:235
const char * manufacturer
Definition: nvnmos.h:237
const char * instance_id
Definition: nvnmos.h:242
const char * product
Definition: nvnmos.h:239
unsigned int num_functions
Definition: nvnmos.h:247
const char ** functions
Definition: nvnmos.h:245
Definition: nvnmos.h:173
NvNmosSenderConfig * senders
Definition: nvnmos.h:210
int log_level
Definition: nvnmos.h:222
unsigned int num_host_addresses
Definition: nvnmos.h:184
unsigned int http_port
Definition: nvnmos.h:187
const char * seed
Definition: nvnmos.h:201
const char ** host_addresses
Definition: nvnmos.h:182
NvNmosReceiverConfig * receivers
Definition: nvnmos.h:205
const char * description
Definition: nvnmos.h:194
const char * label
Definition: nvnmos.h:191
unsigned int num_senders
Definition: nvnmos.h:212
const char * host_name
Definition: nvnmos.h:177
nmos_logging_callback log_callback
Definition: nvnmos.h:219
unsigned int num_log_categories
Definition: nvnmos.h:227
unsigned int num_receivers
Definition: nvnmos.h:207
const char ** log_categories
Definition: nvnmos.h:225
NvNmosAssetConfig * asset_tags
Definition: nvnmos.h:197
nmos_connection_rtp_activation_callback rtp_connection_activated
Definition: nvnmos.h:216
Definition: nvnmos.h:295
void * impl
Definition: nvnmos.h:305
void * user_data
Definition: nvnmos.h:301
Definition: nvnmos.h:255
const char * sdp
Definition: nvnmos.h:266
Definition: nvnmos.h:274
const char * sdp
Definition: nvnmos.h:286