[Mplayer-cvslog] CVS: main/vidix README,1.1,1.2 vidix.h,1.4,1.5 vidixlib.h,1.3,1.4 vidixlib.c,1.5,1.6

Nick Kurshev nick at mplayer.dev.hu
Wed Jan 16 09:33:19 CET 2002


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

Modified Files:
	README vidix.h vidixlib.h vidixlib.c 
Log Message:
+ new features and possibility
  deinterlacing
  oem effects
  ITU color space
  forcing driver
- audio support (develop and introduce AUDIX for that)


Index: README
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README	5 Jan 2002 10:13:25 -0000	1.1
+++ README	16 Jan 2002 08:33:09 -0000	1.2
@@ -3,3 +3,5 @@
 This library was designed and introduced as interface to userspace drivers
 to provide DGA everywhere where it's possible (unline X11).
 I hope that these drivers will be portable same as X11 (not only on *nix).
+
+For detail on how to develop new driver see main/DOCS/tech/vidix.txt

Index: vidix.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidix.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vidix.h	9 Jan 2002 18:58:25 -0000	1.4
+++ vidix.h	16 Jan 2002 08:33:09 -0000	1.5
@@ -25,8 +25,14 @@
 			/* returns driver version */
 extern unsigned vixGetVersion( void );
 
-			/* Probes video hw. Returns 0 if ok else errno */
-extern int	vixProbe( int verbose );
+#define PROBE_NORMAL	0 /* normal probing */
+#define PROBE_FORCE	1 /* ignore device_id but recognize device if it's known */
+			/* Probes video hw.
+			   verbose - specifies verbose level.
+			   force   - specifies force mode - driver should ignore
+			             device_id (danger but useful for new devices)
+			   Returns 0 if ok else errno */
+extern int	vixProbe( int verbose, int force );
 			/* Initializes driver. Returns 0 if ok else errno */
 extern int	vixInit( void );
 			/* Destroys driver */
@@ -35,15 +41,12 @@
 typedef struct vidix_capability_s
 {
 	char	name[32];	/* Driver name */
-#define TYPE_OUTPUT	0x00000000	/* Is a video capture device */
-#define TYPE_CAPTURE	0x00000001	/* Is a CODEC device */
-#define TYPE_CODEC	0x00000002	/* Is a video output device */
+#define TYPE_OUTPUT	0x00000000	/* Is a video playback device */
+#define TYPE_CAPTURE	0x00000001	/* Is a capture device */
+#define TYPE_CODEC	0x00000002	/* Device supports hw (de)coding */
 #define TYPE_FX		0x00000004	/* Is a video effects device */
 	int	type;		/* Device type, see below */
-	int	inputs;		/* Num video inputs */
-	int	outputs;	/* Num video outputs */
-	int	in_audios;	/* Num audio inputs */
-	int	out_audios;	/* Num audio outputs */
+	unsigned reserved0[4];
 	int	maxwidth;
 	int	maxheight;
 	int	minwidth;
@@ -51,10 +54,11 @@
 	int	maxframerate;   /* -1 if unlimited */
 #define FLAG_NONE		0x00000000 /* No flags defined */
 #define FLAG_DMA		0x00000001 /* Card can use DMA */
+#define FLAG_EQ_DMA		0x00000002 /* Card can use DMA only if src pitch == dest pitch */
 #define FLAG_UPSCALER		0x00000010 /* Card supports hw upscaling */
 #define FLAG_DOWNSCALER		0x00000020 /* Card supports hw downscaling */
 #define FLAG_SUBPIC		0x00001000 /* Card supports DVD subpictures */
-	unsigned flags;		/* Feature flags, see below */
+	unsigned flags;		/* Feature flags, see above */
 	unsigned short vendor_id;
 	unsigned short device_id;
 	unsigned reserved[4];
@@ -139,7 +143,7 @@
 	vidix_rect_t	dest;           /* app -> driver: destinition movie size. driver->app dest_pitch */
 	/* memory model */
 	unsigned	frame_size;		/* driver -> app; destinition frame size */
-	unsigned	num_frames;		/* app -> driver; after call: driver -> app */
+	unsigned	num_frames;		/* app -> driver: after call: driver -> app */
 #define LVO_MAXFRAMES 32
 	unsigned	offsets[LVO_MAXFRAMES];	/* driver -> app */
 	vidix_yuv_t	offset;			/* driver -> app: relative offsets within frame for yuv planes */
@@ -186,6 +190,10 @@
 	int		red_intense;	/* -1000 : +1000 */
 	int		green_intense;  /* -1000 : +1000 */
 	int		blue_intense;   /* -1000 : +1000 */
+#define VEQ_FLG_ITU_R_BT_601	0x00000000 /* ITU-R BT.601 colour space (default) */
+#define VEQ_FLG_ITU_R_BT_709	0x00000001 /* ITU-R BT.709 colour space */
+#define VEQ_FLG_ITU_MASK	0x0000000f
+	int		flags;		/* currently specifies ITU YCrCb color space to use */
 }vidix_video_eq_t;
 
 			/* Returns 0 if ok else errno */
