tsdumper2 reads incoming mpeg transport stream over UDP/RTP and then records it to disk. The files names are generated based on preconfigured time interval. https://georgi.unixsol.org/programs/tsdumper2/
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.

util.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Utility functions header
  3. * Copyright (C) 2013 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 (COPYING file) for more details.
  13. *
  14. */
  15. #ifndef UTIL_H
  16. #define UTIL_H
  17. #include <inttypes.h>
  18. #include <arpa/inet.h>
  19. void set_thread_name(char *thread_name);
  20. int parse_host_and_port(char *input, struct io *io);
  21. char *my_inet_ntop(int family, struct sockaddr *addr, char *dest, int dest_len);
  22. int create_dir(const char *dir, mode_t mode);
  23. #define p_dbg1(fmt, ...) \
  24. do { if (DEBUG > 0) p_info(fmt, __VA_ARGS__); } while(0)
  25. #define p_dbg2(fmt, ...) \
  26. do { if (DEBUG > 1) p_info(fmt, __VA_ARGS__); } while(0)
  27. __attribute__ ((format(printf, 1, 2))) void die(const char *fmt, ...);
  28. __attribute__ ((format(printf, 1, 2))) void p_err(const char *fmt, ...);
  29. __attribute__ ((format(printf, 1, 2))) void p_info(const char *fmt, ...);
  30. #endif