From 236df8128f08c25b5b91b92f582109de8a05a52e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 19 Oct 2015 02:28:40 +0100 Subject: [PATCH] Separated DVD decoders by type. --- ChangeLog | 21 + DVD/AACS.cs | 85 +++ DVD/ADIP.cs | 85 +++ DVD/BCA.cs | 85 +++ DVD/CPRM.cs | 109 ++++ DVD/CSS&CPRM.cs | 124 ++++ DVD/Cartridge.cs | 130 ++++ DVD/DDS.cs | 85 +++ DVD/DMI.cs | 85 +++ DVD/DVD.cs | 1083 --------------------------------- DVD/Enums.cs | 187 ++++++ DVD/Layers.cs | 247 ++++++++ DVD/PFI.cs | 264 ++++++++ DVD/PRI.cs | 85 +++ DVD/RMD.cs | 124 ++++ DVD/Spare.cs | 95 +++ DVD/UDI.cs | 125 ++++ DiscImageChef.Decoders.csproj | 16 +- 18 files changed, 1951 insertions(+), 1084 deletions(-) create mode 100644 DVD/AACS.cs create mode 100644 DVD/ADIP.cs create mode 100644 DVD/BCA.cs create mode 100644 DVD/CPRM.cs create mode 100644 DVD/CSS&CPRM.cs create mode 100644 DVD/Cartridge.cs create mode 100644 DVD/DDS.cs create mode 100644 DVD/DMI.cs delete mode 100644 DVD/DVD.cs create mode 100644 DVD/Enums.cs create mode 100644 DVD/Layers.cs create mode 100644 DVD/PFI.cs create mode 100644 DVD/PRI.cs create mode 100644 DVD/RMD.cs create mode 100644 DVD/Spare.cs create mode 100644 DVD/UDI.cs diff --git a/ChangeLog b/ChangeLog index a06dbe404..52a585855 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2015-10-19 Natalia Portillo + + * DVD/DVD.cs: + * DVD/DMI.cs: + * DVD/DDS.cs: + * DVD/PFI.cs: + * DVD/PRI.cs: + * DVD/RMD.cs: + * DVD/BCA.cs: + * DVD/UDI.cs: + * DVD/AACS.cs: + * DVD/ADIP.cs: + * DVD/CPRM.cs: + * DVD/Spare.cs: + * DVD/Enums.cs: + * DVD/Layers.cs: + * DVD/CSS&CPRM.cs: + * DVD/Cartridge.cs: + * DiscImageChef.Decoders.csproj: + Separated DVD decoders by type. + 2015-10-19 Natalia Portillo * Floppy/ISO.cs: diff --git a/DVD/AACS.cs b/DVD/AACS.cs new file mode 100644 index 000000000..45214392a --- /dev/null +++ b/DVD/AACS.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AACS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class AACS + { + public struct HDLeadInCopyright + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 2052 + /// HD DVD Lead-In Copyright Information + /// + public byte[] CopyrightInformation; + } + } +} + diff --git a/DVD/ADIP.cs b/DVD/ADIP.cs new file mode 100644 index 000000000..628e7d71f --- /dev/null +++ b/DVD/ADIP.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : ADIP.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class ADIP + { + public struct ADIPInformation + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 259 + /// ADIP, defined in DVD standards + /// + public byte[] ADIP; + } + } +} + diff --git a/DVD/BCA.cs b/DVD/BCA.cs new file mode 100644 index 000000000..7c64d09f0 --- /dev/null +++ b/DVD/BCA.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BCA.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class BCA + { + public struct BurstCuttingArea + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to end + /// Burst cutting area contents, 12 to 188 bytes + /// + public byte[] BCA; + } + } +} + diff --git a/DVD/CPRM.cs b/DVD/CPRM.cs new file mode 100644 index 000000000..5f843de9d --- /dev/null +++ b/DVD/CPRM.cs @@ -0,0 +1,109 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : CPRM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class CPRM + { + public struct DiscMediaIdentifier + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to end + /// Disc Media Identifier for CPRM + /// + public byte[] MediaIdentifier; + } + + public struct DiscMediaKeyBlock + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to end + /// Disc Media Key Block for CPRM + /// + public byte[] MediaKeyBlock; + } + } +} + diff --git a/DVD/CSS&CPRM.cs b/DVD/CSS&CPRM.cs new file mode 100644 index 000000000..f4f0b9541 --- /dev/null +++ b/DVD/CSS&CPRM.cs @@ -0,0 +1,124 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : CSS&CPRM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class CSS_CPRM + { + public struct LeadInCopyright + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4 + /// Copy protection system type + /// + public byte CopyrightType; + /// + /// Byte 5 + /// Bitmask of regions where this disc is playable + /// + public byte RegionInformation; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 7 + /// Reserved + /// + public byte Reserved4; + } + + public struct DiscKey + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 2052 + /// Disc key for CSS, Album Identifier for CPPM + /// + public byte[] Key; + } + } +} + diff --git a/DVD/Cartridge.cs b/DVD/Cartridge.cs new file mode 100644 index 000000000..bc4fa293b --- /dev/null +++ b/DVD/Cartridge.cs @@ -0,0 +1,130 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Cartridge.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class Cartridge + { + public struct MediumStatus + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bit 7 + /// Medium is in a cartridge + /// + public bool Cartridge; + /// + /// Byte 4, bit 6 + /// Medium has been taken out/inserted in a cartridge + /// + public bool OUT; + /// + /// Byte 4, bits 5 to 4 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 4, bit 3 + /// Media is write protected by reason stablished in RAMSWI + /// + public bool MSWI; + /// + /// Byte 4, bit 2 + /// Media is write protected by cartridge + /// + public bool CWP; + /// + /// Byte 4, bit 1 + /// Media is persistently write protected + /// + public bool PWP; + /// + /// Byte 4, bit 0 + /// Reserved + /// + public bool Reserved4; + /// + /// Byte 5 + /// Writable status depending on cartridge + /// + public byte DiscType; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved5; + /// + /// Byte 7 + /// Reason of specific write protection, only defined 0x01 as "bare disc wp", and 0xFF as unspecified. Rest reserved. + /// + public byte RAMSWI; + } + } +} + diff --git a/DVD/DDS.cs b/DVD/DDS.cs new file mode 100644 index 000000000..6de2b77f2 --- /dev/null +++ b/DVD/DDS.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : DDS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class DDS + { + public struct DiscDefinitionStructure + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 2052 + /// DVD-RAM / HD DVD-RAM disc definition structure + /// + public byte[] DDS; + } + } +} + diff --git a/DVD/DMI.cs b/DVD/DMI.cs new file mode 100644 index 000000000..bb313df1a --- /dev/null +++ b/DVD/DMI.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : DMI.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class DMI + { + public struct DiscManufacturingInformation + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 2052 + /// Disc Manufacturing Information + /// + public byte[] DMI; + } + } +} + diff --git a/DVD/DVD.cs b/DVD/DVD.cs deleted file mode 100644 index ce265e632..000000000 --- a/DVD/DVD.cs +++ /dev/null @@ -1,1083 +0,0 @@ -/*************************************************************************** -The Disc Image Chef ----------------------------------------------------------------------------- - -Filename : BD.cs -Version : 1.0 -Author(s) : Natalia Portillo - -Component : Decoders. - -Revision : $Revision$ -Last change by : $Author$ -Date : $Date$ - ---[ Description ] ---------------------------------------------------------- - -Decodes DVD structures. - ---[ License ] -------------------------------------------------------------- - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - ----------------------------------------------------------------------------- -Copyright (C) 2011-2014 Claunia.com -****************************************************************************/ -//$Id$ -using System; -using System.Text; - -namespace DiscImageChef.Decoders -{ - /// - /// Information from the following standards: - /// ANSI X3.304-1997 - /// T10/1048-D revision 9.0 - /// T10/1048-D revision 10a - /// T10/1228-D revision 7.0c - /// T10/1228-D revision 11a - /// T10/1363-D revision 10g - /// T10/1545-D revision 1d - /// T10/1545-D revision 5 - /// T10/1545-D revision 5a - /// T10/1675-D revision 2c - /// T10/1675-D revision 4 - /// T10/1836-D revision 2g - /// ECMA 365 - /// - public static class DVD - { - #region Public enumerations - public enum DiskCategory : byte - { - DVDROM = 0x00, - DVDRAM = 0x01, - DVDR = 0x02, - DVDRW = 0x03, - HDDVDROM = 0x04, - HDDVDRAM = 0x05, - HDDVDR = 0x06, - Reserved1 = 0x07, - UMD = 0x08, - DVDPRW = 0x09, - DVDPR = 0x0A, - Reserved2 = 0x0B, - Reserved3 = 0x0C, - DVDPRWDL = 0x0D, - DVDPRDL = 0x0E, - Reserved4 = 0x0F - } - - public enum MaximumRateField : byte - { - /// - /// 2.52 Mbps - /// - TwoMbps = 0x00, - /// - /// 5.04 Mbps - /// - FiveMbps = 0x01, - /// - /// 10.08 Mbps - /// - TenMbps = 0x02, - /// - /// 20.16 Mbps - /// - TwentyMbps = 0x03, - /// - /// 30.24 Mbps - /// - ThirtyMbps = 0x04, - Unspecified = 0x0F - } - - public enum LayerTypeFieldMask : byte - { - Embossed = 0x01, - Recordable = 0x02, - Rewritable = 0x04, - Reserved = 0x08 - } - - public enum LinearDensityField : byte - { - /// - /// 0.267 μm/bit - /// - TwoSix = 0x00, - /// - /// 0.293 μm/bit - /// - TwoNine = 0x01, - /// - /// 0.409 to 0.435 μm/bit - /// - FourZero = 0x02, - /// - /// 0.280 to 0.291 μm/bit - /// - TwoEight = 0x04, - /// - /// 0.153 μm/bit - /// - OneFive = 0x05, - /// - /// 0.130 to 0.140 μm/bit - /// - OneThree = 0x06, - /// - /// 0.353 μm/bit - /// - ThreeFive = 0x08, - } - - public enum TrackDensityField : byte - { - /// - /// 0.74 μm/track - /// - Seven = 0x00, - /// - /// 0.80 μm/track - /// - Eight = 0x01, - /// - /// 0.615 μm/track - /// - Six = 0x02, - /// - /// 0.40 μm/track - /// - Four = 0x03, - /// - /// 0.34 μm/track - /// - Three = 0x04 - } - - public enum CopyrightType : byte - { - /// - /// There is no copy protection - /// - NoProtection = 0x00, - /// - /// Copy protection is CSS/CPPM - /// - CSS = 0x01, - /// - /// Copy protection is CPRM - /// - CPRM = 0x02, - /// - /// Copy protection is AACS - /// - AACS = 0x10 - } - - public enum WPDiscTypes : byte - { - /// - /// Should not write without a cartridge - /// - DoNotWrite = 0x00, - /// - /// Can write without a cartridge - /// - CanWrite = 0x01, - Reserved1 = 0x02, - Reserved2 = 0x03 - } - #endregion - - #region Public structures - public struct PhysicalFormatInformation - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bits 7 to 4 - /// Disk category field - /// - public byte DiskCategory; - /// - /// Byte 4, bits 3 to 0 - /// Media version - /// - public byte PartVersion; - /// - /// Byte 5, bits 7 to 4 - /// 120mm if 0, 80mm if 1. If UMD (60mm) 0 also. Reserved rest of values - /// - public byte DiscSize; - /// - /// Byte 5, bits 3 to 0 - /// Maximum data rate - /// - public byte MaximumRate; - /// - /// Byte 6, bit 7 - /// Reserved - /// - public bool Reserved3; - /// - /// Byte 6, bits 6 to 5 - /// Number of layers - /// - public byte Layers; - /// - /// Byte 6, bit 4 - /// Track path - /// - public bool TrackPath; - /// - /// Byte 6, bits 3 to 0 - /// Layer type - /// - public byte LayerType; - /// - /// Byte 7, bits 7 to 4 - /// Linear density field - /// - public byte LinearDensity; - /// - /// Byte 7, bits 3 to 0 - /// Track density field - /// - public byte TrackDensity; - /// - /// Bytes 8 to 11 - /// PSN where Data Area starts - /// - public UInt32 DataAreaStartPSN; - /// - /// Bytes 12 to 15 - /// PSN where Data Area ends - /// - public UInt32 DataAreaEndPSN; - /// - /// Bytes 16 to 19 - /// PSN where Data Area ends in Layer 0 - /// - public UInt32 Layer0EndPSN; - /// - /// Byte 20, bit 7 - /// True if BCA exists. GC/Wii discs do not have this bit set, but there is a BCA, making it unreadable in normal DVD drives - /// - public bool BCA; - /// - /// Byte 20, bits 6 to 0 - /// Reserved - /// - public byte Reserved4; - /// - /// Bytes 21 to 22 - /// UMD only, media attribute, application-defined, part of media specific in rest of discs - /// - public UInt16 MediaAttribute; - /// - /// Bytes 21 to 2051, set to zeroes in UMD (at least according to ECMA). - /// Media specific - /// - public byte[] MediaSpecific; - } - - public struct LeadInCopyright - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4 - /// Copy protection system type - /// - public byte CopyrightType; - /// - /// Byte 5 - /// Bitmask of regions where this disc is playable - /// - public byte RegionInformation; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 7 - /// Reserved - /// - public byte Reserved4; - } - - public struct DiscKey - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 2052 - /// Disc key for CSS, Album Identifier for CPPM - /// - public byte[] Key; - } - - public struct BurstCuttingArea - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to end - /// Burst cutting area contents, 12 to 188 bytes - /// - public byte[] BCA; - } - - public struct DiscManufacturingInformation - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 2052 - /// Disc Manufacturing Information - /// - public byte[] DMI; - } - - public struct DiscMediaIdentifier - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to end - /// Disc Media Identifier for CPRM - /// - public byte[] MediaIdentifier; - } - - public struct DiscMediaKeyBlock - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to end - /// Disc Media Key Block for CPRM - /// - public byte[] MediaKeyBlock; - } - - public struct DiscDefinitionStructure - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 2052 - /// DVD-RAM / HD DVD-RAM disc definition structure - /// - public byte[] DDS; - } - - public struct MediumStatus - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bit 7 - /// Medium is in a cartridge - /// - public bool Cartridge; - /// - /// Byte 4, bit 6 - /// Medium has been taken out/inserted in a cartridge - /// - public bool OUT; - /// - /// Byte 4, bits 5 to 4 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 4, bit 3 - /// Media is write protected by reason stablished in RAMSWI - /// - public bool MSWI; - /// - /// Byte 4, bit 2 - /// Media is write protected by cartridge - /// - public bool CWP; - /// - /// Byte 4, bit 1 - /// Media is persistently write protected - /// - public bool PWP; - /// - /// Byte 4, bit 0 - /// Reserved - /// - public bool Reserved4; - /// - /// Byte 5 - /// Writable status depending on cartridge - /// - public byte DiscType; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved5; - /// - /// Byte 7 - /// Reason of specific write protection, only defined 0x01 as "bare disc wp", and 0xFF as unspecified. Rest reserved. - /// - public byte RAMSWI; - } - - public struct SpareAreaInformation - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 7 - /// Data length - /// - public UInt32 UnusedPrimaryBlocks; - /// - /// Bytes 8 to 11 - /// Data length - /// - public UInt32 UnusedSupplementaryBlocks; - /// - /// Bytes 12 to 15 - /// Data length - /// - public UInt32 AllocatedSupplementaryBlocks; - } - - public struct LastBorderOutRMD - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to end - /// RMD in last recorded Border-out - /// - public byte[] RMD; - } - - public struct PreRecordedInformation - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to end - /// Pre-recorded Information in Lead-in for writable media - /// - public byte[] PRI; - } - - public struct UniqueDiscIdentifier - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 5 - /// Reserved - /// - public byte Reserved4; - /// - /// Bytes 6 to 7 - /// Random number - /// - public UInt16 RandomNumber; - /// - /// Byte 8 to 11 - /// Year - /// - public UInt32 Year; - /// - /// Byte 12 to 13 - /// Month - /// - public UInt16 Month; - /// - /// Byte 14 to 15 - /// Day - /// - public UInt16 Day; - /// - /// Byte 16 to 17 - /// Hour - /// - public UInt16 Hour; - /// - /// Byte 18 to 19 - /// Minute - /// - public UInt16 Minute; - /// - /// Byte 20 to 21 - /// Second - /// - public UInt16 Second; - } - - public struct PhysicalFormatInformationForWritables - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bits 7 to 4 - /// Disk category field - /// - public byte DiskCategory; - /// - /// Byte 4, bits 3 to 0 - /// Media version - /// - public byte PartVersion; - /// - /// Byte 5, bits 7 to 4 - /// 120mm if 0, 80mm if 1 - /// - public byte DiscSize; - /// - /// Byte 5, bits 3 to 0 - /// Maximum data rate - /// - public byte MaximumRate; - /// - /// Byte 6, bit 7 - /// Reserved - /// - public bool Reserved3; - /// - /// Byte 6, bits 6 to 5 - /// Number of layers - /// - public byte Layers; - /// - /// Byte 6, bit 4 - /// Track path - /// - public bool TrackPath; - /// - /// Byte 6, bits 3 to 0 - /// Layer type - /// - public byte LayerType; - /// - /// Byte 7, bits 7 to 4 - /// Linear density field - /// - public byte LinearDensity; - /// - /// Byte 7, bits 3 to 0 - /// Track density field - /// - public byte TrackDensity; - /// - /// Bytes 8 to 11 - /// PSN where Data Area starts - /// - public UInt32 DataAreaStartPSN; - /// - /// Bytes 12 to 15 - /// PSN where Data Area ends - /// - public UInt32 DataAreaEndPSN; - /// - /// Bytes 16 to 19 - /// PSN where Data Area ends in Layer 0 - /// - public UInt32 Layer0EndPSN; - /// - /// Byte 20, bit 7 - /// True if BCA exists - /// - public bool BCA; - /// - /// Byte 20, bits 6 to 0 - /// Reserved - /// - public byte Reserved4; - /// - /// Bytes 21 to 2051 - /// Media specific, content defined in each specification - /// - public byte[] MediaSpecific; - } - - public struct ADIPInformation - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 259 - /// ADIP, defined in DVD standards - /// - public byte[] ADIP; - } - - public struct HDLeadInCopyright - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Bytes 4 to 2052 - /// HD DVD Lead-In Copyright Information - /// - public byte[] CopyrightInformation; - } - - public struct HDMediumStatus - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bits 7 to 1 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 4, bit 0 - /// Test Zone has been extended - /// - public bool ExtendedTestZone; - /// - /// Byte 5 - /// Number of remaining RMDs in RDZ - /// - public byte RemainingRMDs; - /// - /// Bytes 6 to 7 - /// Number of remaining RMDs in current RMZ - /// - public UInt16 CurrentRemainingRMDs; - } - - public struct LayerCapacity - { - /// - /// Bytes 0 to 1 - /// Data length - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bit 7 - /// If set, L0 capacity is immutable - /// - public bool InitStatus; - /// - /// Byte 4, bits 6 to 0 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 5 - /// Reserved - /// - public byte Reserved4; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved5; - /// - /// Byte 7 - /// Reserved - /// - public byte Reserved6; - /// - /// Byte 8 to 11 - /// L0 Data Area Capacity - /// - public UInt32 Capacity; - } - - public struct MiddleZoneStartAddress - { - /// - /// Bytes 0 to 1 - /// Data length = 10 - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4, bit 7 - /// If set, L0 shifter middle area is immutable - /// - public bool InitStatus; - /// - /// Byte 4, bits 6 to 0 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 5 - /// Reserved - /// - public byte Reserved4; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved5; - /// - /// Byte 7 - /// Reserved - /// - public byte Reserved6; - /// - /// Byte 8 to 11 - /// Start LBA of Shifted Middle Area on L0 - /// - public UInt32 ShiftedMiddleAreaStartAddress; - } - - public struct JumpIntervalSize - { - /// - /// Bytes 0 to 1 - /// Data length = 10 - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 5 - /// Reserved - /// - public byte Reserved4; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved5; - /// - /// Byte 7 - /// Reserved - /// - public byte Reserved6; - /// - /// Byte 8 to 11 - /// Jump Interval size for the Regular Interval Layer Jump - /// - public UInt32 Size; - } - - public struct ManualLayerJumpAddress - { - /// - /// Bytes 0 to 1 - /// Data length = 10 - /// - public UInt16 DataLength; - /// - /// Byte 2 - /// Reserved - /// - public byte Reserved1; - /// - /// Byte 3 - /// Reserved - /// - public byte Reserved2; - /// - /// Byte 4 - /// Reserved - /// - public byte Reserved3; - /// - /// Byte 5 - /// Reserved - /// - public byte Reserved4; - /// - /// Byte 6 - /// Reserved - /// - public byte Reserved5; - /// - /// Byte 7 - /// Reserved - /// - public byte Reserved6; - /// - /// Byte 8 to 11 - /// LBA for the manual layer jump - /// - public UInt32 LBA; - } - #endregion Public structures - } -} - diff --git a/DVD/Enums.cs b/DVD/Enums.cs new file mode 100644 index 000000000..994d74419 --- /dev/null +++ b/DVD/Enums.cs @@ -0,0 +1,187 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Enums.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + #region Public enumerations + public enum DiskCategory : byte + { + DVDROM = 0x00, + DVDRAM = 0x01, + DVDR = 0x02, + DVDRW = 0x03, + HDDVDROM = 0x04, + HDDVDRAM = 0x05, + HDDVDR = 0x06, + Reserved1 = 0x07, + UMD = 0x08, + DVDPRW = 0x09, + DVDPR = 0x0A, + Reserved2 = 0x0B, + Reserved3 = 0x0C, + DVDPRWDL = 0x0D, + DVDPRDL = 0x0E, + Reserved4 = 0x0F + } + + public enum MaximumRateField : byte + { + /// + /// 2.52 Mbps + /// + TwoMbps = 0x00, + /// + /// 5.04 Mbps + /// + FiveMbps = 0x01, + /// + /// 10.08 Mbps + /// + TenMbps = 0x02, + /// + /// 20.16 Mbps + /// + TwentyMbps = 0x03, + /// + /// 30.24 Mbps + /// + ThirtyMbps = 0x04, + Unspecified = 0x0F + } + + public enum LayerTypeFieldMask : byte + { + Embossed = 0x01, + Recordable = 0x02, + Rewritable = 0x04, + Reserved = 0x08 + } + + public enum LinearDensityField : byte + { + /// + /// 0.267 μm/bit + /// + TwoSix = 0x00, + /// + /// 0.293 μm/bit + /// + TwoNine = 0x01, + /// + /// 0.409 to 0.435 μm/bit + /// + FourZero = 0x02, + /// + /// 0.280 to 0.291 μm/bit + /// + TwoEight = 0x04, + /// + /// 0.153 μm/bit + /// + OneFive = 0x05, + /// + /// 0.130 to 0.140 μm/bit + /// + OneThree = 0x06, + /// + /// 0.353 μm/bit + /// + ThreeFive = 0x08, + } + + public enum TrackDensityField : byte + { + /// + /// 0.74 μm/track + /// + Seven = 0x00, + /// + /// 0.80 μm/track + /// + Eight = 0x01, + /// + /// 0.615 μm/track + /// + Six = 0x02, + /// + /// 0.40 μm/track + /// + Four = 0x03, + /// + /// 0.34 μm/track + /// + Three = 0x04 + } + + public enum CopyrightType : byte + { + /// + /// There is no copy protection + /// + NoProtection = 0x00, + /// + /// Copy protection is CSS/CPPM + /// + CSS = 0x01, + /// + /// Copy protection is CPRM + /// + CPRM = 0x02, + /// + /// Copy protection is AACS + /// + AACS = 0x10 + } + + public enum WPDiscTypes : byte + { + /// + /// Should not write without a cartridge + /// + DoNotWrite = 0x00, + /// + /// Can write without a cartridge + /// + CanWrite = 0x01, + Reserved1 = 0x02, + Reserved2 = 0x03 + } + #endregion +} + diff --git a/DVD/Layers.cs b/DVD/Layers.cs new file mode 100644 index 000000000..d544920c9 --- /dev/null +++ b/DVD/Layers.cs @@ -0,0 +1,247 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Layers.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class Layers + { + public struct LayerCapacity + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bit 7 + /// If set, L0 capacity is immutable + /// + public bool InitStatus; + /// + /// Byte 4, bits 6 to 0 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 5 + /// Reserved + /// + public byte Reserved4; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved5; + /// + /// Byte 7 + /// Reserved + /// + public byte Reserved6; + /// + /// Byte 8 to 11 + /// L0 Data Area Capacity + /// + public UInt32 Capacity; + } + + public struct MiddleZoneStartAddress + { + /// + /// Bytes 0 to 1 + /// Data length = 10 + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bit 7 + /// If set, L0 shifter middle area is immutable + /// + public bool InitStatus; + /// + /// Byte 4, bits 6 to 0 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 5 + /// Reserved + /// + public byte Reserved4; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved5; + /// + /// Byte 7 + /// Reserved + /// + public byte Reserved6; + /// + /// Byte 8 to 11 + /// Start LBA of Shifted Middle Area on L0 + /// + public UInt32 ShiftedMiddleAreaStartAddress; + } + + public struct JumpIntervalSize + { + /// + /// Bytes 0 to 1 + /// Data length = 10 + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 5 + /// Reserved + /// + public byte Reserved4; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved5; + /// + /// Byte 7 + /// Reserved + /// + public byte Reserved6; + /// + /// Byte 8 to 11 + /// Jump Interval size for the Regular Interval Layer Jump + /// + public UInt32 Size; + } + + public struct ManualLayerJumpAddress + { + /// + /// Bytes 0 to 1 + /// Data length = 10 + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 5 + /// Reserved + /// + public byte Reserved4; + /// + /// Byte 6 + /// Reserved + /// + public byte Reserved5; + /// + /// Byte 7 + /// Reserved + /// + public byte Reserved6; + /// + /// Byte 8 to 11 + /// LBA for the manual layer jump + /// + public UInt32 LBA; + } + } +} + diff --git a/DVD/PFI.cs b/DVD/PFI.cs new file mode 100644 index 000000000..4cab0d38e --- /dev/null +++ b/DVD/PFI.cs @@ -0,0 +1,264 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : PFI.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class PFI + { + public struct PhysicalFormatInformation + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bits 7 to 4 + /// Disk category field + /// + public byte DiskCategory; + /// + /// Byte 4, bits 3 to 0 + /// Media version + /// + public byte PartVersion; + /// + /// Byte 5, bits 7 to 4 + /// 120mm if 0, 80mm if 1. If UMD (60mm) 0 also. Reserved rest of values + /// + public byte DiscSize; + /// + /// Byte 5, bits 3 to 0 + /// Maximum data rate + /// + public byte MaximumRate; + /// + /// Byte 6, bit 7 + /// Reserved + /// + public bool Reserved3; + /// + /// Byte 6, bits 6 to 5 + /// Number of layers + /// + public byte Layers; + /// + /// Byte 6, bit 4 + /// Track path + /// + public bool TrackPath; + /// + /// Byte 6, bits 3 to 0 + /// Layer type + /// + public byte LayerType; + /// + /// Byte 7, bits 7 to 4 + /// Linear density field + /// + public byte LinearDensity; + /// + /// Byte 7, bits 3 to 0 + /// Track density field + /// + public byte TrackDensity; + /// + /// Bytes 8 to 11 + /// PSN where Data Area starts + /// + public UInt32 DataAreaStartPSN; + /// + /// Bytes 12 to 15 + /// PSN where Data Area ends + /// + public UInt32 DataAreaEndPSN; + /// + /// Bytes 16 to 19 + /// PSN where Data Area ends in Layer 0 + /// + public UInt32 Layer0EndPSN; + /// + /// Byte 20, bit 7 + /// True if BCA exists. GC/Wii discs do not have this bit set, but there is a BCA, making it unreadable in normal DVD drives + /// + public bool BCA; + /// + /// Byte 20, bits 6 to 0 + /// Reserved + /// + public byte Reserved4; + /// + /// Bytes 21 to 22 + /// UMD only, media attribute, application-defined, part of media specific in rest of discs + /// + public UInt16 MediaAttribute; + /// + /// Bytes 21 to 2051, set to zeroes in UMD (at least according to ECMA). + /// Media specific + /// + public byte[] MediaSpecific; + } + + public struct PhysicalFormatInformationForWritables + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bits 7 to 4 + /// Disk category field + /// + public byte DiskCategory; + /// + /// Byte 4, bits 3 to 0 + /// Media version + /// + public byte PartVersion; + /// + /// Byte 5, bits 7 to 4 + /// 120mm if 0, 80mm if 1 + /// + public byte DiscSize; + /// + /// Byte 5, bits 3 to 0 + /// Maximum data rate + /// + public byte MaximumRate; + /// + /// Byte 6, bit 7 + /// Reserved + /// + public bool Reserved3; + /// + /// Byte 6, bits 6 to 5 + /// Number of layers + /// + public byte Layers; + /// + /// Byte 6, bit 4 + /// Track path + /// + public bool TrackPath; + /// + /// Byte 6, bits 3 to 0 + /// Layer type + /// + public byte LayerType; + /// + /// Byte 7, bits 7 to 4 + /// Linear density field + /// + public byte LinearDensity; + /// + /// Byte 7, bits 3 to 0 + /// Track density field + /// + public byte TrackDensity; + /// + /// Bytes 8 to 11 + /// PSN where Data Area starts + /// + public UInt32 DataAreaStartPSN; + /// + /// Bytes 12 to 15 + /// PSN where Data Area ends + /// + public UInt32 DataAreaEndPSN; + /// + /// Bytes 16 to 19 + /// PSN where Data Area ends in Layer 0 + /// + public UInt32 Layer0EndPSN; + /// + /// Byte 20, bit 7 + /// True if BCA exists + /// + public bool BCA; + /// + /// Byte 20, bits 6 to 0 + /// Reserved + /// + public byte Reserved4; + /// + /// Bytes 21 to 2051 + /// Media specific, content defined in each specification + /// + public byte[] MediaSpecific; + } + } +} + diff --git a/DVD/PRI.cs b/DVD/PRI.cs new file mode 100644 index 000000000..4abb61979 --- /dev/null +++ b/DVD/PRI.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : PRI.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class PRI + { + public struct PreRecordedInformation + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to end + /// Pre-recorded Information in Lead-in for writable media + /// + public byte[] PRI; + } + } +} + diff --git a/DVD/RMD.cs b/DVD/RMD.cs new file mode 100644 index 000000000..cdd2f671f --- /dev/null +++ b/DVD/RMD.cs @@ -0,0 +1,124 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : RMD.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class RMD + { + public struct LastBorderOutRMD + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to end + /// RMD in last recorded Border-out + /// + public byte[] RMD; + } + + public struct HDMediumStatus + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4, bits 7 to 1 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 4, bit 0 + /// Test Zone has been extended + /// + public bool ExtendedTestZone; + /// + /// Byte 5 + /// Number of remaining RMDs in RDZ + /// + public byte RemainingRMDs; + /// + /// Bytes 6 to 7 + /// Number of remaining RMDs in current RMZ + /// + public UInt16 CurrentRemainingRMDs; + } + } +} + diff --git a/DVD/Spare.cs b/DVD/Spare.cs new file mode 100644 index 000000000..7bf1cc51d --- /dev/null +++ b/DVD/Spare.cs @@ -0,0 +1,95 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Spare.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class Spare + { + public struct SpareAreaInformation + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Bytes 4 to 7 + /// Data length + /// + public UInt32 UnusedPrimaryBlocks; + /// + /// Bytes 8 to 11 + /// Data length + /// + public UInt32 UnusedSupplementaryBlocks; + /// + /// Bytes 12 to 15 + /// Data length + /// + public UInt32 AllocatedSupplementaryBlocks; + } + } +} + diff --git a/DVD/UDI.cs b/DVD/UDI.cs new file mode 100644 index 000000000..8db3b599e --- /dev/null +++ b/DVD/UDI.cs @@ -0,0 +1,125 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UDI.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; + +namespace DiscImageChef.Decoders.DVD +{ + /// + /// Information from the following standards: + /// ANSI X3.304-1997 + /// T10/1048-D revision 9.0 + /// T10/1048-D revision 10a + /// T10/1228-D revision 7.0c + /// T10/1228-D revision 11a + /// T10/1363-D revision 10g + /// T10/1545-D revision 1d + /// T10/1545-D revision 5 + /// T10/1545-D revision 5a + /// T10/1675-D revision 2c + /// T10/1675-D revision 4 + /// T10/1836-D revision 2g + /// ECMA 365 + /// + public static class UDI + { + public struct UniqueDiscIdentifier + { + /// + /// Bytes 0 to 1 + /// Data length + /// + public UInt16 DataLength; + /// + /// Byte 2 + /// Reserved + /// + public byte Reserved1; + /// + /// Byte 3 + /// Reserved + /// + public byte Reserved2; + /// + /// Byte 4 + /// Reserved + /// + public byte Reserved3; + /// + /// Byte 5 + /// Reserved + /// + public byte Reserved4; + /// + /// Bytes 6 to 7 + /// Random number + /// + public UInt16 RandomNumber; + /// + /// Byte 8 to 11 + /// Year + /// + public UInt32 Year; + /// + /// Byte 12 to 13 + /// Month + /// + public UInt16 Month; + /// + /// Byte 14 to 15 + /// Day + /// + public UInt16 Day; + /// + /// Byte 16 to 17 + /// Hour + /// + public UInt16 Hour; + /// + /// Byte 18 to 19 + /// Minute + /// + public UInt16 Minute; + /// + /// Byte 20 to 21 + /// Second + /// + public UInt16 Second; + } + } +} + diff --git a/DiscImageChef.Decoders.csproj b/DiscImageChef.Decoders.csproj index d50a2ba03..e2eca8855 100644 --- a/DiscImageChef.Decoders.csproj +++ b/DiscImageChef.Decoders.csproj @@ -39,7 +39,6 @@ - @@ -49,6 +48,21 @@ + + + + + + + + + + + + + + +