[Mplayer-cvslog] CVS: main mplayer.c,1.24,1.25 codecs.c,1.5,1.6

GEREOFFY arpi_esp at users.sourceforge.net
Thu Mar 22 02:58:01 CET 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv24914

Modified Files:
	mplayer.c codecs.c 
Log Message:
DirectShow audio support

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** mplayer.c	2001/03/21 00:14:13	1.24
--- mplayer.c	2001/03/22 01:57:58	1.25
***************
*** 59,62 ****
--- 59,63 ----
  #ifdef USE_DIRECTSHOW
  #include "DirectShow/DS_VideoDec.h"
+ #include "DirectShow/DS_AudioDec.h"
  #endif
  
***************
*** 368,373 ****
  stream_t* stream=NULL;
  int file_format=DEMUXER_TYPE_UNKNOWN;
! int has_audio=1; // audio format 0=no 1=mpeg 2=pcm 3=ac3 4=win32 5=alaw 6=msgsm
! int has_video=0; // video format 0=no 1=mpeg 2=win32/VfW 3=OpenDivX 4=w32/DShow
  //
  int audio_format=0; // override
--- 369,374 ----
  stream_t* stream=NULL;
  int file_format=DEMUXER_TYPE_UNKNOWN;
! int has_audio=1; // audio  0=no 1=mpeg 2=pcm 3=ac3 4=ACM 5=alaw 6=msgsm 7=DShow
! int has_video=0; // video  0=no 1=mpeg 2=win32/VfW 3=OpenDivX 4=w32/DShow
  //
  int audio_format=0; // override
***************
*** 677,680 ****
--- 678,682 ----
    if(has_audio==4){
      if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name();
+     if(avi_header.auds_guid) has_audio=7; // force DShow
      if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
      if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
***************
*** 744,747 ****
--- 746,750 ----
    if(has_audio==4){
      if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name();
+     if(avi_header.auds_guid) has_audio=7; // force DShow
      if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
      if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
***************
*** 1166,1169 ****
--- 1169,1202 ----
    }
  }
+ 
+ if(has_audio==7){
+ #ifndef USE_DIRECTSHOW
+   printf("Compiled without DirectShow support -> force nosound :(\n");
+   has_audio=0;
+ #else
+   // Win32 DShow audio codec:
+     WAVEFORMATEX *in_fmt=(WAVEFORMATEX*)&avi_header.wf_ext;
+     avi_header.wf.nChannels=in_fmt->nChannels;
+     avi_header.wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
+     avi_header.wf.nAvgBytesPerSec=2*avi_header.wf.nSamplesPerSec*avi_header.wf.nChannels;
+     avi_header.wf.wFormatTag=WAVE_FORMAT_PCM;
+     avi_header.wf.nBlockAlign=2*in_fmt->nChannels;
+     avi_header.wf.wBitsPerSample=16;
+     avi_header.wf.cbSize=0;
+ 
+   if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
+     MP3_channels=avi_header.wf.nChannels;
+     MP3_samplerate=avi_header.wf.nSamplesPerSec;
+   } else {
+     printf("Could not load/initialize Win32/DirctShow AUDIO codec (missing .AX file?)\n");
+     if((in_fmt->wFormatTag)==0x55){
+       printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
+       has_audio=1;  // fallback to mp3lib
+     } else
+       has_audio=0;  // nosound
+   }
+ #endif
+ }
+ 
  
  // allocate audio out buffer:

Index: codecs.c
===================================================================
RCS file: /cvsroot/mplayer/main/codecs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** codecs.c	2001/03/20 22:11:38	1.5
--- codecs.c	2001/03/22 01:57:58	1.6
***************
*** 2,8 ****
  //#define USE_DIRECTSHOW
  
! static GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
      { 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
  
  char* get_vids_codec_name(){
  //  unsigned long fccHandler=avi_header.video.fccHandler;
--- 2,23 ----
  //#define USE_DIRECTSHOW
  
! static    GUID wmv1_clsid={0x4facbba1, 0xffd8, 0x4cd7,
!     {0x82, 0x28, 0x61, 0xe2, 0xf6, 0x5c, 0xb1, 0xae}};
! static    GUID wmv2_clsid={0x521fb373, 0x7654, 0x49f2, 
!     {0xbd, 0xb1, 0x0c, 0x6e, 0x66, 0x60, 0x71, 0x4f}};    
! static    GUID CLSID_MorganMjpeg={0x6988b440, 0x8352, 0x11d3, 
!     {0x9b, 0xda, 0xca, 0x86, 0x73, 0x7c, 0x71, 0x68}};
! static    GUID CLSID_Acelp={0x4009f700, 0xaeba, 0x11d1,
!     {0x83, 0x44, 0x00, 0xc0, 0x4f, 0xb9, 0x2e, 0xb7}};
! static    GUID CLSID_Voxware={0x73f7a062, 0x8829, 0x11d1,
!     {0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d}};
! static    GUID CLSID_DivxDecompressorCF={0x82CCd3E0, 0xF71A, 0x11D0,
      { 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa}};
+ static    GUID CLSID_IV50_Decoder={0x30355649, 0x0000, 0x0010,
+     {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
+ static    GUID dvsd_clsid={0xB1B77C00, 0xC3E4, 0x11CF,
+     {0xAF, 0x79, 0x00, 0xAA, 0x00, 0xB6, 0x7A, 0x42}};
  
+ 
  char* get_vids_codec_name(){
  //  unsigned long fccHandler=avi_header.video.fccHandler;
***************
*** 135,138 ****
--- 150,161 ----
  //          return "m3jpeg32.dll";
  //          return "libavi_mjpeg.so";
+ 
+ 	case mmioFOURCC('W', 'M', 'V', '1'):
+ 	  printf("Video in Windows Media Video 1 format\n");
+           avi_header.yuv_supported=1;
+           avi_header.vids_guid=&wmv1_clsid;
+           return "wmvds32.ax";
+ 
+ 
    }
    printf("UNKNOWN video codec: %.4s (0x%0X)\n",&fccHandler,fccHandler);
***************
*** 163,167 ****
              return "msgsm32.acm";   // segfault :( - not req. has internal now!
          case 0x75://VoxWare
!             return "voxmsdec.ax";   // directshow, not yet supported just a try
  //	case 0x06://???
  //            return "lhacm.acm";
--- 186,191 ----
              return "msgsm32.acm";   // segfault :( - not req. has internal now!
          case 0x75://VoxWare
!             avi_header.auds_guid=&CLSID_Voxware;
!             return "voxmsdec.ax";
  //	case 0x06://???
  //            return "lhacm.acm";


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list