hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Thu Oct 11 13:12:49 PDT 2007


 hald/linux/probing/linux_dvd_rw_utils.c |   36 ++++++++++++++++++++++++++++++++
 hald/linux/probing/linux_dvd_rw_utils.h |    7 ++++++
 hald/linux/probing/probe-storage.c      |   12 ++++++++++
 hald/linux/probing/probe-volume.c       |    7 ++++++
 hald/solaris/probing/probe-volume.c     |    2 -
 5 files changed, 62 insertions(+), 2 deletions(-)

New commits:
diff-tree 32d1f52a2e6c08d83723fe9d11417eeefb90768f (from a268049eb5caabbe97f6f8d34e8a095b00e340f4)
Author: Bastien Nocera <hadess at hadess.net>
Date:   Thu Oct 11 16:12:00 2007 -0400

    add bluray support
    
    On Wed, 2007-10-10 at 16:35 +0200, Danny Kukawka wrote:
    > On Mittwoch, 10. Oktober 2007, Bastien Nocera wrote:
    > > Heya,
    > >
    > > I posted an untested patch, with the values taken from the latest dvd
    > > +rw-tools version:
    > > http://bugs.freedesktop.org/show_bug.cgi?id=12767
    > >
    > > I'd appreciate comments, and actual testing. Note that the spec isn't
    > > updated, and that the Blu-ray video disc detection probably doesn't
    > > work, as they're usually UDF, not ISO9660.
    >
    > Some comments:
    > * the patch didn't compile ('}' missing in probe-volume.c:264)
    
    Told you it was untested :)
    
    > * I would prevent mix LIBHAL_STORAGE_ICON_DISC_* with
    >   DRIVE_CDROM_CAPS_* in probe-storage.c
    
    Thinko, good catch.
    
    > * in get_disc_capacity_dvdr_from_type() im miss code for 0x42 (BR-R RRM) not
    >   sure if they should get handled like 0x41 (BD-R SRM)
    
    0x42 isn't supported by dvd+rw-tools, so I don't know if the capacity
    calculation works in the same way. Maybe adding a comment to that effect
    would be useful.
    
    > I have added a new version of the patch with this stuff fixed and also add
    > some more support for HD DVD* discs (didn't add code to
    > get_disc_capacity_dvdr_from_type() atm).
    
    Looks good.

diff --git a/hald/linux/probing/linux_dvd_rw_utils.c b/hald/linux/probing/linux_dvd_rw_utils.c
index 7431f1b..3760a99 100644
--- a/hald/linux/probing/linux_dvd_rw_utils.c
+++ b/hald/linux/probing/linux_dvd_rw_utils.c
@@ -237,6 +237,13 @@ get_dvd_r_rw_profile (int fd)
 		 * 0x1A: DVD+RW  
 		 * 0x2A: DVD+RW DL
 		 * 0x2B: DVD+R DL 
+		 * 0x40: BD-ROM
+		 * 0x41: BD-R SRM
+		 * 0x42: BR-R RRM
+		 * 0x43: BD-RE
+		 * 0x50: HD DVD-ROM
+		 * 0x51: HD DVD-R 
+		 * 0x52: HD DVD-Rewritable 
 		 */
 
 		switch (profile) {
@@ -256,6 +263,25 @@ get_dvd_r_rw_profile (int fd)
 			case 0x2B:
 				retval |= DRIVE_CDROM_CAPS_DVDPLUSRDL;
 				break;
+			case 0x40:
+				retval |= DRIVE_CDROM_CAPS_BDROM;
+				break;
+			case 0x41:
+			case 0x42:
+				retval |= DRIVE_CDROM_CAPS_BDR;
+				break;
+			case 0x43:
+				retval |= DRIVE_CDROM_CAPS_BDRE;
+				break;
+			case 0x50:
+				retval |= DRIVE_CDROM_CAPS_HDDVDROM;
+				break;
+			case 0x51:
+				retval |= DRIVE_CDROM_CAPS_HDDVDR;
+				break;
+			case 0x52:
+				retval |= DRIVE_CDROM_CAPS_HDDVDRW;
+				break;
 			default:
 				break;
 		}
