Reporting media product info with -as cdrecord -atip

This commit is contained in:
Thomas Schmitt 2009-09-06 14:56:36 +00:00
parent 18438856c8
commit 5fde82ba76
2 changed files with 51 additions and 3 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.09.06.112851"
#define Xorriso_timestamP "2009.09.06.144813"

View File

@ -8520,6 +8520,8 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
struct burn_drive_info *dinfo;
struct burn_drive *drive;
enum burn_disc_status s;
char *manuf= NULL, *media_code1= NULL, *media_code2= NULL;
char *book_type= NULL, *product_id= NULL;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print drive and media info", 2);
@ -8573,8 +8575,10 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
sprintf(respt, "Current: %s\n",profile_name);
Xorriso_result(xorriso,1);
Xorriso_list_profiles(xorriso, 1 | 2);
if(strstr(profile_name,"DVD")==profile_name) {
sprintf(respt, "book type: %s (emulated booktype)\n", profile_name);
if(strstr(profile_name,"BD")==profile_name) {
printf("Mounted Media: %2.2Xh, %s\n", profile_number, profile_name);
} else if(strstr(profile_name,"DVD")==profile_name) {
sprintf(respt, "book type: %s (emulated booktype)\n", profile_name);
Xorriso_result(xorriso,1);
if(profile_number == 0x13) {
sprintf(respt, "xorriso: message for sdvdbackup: \"(growisofs mode Restricted Overwrite)\"\n");
@ -8609,6 +8613,50 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
" 1T speed low: %.f 1T speed high: %.f\n",x_speed_min,x_speed_max);
Xorriso_result(xorriso,1);
}
ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2,
&book_type, 0);
if(ret > 0 && media_code1 != NULL && media_code2 != NULL)
manuf= burn_guess_manufacturer(profile_number, media_code1, media_code2, 0);
if(product_id != NULL) {
sprintf(respt, "Product Id: %s\n", product_id);
Xorriso_result(xorriso,1);
}
if(manuf != NULL) {
sprintf(respt, "Producer: %s\n", manuf);
Xorriso_result(xorriso, 1);
}
if(profile_number == 0x09 || profile_number == 0x0a) {
sprintf(respt, "Manufacturer: %s\n", manuf);
Xorriso_result(xorriso, 1);
} else if(product_id != NULL && media_code1 != NULL && media_code2 != NULL){
free(product_id);
free(media_code1);
free(media_code2);
if(book_type != NULL)
free(book_type);
product_id= media_code1= media_code2= book_type= NULL;
ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2,
&book_type, 1);
if(ret > 0) {
sprintf(respt, "Manufacturer: '%s'\n", media_code1);
Xorriso_result(xorriso, 1);
if(media_code2[0]) {
sprintf(respt, "Media type: '%s'\n", media_code2);
Xorriso_result(xorriso, 1);
}
}
}
if(manuf != NULL)
free(manuf);
if(media_code1 != NULL)
free(media_code1);
if(media_code2 != NULL)
free(media_code2);
if(book_type != NULL)
free(book_type);
if(product_id != NULL)
free(product_id);
return(1);
}