Reporting media product info with -as cdrecord -atip
This commit is contained in:
parent
f779f2f308
commit
3c25d5a163
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2009.09.06.112851"
|
#define Xorriso_timestamP "2009.09.06.144813"
|
||||||
|
@ -8520,6 +8520,8 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
|
|||||||
struct burn_drive_info *dinfo;
|
struct burn_drive_info *dinfo;
|
||||||
struct burn_drive *drive;
|
struct burn_drive *drive;
|
||||||
enum burn_disc_status s;
|
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,
|
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
|
||||||
"on attempt to print drive and media info", 2);
|
"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);
|
sprintf(respt, "Current: %s\n",profile_name);
|
||||||
Xorriso_result(xorriso,1);
|
Xorriso_result(xorriso,1);
|
||||||
Xorriso_list_profiles(xorriso, 1 | 2);
|
Xorriso_list_profiles(xorriso, 1 | 2);
|
||||||
if(strstr(profile_name,"DVD")==profile_name) {
|
if(strstr(profile_name,"BD")==profile_name) {
|
||||||
sprintf(respt, "book type: %s (emulated booktype)\n", 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);
|
Xorriso_result(xorriso,1);
|
||||||
if(profile_number == 0x13) {
|
if(profile_number == 0x13) {
|
||||||
sprintf(respt, "xorriso: message for sdvdbackup: \"(growisofs mode Restricted Overwrite)\"\n");
|
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);
|
" 1T speed low: %.f 1T speed high: %.f\n",x_speed_min,x_speed_max);
|
||||||
Xorriso_result(xorriso,1);
|
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);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user