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
23 
24 #define CMDLINE_PARSER_PACKAGE "janus-pp-rec"
25 #endif
26 
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28 
29 #define CMDLINE_PARSER_PACKAGE_NAME "janus-pp-rec"
30 #endif
31 
32 #ifndef CMDLINE_PARSER_VERSION
33 
34 #define CMDLINE_PARSER_VERSION "0.9.5"
35 #endif
36 
39 {
40  const char *help_help;
41  const char *version_help;
42  int json_flag;
43  const char *json_help;
45  const char *header_help;
46  int parse_flag;
47  const char *parse_help;
48  char * metadata_arg;
49  char * metadata_orig;
50  const char *metadata_help;
53  const char *postreset_trigger_help;
56  const char *ignore_first_help;
59  const char *audiolevel_ext_help;
62  const char *videoorient_ext_help;
65  const char *debug_level_help;
67  const char *debug_timestamps_help;
69  const char *disable_colors_help;
70  char * format_arg;
71  char * format_orig;
72  const char *format_help;
74  const char *faststart_help;
76  char * audioskew_orig;
77  const char *audioskew_help;
79  unsigned int help_given ;
80  unsigned int version_given ;
81  unsigned int json_given ;
82  unsigned int header_given ;
83  unsigned int parse_given ;
84  unsigned int metadata_given ;
85  unsigned int postreset_trigger_given ;
86  unsigned int ignore_first_given ;
87  unsigned int audiolevel_ext_given ;
88  unsigned int videoorient_ext_given ;
89  unsigned int debug_level_given ;
90  unsigned int debug_timestamps_given ;
91  unsigned int disable_colors_given ;
92  unsigned int format_given ;
93  unsigned int faststart_given ;
94  unsigned int audioskew_given ;
96 } ;
97 
100 {
101  int override;
102  int initialize;
103  int check_required;
104  int check_ambiguity;
105  int print_errors;
106 } ;
107 
109 extern const char *gengetopt_args_info_purpose;
111 extern const char *gengetopt_args_info_usage;
113 extern const char *gengetopt_args_info_description;
115 extern const char *gengetopt_args_info_help[];
116 
124 int cmdline_parser (int argc, char **argv,
125  struct gengetopt_args_info *args_info);
126 
138 int cmdline_parser2 (int argc, char **argv,
139  struct gengetopt_args_info *args_info,
140  int override, int initialize, int check_required);
141 
150 int cmdline_parser_ext (int argc, char **argv,
151  struct gengetopt_args_info *args_info,
152  struct cmdline_parser_params *params);
153 
160 int cmdline_parser_dump(FILE *outfile,
161  struct gengetopt_args_info *args_info);
162 
170 int cmdline_parser_file_save(const char *filename,
171  struct gengetopt_args_info *args_info);
172 
176 void cmdline_parser_print_help(void);
181 
188 
195 
201 void cmdline_parser_init (struct gengetopt_args_info *args_info);
207 void cmdline_parser_free (struct gengetopt_args_info *args_info);
208 
216 int cmdline_parser_required (struct gengetopt_args_info *args_info,
217  const char *prog_name);
218 
219 extern const char *cmdline_parser_format_values[];
222 #ifdef __cplusplus
223 }
224 #endif /* __cplusplus */
225 #endif /* PP_CMDLINE_H */
cmdline_parser_ext
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
Definition: p2m-cmdline.c:283
gengetopt_args_info::help_given
unsigned int help_given
Whether help was given.
Definition: p2m-cmdline.h:51
gengetopt_args_info::debug_timestamps_flag
int debug_timestamps_flag
Enable debug/logging timestamps (default=off).
Definition: pp-cmdline.h:66
gengetopt_args_info::audioskew_orig
char * audioskew_orig
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0) original value given ...
Definition: pp-cmdline.h:76
gengetopt_args_info::videoorient_ext_help
const char * videoorient_ext_help
ID of the video-orientation RTP extension (default=none) help description.
Definition: pp-cmdline.h:62
gengetopt_args_info::header_help
const char * header_help
Only parse .mjr header help description.
Definition: pp-cmdline.h:45
gengetopt_args_info::audiolevel_ext_help
const char * audiolevel_ext_help
ID of the audio-levels RTP extension (default=none) help description.
Definition: pp-cmdline.h:59
cmdline_parser2
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
Definition: p2m-cmdline.c:299
gengetopt_args_info::ignore_first_orig
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:55
gengetopt_args_info::videoorient_ext_orig
char * videoorient_ext_orig
ID of the video-orientation RTP extension (default=none) original value given at command line.
Definition: pp-cmdline.h:61
gengetopt_args_info::videoorient_ext_arg
int videoorient_ext_arg
ID of the video-orientation RTP extension (default=none).
Definition: pp-cmdline.h:60
gengetopt_args_info::debug_level_help
const char * debug_level_help
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4) help description.
Definition: pp-cmdline.h:65
gengetopt_args_info::postreset_trigger_orig
char * postreset_trigger_orig
Number of packets needed to detect a timestamp reset (default=200) original value given at command li...
Definition: pp-cmdline.h:52
gengetopt_args_info::faststart_help
const char * faststart_help
For mp4 files write the MOOV atom at the head of the file help description.
Definition: pp-cmdline.h:74
cmdline_parser_params_create
struct cmdline_parser_params * cmdline_parser_params_create(void)
Definition: p2m-cmdline.c:163
gengetopt_args_info::metadata_orig
char * metadata_orig
Save this metadata string in the target file original value given at command line.
Definition: pp-cmdline.h:49
gengetopt_args_info::header_given
unsigned int header_given
Whether header was given.
Definition: pp-cmdline.h:82
gengetopt_args_info::parse_help
const char * parse_help
Only parse and re-order packets help description.
Definition: pp-cmdline.h:47
gengetopt_args_info::parse_given
unsigned int parse_given
Whether parse was given.
Definition: pp-cmdline.h:83
gengetopt_args_info::audioskew_given
unsigned int audioskew_given
Whether audioskew was given.
Definition: pp-cmdline.h:94
gengetopt_args_info::format_orig
char * format_orig
Specifies the output format (overrides the format from the destination) original value given at comma...
Definition: pp-cmdline.h:71
gengetopt_args_info::version_given
unsigned int version_given
Whether version was given.
Definition: p2m-cmdline.h:52
gengetopt_args_info::disable_colors_help
const char * disable_colors_help
Disable color in the logging help description.
Definition: pp-cmdline.h:69
cmdline_parser_print_help
void cmdline_parser_print_help(void)
Definition: p2m-cmdline.c:133
gengetopt_args_info::json_help
const char * json_help
Only print JSON header help description.
Definition: pp-cmdline.h:43
gengetopt_args_info::header_flag
int header_flag
Only parse .mjr header (default=off).
Definition: pp-cmdline.h:44
gengetopt_args_info::faststart_flag
int faststart_flag
For mp4 files write the MOOV atom at the head of the file (default=off).
Definition: pp-cmdline.h:73
gengetopt_args_info::debug_timestamps_help
const char * debug_timestamps_help
Enable debug/logging timestamps help description.
Definition: pp-cmdline.h:67
gengetopt_args_info::postreset_trigger_help
const char * postreset_trigger_help
Number of packets needed to detect a timestamp reset (default=200) help description.
Definition: pp-cmdline.h:53
gengetopt_args_info::disable_colors_given
unsigned int disable_colors_given
Whether disable-colors was given.
Definition: pp-cmdline.h:91
gengetopt_args_info::metadata_arg
char * metadata_arg
Save this metadata string in the target file.
Definition: pp-cmdline.h:48
gengetopt_args_info::metadata_help
const char * metadata_help
Save this metadata string in the target file help description.
Definition: pp-cmdline.h:50
gengetopt_args_info_help
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: p2m-cmdline.c:36
gengetopt_args_info::ignore_first_arg
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:54
gengetopt_args_info::postreset_trigger_given
unsigned int postreset_trigger_given
Whether postreset-trigger was given.
Definition: pp-cmdline.h:85
gengetopt_args_info::audioskew_help
const char * audioskew_help
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0) help description.
Definition: pp-cmdline.h:77
cmdline_parser_dump
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Definition: p2m-cmdline.c:209
gengetopt_args_info::faststart_given
unsigned int faststart_given
Whether faststart was given.
Definition: pp-cmdline.h:93
gengetopt_args_info::debug_level_given
unsigned int debug_level_given
Whether debug-level was given.
Definition: pp-cmdline.h:89
gengetopt_args_info::ignore_first_help
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:56
gengetopt_args_info::parse_flag
int parse_flag
Only parse and re-order packets (default=off).
Definition: pp-cmdline.h:46
gengetopt_args_info::json_flag
int json_flag
Only print JSON header (default=off).
Definition: pp-cmdline.h:42
gengetopt_args_info::version_help
const char * version_help
Print version and exit help description.
Definition: p2m-cmdline.h:41
gengetopt_args_info::audioskew_arg
int audioskew_arg
Time threshold to trigger an audio skew compensation, disabled if 0 (default=0).
Definition: pp-cmdline.h:75
cmdline_parser_format_values
const char * cmdline_parser_format_values[]
Possible values for format.
Definition: pp-cmdline.c:72
cmdline_parser_free
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Definition: p2m-cmdline.c:256
gengetopt_args_info::debug_timestamps_given
unsigned int debug_timestamps_given
Whether debug-timestamps was given.
Definition: pp-cmdline.h:90
cmdline_parser_params::check_ambiguity
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: p2m-cmdline.h:65
cmdline_parser_print_version
void cmdline_parser_print_version(void)
Definition: p2m-cmdline.c:101
gengetopt_args_info::format_help
const char * format_help
Specifies the output format (overrides the format from the destination) help description.
Definition: pp-cmdline.h:72
gengetopt_args_info::videoorient_ext_given
unsigned int videoorient_ext_given
Whether videoorient-ext was given.
Definition: pp-cmdline.h:88
cmdline_parser_params_init
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Definition: p2m-cmdline.c:150
gengetopt_args_info::postreset_trigger_arg
int postreset_trigger_arg
Number of packets needed to detect a timestamp reset (default=200).
Definition: pp-cmdline.h:51
gengetopt_args_info::format_arg
char * format_arg
Specifies the output format (overrides the format from the destination).
Definition: pp-cmdline.h:70
gengetopt_args_info::audiolevel_ext_arg
int audiolevel_ext_arg
ID of the audio-levels RTP extension (default=none).
Definition: pp-cmdline.h:57
cmdline_parser_params::print_errors
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: p2m-cmdline.h:66
gengetopt_args_info::metadata_given
unsigned int metadata_given
Whether metadata was given.
Definition: pp-cmdline.h:84
cmdline_parser_file_save
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Definition: p2m-cmdline.c:236
cmdline_parser
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: p2m-cmdline.c:277
gengetopt_args_info_usage
const char * gengetopt_args_info_usage
the usage string of the program
Definition: p2m-cmdline.c:30
cmdline_parser_required
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Definition: p2m-cmdline.c:322
gengetopt_args_info::audiolevel_ext_orig
char * audiolevel_ext_orig
ID of the audio-levels RTP extension (default=none) original value given at command line.
Definition: pp-cmdline.h:58
gengetopt_args_info
Where the command line options are stored.
Definition: p2m-cmdline.h:38
config.h
Configuration files parsing (headers)
gengetopt_args_info_description
const char * gengetopt_args_info_description
the description string of the program
Definition: p2m-cmdline.c:34
gengetopt_args_info::json_given
unsigned int json_given
Whether json was given.
Definition: pp-cmdline.h:81
gengetopt_args_info::disable_colors_flag
int disable_colors_flag
Disable color in the logging (default=off).
Definition: pp-cmdline.h:68
cmdline_parser_params
The additional parameters to pass to parser functions.
Definition: p2m-cmdline.h:60
gengetopt_args_info::ignore_first_given
unsigned int ignore_first_given
Whether ignore-first was given.
Definition: pp-cmdline.h:86
gengetopt_args_info::format_given
unsigned int format_given
Whether format was given.
Definition: pp-cmdline.h:92
gengetopt_args_info_purpose
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: p2m-cmdline.c:28
gengetopt_args_info::help_help
const char * help_help
Print help and exit help description.
Definition: p2m-cmdline.h:40
cmdline_parser_params::initialize
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: p2m-cmdline.h:63
gengetopt_args_info::debug_level_arg
int debug_level_arg
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4).
Definition: pp-cmdline.h:63
cmdline_parser_init
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Definition: p2m-cmdline.c:142
cmdline_parser_params::check_required
int check_required
whether to check that all required options were provided (default 1)
Definition: p2m-cmdline.h:64
gengetopt_args_info::audiolevel_ext_given
unsigned int audiolevel_ext_given
Whether audiolevel-ext was given.
Definition: pp-cmdline.h:87
gengetopt_args_info::debug_level_orig
char * debug_level_orig
Debug/logging level (0=disable debugging, 7=maximum debug level; default=4) original value given at c...
Definition: pp-cmdline.h:64