mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 11:14:25 +00:00
Add support for dumping the 2nd layer PFI of DVDs.
This commit is contained in:
@@ -384,7 +384,10 @@ public enum MediaTagType
|
||||
MiniDiscDTOC = 72,
|
||||
/// <summary>Decrypted DVD disc key</summary>
|
||||
[Description("Disc key (Decrypted)")]
|
||||
DVD_DiscKey_Decrypted = 73
|
||||
DVD_DiscKey_Decrypted = 73,
|
||||
/// <summary>Physical Format Information for the 2nd layer of dual-layer DVDs</summary>
|
||||
[Description("Physical Format Information (2nd Layer)")]
|
||||
DVD_PFI_2ndLayer = 74
|
||||
}
|
||||
|
||||
/// <summary>Enumeration of media types defined in metadata</summary>
|
||||
|
||||
@@ -420,6 +420,33 @@ partial class Dump
|
||||
DiskCategory.UMD => MediaType.UMD,
|
||||
_ => MediaType.DVDROM
|
||||
};
|
||||
|
||||
if(nullablePfi.Value.Layers > 1)
|
||||
{
|
||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||
out _,
|
||||
MmcDiscStructureMediaType.Dvd,
|
||||
0,
|
||||
1,
|
||||
MmcDiscStructureFormat.PhysicalInformation,
|
||||
0,
|
||||
_dev.Timeout,
|
||||
out _);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
PFI.PhysicalFormatInformation? layer2Pfi = PFI.Decode(cmdBuf, dskType);
|
||||
|
||||
if(layer2Pfi.HasValue)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);
|
||||
mediaTags.Add(MediaTagType.DVD_PFI_2ndLayer, tmpBuf);
|
||||
|
||||
UpdateStatus?.Invoke("Layer 2 PFI:\n" + PFI.Prettify(layer2Pfi.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -566,6 +566,20 @@ public static class ImageInfo
|
||||
}
|
||||
}
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_PFI_2ndLayer) == true)
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.DVD_PFI_2ndLayer, out byte[] pfi);
|
||||
|
||||
if(errno == ErrorNumber.NoError)
|
||||
{
|
||||
AaruLogging.WriteLine(Localization.Core
|
||||
.DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup);
|
||||
|
||||
AaruLogging.Write(PFI.Prettify(pfi, imageFormat.Info.MediaType));
|
||||
AaruLogging.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVDRAM_DDS) == true)
|
||||
{
|
||||
errno = imageFormat.ReadMediaTag(MediaTagType.DVDRAM_DDS, out byte[] dds);
|
||||
|
||||
@@ -210,6 +210,7 @@ public sealed partial class DecodeMediaTagsViewModel : ViewModelBase
|
||||
|
||||
break;
|
||||
case MediaTagType.DVD_PFI:
|
||||
case MediaTagType.DVD_PFI_2ndLayer:
|
||||
DecodedText = PFI.Prettify(value.Data, _mediaType);
|
||||
if(string.IsNullOrEmpty(DecodedText)) DecodedVisible = false;
|
||||
|
||||
|
||||
6
Aaru.Localization/Core.Designer.cs
generated
6
Aaru.Localization/Core.Designer.cs
generated
@@ -6892,5 +6892,11 @@ namespace Aaru.Localization {
|
||||
return ResourceManager.GetString("Media_identified_as", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup {
|
||||
get {
|
||||
return ResourceManager.GetString("DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3496,4 +3496,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta.</value>
|
||||
<data name="XML_type_0" xml:space="preserve">
|
||||
<value>[slateblue1]Tipo XML:[/] [italic][rosybrown]{0}[/][/]</value>
|
||||
</data>
|
||||
<data name="DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup" xml:space="preserve">
|
||||
<value>[bold][blue]Información del formato físico del DVD (2ª capa) contenida en la imagen:[/][/]</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -3517,4 +3517,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
|
||||
<data name="Media_identified_as" xml:space="preserve">
|
||||
<value>Media identified as</value>
|
||||
</data>
|
||||
<data name="DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup" xml:space="preserve">
|
||||
<value>[bold][blue]DVD 2nd layer Physical Format Information contained in image:[/][/]</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user