[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Re: Submission of new mmc function for libcdio

From: Thomas Schmitt
Subject: [Libcdio-devel] Re: Submission of new mmc function for libcdio
Date: Sun, 31 Jan 2010 15:41:13 +0100


> _mmc_get_disc_empty ( const CdIo_t *p_cdio, driver_return_code_t *i_status )
> ...
> ...
>       if (buf[2] & 0x03 == 0x00)
>         return true;
>       else
>         return false;

I understand you are into writing CD.
So you should rather distinguish three states:
Blank (=0x00), Appendable/Incomplete (0x01),
Closed/Finalized (0x02).
Maybe one should even forward the fourth case:
Random Access (0x03).
The latter is not used in libburn. I had some
reason to use profile numbers for identifying
overwriteables. Forgotten, i fear.

Blank is the result of cdrecord blank=...
Appendable is from     cdrecord with -multi
Closed is from         cdrecord without -multi
These states also apply to DVD-R[W], DVD+R and
BD-R. (Not necessarily reachable by cdrecord.)

>   Detects a disc (CD or DVD) ccapacity.
> _mmc_get_disc_capacity ( const CdIo_t *p_cdio, driver_return_code_t

I think this will not work with appendable media.
MMC-5 says:
" Current/Maximum Capacity Descriptor
for Unformatted or Blank Media."

> is there a simpler way to get capacity ?).

Not simpler, but probably more complete.

With non-overwriteable media, libburn uses rather
READ TRACK INFORMATION with a media dependent
track number. Byte 16 to 19 of the reply contain
the number of free blocks.
The track number depends on the profile:
     if (d->current_profile == 0x1a || d->current_profile == 0x13 ||
         d->current_profile == 0x12 || d->current_profile == 0x42 ||
         d->current_profile == 0x43)
              /* DVD+RW , DVD-RW restricted overwrite , DVD-RAM
                 BD-R random recording, BD-RE */
             trackno = 1;
(Actually irrelevant in this case.)

     else if (d->current_profile == 0x10 ||
              d->current_profile == 0x11 ||
              d->current_profile == 0x14 ||
              d->current_profile == 0x15 ||
              d->current_profile == 0x40 ||
              d->current_profile == 0x41)
             /* DVD-ROM ,  DVD-R[W] Sequential ,
                BD-ROM , BD-R sequential */

             trackno = d->last_track_no;

     else /* mmc5r03c.pdf: valid only for CD, DVD+R, DVD+R DL */

             trackno = 0xFF;

d->last_track_no is 1 with blank media and stems
from READ DISC INFORMATION bytes 6 and 11 for
appendable media.
Maybe i am just too cautious. You will have to
test a lot of media and states. Pity i cannot
lend you my pile of test media. 23 different
types and states currently. Reserved for inquiry
Give me a note when libcdio tests are ready.

> I intend to add a "cdio_get_isosize" function.

Take care to read the ECMA-119 PVD from the start
address + 16 of the first track in the last
session on media. That is what should be mounted
by default. (Not all OSes are smart enough.
Namely Solaris is said to be unpreprared for
multi-session DVD.)

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]