Top | ![]() |
![]() |
![]() |
![]() |
gboolean | mirage_sector_feed_data () |
gboolean | mirage_sector_extract_data () |
gint | mirage_sector_get_address () |
gboolean | mirage_sector_get_data () |
gboolean | mirage_sector_set_data () |
gboolean | mirage_sector_get_edc_ecc () |
gboolean | mirage_sector_set_edc_ecc () |
gboolean | mirage_sector_get_header () |
gboolean | mirage_sector_set_header () |
MirageSectorType | mirage_sector_get_sector_type () |
gboolean | mirage_sector_get_subchannel () |
gboolean | mirage_sector_set_subchannel () |
gboolean | mirage_sector_get_subheader () |
gboolean | mirage_sector_set_subheader () |
gboolean | mirage_sector_get_sync () |
gboolean | mirage_sector_set_sync () |
gboolean | mirage_sector_verify_lec () |
gboolean | mirage_sector_verify_subchannel_crc () |
void | mirage_sector_scramble () |
MirageSector | |
struct | MirageSectorClass |
enum | MirageSectorType |
enum | MirageSectorSubchannelFormat |
enum | MirageSectorValidData |
MirageSector object represents a sector. It provides access to the sector data, generating it if needed.
gboolean mirage_sector_feed_data (MirageSector *self
,gint address
,MirageSectorType type
,const guint8 *main_data
,guint main_data_length
,MirageSectorSubchannelFormat subchannel_format
,const guint8 *subchannel_data
,guint subchannel_data_length
,gint ignore_data_mask
,GError **error
);
Feeds data to sector. If type
is MIRAGE_SECTOR_RAW
or MIRAGE_SECTOR_RAW_SCRAMBLED
,
the real sector type is determined during feeding.
self |
||
address |
absolute disc address the sector represents. Given in sectors. |
[in] |
type |
track type (one of MirageSectorType). |
[in] |
main_data |
main data buffer. |
[in] |
main_data_length |
length of data in main data buffer. |
[in] |
subchannel_format |
subchannel data format. |
[in] |
subchannel_data |
subchannel data buffer. |
[in][allow-none] |
subchannel_data_length |
length of data in subchannel data buffer. |
[in] |
ignore_data_mask |
a mask of MirageSectorValidData values, indicating which parts of main channel sector data, if any, should be ignored and regerated even though they are provided by the data feed. |
[in] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_extract_data (MirageSector *self
,const guint8 **main_data
,guint main_data_length
,MirageSectorSubchannelFormat subchannel_format
,const guint8 **subchannel_data
,guint subchannel_data_length
,GError **error
);
Extracts data from sector. Which parts of main channel data are extracted
depends on provided main_data_length
.
self |
||
main_data |
location to store pointer to main data buffer. |
[out][transfer none] |
main_data_length |
requested length of data in main data buffer. |
[in] |
subchannel_format |
requested subchannel data format. |
[out] |
subchannel_data |
location to store pointer to subchannel data buffer, or |
[in][transfer none][allow-none] |
subchannel_data_length |
requested length of data in subchannel data buffer. |
[in] |
error |
location to store error, or |
[out][allow-none] |
gint
mirage_sector_get_address (MirageSector *self
);
Retrieves absolute disc address of the sector.
gboolean mirage_sector_get_data (MirageSector *self
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's user data. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; therefore, the buffer should not
be modified.
self |
||
ret_buf |
location to store pointer to buffer containing user data, or |
[out][transfer none][allow-none][array length=ret_len] |
ret_len |
location to store length of user data, or |
[out][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_set_data (MirageSector *self
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's user data to that stored in buf
.
gboolean mirage_sector_get_edc_ecc (MirageSector *self
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's EDC/ECC data. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; therefore, the buffer should not
be modified.
If EDC/ECC data is not provided by image file(s), it is generated.
self |
||
ret_buf |
location to store pointer to buffer containing EDC/ECC data, or |
[out][transfer none][allow-none][array length=ret_len] |
ret_len |
location to store length of EDC/ECC data, or |
[out][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_set_edc_ecc (MirageSector *self
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's EDC/ECC data to that stored in buf
.
gboolean mirage_sector_get_header (MirageSector *self
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's header. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; therefore, the buffer should not
be modified.
If header is not provided by image file(s), it is generated.
gboolean mirage_sector_set_header (MirageSector *self
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's header to that stored in buf
.
MirageSectorType
mirage_sector_get_sector_type (MirageSector *self
);
Retrieves sector type (track mode); one of MirageSectorType.
gboolean mirage_sector_get_subchannel (MirageSector *self
,MirageSectorSubchannelFormat format
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's subchannel. format
must be one of MirageSectorSubchannelFormat.
The pointer to appropriate location in sector's data buffer is stored into
ret_buf
; therefore, the buffer should not be modified.
If subchannel is not provided by image file(s), it is generated.
self |
||
format |
subchannel format. |
[in] |
ret_buf |
location to store pointer to buffer containing subchannel, or |
[out][transfer none][allow-none][array length=ret_len] |
ret_len |
location to store length of subchannel data, or |
[out][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_set_subchannel (MirageSector *self
,MirageSectorSubchannelFormat format
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's subchannel data to that stored in buf
. format
must be
one of MirageSectorSubchannelFormat.
gboolean mirage_sector_get_subheader (MirageSector *self
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's subheader. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; therefore, the buffer should not
be modified.
If subheader is not provided by image file(s), it is generated.
self |
||
ret_buf |
location to store pointer to buffer containing subheader, or |
[out][transfer none][allow-none][array length=ret_len] |
ret_len |
location to store length of subheader, or |
[out][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_set_subheader (MirageSector *self
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's subheader to that stored in buf
.
gboolean mirage_sector_get_sync (MirageSector *self
,const guint8 **ret_buf
,gint *ret_len
,GError **error
);
Retrieves sector's sync pattern. The pointer to appropriate location in
sector's data buffer is stored into ret_buf
; therefore, the buffer should not
be modified.
If sync pattern is not provided by image file(s), it is generated.
self |
||
ret_buf |
location to store pointer to buffer containing sync pattern, or |
[out][transfer none][allow-none][array length=ret_len] |
ret_len |
location to store length of sync pattern, or |
[out][allow-none] |
error |
location to store error, or |
[out][allow-none] |
gboolean mirage_sector_set_sync (MirageSector *self
,const guint8 *buf
,gint len
,GError **error
);
Sets sector's sync pattern to that stored in buf
.
gboolean
mirage_sector_verify_lec (MirageSector *self
);
Verifies the sector data in terms of L-EC error detection/correction. Data sectors (Mode 1, Mode 2 Form 1 and Mode 2 Form 2) contain error detection/error correction codes which is part of so called layered error correction. This function calculates the EDC for sector data and compares it with EDC provided by the image file.
As a result of comparison, the sectors with intentionally faulty EDC (and possibly ECC, though ECC is not verified) can be discovered.
This function requires EDC/ECC data to be provided by the image. If it
is not provided, it would be generated by MirageSector on first access
via mirage_sector_get_edc_ecc()
using the same algorithm as the one used
by this function. Therefore, in case of EDC/ECC data missing, the verification
automatically succeeds.
gboolean
mirage_sector_verify_subchannel_crc (MirageSector *self
);
Verifies the Q subchannel's CRC for the sector.
As a result of comparison, the sectors with intentionally faulty Q subchannel can be discovered.
This function requires subchannel data to be provided by the image. If it
is not provided, it would be generated by MirageSector on first access
via mirage_sector_get_subchannel()
using the same algorithm as the one used
by this function. Therefore, in case of subchannel data missing, the verification
automatically succeeds.
void
mirage_sector_scramble (MirageSector *self
);
Scrambles 2340 bytes of sector data after sync pattern, using scrambler from ECMA-130 Annex B. Running this function on already-scrambled sector results in unscrambling.
typedef struct _MirageSector MirageSector;
All the fields in the MirageSector structure are private to the MirageSector implementation and should never be accessed directly.
struct MirageSectorClass { MirageObjectClass parent_class; };
The class structure for the MirageSector type.
Sector type. Also implies track mode.