@@ -672,6 +698,7 @@ get_disc_capacity_dvdr_from_type (int fd
 	case 0x11:		/* DVD-R */
 	case 0x1B:		/* DVD+R */
 	case 0x2B:		/* DVD+R Double Layer */
+	case 0x41:		/* BD-R SRM */
 
 		/* READ TRACK INFORMATION */
 		scsi_command_init (cmd, 0, 0x52);
@@ -697,6 +724,13 @@ get_disc_capacity_dvdr_from_type (int fd
 
 		retval = 0;
 		break;
+	case 0x43:		/* BD-RE */
+		/* Pull the formatted capacity */
+		blocks  = formats [4 + 0] << 24;
+		blocks |= formats [4 + 1] << 16;
+		blocks |= formats [4 + 2] << 8;
+		blocks |= formats [4 + 3];
+		break;
 	default:
 		blocks = 0;
 		break;
@@ -739,6 +773,8 @@ get_disc_capacity_for_type (int fd,
 	case 0x2B:
 	case 0x1A:
 	case 0x12:
+	case 0x41:
+	case 0x43:
 		retval = get_disc_capacity_dvdr_from_type (fd, type, size);
 		break;
 	default:
diff --git a/hald/linux/probing/linux_dvd_rw_utils.h b/hald/linux/probing/linux_dvd_rw_utils.h
index 5b6105a..6f943b1 100644
--- a/hald/linux/probing/linux_dvd_rw_utils.h
+++ b/hald/linux/probing/linux_dvd_rw_utils.h
@@ -16,7 +16,14 @@
 #define DRIVE_CDROM_CAPS_DVDPLUSRW    4
 #define DRIVE_CDROM_CAPS_DVDPLUSRWDL  8
 #define DRIVE_CDROM_CAPS_DVDPLUSRDL  16
+#define DRIVE_CDROM_CAPS_BDROM       32
+#define DRIVE_CDROM_CAPS_BDR         64
+#define DRIVE_CDROM_CAPS_BDRE       128
+#define DRIVE_CDROM_CAPS_HDDVDROM   256
+#define DRIVE_CDROM_CAPS_HDDVDR     512
+#define DRIVE_CDROM_CAPS_HDDVDRW   1024
 
+ 
 int get_dvd_r_rw_profile (int fd);
 int get_read_write_speed (int fd, int *read_speed, int *write_speed, char **write_speeds);
 int get_disc_capacity_for_type (int fd, int type, guint64 *capacity);
diff --git a/hald/linux/probing/probe-storage.c b/hald/linux/probing/probe-storage.c
index b47971c..f13d015 100644
--- a/hald/linux/probing/probe-storage.c
+++ b/hald/linux/probing/probe-storage.c
@@ -227,6 +227,18 @@ main (int argc, char *argv[])
 					libhal_changeset_set_property_bool (cs, "storage.cdrom.dvdplusrwdl", TRUE);
 				if (profile & DRIVE_CDROM_CAPS_DVDPLUSRDL)
 					libhal_changeset_set_property_bool (cs, "storage.cdrom.dvdplusrdl", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_BDROM)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.bd", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_BDR)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.bdr", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_BDRE)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.bdre", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_HDDVDROM)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.hddvd", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_HDDVDR)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.hddvdr", TRUE);
+				if (profile & DRIVE_CDROM_CAPS_HDDVDRW)
+					libhal_changeset_set_property_bool (cs, "storage.cdrom.hddvdrw", TRUE);
 			}
 			if (capabilities & CDC_DVD_R) {
 				libhal_changeset_set_property_bool (cs, "storage.cdrom.dvdr", TRUE);
diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c
index de30047..61eb96a 100644
--- a/hald/linux/probing/probe-volume.c
+++ b/hald/linux/probing/probe-volume.c
@@ -180,6 +180,7 @@ advanced_disc_detect (LibHalContext *ctx
 	
 	/* set defaults */
 	libhal_changeset_set_property_bool (cs, "volume.disc.is_videodvd", FALSE);
+	libhal_changeset_set_property_bool (cs, "volume.disc.is_blurayvideo", FALSE);
 	libhal_changeset_set_property_bool (cs, "volume.disc.is_vcd", FALSE);
 	libhal_changeset_set_property_bool (cs, "volume.disc.is_svcd", FALSE);
 	
@@ -255,6 +256,12 @@ advanced_disc_detect (LibHalContext *ctx
 				HAL_DEBUG(("Disc in %s is a Video DVD", device_file));
 				break;
 			}
+			else if (!strcmp (dirname, "BDMV"))
+			{
+				libhal_changeset_set_property_bool (cs, "volume.disc.is_blurayvideo", TRUE);
+				HAL_DEBUG(("Disc in %s is a Blu-ray video disc", device_file));
+				break;
+			}
 			else if (!strcmp (dirname, "VCD"))
 			{
 				libhal_changeset_set_property_bool (cs, "volume.disc.is_vcd", TRUE);
diff --git a/hald/solaris/probing/probe-volume.c b/hald/solaris/probing/probe-volume.c
index 621022e..91b0dca 100644
--- a/hald/solaris/probing/probe-volume.c
+++ b/hald/solaris/probing/probe-volume.c
@@ -279,8 +279,6 @@ probe_disc (int fd, LibHalContext *ctx, 
                         disc_type = "bd_rom";
 			break;
 		case 0x41: /* BD-R Sequential */
-                        disc_type = "bd_r";
-			break;
 		case 0x42: /* BD-R Random */
                         disc_type = "bd_r";
 			break;


More information about the hal-commit mailing list