hal and disc type

David Zeuthen david at fubar.dk
Thu May 6 05:19:48 PDT 2004


On Thu, May 06, 2004 at 11:43:13AM +0100, Bastien Nocera wrote:
> Hey David,
> 

Hey Bastien,

thanks for getting back to me.

> On Thu, 2004-05-06 at 11:32 +0200, David Zeuthen wrote:
> > Hi,
> > 
> > I just committed a change yesterday with a number of changes to properties
> > related to handling of storage devices - mostly cleanups and sane renaming
> > of property keys. 
> > 
> > I did add some code (snitched from dvd+rw-tools, GPL stuff) to test for
> > dvd discs and report back the correct type; this was done using some of 
> > the code Bastien added so I've copied him as well :-)
> 
> Did you get the code from the current libbacon CVS?
> 

Nope, took it straight from the same source, see get_dvd_media_type() in

 http://freedesktop.org/cgi-bin/viewcvs.cgi/hal/hal/hald/linux/linux_dvd_rw_utils.c?rev=1.5&view=auto

> I don't think you would really want to use that detection code. You have
> 2 choices, either you get information from the disc itself, and for
> example, DVD+RW discs will appear as DVDs, because the booktype says so.
> 
> Otherwise, you can use the code currently in libbacon, and get the
> physical type of the disc, which is very likely what you want.
> nautilus-cd-burner would use that to know if the CD is blankeable for
> example.
> 

Ok, so it sounds sane to use the code from the function guess_media_type
in libbacon. A few questions, if you'll indulge me

        CD_MEDIA_TYPE_CD           ; will a closed CDR or CDRW show up as this?
                                     (does it even make sense to speak about a
                                      closed CDRW?)
                                      
        CD_MEDIA_TYPE_CDR          ; will a blank disc show up as this?
        CD_MEDIA_TYPE_CDRW

        CD_MEDIA_TYPE_DVD,         ; same questions re: closed media
        CD_MEDIA_TYPE_DVDR,
        CD_MEDIA_TYPE_DVDRW,
        CD_MEDIA_TYPE_DVD_RAM,
        CD_MEDIA_TYPE_DVD_PLUS_R,
        CD_MEDIA_TYPE_DVD_PLUS_RW,

So, I must admit I'm a little bit at a loss here.. Feel free to point me
to documentation etc.

> If you're looking for data-type on the disc, the current code won't be
> precise enough. You want to be able to know if the disc is:
> - data only
> - audio only
> - mixed
> - blank

Ok, for this I suppose I can use the CDROM_DISC_STATUS ioctl. Will
CDS_NO_INFO also apply to blank writeable DVD media? (if it makes sense
to even speak about this)

> - PhotoCD
> - video DVD
> - VCD
> 

This sounds like something a policy-piece like gnome-volume-manager
should determine. 

I mean a Video DVD is just media with the appropriate files, e.g. 
VIDEO_TS, AUDIO_TS and friends on it right? There is no book-type for
these right? One of my 'Video DVD' show up (Boogie Nights) as dvd_rom 
(e.g. type 0x10 from the MMC-call).

g-v-m can tag the HalDevice with capability 'content.video_dvd' or
something.

> Which gives something useful to the applications. If a data DVD+RW
> claims it's a DVD to be able to put it in a set-top DVD appliance, it's
> pretty useless to the application writers, or the user...
> 
> > How about splitting volume.disc_type into the following properties
> > 
> >  volume.disc_type = audio|cd_rom|cd_r|cd_rw|dvd_rom|dvd_r|dvd_ram|dvd_rw|
> >                     dvd_plus|rdvd_plus_rw
> > 
> >  volume.disc_is_mixed = TRUE|FALSE   ; TRUE iff there is also audio tracks 
> >                                        on the disc
> > 
> >  volume.disc_is_closed = TRUE|FALSE  ; TRUE iff no (further) writing can
> >                                        be done
> > 
> >  volume.disc_capacity = <int64>
> > 
> > Looks sane?
> 
> No quite yet ;)
> 

Ugh, I still think it makes sense, sort of. Suggestions then?

Cheers,
David

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list