changeset 3504:21fc87d76300

support for RGB/BGR modes (tested with raw and divx4)
author alex
date Sat, 15 Dec 2001 17:12:20 +0000
parents 7aed2edd99ab
children f35c03c967a3
files mencoder.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Sat Dec 15 16:49:45 2001 +0000
+++ b/mencoder.c	Sat Dec 15 17:12:20 2001 +0000
@@ -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;
@@ -432,6 +434,12 @@
     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);
      exit(1);