Mercurial > mplayer.hg
changeset 13247:933b45ad31d5
Removal of -jpeg commandline option.
It's replaced by an options parser in the module itself. Instead of
mplayer -vo jpeg -jpeg options one now has to use mplayer -vo jpeg:options.
author | ivo |
---|---|
date | Sat, 04 Sep 2004 22:59:33 +0000 |
parents | 5dea9e3618ba |
children | 80d80d449057 |
files | DOCS/man/en/mplayer.1 cfg-mplayer.h help/help_mp-en.h libvo/vo_jpeg.c |
diffstat | 4 files changed, 225 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1 Sat Sep 04 15:34:20 2004 +0000 +++ b/DOCS/man/en/mplayer.1 Sat Sep 04 22:59:33 2004 +0000 @@ -2074,39 +2074,6 @@ Not supported by all video output drivers. . .TP -.B \-jpeg <option1:option2:...> (\-vo jpeg only) -Specify options for the jpeg video output driver. -.sp 1 -Available options are: -.sp 1 -.PD 0 -.RSs -.IPs [no]progressive -Specify standard or progressive JPEG (default: noprogressive). -.IPs [no]baseline -Specify use of baseline or not (default: baseline). -.IPs optimize=<0\-100> -optimization factor (default: 100) -.IPs smooth=<0\-100> -smooth factor (default: 0) -.IPs quality=<0\-100> -quality factor (default: 75) -.IPs outdir=<value> -Specify the directory to save the JPEG files to. -If not specified, all JPEG files are written to the current directory. -.IPs subdirs=<value> -If specified, MPlayer will create numbered subdirectories with the -specified prefix. -If it's not specified, no subdirectories are created -and all JPEG files are written to the same directory. -.IPs maxfiles=<value> -Maximum number of JPEG files to be saved per subdirectory in case subdirs -is specified. -Must be equal to or larger than 1 (default: 1000). -.RE -.PD 1 -. -.TP .B \-monitor-dotclock <range[,range,...]> (\-vo fbdev and vesa only) Specify the dotclock or pixelclock range of the monitor. . @@ -2724,6 +2691,32 @@ .B jpeg\ \ \ Output each frame into a JPEG file in the current directory. Each file takes the frame number padded with leading zeros as name. +.PD 0 +.RSs +.IPs [no]progressive +Specify standard or progressive JPEG (default: noprogressive). +.IPs [no]baseline +Specify use of baseline or not (default: baseline). +.IPs optimize=<0\-100> +optimization factor (default: 100) +.IPs smooth=<0\-100> +smooth factor (default: 0) +.IPs quality=<0\-100> +quality factor (default: 75) +.IPs outdir=<value> +Specify the directory to save the JPEG files to. +If not specified, all JPEG files are written to the current directory. +.IPs subdirs=<value> +If specified, MPlayer will create numbered subdirectories with the +specified prefix. +If it's not specified, no subdirectories are created +and all JPEG files are written to the same directory. +.IPs maxfiles=<value> +Maximum number of JPEG files to be saved per subdirectory in case subdirs +is specified. +Must be equal to or larger than 1 (default: 1000). +.RE +.PD 1 . .TP .B pgm\ \ \ \
--- a/cfg-mplayer.h Sat Sep 04 15:34:20 2004 +0000 +++ b/cfg-mplayer.h Sat Sep 04 22:59:33 2004 +0000 @@ -29,16 +29,6 @@ #ifdef HAVE_PNG extern int z_compression; #endif -#ifdef HAVE_JPEG -extern int jpeg_baseline; -extern int jpeg_progressive_mode; -extern int jpeg_optimize; -extern int jpeg_smooth; -extern int jpeg_quality; -extern char * jpeg_outdir; -extern char * jpeg_subdirs; -extern int jpeg_maxfiles; -#endif #ifdef HAVE_SDL //extern char *sdl_driver; extern int sdl_noxv; @@ -144,22 +134,6 @@ {NULL, NULL, 0, 0, 0, 0, NULL} }; -#ifdef HAVE_JPEG -m_option_t jpeg_conf[]={ - {"progressive", &jpeg_progressive_mode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noprogressive", &jpeg_progressive_mode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"baseline", &jpeg_baseline, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nobaseline", &jpeg_baseline, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"optimize", &jpeg_optimize, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - {"smooth", &jpeg_smooth, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - {"quality", &jpeg_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - {"outdir", &jpeg_outdir, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"subdirs", &jpeg_subdirs, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"maxfiles", &jpeg_maxfiles, CONF_TYPE_INT, CONF_MIN, 1, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} -}; -#endif - extern int sws_flags; extern int readPPOpt(void *conf, char *arg); extern void revertPPOpt(void *conf, char* opt); @@ -228,7 +202,8 @@ #endif // -vo jpeg only: #ifdef HAVE_JPEG - {"jpeg", jpeg_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL}, + {"jpeg", "-jpeg is deprecated. Use -vo jpeg:options instead.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif // -vo sdl only: #ifdef HAVE_SDL
--- a/help/help_mp-en.h Sat Sep 04 15:34:20 2004 +0000 +++ b/help/help_mp-en.h Sat Sep 04 22:59:33 2004 +0000 @@ -758,4 +758,13 @@ #define MSGTR_VO_JPEG_DirExistsAndIsWritable "Output directory already exists and is writable." #define MSGTR_VO_JPEG_CantCreateDirectory "Unable to create ouput directory." #define MSGTR_VO_JPEG_DirectoryCreateSuccess "Output directory successfully created." +#define MSGTR_VO_JPEG_ParsingSuboptions "Parsing suboptions." +#define MSGTR_VO_JPEG_SuboptionsParsedOK "Suboptions parsed OK." +#define MSGTR_VO_JPEG_ProgressiveJPEG "Progressive JPEG enabled." +#define MSGTR_VO_JPEG_NoProgressiveJPEG "Progressive JPEG disabled." +#define MSGTR_VO_JPEG_BaselineJPEG "Baseline JPEG enabled." +#define MSGTR_VO_JPEG_NoBaselineJPEG "Baseline JPEG disabled." +#define MSGTR_VO_JPEG_ValueOutOfRange "Value out of range" +#define MSGTR_VO_JPEG_NoValueSpecified "No value specified." +#define MSGTR_VO_JPEG_UnknownOptions "Unknown option(s)"
--- a/libvo/vo_jpeg.c Sat Sep 04 15:34:20 2004 +0000 +++ b/libvo/vo_jpeg.c Sat Sep 04 22:59:33 2004 +0000 @@ -25,6 +25,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> +#include <math.h> /* for log10() */ /* ------------------------------------------------------------------------- */ @@ -305,6 +306,193 @@ static uint32_t preinit(const char *arg) { + char *buf; /* buf is used to store parsed string values */ + int length; /* length is used when calculating the length of buf */ + int value; /* storage for parsed integer values */ + + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_ParsingSuboptions); + + if (arg) { + + while (*arg != '\0') { + if (!strncmp(arg, ":", 1)) { + arg++; + continue; /* multiple ':' is not really an error */ + } if (!strncmp(arg, "progressive", 11)) { + arg += 11; + jpeg_progressive_mode = 1; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_ProgressiveJPEG); + } else if (!strncmp(arg, "noprogressive", 13)) { + arg += 13; + jpeg_progressive_mode = 0; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_NoProgressiveJPEG); + } else if (!strncmp(arg, "baseline", 8)) { + arg += 8; + jpeg_baseline = 1; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_BaselineJPEG); + } else if (!strncmp(arg, "nobaseline", 10)) { + arg += 10; + jpeg_baseline = 0; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_NoBaselineJPEG); + } else if (!strncmp(arg, "optimize=", 9)) { + arg += 9; + if (sscanf(arg, "%d", &value) == 1) { + if ( (value < 0 ) || (value > 100) ) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s %s.\n", + info.short_name, "optimize", + MSGTR_VO_JPEG_ValueOutOfRange, "[0-100]"); + exit_player(MSGTR_Exit_error); + } else { + jpeg_optimize = value; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %d\n", + info.short_name, "optimize", value); + } + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "optimize", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + /* only here if value is set and sane */ + if (value) { + arg += (int)log10(value) + 1; + } else { + arg++; /* log10(0) fails */ + } + } else if (!strncmp(arg, "smooth=", 7)) { + arg += 7; + if (sscanf(arg, "%d", &value) == 1 ) { + if ( (value < 0) || (value > 100) ) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s %s.\n", + info.short_name, "smooth", + MSGTR_VO_JPEG_ValueOutOfRange, "[0-100]"); + exit_player(MSGTR_Exit_error); + } else { + jpeg_smooth = value; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %d\n", + info.short_name, "smooth", value); + } + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "smooth", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + /* only here if value is set and sane */ + if (value) { + arg += (int)log10(value) + 1; + } else { + arg++; /* log10(0) fails */ + } + } else if (!strncmp(arg, "quality=", 8)) { + arg += 8; + if (sscanf(arg, "%d", &value) == 1) { + if ( (value < 0) || (value > 100) ) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s %s.\n", + info.short_name, "quality", + MSGTR_VO_JPEG_ValueOutOfRange, "[0-100]"); + exit_player(MSGTR_Exit_error); + } else { + jpeg_quality = value; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %d\n", + info.short_name, "quality", value); + } + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "quality", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + /* only here if value is set and sane */ + if (value) { + arg += (int)log10(value) + 1; + } else { + arg++; /* log10(0) fails */ + } + } else if (!strncmp(arg, "outdir=", 7)) { + arg += 7; + buf = malloc(strlen(arg)+1); /* maximum length possible */ + if (!buf) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s\n", info.short_name, + MSGTR_MemAllocFailed); + exit_player(MSGTR_Exit_error); + } + if (sscanf(arg, "%[^:]", buf) == 1) { + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %s\n", + info.short_name, "outdir", buf); + length = strlen(buf); + arg += length; + jpeg_outdir = malloc(length+1); + strncpy(jpeg_outdir, buf, length+1); + free(buf); + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "outdir", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + } else if (!strncmp(arg, "subdirs=", 8)) { + arg += 8; + buf = malloc(strlen(arg)+1); /* maximum length possible */ + if (!buf) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s\n", info.short_name, + MSGTR_MemAllocFailed); + exit_player(MSGTR_Exit_error); + } + if (sscanf(arg, "%[^:]", buf) == 1) { + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %s\n", + info.short_name, "subdirs", buf); + length = strlen(buf); + arg += length; + jpeg_subdirs = malloc(length+1); + strncpy(jpeg_subdirs, buf, length+1); + free(buf); + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "subdirs", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + } else if (!strncmp(arg, "maxfiles=", 9)) { + arg += 9; + if (sscanf(arg, "%d", &value) == 1) { + if (value < 1) { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s %s.\n", + info.short_name, "maxfiles", + MSGTR_VO_JPEG_ValueOutOfRange, ">=1"); + exit_player(MSGTR_Exit_error); + } else { + jpeg_maxfiles = value; + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s --> %d\n", + info.short_name, "maxfiles", value); + } + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s - %s\n", + info.short_name, "maxfiles", + MSGTR_VO_JPEG_NoValueSpecified); + exit_player(MSGTR_Exit_error); + } + /* only here if value is set and sane */ + if (value) { + arg += (int)log10(value) + 1; + } else { + arg++; /* log10(0) fails */ + } + } else { + mp_msg(MSGT_VO, MSGL_ERR, "%s: %s %-20s...\n", info.short_name, + MSGTR_VO_JPEG_UnknownOptions, arg); + exit_player(MSGTR_Exit_error); + } + } /* end while */ + } /* endif */ + + mp_msg(MSGT_VO, MSGL_INFO, "%s: %s\n", info.short_name, + MSGTR_VO_JPEG_SuboptionsParsedOK); return 0; }