changeset 6083:6aa4fc282fc7

added support for codec selection
author alex
date Mon, 13 May 2002 21:18:52 +0000
parents 03a4d9bb2650
children b34f4ef001f0
files libmpcodecs/ve_vfw.c
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_vfw.c	Mon May 13 21:09:03 2002 +0000
+++ b/libmpcodecs/ve_vfw.c	Mon May 13 21:18:52 2002 +0000
@@ -22,6 +22,15 @@
 
 #include "dll_init.h"
 
+static char *vfw_param_codec = NULL;
+
+#include "cfgparser.h"
+
+struct config vfwopts_conf[]={
+    {"codec", &vfw_param_codec, CONF_TYPE_STRING, 0, 0, 0, NULL},
+    {NULL, NULL, 0, 0, 0, 0, NULL}
+};
+
 struct vf_priv_s {
     aviwrite_stream_t* mux;
     BITMAPINFOHEADER* bih;
@@ -84,8 +93,15 @@
     vfw_bih->biBitCount=24;
     vfw_bih->biCompression=0;
 //    vfw_bih->biSizeImage=vo_w*vo_h*((vfw_bih->biBitCount+7)/8);
+
+    if (!vfw_param_codec)
+    {
+	printf("No VfW codec specified! It's required!\n");
+	return 0;
+    }
 //    mux_v->bih=vfw_open_encoder("divxc32.dll",vfw_bih,mmioFOURCC('D', 'I', 'V', '3'));
-    mux_v->bih=vfw_open_encoder("AvidAVICodec.dll",vfw_bih, 0);
+//    mux_v->bih=vfw_open_encoder("AvidAVICodec.dll",vfw_bih, 0);
+    mux_v->bih = vfw_open_encoder(vfw_param_codec, vfw_bih, 0);
     if(!mux_v->bih) return 0;
 
     return 1;