[MPlayer-dev-eng] Re: [PATCH] DXR2 video output

Tobias Diedrich td at informatik.uni-hannover.de
Mon May 13 19:44:54 CEST 2002


Alban Bedel wrote:

> I got a dxr2 this weekend and tested your patch. First I saw that your patch depend
> on another patch that you send to the dxr2 driver list, so put I these parts inside
> #if 0 blocks. I removed the included encoder, added many options and overlay
> support.

I changed this to #ifdef DXR2_AUDIO_FREQ_24 and a link to the patch.
Also the freq_id is now directly set to the dxr2 values.
(I initially copied it from ao_mpegpes, where it is the value for the
corresponding header field in the stream, but the dxr2 seems to like
only 0 here, and the frequency is set using the ioctl...)

> I also tried to add support for hw audio decoding but failed. Either the sound or
> the video was always choppy :(

How do you do the audio passthrough ?
I looked but it seemed to me there is no support for that yet ?

> I needed overlay support as I don't have a TV.

Nice. I was going to do that next.

-- 
Tobias								PGP: 0x9AC7E0BC
-------------- next part --------------
diff -urN main/libao2/Makefile main.new/libao2/Makefile
--- main/libao2/Makefile	Thu Apr  4 15:52:24 2002
+++ main.new/libao2/Makefile	Mon May 13 19:09:38 2002
@@ -8,7 +8,7 @@
 
 OBJS=$(SRCS:.c=.o)
 
-CFLAGS  = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC)
+CFLAGS  = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DXR2_INC) $(DVB_INC)
 
 .SUFFIXES: .c .o
 
diff -urN main/libao2/ao_dxr2.c main.new/libao2/ao_dxr2.c
--- main/libao2/ao_dxr2.c	Mon May 13 15:15:39 2002
+++ main.new/libao2/ao_dxr2.c	Mon May 13 19:22:03 2002
@@ -45,29 +45,32 @@
 
 	switch(rate){
 	case 48000:
-		freq_id=0;
+		freq_id=DXR2_AUDIO_FREQ_48;
 		break;
 	case 96000:
-		freq_id=1;
+		freq_id=DXR2_AUDIO_FREQ_96;
 		break;
 	case 44100:
-		freq_id=2;
+		freq_id=DXR2_AUDIO_FREQ_441;
 		break;
 	case 32000:
-		freq_id=3;
+		freq_id=DXR2_AUDIO_FREQ_32;
 		break;
 	case 22050:
-		freq_id=4;
+		freq_id=DXR2_AUDIO_FREQ_2205;
 		break;
-#if 0
+#ifdef DXR2_AUDIO_FREQ_24
+	// This is not yet in the dxr2 driver CVS
+	// you can get the patch at
+	// http://www.ranmachan.dyndns.org/~ranma/patches/dxr2.pcm1723.20020513
 	case 24000:
-		freq_id=5;
+		freq_id=DXR2_AUDIO_FREQ_24;
 		break;
 	case 64000:
-		freq_id=6;
+		freq_id=DXR2_AUDIO_FREQ_64;
 		break;
 	case 88200:
-		freq_id=7;
+		freq_id=DXR2_AUDIO_FREQ_882;
 		break;
 #endif
 	default:
diff -urN main/libvo/vo_dxr2.c main.new/libvo/vo_dxr2.c
--- main/libvo/vo_dxr2.c	Mon May 13 15:31:35 2002
+++ main.new/libvo/vo_dxr2.c	Mon May 13 19:17:10 2002
@@ -176,7 +176,7 @@
   int ptslen=5;
 
   if(dxr2_fd < 0) {
-    mp_msg(MSGT_VO,MSGL_ERR,"DXR2 isn't ready\n");
+    mp_msg(MSGT_VO,MSGL_ERR,"DXR2 fd is not valid\n");
     return;
   }
 
@@ -228,28 +228,14 @@
   int ptslen=5;
 
   if(dxr2_fd < 0) {
-    mp_msg(MSGT_VO,MSGL_ERR,"DXR2 isn't ready\n");
+    mp_msg(MSGT_VO,MSGL_ERR,"DXR2 fd is not valid\n");
     return;
   }    
 
   if(last_freq_id != freq_id) {
-    switch (freq_id) {
-    case 0: arg=DXR2_AUDIO_FREQ_48; break;
-    case 1: arg=DXR2_AUDIO_FREQ_96; break;
-    case 2: arg=DXR2_AUDIO_FREQ_441; break;
-    case 3: arg=DXR2_AUDIO_FREQ_32; break;
-    case 4: arg=DXR2_AUDIO_FREQ_2205; break;
-#if 0
-      // This is not is the dxr2 driver, but in a Tobias Diedrich patch 
-    case 5: arg=DXR2_AUDIO_FREQ_24; break;
-    case 6:  arg=DXR2_AUDIO_FREQ_64; break;
-    case 7: arg=DXR2_AUDIO_FREQ_882; break;
-#endif
-    }
-    ioctl(dxr2_fd, DXR2_IOC_SET_AUDIO_SAMPLE_FREQUENCY, &arg);
+    ioctl(dxr2_fd, DXR2_IOC_SET_AUDIO_SAMPLE_FREQUENCY, &freq_id);
     last_freq_id = freq_id;
   }
-  freq_id=0;
 
   if (((int) timestamp)<0)
     timestamp=0;
@@ -316,7 +302,7 @@
     //	   audio sampling frequency (48khz = 0, 96khz = 1)        2 bit
     //	   reserved                                               1 bit
     //	   number of audio channels - 1 (e.g. stereo = 1)         3 bit
-    pack[ptslen+14]=1|(freq_id<<4);
+    pack[ptslen+14]=1;
 
     //	   dynamic range control (0x80 if off)
     pack[ptslen+15]=0x80;
@@ -326,7 +312,6 @@
 
     len-=payload_size; data+=payload_size;
     timestamp+=90000/4*payload_size/48000;
-    //		ptslen=0; // store PTS only once, at first packet!
   }
 }
 


More information about the MPlayer-dev-eng mailing list