minor interface changing and verbosing

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4009 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nick 2002-01-06 16:00:12 +00:00
parent cf96db14ed
commit b093edc135
2 changed files with 28 additions and 7 deletions

View File

@ -104,7 +104,7 @@ typedef struct vidix_yuv_s
typedef struct vidix_rect_s typedef struct vidix_rect_s
{ {
unsigned x,y,w,h; /* in pixels */ unsigned x,y,w,h; /* in pixels */
vidix_yuv_t pitch; /* bytes per line */ vidix_yuv_t pitch; /* line-align in bytes */
}vidix_rect_t; }vidix_rect_t;
typedef struct vidix_color_key_s typedef struct vidix_color_key_s
@ -145,7 +145,7 @@ typedef struct vidix_playback_s
#define KEYS_XOR 3 #define KEYS_XOR 3
unsigned key_op; /* app -> driver: keys operations */ unsigned key_op; /* app -> driver: keys operations */
/* memory model */ /* memory model */
unsigned frame_size; /* app -> driver */ 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 #define LVO_MAXFRAMES 32
unsigned offsets[LVO_MAXFRAMES]; /* driver -> app */ unsigned offsets[LVO_MAXFRAMES]; /* driver -> app */

View File

@ -81,17 +81,34 @@ static int vdl_probe_driver(VDL_HANDLE stream,const char *path,const char *name,
int (*_cap)(vidix_capability_t*); int (*_cap)(vidix_capability_t*);
strcpy(drv_name,path); strcpy(drv_name,path);
strcat(drv_name,name); strcat(drv_name,name);
if(verbose) printf("vidixlib: PROBING: %s\n",drv_name);
if(!(t_vdl(stream)->handle = dlopen(drv_name,RTLD_NOW|RTLD_GLOBAL))) return 0; if(!(t_vdl(stream)->handle = dlopen(drv_name,RTLD_NOW|RTLD_GLOBAL))) return 0;
_ver = dlsym(t_vdl(stream)->handle,"vixGetVersion"); _ver = dlsym(t_vdl(stream)->handle,"vixGetVersion");
_probe = dlsym(t_vdl(stream)->handle,"vixProbe"); _probe = dlsym(t_vdl(stream)->handle,"vixProbe");
_cap = dlsym(t_vdl(stream)->handle,"vixGetCapability"); _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; } } if(_ver)
else goto err; {
if((*_ver)() != VIDIX_VERSION)
{
if(verbose) printf("vidixlib: %s has wrong version\n",drv_name);
err:
dlclose(t_vdl(stream)->handle);
t_vdl(stream)->handle = 0;
return 0;
}
}
else
{
fatal_err:
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) != 0) goto err; }
else goto err; else goto fatal_err;
if(_cap) { if((*_cap)(&vid_cap) != 0) goto err; } if(_cap) { if((*_cap)(&vid_cap) != 0) goto err; }
else goto err; else goto fatal_err;
if((vid_cap.type & cap) != cap) goto err; if((vid_cap.type & cap) != cap) goto err;
if(verbose) printf("vidixlib: %s probed o'k\n",drv_name);
return 1; return 1;
} }
@ -104,7 +121,11 @@ static int vdl_find_driver(VDL_HANDLE stream,const char *path,unsigned cap,int v
while(!done) while(!done)
{ {
name = readdir(dstream); name = readdir(dstream);
if(name) { if(vdl_probe_driver(stream,path,name->d_name,cap,verbose)) break; } if(name)
{
if(name->d_name[0] != '.')
if(vdl_probe_driver(stream,path,name->d_name,cap,verbose)) break;
}
else done = 1; else done = 1;
} }
closedir(dstream); closedir(dstream);