changeset 3480:9943dbacb48e

vcodec_raw added
author alex
date Thu, 13 Dec 2001 17:50:19 +0000
parents 2704448de713
children 79e046b9e877
files cfg-mencoder.h mencoder.c
diffstat 2 files changed, 36 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mencoder.h	Thu Dec 13 00:25:08 2001 +0000
+++ b/cfg-mencoder.h	Thu Dec 13 17:50:19 2001 +0000
@@ -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}
 };
 
--- a/mencoder.c	Thu Dec 13 00:25:08 2001 +0000
+++ b/mencoder.c	Thu Dec 13 17:50:19 2001 +0000
@@ -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;
@@ -832,6 +854,17 @@
     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
     if(skip_flag<=0) aviwrite_write_chunk(muxer,mux_v,muxer_f,sizeof(int),0x10);