mme_dvd_get_disc region()

Get the region permissions for a DVD-video

Synopsis:

#include <mme/mme.h>

int mme_dvd_get_disc_region ( mme_hdl_t *hdl,
                              uint64_t msid,
                              uint32_t *region );

Arguments:

hdl
An MME connection handle.
msid
The ID of the mediastore (DVD-video disk) from which information is needed.
region
A pointer to the location where the function can store the region reported by the DVD-video disk.

Library:

mme

Description:

The function mme_dvd_get_disc_region() gets the region code of specific DVD-video disks that are inserted into the DVD drive. The bits set by mme_dvd_get_disc_region() represent the regions in which the DVD-video may be played. If no bits are set, the DVD-video is regionless and can be played in any region.

The region argument takes a 32-bit region code, but the top 24 bits of the region aren't currently used. Region codes are represented in bits 0 to 7, with bit 0 representing region 1, up to bit 7 representing region 8.

How to use mme_dvd_get_disc_region()

Before playing a DVD-video, the MME automatically checks the region for a DVD-video disk against the DVD drive region, and enforces permissions. If the user attempts to play a DVD-video in a drive that does not have permissions for that DVD-video's region, the MME generates a MME_PLAY_ERROR_REGION event.

You should use the function mme_dvd_get_disc_region() to check the regions of a DVD-video disk when you first access it. You can perform a bitwise AND operation to compare these regions against the region codes for which a device is enabled in order to determine if the DVD-video can be played on that device. For example, if the device is enabled for regions 1 and 3, you can check that a DVD-video disk is from one of these regions or has no region set before allowing the user to continue.

By getting the DVD-video disk regions on first access and checking these against the DVD drive regions, you can inform the end-user immediately in the event that the DVD-video is not playable on the drive.

Example: check if a DVD-video disk can be played on a device

/*
  * You can play a disk if it has no region (its region code
  * is 0), or if one of the disk region bits matches the
  * device region bits.
  */
if (bitsfromdisc == 0 || (bitsfromdisc & deviceregion) != 0) {
	/* Region is OK */
}

Events

None delivered.

Blocking and validation

This function doesn't block.

Returns:

0
Success.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

mme_video_get_status()