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/

config.h 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. int multicast_ttl;
  38. struct in_addr output_intf;
  39. char *global_conf;
  40. char *channels_conf;
  41. char *nit_conf;
  42. char *epg_conf;
  43. int debug;
  44. int quiet;
  45. int write_input_file;
  46. int write_output_file;
  47. int pcr_mode; // 0 - do not touch PCRs
  48. // 1 - move PCRs to their calculated place
  49. // 2 - rewrite PCRs using output bitrate
  50. // 3 - move PCRs and rewrite them
  51. uint16_t network_id; // For NIT && SDT
  52. uint16_t transport_stream_id;// For NIT
  53. char *network_name; // For NIT
  54. char *provider_name; // For SDT
  55. double output_bitrate; // Output bitrate (bps)
  56. long output_tmout; // Smooth interval miliseconds
  57. long usleep_overhead; // How much more usecs uslep(1) takes
  58. long output_packets_per_sec; // How much packets should be sent in one second
  59. time_t epg_conf_mtime; // Last change time of epg config
  60. LIST * channels; // List of channels
  61. LIST * inputs; // Input threads
  62. LIST * nit;
  63. OUTPUT * output; // Output
  64. struct {
  65. unsigned int pat; // DVB section id 0x00 (program_association_section)
  66. unsigned int pmt; // DVB section id 0x02 (program_map_section)
  67. unsigned int nit; // DVB section id 0x40 (network_information_section - actual_network)
  68. unsigned int sdt; // DVB section id 0x42 (service_description_section - actual_transport_stream)
  69. unsigned int eit; // DVB section id 0x4e (event_information_section - actual_transport_stream, present/following)
  70. unsigned int tdt; // DVB section id 0x70 (time_date_section)
  71. unsigned int tot; // DVB section id 0x73 (time_offset_section)
  72. unsigned int stats; // Local
  73. } timeouts;
  74. } CONFIG;
  75. CONFIG * config_alloc ();
  76. void config_free (CONFIG **conf);
  77. void config_load (CONFIG *conf, int argc, char **argv);
  78. int config_load_global (CONFIG *conf);
  79. int config_load_channels (CONFIG *conf);
  80. int config_load_nit (CONFIG *conf);
  81. int config_load_epg (CONFIG *conf);
  82. #endif