minor update , load capture devices on startup in reloaded

git-svn-id: svn://code.dyne.org/veejay/trunk@812 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2007-02-25 14:09:42 +00:00
parent 20c931c685
commit d99b453050
3 changed files with 45 additions and 53 deletions

View File

@@ -14,10 +14,10 @@
CODENAME: classic
0.9.23
0.9.25
2006/2007 - release date Feb. 12 2007
2006/2007 - release date Feb. 24 2007
=======================================
:: Veejay, a visual instrument for GNU ::

View File

@@ -102,6 +102,7 @@ static int vj_unicap_scan_enumerate_devices(void *unicap)
unicap_driver_t *ud = (unicap_driver_t*) unicap;
char key[64];
unicap_void_device(&(ud->device));
while( SUCCESS( unicap_enumerate_devices( NULL, &(ud->device), i )) )
{
@@ -153,61 +154,53 @@ char **vj_unicap_get_devices(void *unicap, int *n_dev)
veejay_msg(0, "I didn't find any capture devices");
return NULL;
}
/*
result = (char**) vj_calloc(sizeof(char*) * (ud->num_devices+1));
unicap_void_device( &(ud->device) );
for( i = 0; i < ud->num_devices; i++ )
char **items = vevo_list_properties( ud->device_list );
if(! items )
{
char tmp[1024];
unicap_property_t property;
unicap_format_t format;
int property_count = 0;
int format_count = 0;
if( !SUCCESS( unicap_enumerate_devices( NULL, &(ud->device), i)))
{
veejay_msg(0, "Failed to get information for device '%s'", ud->device.identifier );
continue;
}
if( !SUCCESS( unicap_open( &(ud->handle), &(ud->device) ) ) )
{
veejay_msg(0, "Failed to open: %s (device '%d')\n", &(ud->device.identifier), i );
continue;
}
unicap_lock_properties( ud->handle );
unicap_void_property( &property );
unicap_void_format( &format );
unicap_reenumerate_properties( ud->handle, &property_count );
unicap_reenumerate_formats( ud->handle, &format_count );
char *device_name = strdup( ud->device.identifier );
char *device_location = strdup( ud->device.device );
snprintf(tmp,1024, "%03d%s%03d%s",
strlen( device_name ),
device_name,
strlen( device_location ),
device_location );
result[j] = strdup( tmp );
j++;
free( device_location );
free( device_name );
unicap_unlock_properties( ud->handle );
unicap_close( ud->handle );
veejay_msg(0, "Empty list of capture devices");
return NULL;
}
int len = 1;
int error = 0;
for ( i = 0; items[i] != NULL ; i ++ )
{
error = vevo_property_get( ud->device_list,items[i], 0, NULL );
if( error == VEVO_NO_ERROR )
len ++;
}
result = vj_calloc( sizeof(char*) * len );
for( i = 0; items[i] != NULL ; i ++ )
{
void *port = NULL;
error = vevo_property_get( ud->device_list, items[i], 0, &port );
if( error == VEVO_NO_ERROR )
{
size_t name_len = vevo_property_element_size( port, "name", 0 );
char *name = (char*) vj_calloc( name_len );
vevo_property_get( port, "name",0,&name );
name_len = vevo_property_element_size( port, "device", 0 );
char *loc = (char*) vj_calloc( name_len );
vevo_property_get( port, "device", 0, &loc );
int new_len = strlen(loc) + strlen(name) + 8;
char *text = vj_calloc( new_len );
snprintf(text, new_len, "%03d%s%03d%s",strlen(name), name,strlen(loc), loc );
free(name);
free(loc);
result[j] = strdup(text );
free(text);
j++;
}
free(items[i]);
}
free(items );
*n_dev = j;
*/
return result;
}

View File

@@ -2575,7 +2575,6 @@ void vj_event_send_devicelist( void *ptr, const char format[], va_list ap)
veejay_t *v = (veejay_t*) ptr;
char *buf = vj_tag_scan_devices();
veejay_msg(0, "%s",buf);
SEND_MSG( v, buf );
free(buf);
}