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.3KB

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