[Mplayer-cvslog] CVS: main/vidix vidix.h,1.1,1.2 vidixlib.h,1.1,1.2 vidixlib.c,1.1,1.2

Nick Kurshev nick at mplayer.dev.hu
Sat Jan 5 19:16:22 CET 2002


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

Modified Files:
	vidix.h vidixlib.h vidixlib.c 
Log Message:
minor interface changing

Index: vidix.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidix.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vidix.h	5 Jan 2002 10:13:25 -0000	1.1
+++ vidix.h	5 Jan 2002 18:16:19 -0000	1.2
@@ -26,7 +26,7 @@
 extern unsigned vixGetVersion( void );
 
 			/* Probes video hw. Returns 0 if ok else errno */
-extern int	vixProbe( void );
+extern int	vixProbe( int verbose );
 			/* Initializes driver. Returns 0 if ok else errno */
 extern int	vixInit( void );
 			/* Destroys driver */
@@ -144,23 +144,17 @@
 #define KEYS_OR		2
 #define KEYS_XOR	3
 	unsigned	key_op;		/* app -> driver: keys operations */
-}vidix_playback_t;
-
-			/* Returns 0 if ok else errno */
-extern int	vixConfigPlayback(const vidix_playback_t *);
-
-typedef struct vidix_dga_s
-{
+	/* memory model */
 	unsigned	frame_size;		/* app -> driver */
 	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 */
 	void*		dga_addr;		/* driver -> app: linear address */
-}vidix_dga_t;
+}vidix_playback_t;
 
 			/* Returns 0 if ok else errno */
-extern int	vixMapPlayback(vidix_dga_t *);
+extern int	vixConfigPlayback(vidix_playback_t *);
 
 			/* Returns 0 if ok else errno */
 extern int 	vixPlaybackOn( void );

Index: vidixlib.h
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidixlib.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vidixlib.h	5 Jan 2002 10:13:25 -0000	1.1
+++ vidixlib.h	5 Jan 2002 18:16:19 -0000	1.2
@@ -35,9 +35,10 @@
 			   path - specifies path where drivers are located.
 			   name - specifies prefered driver name (can be NULL).
 			   cap  - specifies driver capability (TYPE_* constants).
+			   verbose - specifies verbose level
 			   returns !0 if ok else NULL.
 			   */
-extern VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap);
+extern VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose);
 			/* Closes stream and corresponded driver. */
 extern void	  vdlClose(VDL_HANDLE stream);
 
@@ -48,10 +49,7 @@
 extern int	  vdlQueryFourcc(VDL_HANDLE,vidix_fourcc_t *);
 
 			/* Returns 0 if ok else errno */
-extern int	  vdlConfigPlayback(VDL_HANDLE,const vidix_playback_t *);
-
-			/* Returns 0 if ok else errno */
-extern int	  vdlMapPlayback(VDL_HANDLE,vidix_dga_t *);
+extern int	  vdlConfigPlayback(VDL_HANDLE, vidix_playback_t *);
 
 			/* Returns 0 if ok else errno */
 extern int 	  vdlPlaybackOn(VDL_HANDLE);

Index: vidixlib.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidixlib.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vidixlib.c	5 Jan 2002 10:13:25 -0000	1.1
+++ vidixlib.c	5 Jan 2002 18:16:19 -0000	1.2
@@ -32,8 +32,7 @@
 	void *  handle;
 	int	(*get_caps)(vidix_capability_t *);
 	int	(*query_fourcc)(vidix_fourcc_t *);
-	int	(*config_playback)(const vidix_playback_t *);
-	int	(*map_playback)(vidix_dga_t *);
+	int	(*config_playback)(vidix_playback_t *);
 	int 	(*playback_on)( void );
 	int 	(*playback_off)( void );
         /* Functions below can be missed in driver ;) */
@@ -59,7 +58,6 @@
   t_vdl(stream)->get_caps	= dlsym(t_vdl(stream)->handle,"vixGetCapability");
   t_vdl(stream)->query_fourcc	= dlsym(t_vdl(stream)->handle,"vixQueryFourcc");
   t_vdl(stream)->config_playback= dlsym(t_vdl(stream)->handle,"vixConfigPlayback");
-  t_vdl(stream)->map_playback	= dlsym(t_vdl(stream)->handle,"vixMapPlayback");
   t_vdl(stream)->playback_on	= dlsym(t_vdl(stream)->handle,"vixPlaybackOn");
   t_vdl(stream)->playback_off	= dlsym(t_vdl(stream)->handle,"vixPlaybackOff");
   t_vdl(stream)->frame_sel	= dlsym(t_vdl(stream)->handle,"vixPlaybackFrameSelect");