@@ -194,6 +202,24 @@
 			/* Returns 0 if ok else errno */
 extern int 	vixPlaybackSetEq( const vidix_video_eq_t * );
 
+typedef struct vidix_deinterlace_s
+{
+#define CFG_NON_INTERLACED		0x00000000 /* stream is not interlaced */
+#define CFG_INTERLACED			0x00000001 /* stream is interlaced */
+#define CFG_EVEN_ODD_INTERLACING	0x00000002 /* first frame contains even fields but second - odd */
+#define CFG_ODD_EVEN_INTERLACING	0x00000004 /* first frame contains odd fields but second - even */
+#define CFG_UNIQUE_INTERLACING		0x00000008 /* field deinterlace_pattern is valid */
+#define CFG_UNKNOWN_INTERLACING		0x0000000f /* unknown deinterlacing - use adaptive if it's possible */
+	unsigned	flags;
+	unsigned	deinterlace_pattern;	/* app -> driver: deinterlace pattern if flag CFG_UNIQUE_INTERLACING is set */
+}vidix_deinterlace_t;
+
+			/* Returns 0 if ok else errno */
+extern int 	vixPlaybackGetDeint( vidix_deinterlace_t * );
+
+			/* Returns 0 if ok else errno */
+extern int 	vixPlaybackSetDeint( const vidix_deinterlace_t * );
+
 typedef struct vidix_slice_s
 {
 	void*		address;		/* app -> driver */
@@ -212,6 +238,37 @@
 
 			/* Returns 0 if ok else errno */
 extern int 	vixPlaybackCopyFrame( const vidix_dma_t * );
+
+/*
+   This structure is introdused to support OEM effects like:
+   - sharpness
+   - exposure
+   - (auto)gain
+   - H(V)flip
+   - black level
+   - white balance
+   and many other
+*/
+typedef struct vidix_oem_fx_s
+{
+#define FX_TYPE_BOOLEAN		0x00000000
+#define FX_TYPE_INTEGER		0x00000001
+	int		type;			/* type of effects */
+	int		num;			/* app -> driver: effect number. From 0 to max number of effects */
+	int		minvalue;		/* min value of effect. 0 - for boolean */
+	int		maxvalue;		/* max value of effect. 1 - for boolean */
+	int		value;			/* current value of effect on 'get'; required on set */
+	char *		name[80];		/* effect name to display */
+}vidix_oem_fx_t;
+
+			/* Returns 0 if ok else errno */
+extern int	vixQueryNumOemEffects( unsigned * number );
+
+			/* Returns 0 if ok else errno */
+extern int	vixGetOemEffect( vidix_oem_fx_t * );
+
+			/* Returns 0 if ok else errno */
+extern int	vixSetOemEffect( const vidix_oem_fx_t * );
 
 #ifdef __cplusplus
 }

Index: vidixlib.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidixlib.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vidixlib.h	9 Jan 2002 18:58:25 -0000	1.3
+++ vidixlib.h	16 Jan 2002 08:33:09 -0000	1.4
@@ -73,6 +73,22 @@
 extern int 	  vdlPlaybackSetEq(VDL_HANDLE, const vidix_video_eq_t * );
 
 			/* Returns 0 if ok else errno */
+extern int	  vdlPlaybackGetDeint(VDL_HANDLE, vidix_deinterlace_t * );
+
+			/* Returns 0 if ok else errno */
+extern int 	  vdlPlaybackSetDeint(VDL_HANDLE, const vidix_deinterlace_t * );
+
+			/* Returns 0 if ok else errno */
+extern int	  vdlQueryNumOemEffects(VDL_HANDLE, unsigned * number );
+
+			/* Returns 0 if ok else errno */
+extern int	  vdlGetOemEffect(VDL_HANDLE, vidix_oem_fx_t * );
+
+			/* Returns 0 if ok else errno */
+extern int	  vdlSetOemEffect(VDL_HANDLE, const vidix_oem_fx_t * );
+
+
+			/* Returns 0 if ok else errno */
 extern int	  vdlPlaybackCopyFrame(VDL_HANDLE, const vidix_dma_t * );
 
 #ifdef __cplusplus

Index: vidixlib.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidixlib.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vidixlib.c	9 Jan 2002 18:58:25 -0000	1.5
+++ vidixlib.c	16 Jan 2002 08:33:09 -0000	1.6
@@ -42,9 +42,14 @@
 	int 	(*frame_sel)( unsigned frame_idx );
 	int 	(*get_eq)( vidix_video_eq_t * );
 	int 	(*set_eq)( const vidix_video_eq_t * );
+	int 	(*get_deint)( vidix_deinterlace_t * );
+	int 	(*set_deint)( const vidix_deinterlace_t * );
 	int 	(*copy_frame)( const vidix_dma_t * );
 	int 	(*get_gkey)( vidix_grkey_t * );
 	int 	(*set_gkey)( const vidix_grkey_t * );
