mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Implement xml media type.
This commit is contained in:
@@ -113,6 +113,8 @@ uint32_t edc_cd_compute(void *context, uint32_t edc, const uint8_t *src, int siz
|
|||||||
|
|
||||||
int32_t read_track_sector(void *context, uint8_t *data, uint64_t sectorAddress, uint32_t *length, uint8_t track);
|
int32_t read_track_sector(void *context, uint8_t *data, uint64_t sectorAddress, uint32_t *length, uint8_t track);
|
||||||
|
|
||||||
static int32_t GetMediaTagTypeForDataType(int32_t type);
|
int32_t GetMediaTagTypeForDataType(int32_t type);
|
||||||
|
|
||||||
|
int32_t GetXmlMediaType(int32_t type);
|
||||||
|
|
||||||
#endif //LIBDICFORMAT_DECLS_H
|
#endif //LIBDICFORMAT_DECLS_H
|
||||||
|
|||||||
102
src/helpers.c
102
src/helpers.c
@@ -34,7 +34,7 @@
|
|||||||
#include <dicformat.h>
|
#include <dicformat.h>
|
||||||
|
|
||||||
// Converts between image data type and dic media tag type
|
// Converts between image data type and dic media tag type
|
||||||
static int32_t GetMediaTagTypeForDataType(int32_t type)
|
int32_t GetMediaTagTypeForDataType(int32_t type)
|
||||||
{
|
{
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
@@ -110,3 +110,103 @@ static int32_t GetMediaTagTypeForDataType(int32_t type)
|
|||||||
default: return -1;
|
default: return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the CICM XML media type from DIC media type
|
||||||
|
int32_t GetXmlMediaType(int32_t type)
|
||||||
|
{
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case CD:
|
||||||
|
case CDDA:
|
||||||
|
case CDG:
|
||||||
|
case CDEG:
|
||||||
|
case CDI:
|
||||||
|
case CDIREADY:
|
||||||
|
case CDROM:
|
||||||
|
case CDROMXA:
|
||||||
|
case CDPLUS:
|
||||||
|
case CDMO:
|
||||||
|
case CDR:
|
||||||
|
case CDRW:
|
||||||
|
case CDMRW:
|
||||||
|
case VCD:
|
||||||
|
case SVCD:
|
||||||
|
case PCD:
|
||||||
|
case SACD:
|
||||||
|
case DDCD:
|
||||||
|
case DDCDR:
|
||||||
|
case DDCDRW:
|
||||||
|
case DTSCD:
|
||||||
|
case CDMIDI:
|
||||||
|
case CDV:
|
||||||
|
case DVDROM:
|
||||||
|
case DVDR:
|
||||||
|
case DVDRW:
|
||||||
|
case DVDPR:
|
||||||
|
case DVDPRW:
|
||||||
|
case DVDPRWDL:
|
||||||
|
case DVDRDL:
|
||||||
|
case DVDPRDL:
|
||||||
|
case DVDRAM:
|
||||||
|
case DVDRWDL:
|
||||||
|
case DVDDownload:
|
||||||
|
case HDDVDROM:
|
||||||
|
case HDDVDRAM:
|
||||||
|
case HDDVDR:
|
||||||
|
case HDDVDRW:
|
||||||
|
case HDDVDRDL:
|
||||||
|
case HDDVDRWDL:
|
||||||
|
case BDROM:
|
||||||
|
case BDR:
|
||||||
|
case BDRE:
|
||||||
|
case BDRXL:
|
||||||
|
case BDREXL:
|
||||||
|
case EVD:
|
||||||
|
case FVD:
|
||||||
|
case HVD:
|
||||||
|
case CBHD:
|
||||||
|
case HDVMD:
|
||||||
|
case VCDHD:
|
||||||
|
case SVOD:
|
||||||
|
case FDDVD:
|
||||||
|
case LD:
|
||||||
|
case LDROM:
|
||||||
|
case LDROM2:
|
||||||
|
case LVROM:
|
||||||
|
case MegaLD:
|
||||||
|
case PS1CD:
|
||||||
|
case PS2CD:
|
||||||
|
case PS2DVD:
|
||||||
|
case PS3DVD:
|
||||||
|
case PS3BD:
|
||||||
|
case PS4BD:
|
||||||
|
case UMD:
|
||||||
|
case XGD:
|
||||||
|
case XGD2:
|
||||||
|
case XGD3:
|
||||||
|
case XGD4:
|
||||||
|
case MEGACD:
|
||||||
|
case SATURNCD:
|
||||||
|
case GDROM:
|
||||||
|
case GDR:
|
||||||
|
case SuperCDROM2:
|
||||||
|
case JaguarCD:
|
||||||
|
case ThreeDO:
|
||||||
|
case PCFX:
|
||||||
|
case NeoGeoCD:
|
||||||
|
case GOD:
|
||||||
|
case WOD:
|
||||||
|
case WUOD:
|
||||||
|
case CDTV:
|
||||||
|
case CD32:
|
||||||
|
case Nuon:
|
||||||
|
case Playdia:
|
||||||
|
case Pippin:
|
||||||
|
case FMTOWNS:
|
||||||
|
case MilCD:
|
||||||
|
case VideoNow:
|
||||||
|
case VideoNowColor:
|
||||||
|
case VideoNowXp: return OpticalDisc;
|
||||||
|
default: return BlockMedia;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1154,9 +1154,7 @@ void *open(const char *filepath)
|
|||||||
|
|
||||||
ctx->imageInfo.CreationTime = ctx->header.creationTime;
|
ctx->imageInfo.CreationTime = ctx->header.creationTime;
|
||||||
ctx->imageInfo.LastModificationTime = ctx->header.lastWrittenTime;
|
ctx->imageInfo.LastModificationTime = ctx->header.lastWrittenTime;
|
||||||
|
ctx->imageInfo.XmlMediaType = GetXmlMediaType(ctx->header.mediaType);
|
||||||
// TODO: GetXmlMediaType
|
|
||||||
// imageInfo.XmlMediaType = GetXmlMediaType(header.mediaType);
|
|
||||||
|
|
||||||
if(ctx->geometryBlock.identifier != GeometryBlock/* && ctx->imageInfo.XmlMediaType == XmlMediaType.BlockMedia*/)
|
if(ctx->geometryBlock.identifier != GeometryBlock/* && ctx->imageInfo.XmlMediaType == XmlMediaType.BlockMedia*/)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user