libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
dpm.h
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2026 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LIBAARUFORMAT_DPM_H
20#define LIBAARUFORMAT_DPM_H
21
22#include <stdint.h> /* Fixed-width integer types for on-disk packed structures */
23
24#pragma pack(push, 1)
25
51
53#define DPM_UNITS_PER_TURN 2560000
55#define DPM_UNITS_PER_ALCOHOL_UNIT 10000
56
58#define DPM_FLAG_OPPOSITE_TRACK_PATH 0x01
59
72
76typedef struct DpmHeader
77{
78 uint32_t identifier;
79 uint32_t entries;
80 uint32_t calibrations;
81 uint32_t nominalSpacing;
82 uint16_t timingUnit;
83 uint16_t speed;
84 uint8_t layerEnds;
85 uint8_t flags;
86 uint16_t reserved;
87 uint64_t length;
88 uint64_t crc64;
90
94typedef struct DpmEntry
95{
96 uint64_t lba;
97 uint64_t angle;
98 uint8_t status;
100
104typedef struct DpmCalibration
105{
106 uint64_t lba;
107 uint64_t rotationPeriod;
110
111#pragma pack(pop)
112
113#endif // LIBAARUFORMAT_DPM_H
DpmEntryStatus
Status of the bin of sectors that ends at an entry.
Definition dpm.h:64
@ DpmStatusLayerBreak
Bin crosses a layer boundary or is too short, density copied from the bin before.
Definition dpm.h:70
@ DpmStatusUnknown
Unknown, e.g. imported from a format that does not record it.
Definition dpm.h:65
@ DpmStatusUnreadable
Sectors could not be read, interpolated from its neighbours.
Definition dpm.h:69
@ DpmStatusInterpolated
Measurement failed, interpolated from its neighbours.
Definition dpm.h:68
@ DpmStatusMeasured
Measured on the first attempt.
Definition dpm.h:66
@ DpmStatusRemeasured
Measured again because the first measurement was an outlier.
Definition dpm.h:67
A rotation calibration done while measuring.
Definition dpm.h:105
uint64_t sectorsPerTurnX1000
Sectors per rotation at lba, multiplied by 1000.
Definition dpm.h:108
uint64_t rotationPeriod
Rotation period, in nanoseconds.
Definition dpm.h:107
uint64_t lba
Sector address where the calibration was done.
Definition dpm.h:106
A DPM control point.
Definition dpm.h:95
uint64_t angle
Cumulative angle since the first entry, in DPM_UNITS_PER_TURN units per turn.
Definition dpm.h:97
uint64_t lba
Sector address.
Definition dpm.h:96
uint8_t status
DpmEntryStatus of the bin that ends at this entry.
Definition dpm.h:98
Header of the Data Position Measurement block.
Definition dpm.h:77
uint32_t calibrations
Number of DpmCalibration records.
Definition dpm.h:80
uint16_t timingUnit
Sectors per timing unit (1 on CD, 16 on DVD, 32 on BD), 0 if unknown.
Definition dpm.h:82
uint32_t entries
Number of DpmEntry records.
Definition dpm.h:79
uint32_t nominalSpacing
Nominal number of sectors between entries.
Definition dpm.h:81
uint8_t layerEnds
Number of layer boundaries (layers - 1), 0 for single layer media or if unknown.
Definition dpm.h:84
uint8_t flags
Flags, see DPM_FLAG_OPPOSITE_TRACK_PATH.
Definition dpm.h:85
uint64_t length
Payload bytes after this header.
Definition dpm.h:87
uint32_t identifier
Block identifier, must be BlockType::DataPositionMeasurementBlock.
Definition dpm.h:78
uint16_t reserved
Reserved, must be 0.
Definition dpm.h:86
uint64_t crc64
CRC64-ECMA of the payload.
Definition dpm.h:88
uint16_t speed
Requested speed, as a multiple of the medium base speed. 0xFFFF maximum, 0 unknown.
Definition dpm.h:83