From 5fde82ba76ecb94550d744a5dbf5ac8a218aadfb Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 6 Sep 2009 14:56:36 +0000 Subject: [PATCH] Reporting media product info with -as cdrecord -atip --- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 52 +++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index e9d73781..e79efafa 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.09.06.112851" +#define Xorriso_timestamP "2009.09.06.144813" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index cdcad2bb..ac56d444 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -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); }