I found several utilities that can work with DVD region settings in OS X: DVD Info X and Region X. DVD Info X will display the region code of your disc without having to insert a DVD.
Region X is more interesting because, although it does not directly correspond to your goal, its source is available . Looking at this, I found that the ScanAll method in Region Xm is what you need. More specifically, an interesting case is where the disc name is not found (since there is no disc on it), and the SCSI command is used to determine the properties of the DVD drive (calling printf is my complement):
task = (*scsitaskinterface)->CreateSCSITask(scsitaskinterface); if (task) { cdb[0] = 0xa4; cdb[1] = 0x00; cdb[2] = 0x00; cdb[3] = 0x00; cdb[4] = 0x00; cdb[5] = 0x00; cdb[6] = 0x00; cdb[7] = 0x00; cdb[8] = (sizeof(DVDInfo) >> 8) & 0xff; cdb[9] = sizeof(DVDInfo) & 0xff; cdb[10] = 0x08; cdb[11] = 0x00; memset(&DVDInfo, 0, sizeof(DVDInfo)); ProcessCDB(task, cdb, 12, DirIn, &DVDInfo, sizeof(DVDInfo), 30000); printf("drive region %#hhx\n", DVDInfo.driveRegion); printf("number of region changes left: %hhu\n", DVDInfo.numberUserResets); if (DVDInfo.rpcScheme == 0) RPC1++; if (DVDInfo.rpcScheme != 0) RPC2++; (*task)->Release(task); }
I ran this on my Macbook Pro and the result was as expected.
Obviously, you will need to massage it in order to isolate this part into something that you can use, but I think this code will be a useful starting point.
source share