mptsd reads mpegts streams from udp/multicast or http and combines them into one multiple program stream that is suitable for outputting to DVB-C modulator. Tested with Dektec DTE-3114 Quad QAM Modulator and used in production in small DVB-C networks. https://georgi.unixsol.org/programs/mptsd/
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.

config.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * mptsd configuration header file
  3. * Copyright (C) 2010-2011 Unix Solutions Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2
  7. * as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  17. */
  18. #ifndef CONFIG_H
  19. #define CONFIG_H
  20. #include <pthread.h>
  21. #include <arpa/inet.h>
  22. #include <netinet/in.h>
  23. #include "libfuncs/list.h"
  24. #include "data.h"
  25. typedef struct {
  26. char *ident;
  27. char *pidfile;
  28. int syslog_active;
  29. char *logident;
  30. char *loghost;
  31. int logport;
  32. struct sockaddr_in server;
  33. char *server_addr;
  34. int server_port;
  35. int server_socket;
  36. pthread_t server_thread;
  37. struct sockaddr_in udp_server;
  38. char *udp_server_addr;
  39. int udp_server_port;
  40. int udp_server_socket;
  41. pthread_t udp_server_thread;
  42. int multicast_ttl;
  43. struct in_addr output_intf;
  44. char *global_conf;
  45. char *channels_conf;
  46. char *nit_conf;
  47. char *epg_conf;
  48. int debug;
  49. int quiet;
  50. int write_input_file;
  51. int write_output_file;
  52. int pcr_mode; // 0 - do not touch PCRs
  53. // 1 - move PCRs to their calculated place
  54. // 2 - rewrite PCRs using output bitrate
  55. // 3 - move PCRs and rewrite them
  56. uint16_t network_id; // For NIT && SDT
  57. uint16_t transport_stream_id;// For NIT
  58. char *frequency; // For NIT
  59. char *modulation; // For NIT
  60. char *symbol_rate; // For NIT
  61. char *network_name; // For NIT
  62. char *provider_name; // For SDT
  63. double output_bitrate; // Output bitrate (bps)
  64. long output_tmout; // Smooth interval miliseconds
  65. long usleep_overhead; // How much more usecs uslep(1) takes
  66. long output_packets_per_sec; // How much packets should be sent in one second
  67. time_t epg_conf_mtime; // Last change time of epg config
  68. LIST * channels; // List of channels
  69. LIST * inputs; // Input threads
  70. LIST * nit;
  71. OUTPUT * output; // Output
  72. struct {
  73. unsigned int pat; // DVB section id 0x00 (program_association_section)
  74. unsigned int pmt; // DVB section id 0x02 (program_map_section)
  75. unsigned int nit; // DVB section id 0x40 (network_information_section - actual_network)
  76. unsigned int sdt; // DVB section id 0x42 (service_description_section - actual_transport_stream)
  77. unsigned int eit; // DVB section id 0x4e (event_information_section - actual_transport_stream, present/following)
  78. unsigned int tdt; // DVB section id 0x70 (time_date_section)
  79. unsigned int tot; // DVB section id 0x73 (time_offset_section)
  80. unsigned int stats; // Local
  81. } timeouts;
  82. } CONFIG;
  83. CONFIG * config_alloc ();
  84. void config_free (CONFIG **conf);
  85. void config_load (CONFIG *conf, int argc, char **argv);
  86. int config_load_global (CONFIG *conf);
  87. int config_load_channels (CONFIG *conf);
  88. int config_load_nit (CONFIG *conf);
  89. int config_load_epg (CONFIG *conf);
  90. #endif