[Mplayer-cvslog] CVS: main dec_video.c,1.64,1.65

Arpi of Ize arpi at mplayer.dev.hu
Thu Nov 22 04:15:52 CET 2001


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

Modified Files:
	dec_video.c 
Log Message:
NEW_DSHOW added (for dshow C version)

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- dec_video.c	16 Nov 2001 22:59:39 -0000	1.64
+++ dec_video.c	22 Nov 2001 03:15:49 -0000	1.65
@@ -1,4 +1,6 @@
 
+//#define NEW_DSHOW
+
 #include "config.h"
 
 #include <stdio.h>
@@ -53,8 +55,19 @@
 int divx_quality=0;
 
 #ifdef USE_DIRECTSHOW
+#ifdef NEW_DSHOW
+//#include "loader/dshow/DS_VideoDecoder.h"
+//static DS_VideoDecoder* ds_vdec=NULL;
+typedef struct _CodecInfo
+{
+    char* dll;
+    GUID* guid;
+}CodecInfo;
+static void* ds_vdec=NULL;
+#else
 #include "loader/DirectShow/DS_VideoDec.h"
 #endif
+#endif
 
 #ifdef USE_LIBAVCODEC
 #ifdef USE_LIBAVCODEC_SO
@@ -177,7 +190,11 @@
 #ifdef USE_DIRECTSHOW
   case VFM_DSHOW: {
    if(quality<0 || quality>4) quality=4;
+#ifdef NEW_DSHOW
+   DS_VideoDecoder_SetValue(ds_vdec,"Quality",quality);
+#else
    DS_SetValue_DivX("Quality",quality);
+#endif
   }
   break;
 #endif
@@ -212,11 +229,17 @@
 
 int set_video_colors(sh_video_t *sh_video,char *item,int value){
 #ifdef USE_DIRECTSHOW
+#ifndef NEW_DSHOW
     if(sh_video->codec->driver==VFM_DSHOW){
+#ifdef NEW_DSHOW
+	DS_VideoDecoder_SetValue(ds_vdec,item,value);
+#else
 	DS_SetValue_DivX(item,value);
+#endif
 	return 1;
     }
 #endif
+#endif
 
 #ifdef NEW_DECORE
 #ifdef DECORE_VERSION
@@ -276,7 +299,11 @@
 #endif
 #ifdef USE_DIRECTSHOW
     case VFM_DSHOW: // Win32/DirectShow
+#ifdef NEW_DSHOW
+	if(ds_vdec){ DS_VideoDecoder_Destroy(ds_vdec); ds_vdec=NULL; }
+#else
 	DS_VideoDecoder_Close();
+#endif
 	break;
 #endif
     case VFM_MPEG:
@@ -333,7 +360,14 @@
    return 0;
 #else
    int bpp;
+#ifdef NEW_DSHOW
+   CodecInfo ci;
+   ci.dll=sh_video->codec->dll;
+   ci.guid=&sh_video->codec->guid;
+   if(!(ds_vdec=DS_VideoDecoder_Create(&ci,sh_video->bih, 0, 0))){
+#else
    if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){
+#endif
 //   if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){
         mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh_video->codec->dll);
         mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
@@ -346,22 +380,38 @@
    case IMGFMT_YUY2:
    case IMGFMT_UYVY:
      bpp=16;
+#ifdef NEW_DSHOW
+     DS_VideoDecoder_SetDestFmt(ds_vdec,16,out_fmt);break;        // packed YUV
+#else
      DS_VideoDecoder_SetDestFmt(16,out_fmt);break;        // packed YUV
+#endif
    case IMGFMT_YV12:
    case IMGFMT_I420:
    case IMGFMT_IYUV:
      bpp=12;
+#ifdef NEW_DSHOW
+     DS_VideoDecoder_SetDestFmt(ds_vdec,12,out_fmt);break;        // planar YUV
+#else
      DS_VideoDecoder_SetDestFmt(12,out_fmt);break;        // planar YUV
+#endif
    default:
      bpp=((out_fmt&255)+7)&(~7);
+#ifdef NEW_DSHOW
+     DS_VideoDecoder_SetDestFmt(ds_vdec,out_fmt&255,0);           // RGB/BGR
+#else
      DS_VideoDecoder_SetDestFmt(out_fmt&255,0);           // RGB/BGR
+#endif
    }
 
    sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*bpp/8); // FIXME!!!
 
-   DS_VideoDecoder_Start();
-
    DS_SetAttr_DivX("Quality",divx_quality);
+
+#ifdef NEW_DSHOW
+   DS_VideoDecoder_StartInternal(ds_vdec);
+#else
+   DS_VideoDecoder_Start();
+#endif
 //   printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) );
 //   printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) );
    
@@ -606,7 +656,12 @@
 #endif
 #ifdef USE_DIRECTSHOW
   case VFM_DSHOW: {        // W32/DirectShow
-    if(drop_frame<2) DS_VideoDecoder_DecodeFrame(start, in_size, 0, !drop_frame);
+    if(drop_frame<2)
+#ifdef NEW_DSHOW
+	DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : sh_video->our_out_buffer);
+#else
+	DS_VideoDecoder_DecodeFrame(start, in_size, 0, !drop_frame);
+#endif
     if(!drop_frame && sh_video->our_out_buffer) blit_frame=3;
     break;
   }




More information about the MPlayer-cvslog mailing list