[Mplayer-cvslog] CVS: main cfg-mencoder.h,1.12,1.13 mencoder.c,1.40,1.41

Alex Beregszaszi alex at mplayer.dev.hu
Thu Dec 13 18:50:27 CET 2001


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

Modified Files:
	cfg-mencoder.h mencoder.c 
Log Message:
vcodec_raw added

Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- cfg-mencoder.h	8 Dec 2001 13:30:35 -0000	1.12
+++ cfg-mencoder.h	13 Dec 2001 17:50:19 -0000	1.13
@@ -47,7 +47,8 @@
 	{"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_COPY},
 	{"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO},
 	{"divx4", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_DIVX4},
-	{"help", "\nAvailable codecs:\n   copy\n   frameno\n   divx4\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
+	{"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW},
+	{"help", "\nAvailable codecs:\n   copy\n   frameno\n   divx4\n   raw\n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0},
 	{NULL, NULL, 0, 0, 0, 0}
 };
 

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- mencoder.c	8 Dec 2001 13:30:06 -0000	1.40
+++ mencoder.c	13 Dec 2001 17:50:19 -0000	1.41
@@ -1,6 +1,7 @@
 #define VCODEC_COPY 0
 #define VCODEC_FRAMENO 1
 #define VCODEC_DIVX4 2
+#define VCODEC_RAW 3
 
 #define ACODEC_COPY 0
 #define ACODEC_PCM 1
@@ -525,6 +526,26 @@
 	mux_v->bih->biWidth, mux_v->bih->biHeight,
 	mux_v->bih->biBitCount, mux_v->bih->biCompression);
     break;
+case VCODEC_RAW:
+    printf("sh_video->bih: %x\n", sh_video->bih);
+    if (sh_video->bih)
+	mux_v->bih=sh_video->bih;
+    else
+    {
+	mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
+	mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
+	mux_v->bih->biWidth=sh_video->disp_w;
+	mux_v->bih->biHeight=sh_video->disp_h;
+	mux_v->bih->biCompression=0;
+	mux_v->bih->biPlanes=1;
+	mux_v->bih->biBitCount=24; // FIXME!!!
+	mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
+    }
+    mux_v->bih->biCompression=0;
+    printf("videocodec: raw (%dx%d %dbpp fourcc=%x)\n",
+	mux_v->bih->biWidth, mux_v->bih->biHeight,
+	mux_v->bih->biBitCount, mux_v->bih->biCompression);
+    break;
 case VCODEC_FRAMENO:
     mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
@@ -578,7 +599,7 @@
 	mux_a->wf->nChannels = sh_audio->channels;
 	mux_a->wf->nSamplesPerSec = sh_audio->samplerate;
 	mux_a->wf->nAvgBytesPerSec=mux_a->h.dwSampleSize*mux_a->wf->nSamplesPerSec;
-	mux_a->wf->wBitsPerSample = 16;
+	mux_a->wf->wBitsPerSample = 16; // FIXME
 	mux_a->wf->cbSize=0; // FIXME for l3codeca.acm
     }
     printf("audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d)\n",
@@ -628,6 +649,7 @@
 
 switch(mux_v->codec){
 case VCODEC_COPY:
+case VCODEC_RAW:
     break;
 case VCODEC_FRAMENO:
     decoded_frameno=0;
@@ -831,6 +853,17 @@
 case VCODEC_COPY:
     mux_v->buffer=start;
     if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
+    break;
+case VCODEC_RAW:
+    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;
+    }
+    mux_v->buffer = vo_image_ptr;
+    aviwrite_write_chunk(muxer,mux_v,muxer_f,mux_v->buffer_size,0x10);
     break;
 case VCODEC_FRAMENO:
     mux_v->buffer=&decoded_frameno; // tricky




More information about the MPlayer-cvslog mailing list