pp-cmdline.h
Go to the documentation of this file.
1 
8 #ifndef PP_CMDLINE_H
9 #define PP_CMDLINE_H
10 
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15 
16 #include <stdio.h> /* for FILE */
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 #ifndef CMDLINE_PARSER_PACKAGE
24 #define CMDLINE_PARSER_PACKAGE "janus-pp-rec"
25 #endif
26 
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
29 #define CMDLINE_PARSER_PACKAGE_NAME "janus-pp-rec"
30 #endif
31 
32 #ifndef CMDLINE_PARSER_VERSION
34 #define CMDLINE_PARSER_VERSION "1.0.0"
35 #endif
36 
39 {
40  const char *help_help;
41  const char *version_help;
43  const char *file_extensions_help;
44  int json_flag;
45  const char *json_help;
47  const char *header_help;
48  int parse_flag;
49  const char *parse_help;
51  const char *extended_json_help;
52  char * metadata_arg;
53  char * metadata_orig;
54  const char *metadata_help;
57  const char *ignore_first_help;
60  const char *payload_type_help;
63  const char *audiolevel_ext_help;
66  const char *videoorient_ext_help;
67  int debug_level_arg;
68  char * debug_level_orig;
69  const char *debug_level_help;
71  const char *debug_timestamps_help;
73  const char *disable_colors_help;
74  char * format_arg;
75  char * format_orig;
76  const char *format_help;
78  const char *faststart_help;
80  char * audioskew_orig;
81  const char *audioskew_help;
84  const char *silence_distance_help;
86  char * restamp_orig;
87  const char *restamp_help;
90  const char *restamp_packets_help;
93  const char *restamp_min_th_help;
95  unsigned int help_given ;
96  unsigned int version_given ;
97  unsigned int file_extensions_given ;
98  unsigned int json_given ;
99  unsigned int header_given ;
100  unsigned int parse_given ;
101  unsigned int extended_json_given ;
102  unsigned int metadata_given ;
103  unsigned int ignore_first_given ;
104  unsigned int payload_type_given ;
105  unsigned int audiolevel_ext_given ;
106  unsigned int videoorient_ext_given ;
107  unsigned int debug_level_given ;
108  unsigned int debug_timestamps_given ;
109  unsigned int disable_colors_given ;
110  unsigned int format_given ;
111  unsigned int faststart_given ;
112  unsigned int audioskew_given ;
113  unsigned int silence_distance_given ;
114  unsigned int restamp_given ;
115  unsigned int restamp_packets_given ;
116  unsigned int restamp_min_th_given ;
118 } ;
119 
122 {
123  int override;
124  int initialize;
125  int check_required;
126  int check_ambiguity;
127  int print_errors;
128 } ;
129 
131 extern const char *gengetopt_args_info_purpose;
133 extern const char *gengetopt_args_info_usage;
135 extern const char *gengetopt_args_info_description;
137 extern const char *gengetopt_args_info_help[];
138 
146 int cmdline_parser (int argc, char **argv,
147  struct gengetopt_args_info *args_info);
148 
160 int cmdline_parser2 (int argc, char **argv,
161  struct gengetopt_args_info *args_info,
162  int override, int initialize, int check_required);
163 
172 int cmdline_parser_ext (int argc, char **argv,
173  struct gengetopt_args_info *args_info,
174  struct cmdline_parser_params *params);
175 
182 int cmdline_parser_dump(FILE *outfile,
183  struct gengetopt_args_info *args_info);
184 
192 int cmdline_parser_file_save(const char *filename,
193  struct gengetopt_args_info *args_info);
194 
198 void cmdline_parser_print_help(void);
203 
210 
217 
223 void cmdline_parser_init (struct gengetopt_args_info *args_info);
229 void cmdline_parser_free (struct gengetopt_args_info *args_info);
230 
238 int cmdline_parser_required (struct gengetopt_args_info *args_info,
239  const char *prog_name);
240 
241 extern const char *cmdline_parser_format_values[];
244 #ifdef __cplusplus
245 }
246 #endif /* __cplusplus */
247 #endif /* PP_CMDLINE_H */
Configuration files parsing (headers)
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Definition: cmdline.c:416
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: cmdline.c:560
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Definition: cmdline.c:519
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: cmdline.c:28
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: cmdline.c:36
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
Definition: cmdline.c:582
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Definition: cmdline.c:605
void cmdline_parser_print_version(void)
Definition: cmdline.c:268
const char * gengetopt_args_info_usage
the usage string of the program
Definition: cmdline.c:30
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
Definition: cmdline.c:566
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Definition: cmdline.c:309
const char * gengetopt_args_info_description
the description string of the program
Definition: cmdline.c:34
const char * cmdline_parser_format_values[]
Possible values for format.
Definition: pp-cmdline.c:78
void cmdline_parser_print_help(void)
Definition: cmdline.c:300
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Definition: cmdline.c:539
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Definition: cmdline.c:317
struct cmdline_parser_params * cmdline_parser_params_create(void)
Definition: cmdline.c:330
The additional parameters to pass to parser functions.
Definition: cmdline.h:198
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: cmdline.h:203
int check_required
whether to check that all required options were provided (default 1)
Definition: cmdline.h:201
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: cmdline.h:202
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: cmdline.h:200
Where the command line options are stored.
Definition: cmdline.h:39
const char * videoorient_ext_help
ID of the video-orientation RTP extension (default=none) help description.
Definition: pp-cmdline.h:66
const char * format_help
Specifies the output format (overrides the format from the destination) help description.
Definition: pp-cmdline.h:76
unsigned int format_given
Whether format was given.
Definition: pp-cmdline.h:110
unsigned int restamp_given
Whether restamp was given.
Definition: pp-cmdline.h:114
int audiolevel_ext_arg
ID of the audio-levels RTP extension (default=none).
Definition: pp-cmdline.h:61
const char * file_extensions_help
Only print the supported target file extensions per codec help description.
Definition: pp-cmdline.h:43
int faststart_flag
For mp4 files write the MOOV atom at the head of the file (default=off).
Definition: pp-cmdline.h:77
const char * disable_colors_help
Disable color in the logging help description.
Definition: cmdline.h:134
int payload_type_arg
Ignore all RTP packets that don't match the specified payload type (default=none).
Definition: pp-cmdline.h:58
int restamp_min_th_arg
Minimum latency of moving average to reach before starting to correct timestamps. (default=500).
Definition: pp-cmdline.h:91
char * debug_level_orig
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4) original value given at c...
Definition: cmdline.h:129
const char * audioskew_help
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0) help description.
Definition: pp-cmdline.h:81
const char * json_help
Only print JSON header help description.
Definition: pp-cmdline.h:45
int restamp_arg
If the latency of a packet is bigger than the moving_average_latency * (<restamp>/1000) the timestamp...
Definition: pp-cmdline.h:85
unsigned int parse_given
Whether parse was given.
Definition: pp-cmdline.h:100
const char * ignore_first_help
Number of first packets to ignore when processing, e.g., in case they're cause of issues (default=0) ...
Definition: pp-cmdline.h:57
int disable_colors_flag
Disable color in the logging (default=off).
Definition: cmdline.h:133
int videoorient_ext_arg
ID of the video-orientation RTP extension (default=none).
Definition: pp-cmdline.h:64
int parse_flag
Only parse and re-order packets (default=off).
Definition: pp-cmdline.h:48
unsigned int extended_json_given
Whether extended-json was given.
Definition: pp-cmdline.h:101
unsigned int silence_distance_given
Whether silence-distance was given.
Definition: pp-cmdline.h:113
const char * help_help
Print help and exit help description.
Definition: cmdline.h:40
unsigned int faststart_given
Whether faststart was given.
Definition: pp-cmdline.h:111
unsigned int debug_timestamps_given
Whether debug-timestamps was given.
Definition: cmdline.h:185
unsigned int videoorient_ext_given
Whether videoorient-ext was given.
Definition: pp-cmdline.h:106
int extended_json_flag
Only print extended JSON report (automatically enables –json) (default=off).
Definition: pp-cmdline.h:50
const char * metadata_help
Save this metadata string in the target file help description.
Definition: pp-cmdline.h:54
int debug_level_arg
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4).
Definition: cmdline.h:128
const char * header_help
Only parse .mjr header help description.
Definition: pp-cmdline.h:47
char * restamp_packets_orig
Number of packets used for calculating moving average latency for timestamp correction (default=10) o...
Definition: pp-cmdline.h:89
unsigned int restamp_packets_given
Whether restamp-packets was given.
Definition: pp-cmdline.h:115
const char * restamp_packets_help
Number of packets used for calculating moving average latency for timestamp correction (default=10) h...
Definition: pp-cmdline.h:90
int header_flag
Only parse .mjr header (default=off).
Definition: pp-cmdline.h:46
unsigned int restamp_min_th_given
Whether restamp-min-th was given.
Definition: pp-cmdline.h:116
int restamp_packets_arg
Number of packets used for calculating moving average latency for timestamp correction (default=10).
Definition: pp-cmdline.h:88
char * payload_type_orig
Ignore all RTP packets that don't match the specified payload type (default=none) original value give...
Definition: pp-cmdline.h:59
unsigned int metadata_given
Whether metadata was given.
Definition: pp-cmdline.h:102
unsigned int json_given
Whether json was given.
Definition: pp-cmdline.h:98
const char * debug_timestamps_help
Enable debug/logging timestamps help description.
Definition: cmdline.h:132
char * format_orig
Specifies the output format (overrides the format from the destination) original value given at comma...
Definition: pp-cmdline.h:75
char * audioskew_orig
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0) original value given ...
Definition: pp-cmdline.h:80
const char * audiolevel_ext_help
ID of the audio-levels RTP extension (default=none) help description.
Definition: pp-cmdline.h:63
const char * restamp_min_th_help
Minimum latency of moving average to reach before starting to correct timestamps. (default=500) help ...
Definition: pp-cmdline.h:93
char * format_arg
Specifies the output format (overrides the format from the destination).
Definition: pp-cmdline.h:74
const char * faststart_help
For mp4 files write the MOOV atom at the head of the file help description.
Definition: pp-cmdline.h:78
unsigned int header_given
Whether header was given.
Definition: pp-cmdline.h:99
unsigned int ignore_first_given
Whether ignore-first was given.
Definition: pp-cmdline.h:103
char * audiolevel_ext_orig
ID of the audio-levels RTP extension (default=none) original value given at command line.
Definition: pp-cmdline.h:62
unsigned int debug_level_given
Whether debug-level was given.
Definition: cmdline.h:184
unsigned int help_given
Whether help was given.
Definition: cmdline.h:150
const char * extended_json_help
Only print extended JSON report (automatically enables –json) help description.
Definition: pp-cmdline.h:51
int silence_distance_arg
RTP packets distance used to detect RTP silence suppression, disabled if 0 (default=0).
Definition: pp-cmdline.h:82
char * metadata_arg
Save this metadata string in the target file.
Definition: pp-cmdline.h:52
unsigned int audiolevel_ext_given
Whether audiolevel-ext was given.
Definition: pp-cmdline.h:105
unsigned int payload_type_given
Whether payload-type was given.
Definition: pp-cmdline.h:104
char * metadata_orig
Save this metadata string in the target file original value given at command line.
Definition: pp-cmdline.h:53
int ignore_first_arg
Number of first packets to ignore when processing, e.g., in case they're cause of issues (default=0).
Definition: pp-cmdline.h:55
int file_extensions_flag
Only print the supported target file extensions per codec (default=off).
Definition: pp-cmdline.h:42
const char * restamp_help
If the latency of a packet is bigger than the moving_average_latency * (<restamp>/1000) the timestamp...
Definition: pp-cmdline.h:87
const char * debug_level_help
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4) help description.
Definition: cmdline.h:130
unsigned int version_given
Whether version was given.
Definition: cmdline.h:151
const char * version_help
Print version and exit help description.
Definition: cmdline.h:41
int audioskew_arg
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0).
Definition: pp-cmdline.h:79
unsigned int file_extensions_given
Whether file-extensions was given.
Definition: pp-cmdline.h:97
char * restamp_min_th_orig
Minimum latency of moving average to reach before starting to correct timestamps. (default=500) origi...
Definition: pp-cmdline.h:92
const char * parse_help
Only parse and re-order packets help description.
Definition: pp-cmdline.h:49
char * ignore_first_orig
Number of first packets to ignore when processing, e.g., in case they're cause of issues (default=0) ...
Definition: pp-cmdline.h:56
const char * silence_distance_help
RTP packets distance used to detect RTP silence suppression, disabled if 0 (default=0) help descripti...
Definition: pp-cmdline.h:84
char * videoorient_ext_orig
ID of the video-orientation RTP extension (default=none) original value given at command line.
Definition: pp-cmdline.h:65
char * restamp_orig
If the latency of a packet is bigger than the moving_average_latency * (<restamp>/1000) the timestamp...
Definition: pp-cmdline.h:86
unsigned int disable_colors_given
Whether disable-colors was given.
Definition: cmdline.h:186
unsigned int audioskew_given
Whether audioskew was given.
Definition: pp-cmdline.h:112
int json_flag
Only print JSON header (default=off).
Definition: pp-cmdline.h:44
const char * payload_type_help
Ignore all RTP packets that don't match the specified payload type (default=none) help description.
Definition: pp-cmdline.h:60
int debug_timestamps_flag
Enable debug/logging timestamps (default=off).
Definition: cmdline.h:131
char * silence_distance_orig
RTP packets distance used to detect RTP silence suppression, disabled if 0 (default=0) original value...
Definition: pp-cmdline.h:83