[Mplayer-cvslog] CVS: main dec_video.c,1.72,1.73 dec_audio.c,1.57,1.58

Arpi of Ize arpi at mplayer.dev.hu
Mon Dec 10 21:11:33 CET 2001


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

Modified Files:
	dec_video.c dec_audio.c 
Log Message:
changed for updated DShow wrapper api

Index: dec_video.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_video.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- dec_video.c	9 Dec 2001 15:39:12 -0000	1.72
+++ dec_video.c	10 Dec 2001 20:11:31 -0000	1.73
@@ -57,6 +57,7 @@
 int divx_quality=0;
 
 #ifdef USE_DIRECTSHOW
+static void* ds_vdec=NULL;
 #ifdef NEW_DSHOW
 //#include "loader/dshow/DS_VideoDecoder.h"
 //static DS_VideoDecoder* ds_vdec=NULL;
@@ -65,7 +66,6 @@
     char* dll;
     GUID* guid;
 }CodecInfo;
-static void* ds_vdec=NULL;
 #else
 #include "loader/DirectShow/DS_VideoDec.h"
 #endif
@@ -199,11 +199,7 @@
 #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
@@ -239,11 +235,7 @@
 int set_video_colors(sh_video_t *sh_video,char *item,int value){
 #ifdef USE_DIRECTSHOW
     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
@@ -306,11 +298,7 @@
 #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:
@@ -373,7 +361,7 @@
    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)){
+   if(!(ds_vdec=DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0))){
 #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);
@@ -387,38 +375,22 @@
    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_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) );
    
@@ -673,11 +645,7 @@
 #ifdef USE_DIRECTSHOW
   case VFM_DSHOW: {        // W32/DirectShow
     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;
   }

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- dec_audio.c	10 Dec 2001 01:34:36 -0000	1.57
+++ dec_audio.c	10 Dec 2001 20:11:31 -0000	1.58
@@ -52,6 +52,7 @@
 
 #ifdef USE_DIRECTSHOW
 #include "loader/DirectShow/DS_AudioDec.h"
+static void* ds_adec=NULL;
 #endif
 
 #ifdef HAVE_OGGVORBIS
@@ -231,7 +232,7 @@
 #else
   // Win32 DShow audio codec:
 //  printf("DShow_audio: channs=%d  rate=%d\n",sh_audio->channels,sh_audio->samplerate);
-  if(DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,sh_audio->wf)){
+  if(!(ds_adec=DS_AudioDecoder_Open(sh_audio->codec->dll,&sh_audio->codec->guid,sh_audio->wf))){
     mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_MissingDLLcodec,sh_audio->codec->dll);
     driver=0;
   } else {
@@ -977,7 +978,7 @@
       case AFM_DSHOW: // DirectShow
       { int size_in=0;
         int size_out=0;
-        int srcsize=DS_AudioDecoder_GetSrcSize(maxlen);
+        int srcsize=DS_AudioDecoder_GetSrcSize(ds_adec, maxlen);
         mp_msg(MSGT_DECAUDIO,MSGL_DBG3,"DShow says: srcsize=%d  (buffsize=%d)  out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen);
         if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!!
         if(sh_audio->a_in_buffer_len<srcsize){
@@ -985,7 +986,7 @@
             demux_read_data(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len],
             srcsize-sh_audio->a_in_buffer_len);
         }
-        DS_AudioDecoder_Convert(sh_audio->a_in_buffer,sh_audio->a_in_buffer_len,
+        DS_AudioDecoder_Convert(ds_adec, sh_audio->a_in_buffer,sh_audio->a_in_buffer_len,
             buf,maxlen, &size_in,&size_out);
         mp_dbg(MSGT_DECAUDIO,MSGL_DBG2,"DShow: audio %d -> %d converted  (in_buf_len=%d of %d)  %d\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size,ds_tell_pts(sh_audio->ds));
         if(size_in>=sh_audio->a_in_buffer_len){




More information about the MPlayer-cvslog mailing list