|
Mac Dev Center
Mac OS X Reference Library Drivers, Kernel, & Hardware: User-Space Device Access Disc Recording Framework Reference
|
DRTrack |
The DRTrack class represents a track on the burned disc.
A DRTrack provides data to the for the burn and contains a description of the track on disc (length, block type, data format, etc). Data is provided for the burn in a real-time thread. It is up to the track to provide this data in a timely manner, otherwise a burn underrun can occur and ruin a disc.
DRTracks do not typically store or cache the data to be written to disk, instead the data is streamed to the disc from some data producer as it's needed. This is accomplished through an object associated with the track when the track is created called the track producer. A track producer is a class you create that implements the DRTrackDataProduction informal protocol. This protocol defines all of the methods that a track object will call during a burn to obtain data.
A DRTrack object contains several properties which define the track for the burn. These properties are stored in an NSDictionary and are accessed through the properties and setProperties: methods.
There are several properties that are required to be present and if they are not, will cause the burn to fail. These are:
The possible values of these properties are defined in the Mt. Fuji (IFF-8090i) specification for CD/DVD devices. It's up to you to understand the possible values and meanings of each.
All other keys contained in the properties dictionary are optional and can be omitted.
Asks the track producer for a size estimate.
Initializes a DRTrack with the producer
Returns the properties dictionary of the track.
Sets the properties dictionary of the track
Tests the production speed for a specified interval.
Tests the production speed for a specified byte count.
estimateLength |
Asks the track producer for a size estimate.
- (uint64_t) estimateLength;
The estimated length of the track.
This method calls the track producer to ask it to estimate the size needed for its data.
For some types of track, this call may be very expensive. For example, a DRFilesystemTrack may need to iterate folders on disk to provide an accurate estimate, which (if a large number of files and folders are involved) can cause this call to take 30 seconds or more. Since your main thread should not be allowed to block for this long, you may wish to call this function on a separate thread.
initWithProducer: |
Initializes a DRTrack with the producer
producerThe object to use as the data producer
A DRTrack
properties |
Returns the properties dictionary of the track.
- (NSDictionary*) properties;
An NSDictionary containing the properties of the track.
setProperties: |
Sets the properties dictionary of the track
- (void) setProperties:(NSDictionary*)properties;
propertiesNSDictionary of the properties to set.
testProductionSpeedForInterval: |
Tests the production speed for a specified interval.
- (float) testProductionSpeedForInterval:(NSTimeInterval)interval;
intervalThe length of the test in seconds.
The maximum speed data can be produced at.
Runs a fake "production" cycle, repeatedly asking the receiver for data by calling it's producer's produceDataIntoBuffer:length:atAddress:blockSize:ioFlags: for the specified time interval.
Use this function to verify that the the production code can produce data fast enough to satisfy the data throughput requirements of the burn.
Returns the calculated maximum speed the at which the receiver can produce data. This value should be used when setting up a burn to limit the burn speed
testProductionSpeedForLength: |
Tests the production speed for a specified byte count.
- (float) testProductionSpeedForLength:(uint32_t)length;
lengthThe length of the test in bytes.
The maximum speed data can be produced at.
Runs a fake "production" cycle, repeatedly asking the receiver for data by calling it's producer's produceDataIntoBuffer:length:atAddress:blockSize:ioFlags: until the specified length number of bytes have been produced.
Use this function to verify that the the production code can produce data fast enough to satisfy the data throughput requirements of the burn.
Returns the calculated maximum speed the at which the receiver can produce data. This value should be used when setting up a burn to limit the burn speed
Last Updated: 2009-08-12