Fork me on GitHub
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
pp-cmdline.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include "postprocessing/pp-cmdline.h"
Include dependency graph for pp-cmdline.c:

Macros

#define FIX_UNUSED(X)   (void) (X) /* avoid warnings for unused params */
 

Enumerations

enum  cmdline_parser_arg_type {
  ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT ,
  ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT ,
  ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT
}
 

Functions

void cmdline_parser_print_version (void)
 
void cmdline_parser_print_help (void)
 
void cmdline_parser_init (struct gengetopt_args_info *args_info)
 
void cmdline_parser_params_init (struct cmdline_parser_params *params)
 
struct cmdline_parser_paramscmdline_parser_params_create (void)
 
int cmdline_parser_dump (FILE *outfile, struct gengetopt_args_info *args_info)
 
int cmdline_parser_file_save (const char *filename, struct gengetopt_args_info *args_info)
 
void cmdline_parser_free (struct gengetopt_args_info *args_info)
 
int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 
int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
 
int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 
int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 

Variables

const char * gengetopt_args_info_purpose = ""
 the purpose string of the program
 
const char * gengetopt_args_info_usage = "Usage: janus-pp-rec [OPTIONS] source.mjr\n[destination.[opus|ogg|mka|wav|webm|mkv|h264|srt]]"
 the usage string of the program
 
const char * gengetopt_args_info_versiontext = ""
 
const char * gengetopt_args_info_description = ""
 the description string of the program
 
const char * gengetopt_args_info_help []
 all the lines making the help output
 
const char * cmdline_parser_format_values [] = {"opus", "ogg", "mka", "wav", "webm", "mkv", "mp4", "srt", 0}
 Possible values for format.
 

Macro Definition Documentation

◆ FIX_UNUSED

#define FIX_UNUSED (   X)    (void) (X) /* avoid warnings for unused params */

Enumeration Type Documentation

◆ cmdline_parser_arg_type

Enumerator
ARG_NO 
ARG_FLAG 
ARG_STRING 
ARG_INT 
ARG_NO 
ARG_FLAG 
ARG_STRING 
ARG_INT 
ARG_NO 
ARG_FLAG 
ARG_STRING 
ARG_INT 

Function Documentation

◆ cmdline_parser()

int cmdline_parser ( int  argc,
char **  argv,
struct gengetopt_args_info args_info 
)

The command line parser

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser2()

int cmdline_parser2 ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
int  override,
int  initialize,
int  check_required 
)

The command line parser (version with additional parameters - deprecated)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
overridewhether to override possibly already present options
initializewhether to initialize the option structure my_args_info
check_requiredwhether to check that all required options were provided
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_dump()

int cmdline_parser_dump ( FILE *  outfile,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into an already open FILE stream.

Parameters
outfilethe stream where to dump options
args_infothe option struct to dump
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_ext()

int cmdline_parser_ext ( int  argc,
char **  argv,
struct gengetopt_args_info args_info,
struct cmdline_parser_params params 
)

The command line parser (version with additional parameters)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
paramsadditional parameters for the parser
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_file_save()

int cmdline_parser_file_save ( const char *  filename,
struct gengetopt_args_info args_info 
)

Save the contents of the option struct into a (text) file. This file can be read by the config file parser (if generated by gengetopt)

Parameters
filenamethe file where to save
args_infothe option struct to save
Returns
0 if everything went fine, NON 0 if an error took place

◆ cmdline_parser_free()

void cmdline_parser_free ( struct gengetopt_args_info args_info)

Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the structure itself)

Parameters
args_infothe structure to deallocate

◆ cmdline_parser_init()

void cmdline_parser_init ( struct gengetopt_args_info args_info)

Initializes the passed gengetopt_args_info structure's fields (also set default values for options that have a default)

Parameters
args_infothe structure to initialize

◆ cmdline_parser_params_create()