+	int 	(*get_num_fx)( unsigned * );
+	int 	(*get_fx)( vidix_oem_fx_t * );
+	int 	(*set_fx)( const vidix_oem_fx_t * );
 }vdl_stream_t;
 
 #define t_vdl(p) (((vdl_stream_t *)p))
@@ -68,13 +73,18 @@
   t_vdl(stream)->set_eq	= dlsym(t_vdl(stream)->handle,"vixPlaybackSetEq");
   t_vdl(stream)->get_gkey	= dlsym(t_vdl(stream)->handle,"vixGetGrKeys");
   t_vdl(stream)->set_gkey	= dlsym(t_vdl(stream)->handle,"vixSetGrKeys");
+  t_vdl(stream)->get_deint	= dlsym(t_vdl(stream)->handle,"vixPlaybackGetDeint");
+  t_vdl(stream)->set_deint	= dlsym(t_vdl(stream)->handle,"vixPlaybackSetDeint");
   t_vdl(stream)->copy_frame	= dlsym(t_vdl(stream)->handle,"vixPlaybackCopyFrame");
+  t_vdl(stream)->get_num_fx	= dlsym(t_vdl(stream)->handle,"vixQueryNumOemEffects");
+  t_vdl(stream)->get_fx		= dlsym(t_vdl(stream)->handle,"vixGetOemEffect");
+  t_vdl(stream)->set_fx		= dlsym(t_vdl(stream)->handle,"vixSetOemEffect");
   /* check driver viability */
   if(!( t_vdl(stream)->get_caps && t_vdl(stream)->query_fourcc &&
 	t_vdl(stream)->config_playback && t_vdl(stream)->playback_on &&
 	t_vdl(stream)->playback_off))
   {
-    printf("vidixlib: some features are missed in driver\n");
+    printf("vidixlib: Incomplete driver: some features are missed in it.\n");
     return 0;
   }
   return 1;
@@ -84,7 +94,7 @@
 {
   vidix_capability_t vid_cap;
   unsigned (*_ver)(void);
-  int      (*_probe)(int);
+  int      (*_probe)(int,int);
   int      (*_cap)(vidix_capability_t*);
   strcpy(drv_name,path);
   strcat(drv_name,name);
@@ -114,7 +124,7 @@
     if(verbose) printf("vidixlib: %s has no function definition\n",drv_name);
     goto err;
   }
-  if(_probe) { if((*_probe)(verbose) != 0) goto err; }
+  if(_probe) { if((*_probe)(verbose,PROBE_NORMAL) != 0) goto err; }
   else goto fatal_err;
   if(_cap) { if((*_cap)(&vid_cap) != 0) goto err; }
   else goto fatal_err;
@@ -156,7 +166,7 @@
   if(name)
   {
     unsigned (*ver)(void);
-    int (*probe)(int);
+    int (*probe)(int,int);
     unsigned version = 0;
     strcpy(drv_name,path);
     strcat(drv_name,name);
@@ -175,7 +185,7 @@
       goto err;
     }
     probe = dlsym(t_vdl(stream)->handle,"vixProbe");
-    if(probe) { if((*probe)(verbose)!=0) goto drv_err; }
+    if(probe) { if((*probe)(verbose,PROBE_FORCE)!=0) goto drv_err; }
     else goto drv_err;
     fill:
     if(!vdl_fill_driver(stream)) goto drv_err;
@@ -263,4 +273,29 @@
 int 	  vdlSetGrKeys(VDL_HANDLE handle, const vidix_grkey_t * k)
 {
   return t_vdl(handle)->set_gkey ? t_vdl(handle)->set_gkey(k) : ENOSYS;
+}
+
+int	  vdlPlaybackGetDeint(VDL_HANDLE handle, vidix_deinterlace_t * d)
+{
+  return t_vdl(handle)->get_deint ? t_vdl(handle)->get_deint(d) : ENOSYS;
+}
+
+int 	  vdlPlaybackSetDeint(VDL_HANDLE handle, const vidix_deinterlace_t * d)
+{
+  return t_vdl(handle)->set_deint ? t_vdl(handle)->set_deint(d) : ENOSYS;
+}
+
+int	  vdlQueryNumOemEffects(VDL_HANDLE handle, unsigned * number )
+{
+  return t_vdl(handle)->get_num_fx ? t_vdl(handle)->get_num_fx(number) : ENOSYS;
+}
+
+int	  vdlGetOemEffect(VDL_HANDLE handle, vidix_oem_fx_t * f)
+{
+  return t_vdl(handle)->get_fx ? t_vdl(handle)->get_fx(f) : ENOSYS;
+}
+
+int	  vdlSetOemEffect(VDL_HANDLE handle, const vidix_oem_fx_t * f)
+{
+  return t_vdl(handle)->set_fx ? t_vdl(handle)->set_fx(f) : ENOSYS;
 }




More information about the MPlayer-cvslog mailing list