@@ -67,18 +65,19 @@
   t_vdl(stream)->set_eq	= dlsym(t_vdl(stream)->handle,"vixPlaybackSetEq");
   t_vdl(stream)->copy_frame	= dlsym(t_vdl(stream)->handle,"vixPlaybackCopyFrame");
   /* check driver viability */
-  if(!( t_vdl(stream)->get_caps && t_vdl(stream)->query_fourcc && t_vdl(stream)->config_playback &&
-	t_vdl(stream)->map_playback && t_vdl(stream)->playback_on && t_vdl(stream)->playback_off))
+  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))
 			return 0;
   return 1;
 }
 
-static int vdl_probe_driver(VDL_HANDLE stream,const char *path,const char *name,unsigned cap)
+static int vdl_probe_driver(VDL_HANDLE stream,const char *path,const char *name,unsigned cap,int verbose)
 {
   char drv_name[FILENAME_MAX];
   vidix_capability_t vid_cap;
   unsigned (*_ver)(void);
-  int      (*_probe)(void);
+  int      (*_probe)(int);
   int      (*_cap)(vidix_capability_t*);
   strcpy(drv_name,path);
   strcat(drv_name,name);
@@ -88,7 +87,7 @@
   _cap = dlsym(t_vdl(stream)->handle,"vixGetCapability");
   if(_ver) { if((*_ver)() != VIDIX_VERSION) { err: dlclose(t_vdl(stream)->handle); t_vdl(stream)->handle = 0; return 0; } }
   else goto err;
-  if(_probe) { if((*_probe)() != 0) goto err; }
+  if(_probe) { if((*_probe)(verbose) != 0) goto err; }
   else goto err;
   if(_cap) { if((*_cap)(&vid_cap) != 0) goto err; }
   else goto err;
@@ -96,7 +95,7 @@
   return 1;
 }
 
-static int vdl_find_driver(VDL_HANDLE stream,const char *path,unsigned cap)
+static int vdl_find_driver(VDL_HANDLE stream,const char *path,unsigned cap,int verbose)
 {
   DIR *dstream;
   struct dirent *name;
@@ -105,14 +104,14 @@
   while(!done)
   {
     name = readdir(dstream);
-    if(name) { if(vdl_probe_driver(stream,path,name->d_name,cap)) break; }
+    if(name) { if(vdl_probe_driver(stream,path,name->d_name,cap,verbose)) break; }
     else done = 1;
   }
   closedir(dstream);
   return done?0:1;
 }
 
-VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap)
+VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose)
 {
   vdl_stream_t *stream;
   char drv_name[FILENAME_MAX];
@@ -121,6 +120,7 @@
   if(name)
   {
     unsigned (*ver)(void);
+    int (*probe)(int);
     unsigned version = 0;
     strcpy(drv_name,path);
     strcat(drv_name,name);
@@ -138,13 +138,16 @@
       if(t_vdl(stream)->handle) dlclose(t_vdl(stream)->handle);
       goto err;
     }
+    probe = dlsym(t_vdl(stream)->handle,"vixProbe");
+    if(probe) { if((*probe)(verbose)!=0) goto drv_err; }
+    else goto drv_err;
     fill:
     if(!vdl_fill_driver(stream)) goto drv_err;
   }
   else
-    if(vdl_find_driver(stream,path,cap))	goto fill;
-    else					goto err;
-  if(t_vdl(stream)->init) t_vdl(stream)->init();
+    if(vdl_find_driver(stream,path,cap,verbose))	goto fill;
+    else						goto err;
+  if(t_vdl(stream)->init) if(t_vdl(stream)->init())	goto drv_err;
   return stream;
 }
 
@@ -166,14 +169,9 @@
   return t_vdl(handle)->query_fourcc(f);
 }
 
-int  vdlConfigPlayback(VDL_HANDLE handle,const vidix_playback_t *p)
+int  vdlConfigPlayback(VDL_HANDLE handle,vidix_playback_t *p)
 {
   return t_vdl(handle)->config_playback(p);
-}
-
-int  vdlMapPlayback(VDL_HANDLE handle,vidix_dga_t *m)
-{
-  return t_vdl(handle)->map_playback(m);
 }
 
 int  vdlPlaybackOn(VDL_HANDLE handle)




More information about the MPlayer-cvslog mailing list