videohubctrl can be used to control Blackmagic Design Videohub SDI router device over the network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

data.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * === Main data structures and helpers ===
  3. *
  4. * Blackmagic Design Videohub control application
  5. * Copyright (C) 2014 Unix Solutions Ltd.
  6. * Written by Georgi Chorbadzhiyski
  7. *
  8. * Released under MIT license.
  9. * See LICENSE-MIT.txt for license terms.
  10. *
  11. */
  12. #ifndef DATA_H
  13. #define DATA_H
  14. #include <stdbool.h>
  15. #define MAX_INPUTS 72
  16. #define MAX_OUTPUTS 72
  17. #define MAX_NAME_LEN 64
  18. struct device_desc {
  19. bool dev_present;
  20. bool needs_fw_update;
  21. char protocol_ver[16];
  22. char model_name[MAX_NAME_LEN];
  23. char unique_id[MAX_NAME_LEN];
  24. unsigned int num_video_inputs;
  25. unsigned int num_video_processing_units;
  26. unsigned int num_video_outputs;
  27. unsigned int num_video_monitoring_outputs;
  28. unsigned int num_serial_ports;
  29. };
  30. struct input_desc {
  31. char name[MAX_NAME_LEN];
  32. };
  33. struct output_desc {
  34. char name[MAX_NAME_LEN];
  35. unsigned int routed_to;
  36. bool locked;
  37. bool locked_other;
  38. };
  39. struct videohub_data {
  40. char *dev_host;
  41. char *dev_port;
  42. int dev_fd;
  43. struct device_desc device;
  44. struct input_desc inputs[MAX_INPUTS];
  45. struct output_desc outputs[MAX_OUTPUTS];
  46. };
  47. extern int verbose;
  48. extern int quiet;
  49. #define v(fmt, arguments...) \
  50. do { \
  51. if (verbose) \
  52. printf("verbose: " fmt, ## arguments); \
  53. } while(0)
  54. #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
  55. #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  56. #define UNUSED(x) UNUSED_ ## x __attribute__((unused))
  57. #endif