[MPlayer-cvslog] CVS: main m_option.c, 1.34, 1.35 m_option.h, 1.10, 1.11
Alex Beregszaszi
syncmail at mplayerhq.hu
Mon Dec 27 18:32:57 CET 2004
- Previous message: [MPlayer-cvslog] CVS: main/libao2 Makefile, 1.31, 1.32 ao_alsa.c, 1.10, 1.11 ao_alsa5.c, 1.20, 1.21 ao_arts.c, 1.9, 1.10 ao_dsound.c, 1.5, 1.6 ao_dxr2.c, 1.8, 1.9 ao_esd.c, 1.9, 1.10 ao_jack.c, 1.5, 1.6 ao_macosx.c, 1.6, 1.7 ao_mpegpes.c, 1.21, 1.22 ao_nas.c, 1.16, 1.17 ao_null.c, 1.12, 1.13 ao_oss.c, 1.45, 1.46 ao_pcm.c, 1.22, 1.23 ao_plugin.c, 1.26, 1.27 ao_polyp.c, 1.3, 1.4 ao_sdl.c, 1.38, 1.39 ao_win32.c, 1.18, 1.19 audio_out.c, 1.45, 1.46 audio_plugin.h, 1.13, 1.14 pl_delay.c, 1.8, 1.9 pl_eq.c, 1.8, 1.9 pl_extrastereo.c, 1.5, 1.6 pl_format.c, 1.8, 1.9 pl_resample.c, 1.13, 1.14 pl_surround.c, 1.14, 1.15 pl_volnorm.c, 1.7, 1.8 pl_volume.c, 1.4, 1.5 afmt.h, 1.9, NONE afmt.c, 1.8, NONE
- Next message: [MPlayer-cvslog] CVS: main/libao2 ao_sun.c,1.30,1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
CVS change done by Alex Beregszaszi
Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv22437
Modified Files:
m_option.c m_option.h
Log Message:
CONF_TYPE_AFMT similar to CONF_TYPE_IMGFMT
Index: m_option.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- m_option.c 1 Dec 2004 23:24:25 -0000 1.34
+++ m_option.c 27 Dec 2004 17:32:54 -0000 1.35
@@ -1041,6 +1041,95 @@
NULL
};
+#include "libaf/af_format.h"
+
+/* FIXME: snyc with af_format.h */
+static struct {
+ char* name;
+ unsigned int fmt;
+} mp_afmt_list[] = {
+ // SPECIAL
+ {"mulaw", AF_FORMAT_MU_LAW},
+ {"alaw", AF_FORMAT_A_LAW},
+ {"mpeg2", AF_FORMAT_MPEG2},
+ {"ac3", AF_FORMAT_AC3},
+ {"imaadpcm", AF_FORMAT_IMA_ADPCM},
+ // ORIDNARY
+ {"u8", AF_FORMAT_U8},
+ {"s8", AF_FORMAT_S8},
+ {"u16le", AF_FORMAT_U16_LE},
+ {"u16be", AF_FORMAT_U16_BE},
+ {"u16ne", AF_FORMAT_U16_NE},
+ {"s16le", AF_FORMAT_S16_LE},
+ {"s16be", AF_FORMAT_S16_BE},
+ {"s16ne", AF_FORMAT_S16_NE},
+ {"u24le", AF_FORMAT_U24_LE},
+ {"u24be", AF_FORMAT_U24_BE},
+ {"u24ne", AF_FORMAT_U24_NE},
+ {"s24le", AF_FORMAT_S24_LE},
+ {"s24be", AF_FORMAT_S24_BE},
+ {"s24ne", AF_FORMAT_S24_NE},
+ {"u32le", AF_FORMAT_U32_LE},
+ {"u32be", AF_FORMAT_U32_BE},
+ {"u32ne", AF_FORMAT_U32_NE},
+ {"s32le", AF_FORMAT_S32_LE},
+ {"s32be", AF_FORMAT_S32_BE},
+ {"s32ne", AF_FORMAT_S32_NE},
+ {"floatle", AF_FORMAT_FLOAT_LE},
+ {"floatbe", AF_FORMAT_FLOAT_BE},
+ {"floatne", AF_FORMAT_FLOAT_NE},
+ { NULL, 0 }
+};
+
+static int parse_afmt(m_option_t* opt,char *name, char *param, void* dst, int src) {
+ uint32_t fmt = 0;
+ int i;
+
+ if (param == NULL || strlen(param) == 0)
+ return M_OPT_MISSING_PARAM;
+
+ if(!strcmp(param,"help")) {
+ mp_msg(MSGT_CFGPARSER, MSGL_INFO, "Available formats:");
+ for(i = 0 ; mp_afmt_list[i].name ; i++)
+ mp_msg(MSGT_CFGPARSER, MSGL_INFO, " %s",mp_afmt_list[i].name);
+ mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\n");
+ return M_OPT_EXIT;
+ }
+
+ if (sscanf(param, "0x%x", &fmt) != 1)
+ {
+ for(i = 0 ; mp_afmt_list[i].name ; i++) {
+ if(!strcasecmp(param,mp_afmt_list[i].name)) {
+ fmt=mp_afmt_list[i].fmt;
+ break;
+ }
+ }
+ if(!mp_afmt_list[i].name) {
+ mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: unknown format name: '%s'\n",name,param);
+ return M_OPT_INVALID;
+ }
+ }
+
+ if(dst)
+ *((uint32_t*)dst) = fmt;
+
+ return 1;
+}
+
+m_option_type_t m_option_type_afmt = {
+ "Audio format",
+ "Please report any missing formats.",
+ sizeof(uint32_t),
+ 0,
+ parse_afmt,
+ NULL,
+ copy_opt,
+ copy_opt,
+ NULL,
+ NULL
+};
+
+
//// Objects (i.e. filters, etc) settings
#include "m_struct.h"
Index: m_option.h
===================================================================
RCS file: /cvsroot/mplayer/main/m_option.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- m_option.h 10 Feb 2004 14:32:06 -0000 1.10
+++ m_option.h 27 Dec 2004 17:32:54 -0000 1.11
@@ -20,6 +20,7 @@
extern m_option_type_t m_option_type_print_indirect;
extern m_option_type_t m_option_type_subconfig;
extern m_option_type_t m_option_type_imgfmt;
+extern m_option_type_t m_option_type_afmt;
// Func based types
extern m_option_type_t m_option_type_func_full;
@@ -90,6 +91,7 @@
#define CONF_TYPE_STRING_LIST (&m_option_type_string_list)
#define CONF_TYPE_POSITION (&m_option_type_position)
#define CONF_TYPE_IMGFMT (&m_option_type_imgfmt)
+#define CONF_TYPE_AFMT (&m_option_type_afmt)
#define CONF_TYPE_SPAN (&m_option_type_span)
#define CONF_TYPE_OBJ_SETTINGS_LIST (&m_option_type_obj_settings_list)
#define CONF_TYPE_OBJ_PRESETS (&m_option_type_obj_presets)
- Previous message: [MPlayer-cvslog] CVS: main/libao2 Makefile, 1.31, 1.32 ao_alsa.c, 1.10, 1.11 ao_alsa5.c, 1.20, 1.21 ao_arts.c, 1.9, 1.10 ao_dsound.c, 1.5, 1.6 ao_dxr2.c, 1.8, 1.9 ao_esd.c, 1.9, 1.10 ao_jack.c, 1.5, 1.6 ao_macosx.c, 1.6, 1.7 ao_mpegpes.c, 1.21, 1.22 ao_nas.c, 1.16, 1.17 ao_null.c, 1.12, 1.13 ao_oss.c, 1.45, 1.46 ao_pcm.c, 1.22, 1.23 ao_plugin.c, 1.26, 1.27 ao_polyp.c, 1.3, 1.4 ao_sdl.c, 1.38, 1.39 ao_win32.c, 1.18, 1.19 audio_out.c, 1.45, 1.46 audio_plugin.h, 1.13, 1.14 pl_delay.c, 1.8, 1.9 pl_eq.c, 1.8, 1.9 pl_extrastereo.c, 1.5, 1.6 pl_format.c, 1.8, 1.9 pl_resample.c, 1.13, 1.14 pl_surround.c, 1.14, 1.15 pl_volnorm.c, 1.7, 1.8 pl_volume.c, 1.4, 1.5 afmt.h, 1.9, NONE afmt.c, 1.8, NONE
- Next message: [MPlayer-cvslog] CVS: main/libao2 ao_sun.c,1.30,1.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list