[Mplayer-cvslog] CVS: main mencoder.c,1.41,1.42

Alex Beregszaszi alex at mplayer.dev.hu
Sat Dec 15 18:12:23 CET 2001


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

Modified Files:
	mencoder.c 
Log Message:
support for RGB/BGR modes (tested with raw and divx4)

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- mencoder.c	13 Dec 2001 17:50:19 -0000	1.41
+++ mencoder.c	15 Dec 2001 17:12:20 -0000	1.42
@@ -2,6 +2,7 @@
 #define VCODEC_FRAMENO 1
 #define VCODEC_DIVX4 2
 #define VCODEC_RAW 3
+#define VCODEC_LIBAVCODEC 4
 
 #define ACODEC_COPY 0
 #define ACODEC_PCM 1
@@ -402,6 +403,7 @@
 for(i=0;i<CODECS_MAX_OUTFMT;i++){
     out_fmt=sh_video->codec->outfmt[i];
     if(out_fmt==0xFFFFFFFF) continue;
+    if(IMGFMT_IS_RGB(out_fmt) || IMGFMT_IS_BGR(out_fmt)) break;
     if(out_fmt==IMGFMT_YV12) break;
     if(out_fmt==IMGFMT_I420) break;
     if(out_fmt==IMGFMT_IYUV) break;
@@ -431,6 +433,12 @@
     vo_image=malloc(vo_w*vo_h*3/2);
     vo_image_ptr=vo_image;
 }
+
+if (IMGFMT_IS_BGR(out_fmt))
+    vo_image_ptr = vo_image = malloc(vo_w*vo_h*IMGFMT_BGR_DEPTH(out_fmt)/8);
+
+if (IMGFMT_IS_RGB(out_fmt))
+    vo_image_ptr = vo_image = malloc(vo_w*vo_h*IMGFMT_RGB_DEPTH(out_fmt)/8);
 
 if(!init_video(sh_video)){
      mp_msg(MSGT_MENCODER,MSGL_FATAL,MSGTR_CouldntInitVideoCodec);




More information about the MPlayer-cvslog mailing list