Support HD-DVD
This commit is contained in:
committed by
Stéphane Lesimple
parent
c19e7ea100
commit
c0bde64a54
@@ -399,6 +399,24 @@ static int get_configuration(DeviceHandle *dh)
|
|||||||
dh->subType = BD_RE;
|
dh->subType = BD_RE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x50: dh->profileDescr = "HD-DVD";
|
||||||
|
dh->shortProfile = "HD-DVD";
|
||||||
|
dh->mainType = HD_DVD;
|
||||||
|
dh->subType = HD_DVD;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x51: dh->profileDescr = "HD-DVD-R";
|
||||||
|
dh->shortProfile = "HD-DVD-R";
|
||||||
|
dh->mainType = HD_DVD;
|
||||||
|
dh->subType = HD_DVD_R;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x52: dh->profileDescr = "HD-DVD-RW";
|
||||||
|
dh->shortProfile = "HD-DVD-RW";
|
||||||
|
dh->mainType = HD_DVD;
|
||||||
|
dh->subType = HD_DVD_RW;
|
||||||
|
break;
|
||||||
|
|
||||||
default: dh->profileDescr = "Unknown profile";
|
default: dh->profileDescr = "Unknown profile";
|
||||||
dh->mainType = UNSUPPORTED;
|
dh->mainType = UNSUPPORTED;
|
||||||
dh->subType = UNSUPPORTED;
|
dh->subType = UNSUPPORTED;
|
||||||
@@ -875,13 +893,16 @@ static int query_dvd(DeviceHandle *dh, int probe_only)
|
|||||||
dh->rewriteable = TRUE;
|
dh->rewriteable = TRUE;
|
||||||
break;
|
break;
|
||||||
case 4: dh->bookDescr = "HD DVD-ROM";
|
case 4: dh->bookDescr = "HD DVD-ROM";
|
||||||
dh->subType = UNSUPPORTED;
|
dh->subType = HD_DVD;
|
||||||
break;
|
break;
|
||||||
case 5: dh->bookDescr = "HD DVD-RAM";
|
case 5: dh->bookDescr = "HD DVD-RAM";
|
||||||
dh->subType = UNSUPPORTED;
|
dh->subType = UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
case 6: dh->bookDescr = "HD DVD-R";
|
case 6: dh->bookDescr = "HD DVD-R";
|
||||||
dh->subType = UNSUPPORTED;
|
dh->subType = HD_DVD_R;
|
||||||
|
break;
|
||||||
|
case 7: dh->bookDescr = "HD DVD-RW";
|
||||||
|
dh->subType = HD_DVD_RW;
|
||||||
break;
|
break;
|
||||||
case 9: dh->bookDescr = "DVD+RW";
|
case 9: dh->bookDescr = "DVD+RW";
|
||||||
dh->rewriteable = TRUE;
|
dh->rewriteable = TRUE;
|
||||||
@@ -1185,6 +1206,22 @@ static int query_type(DeviceHandle *dh, int probe_only)
|
|||||||
}
|
}
|
||||||
break; /* unreachable */
|
break; /* unreachable */
|
||||||
|
|
||||||
|
case HD_DVD:
|
||||||
|
dh->read = read_dvd_sector;
|
||||||
|
dh->singleRate = 36000.0/8.0; /* 1x = 36 kbit */
|
||||||
|
dh->maxRate = 3;
|
||||||
|
dh->clusterSize = 32;
|
||||||
|
if(!dh->incomplete)
|
||||||
|
{ ret = query_dvd(dh, probe_only);
|
||||||
|
return (probe_only == 2 ? TRUE : ret);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ if(query_dvd(dh, TRUE)) return TRUE;
|
||||||
|
ret = query_incomplete(dh, probe_only);
|
||||||
|
return (probe_only == 2 ? TRUE : ret);
|
||||||
|
}
|
||||||
|
break; /* unreachable */
|
||||||
|
|
||||||
default: /* maybe HD DVD or sth else we do not support */
|
default: /* maybe HD DVD or sth else we do not support */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1914,6 +1951,13 @@ static gint64 query_size(Image *image)
|
|||||||
return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */
|
return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* HD-DVD: no clue. Stick with READ CAPACITY. */
|
||||||
|
|
||||||
|
if(dh->mainType == HD_DVD)
|
||||||
|
{ Verbose("HD-DVD medium - using size from READ CAPACITY: %" PRId64 " sectors\n", dh->readCapacity+1);
|
||||||
|
return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */
|
||||||
|
}
|
||||||
|
|
||||||
/* For DVD media, READ CAPACITY should give the real image size.
|
/* For DVD media, READ CAPACITY should give the real image size.
|
||||||
READ DVD STRUCTURE may be same value or the unformatted size.
|
READ DVD STRUCTURE may be same value or the unformatted size.
|
||||||
But some drives appear to have both functions reversed,
|
But some drives appear to have both functions reversed,
|
||||||
@@ -2723,6 +2767,7 @@ Image* OpenImageFromDevice(char *device, int query_only)
|
|||||||
|
|
||||||
switch(subTypeMasked)
|
switch(subTypeMasked)
|
||||||
{ case BD:
|
{ case BD:
|
||||||
|
case HD_DVD:
|
||||||
case DVD:
|
case DVD:
|
||||||
case CD:
|
case CD:
|
||||||
{ char *tmp;
|
{ char *tmp;
|
||||||
|
|||||||
@@ -235,6 +235,10 @@ typedef struct _DeviceHandle
|
|||||||
#define BD_R 0x41
|
#define BD_R 0x41
|
||||||
#define BD_RE 0x42
|
#define BD_RE 0x42
|
||||||
|
|
||||||
|
#define HD_DVD 0x50
|
||||||
|
#define HD_DVD_R 0x51
|
||||||
|
#define HD_DVD_RW 0x52
|
||||||
|
|
||||||
#define UNSUPPORTED 0x00
|
#define UNSUPPORTED 0x00
|
||||||
|
|
||||||
/* transport io modes */
|
/* transport io modes */
|
||||||
|
|||||||
Reference in New Issue
Block a user