[Mplayer-cvslog] CVS: main mencoder.c,1.82,1.83 cfg-mencoder.h,1.25,1.26

Arpi of Ize arpi at mplayer.dev.hu
Thu Feb 7 21:22:06 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv3423

Modified Files:
	mencoder.c cfg-mencoder.h 
Log Message:
VfW encoding support (very alpha yet)

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- mencoder.c	6 Feb 2002 22:55:47 -0000	1.82
+++ mencoder.c	7 Feb 2002 20:22:03 -0000	1.83
@@ -5,6 +5,7 @@
 #define VCODEC_LIBAVCODEC 4
 #define VCODEC_NULL 5
 #define VCODEC_RAWRGB 6
+#define VCODEC_VFW 7
 
 #define ACODEC_COPY 0
 #define ACODEC_PCM 1
@@ -79,6 +80,8 @@
 int lavc_param_keyint = -1;
 #endif
 
+static BITMAPINFOHEADER* vfw_bih=NULL;
+
 #ifdef HAVE_LIBCSS
 #include "libmpdemux/dvdauth.h"
 #endif
@@ -545,6 +548,9 @@
     
     if(out_video_codec == VCODEC_RAWRGB) {
         if(IMGFMT_IS_BGR(out_fmt) && IMGFMT_BGR_DEPTH(out_fmt) == 32) break;
+    } else
+    if(out_video_codec == VCODEC_VFW) {
+        if(IMGFMT_IS_BGR(out_fmt) && IMGFMT_BGR_DEPTH(out_fmt) == 24) break;
     }
     else {
         if(IMGFMT_IS_BGR(out_fmt)) break;   
@@ -652,7 +658,7 @@
 
 mux_v=aviwrite_new_stream(muxer,AVIWRITE_TYPE_VIDEO);
 
-mux_v->buffer_size=0x200000;
+mux_v->buffer_size=0x200000; // 2MB
 mux_v->buffer=malloc(mux_v->buffer_size);
 
 mux_v->source=sh_video;
@@ -736,6 +742,23 @@
     mux_v->bih->biCompression=mmioFOURCC('F','r','N','o');
     mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
     break;
+case VCODEC_VFW:
+#ifdef USE_WIN32DLL
+    vfw_bih=malloc(sizeof(BITMAPINFOHEADER));
+    vfw_bih->biSize=sizeof(BITMAPINFOHEADER);
+    vfw_bih->biWidth=vo_w;
+    vfw_bih->biHeight=vo_h;
+    vfw_bih->biPlanes=0;
+    vfw_bih->biBitCount=24;
+    vfw_bih->biCompression=0;
+    vfw_bih->biSizeImage=vo_w*vo_h*((vfw_bih->biBitCount+7)/8);
+//    mux_v->bih=vfw_open_encoder("divxc32.dll",vfw_bih);
+    mux_v->bih=vfw_open_encoder("AvidAVICodec.dll",vfw_bih);
+    break;
+#else
+    printf("No support for Win32/VfW codecs compiled in\n");
+    return 0; /* FIXME */
+#endif
 case VCODEC_NULL:
     mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
@@ -1396,6 +1419,26 @@
     mux_v->buffer=&decoded_frameno; // tricky
     if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10);
     break; }
+#ifdef USE_WIN32DLL
+case VCODEC_VFW: {
+//int vfw_encode_frame(BITMAPINFOHEADER* biOutput,void* OutBuf,
+//		     BITMAPINFOHEADER* biInput,void* Image,
+//		     long* keyframe, int quality);
+    long flags=0;
+    int ret;
+    blit_frame=decode_video(&video_out,sh_video,start,in_size,0);
+    if(skip_flag>0) break;
+    if(!blit_frame){
+	// empty.
+	aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0);
+	break;
+    }
+    ret=vfw_encode_frame(mux_v->bih, mux_v->buffer, vfw_bih, vo_image_ptr, &flags, 10000);
+//    printf("vfw_encode_frame -> %d  (size=%d,flag=%X)\n",ret,mux_v->bih->biSizeImage,flags);
+    aviwrite_write_chunk(muxer,mux_v,muxer_f,mux_v->bih->biSizeImage,flags);
+    break;
+}
+#endif
 case VCODEC_DIVX4:
 #ifndef HAVE_DIVX4ENCORE
     printf("No support for Divx4 encore compiled in\n");

Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- cfg-mencoder.h	31 Jan 2002 00:38:53 -0000	1.25
+++ cfg-mencoder.h	7 Feb 2002 20:22:03 -0000	1.26
@@ -73,8 +73,9 @@
 	{"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL},
 	{"lavc", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBAVCODEC, NULL},
 	{"null", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NULL, NULL},
-    {"rawrgb", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAWRGB, NULL},
-	{"help", "\nAvailable codecs:\n   copy\n   frameno\n   divx4\n   raw\n   lavc\n   rawrgb\n   null\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+	{"rawrgb", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAWRGB, NULL},
+	{"vfw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_VFW, NULL},
+	{"help", "\nAvailable codecs:\n   copy\n   frameno\n   divx4\n   raw\n   lavc\n   rawrgb\n   vfw\n   null\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
 




More information about the MPlayer-cvslog mailing list