struct cmdline_parser_params * cmdline_parser_params_create ( void  )

Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their default values

Returns
the created and initialized cmdline_parser_params structure

◆ cmdline_parser_params_init()

void cmdline_parser_params_init ( struct cmdline_parser_params params)

Initializes all the fields a cmdline_parser_params structure to their default values

Parameters
paramsthe structure to initialize

◆ cmdline_parser_print_help()

void cmdline_parser_print_help ( void  )

Print the help

◆ cmdline_parser_print_version()

void cmdline_parser_print_version ( void  )

Print the version

◆ cmdline_parser_required()

int cmdline_parser_required ( struct gengetopt_args_info args_info,
const char *  prog_name 
)

Checks that all the required options were specified

Parameters
args_infothe structure to check
prog_namethe name of the program that will be used to print possible errors
Returns

Variable Documentation

◆ cmdline_parser_format_values

const char* cmdline_parser_format_values[] = {"opus", "ogg", "mka", "wav", "webm", "mkv", "mp4", "srt", 0}

Possible values for format.

◆ gengetopt_args_info_description

const char* gengetopt_args_info_description = ""

the description string of the program

◆ gengetopt_args_info_help

const char* gengetopt_args_info_help[]
Initial value:
= {
" -h, --help Print help and exit",
" -V, --version Print version and exit",
" -F, --file-extensions Only print the supported target file extensions\n per codec (default=off)",
" -j, --json Only print JSON header (default=off)",
" -H, --header Only parse .mjr header (default=off)",
" -p, --parse Only parse and re-order packets (default=off)",
" -e, --extended-json Only print extended JSON report (automatically\n enables --json) (default=off)",
" -m, --metadata=metadata Save this metadata string in the target file",
" -i, --ignore-first=count Number of first packets to ignore when\n processing, e.g., in case they're cause of\n issues (default=0)",
" -P, --payload-type=pt Ignore all RTP packets that don't match the\n specified payload type (default=none)",
" -a, --audiolevel-ext=id ID of the audio-levels RTP extension\n (default=none)",
" -v, --videoorient-ext=id ID of the video-orientation RTP extension\n (default=none)",
" -d, --debug-level=1-7 Debug/logging level (0=disable debugging,\n 7=maximum debug level; default=4)",
" -D, --debug-timestamps Enable debug/logging timestamps (default=off)",
" -o, --disable-colors Disable color in the logging (default=off)",
" -f, --format=STRING Specifies the output format (overrides the\n format from the destination) (possible\n values=\"opus\", \"ogg\", \"mka\", \"wav\",\n \"webm\", \"mkv\", \"mp4\", \"srt\")",
" -t, --faststart For mp4 files write the MOOV atom at the head\n of the file (default=off)",
" -S, --audioskew=milliseconds Time threshold to trigger an audio skew\n compensation, disabled if 0 (default=0)",
" -C, --silence-distance=count RTP packets distance used to detect RTP silence\n suppression, disabled if 0 (default=0)",
" -r, --restamp=count If the latency of a packet is bigger than the\n `moving_average_latency * (<restamp>/1000)`\n the timestamps will be corrected, disabled if\n 0 (default=0)",
" -c, --restamp-packets=count Number of packets used for calculating moving\n average latency for timestamp correction\n (default=10)",
" -n, --restamp-min-th=milliseconds\n Minimum latency of moving average to reach\n before starting to correct timestamps.\n (default=500)",
0
}

all the lines making the help output

◆ gengetopt_args_info_purpose

const char* gengetopt_args_info_purpose = ""

the purpose string of the program

◆ gengetopt_args_info_usage

const char* gengetopt_args_info_usage = "Usage: janus-pp-rec [OPTIONS] source.mjr\n[destination.[opus|ogg|mka|wav|webm|mkv|h264|srt]]"

the usage string of the program

◆ gengetopt_args_info_versiontext

const char* gengetopt_args_info_versiontext = ""