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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. // Port statuses are supported only by Universal Videohub
  34. // The statuses (actually they are connection types) are:
  35. // BNC, Optical or None /missing port/
  36. char status[8];
  37. };
  38. struct output_desc {
  39. char name[MAX_NAME_LEN];
  40. unsigned int routed_to;
  41. bool locked;
  42. bool locked_other;
  43. char status[8];
  44. };
  45. struct videohub_data {
  46. char *dev_host;
  47. char *dev_port;
  48. int dev_fd;
  49. struct device_desc device;
  50. struct input_desc inputs[MAX_INPUTS];
  51. struct output_desc outputs[MAX_OUTPUTS];
  52. };
  53. extern int debug;
  54. extern int quiet;
  55. #define d(fmt, arguments...) \
  56. do { \
  57. if (debug) \
  58. printf("debug: " fmt, ## arguments); \
  59. } while(0)
  60. #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
  61. #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  62. #define UNUSED(x) UNUSED_ ## x __attribute__((unused))
  63. #endif