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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 288
  16. #define MAX_OUTPUTS 288
  17. #define MAX_NAME_LEN 64
  18. #define MAX_RUN_CMDS (MAX_INPUTS + (MAX_OUTPUTS * 2))
  19. struct device_desc {
  20. bool dev_present;
  21. bool needs_fw_update;
  22. char protocol_ver[16];
  23. char model_name[MAX_NAME_LEN];
  24. char unique_id[MAX_NAME_LEN];
  25. unsigned int num_video_inputs;
  26. unsigned int num_video_processing_units;
  27. unsigned int num_video_outputs;
  28. unsigned int num_video_monitoring_outputs;
  29. unsigned int num_serial_ports;
  30. };
  31. struct input_desc {
  32. char name[MAX_NAME_LEN];
  33. };
  34. struct output_desc {
  35. char name[MAX_NAME_LEN];
  36. unsigned int routed_to;
  37. bool locked;
  38. bool locked_other;
  39. };
  40. struct videohub_data {
  41. char *dev_host;
  42. char *dev_port;
  43. int dev_fd;
  44. struct device_desc device;
  45. struct input_desc inputs[MAX_INPUTS];
  46. struct output_desc outputs[MAX_OUTPUTS];
  47. };
  48. extern int debug;
  49. extern int quiet;
  50. #define d(fmt, arguments...) \
  51. do { \
  52. if (debug) \
  53. printf("debug: " fmt, ## arguments); \
  54. } while(0)
  55. #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
  56. #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  57. #define UNUSED(x) UNUSED_ ## x __attribute__((unused))
  58. #endif