Property Sets and DirectShow


DirectShow uses property sets to support extended services offered by hardware manufacturers and their associated drivers and filters. Hardware and filter vendors can define new capabilities as properties, arrange them in property sets, and publish the specification for these property sets. As the application developer, you can use the methods of the IKsPropertySet interface to determine whether a driver or filter supports a particular set of properties, and to retrieve or to set those properties.

All the methods exposed by IKsPropertySet require a GUID that identifies the property set (guidPropSet parameter) and a DWORD that identifies the property within the property set (the dwPropID parameter). dwPropID is typically a member of an enumerated data type.

Individual properties can also have associated data which the developer specifies in the pPropData parameter in IKsPropertySet::Set and IKsPropertySet::Get. The IKsPropertySet interface specification intentionally leaves these parameters undefined (data type LPVOID), allowing the designer of the property set to use them in a way most beneficial to the individual property. The definition of each property provides the meaning of the property data.

DirectShow provides property sets for DVD and capture. The following table lists the GUID and a description of each property set.
Property Set GUID Description
AM_KSPROPSETID_DvdSubPic DVD Subpicture properties control the color, contrast, and output of the subpicture display.
AM_KSPROPSETID_CopyProt DVD Copy protection property set.
AMPROPSETID_Pin Capture pin property set.

The following topics provide more information about these property sets.

DVD Subpicture Property Set

DVD Subpicture properties control the color, contrast, and output of the subpicture display.

The following information presents the necessary constants and data types for the developer to use for this property set in calls to IKsPropertySet methods. It provides values for the GUID (guidPropSet), property ID (dwPropID), and property data type (pPropData) parameters.

GUID: AM_KSPROPSETID_DvdSubPic

Property Set enum: AM_PROPERTY_DVDSUBPIC

Property ID
Data Type Used by the Specified Property
AM_PROPERTY_DVDSUBPIC_PALETTE
AM_PROPERTY_SPPAL
AM_PROPERTY_DVDSUBPIC_HLI
AM_PROPERTY_SPHLI
AM_PROPERTY_DVDSUBPIC_COMPOSIT_ON
AM_PROPERTY_COMPOSIT_ON


AM_PROPERTY_DVDSUBPIC Property Set

Data Types

DVD subpicture properties.


typedef enum {
    AM_PROPERTY_DVDSUBPIC_PALETTE,
    AM_PROPERTY_DVDSUBPIC_HLI,
    AM_PROPERTY_DVDSUBPIC_COMPOSIT_ON, 
} AM_PROPERTY_DVDSUBPIC;
Values
AM_PROPERTY_DVDSUBPIC_PALETTE
Sets the palette for a subpicture. Data type is AM_PROPERTY_SPPAL.
AM_PROPERTY_DVDSUBPIC_HLI
Set-only property which specifies a rectangle of subpicture or screen whose color or contrast is to be changed. Data type is AM_PROPERTY_SPHLI.
AM_PROPERTY_DVDSUBPIC_COMPOSIT_ON
Set-only property which enables or disables subpicture display. DirectShow defines the AM_PROPERTY_COMPOSIT_ON boolean data type for this property, as well as *PAM_PROPERTY_COMPOSIT_ON as a pointer to this data type. TRUE indicates display the subpicture, FALSE indicates disable it. See the WDM DDK for more information.
Remarks

The AM_PROPERTY_DVDSUBPIC_HLI property is set-only. It specifies a rectangle of subpicture or screen whose color or contrast is to be changed. This differs from the DVD specification in that the Microsoft DVD navigator parses all button and keyboard information and only passes one highlight rectangle down to the subpicture decoder at any given time. As a result, highlight information is sent to the decoder more often than it is present in the DVD stream.

The highlight information arrives asynchronously to the data stream. The decoder uses the highlight Start and End time stamps to correlate the highlight information to the relevant subpicture information, if any. If the decoder has not received any subpicture stream information for the requested time stamps, the decoder assumes that the highlight information is stand-alone and does not apply to a subpicture. In this case, the color and contrast information can be assumed to be all the same color.

The data is not entirely in DVD disc format. Microsoft provides an additional structure of type AM_PROPERTY_SPHLI that is passed as the parameter to this property. This structure describes the currently selected button from the DVD highlight information.

The DVD navigator processes all keystroke information and sends new highlight information each time a button state changes. The information describes only one mode of one button at a time. It includes a display rectangle in pixel coordinates of the screen, or a display of the subpicture, if present. The structure also contains color and contrast information but only for the present state of the currently selected button. The format is defined in the DVD specification.

Highlight information contains Start and End Timestamps. These are in the same units as other time stamps, with two exceptions: A Start Timestamp of 0xFFFFFFFF means the highlight property is effective upon receipt, and an End Timestamp of 0xFFFFFFFF means the highlight property is valid until next highlight received.

The HLISS field is as defined in the DVD specification. A value of zero indicates that all highlights are invalid and the decoder should disable all highlights.


AM_DVD_YUV

Structures

DVD YUV subpicture data.

 typedef struct _AM_DVD_YUV {
    UCHAR   Reserved;
    UCHAR   Y;
    UCHAR   U;
    UCHAR   V;
} AM_DVD_YUV, *PAM_DVD_YUV;
Members
Reserved
Reserved.
Y
Y data.
U
U data.
V
V data.
Remarks

This structure is contained within the AM_PROPERTY_SPPAL structure.


AM_PROPERTY_SPPAL

Structures

DVD subpicture palette.

 typedef struct _AM_PROPERTY_SPPAL {
    AM_DVD_YUV sppal[16];
} AM_PROPERTY_SPPAL, *PAM_PROPERTY_SPPAL;
Members
sppal
Array of 16 YUV elements which correspond to the four-bit color numbers requested within the subpicture command stream. The YUV elements are of type AM_DVD_YUV.
Remarks

The AM_PROPERTY_DVDSUBPIC_PALETTE property uses this structure.


AM_COLCON

Structures

Color contrast description from DVD highlight (HLI).

 typedef struct _AM_COLCON {
    UCHAR emph1col:4;
    UCHAR emph2col:4;
    UCHAR backcol:4;
    UCHAR patcol:4;
    UCHAR emph1con:4;
    UCHAR emph2con:4;
    UCHAR backcon:4;
    UCHAR patcon:4;
} AM_COLCON, *PAM_COLCON;
Members
emph1col
Emphasis color 1.
emph2col
Emphasis color 2.
backcol
Background color.
patcol
Pattern color.
emph1con
Emphasis contrast 1.
emph2con
Emphasis contrast 2.
backcon
Background contrast.
patcon
Pattern contrast.
Remarks

This structure is contained within the AM_PROPERTY_SPHLI structure.


AM_PROPERTY_SPHLI

Structures

Describes the currently selected button from the DVD highlight information.

 typedef struct _AM_PROPERTY_SPHLI {
    USHORT  HLISS;      
    USHORT  Reserved;
    ULONG   StartPTM; 
    ULONG   EndPTM;  
    USHORT  StartX;
    USHORT  StartY;
    USHORT  StopX;
    USHORT  StopY;
    AM_COLCON  ColCon;     // color contrast description (4 bytes as given in HLI)
} AM_PROPERTY_SPHLI, *PAM_PROPERTY_SPHLI;
Members
HLISS
Highlight status of current selection.
Reserved
Reserved for internal use. Do not use or set.
StartPTM
Start presentation time divided by 90,000.
EndPTM
End presentation time divided by 90,000.
StartX
Start x-coordinate pixel of the current highlight button.
StartY
Start y-coordinate pixel of the current highlight button.
StopX
Ending x-coordinate pixel of the current highlight button.
StopY
Ending y-coordinate pixel of the current highlight button.
ColCon
Color contrast description of type AM_COLCON.
Remarks

The AM_PROPERTY_DVDSUBPIC_HLI property uses this structure.

DVD Copy Protection Property Set

GUID: AM_KSPROPSETID_CopyProt

Property Set enum: AM_PROPERTY_DVDCOPYPROT

Properties:

Property ID
Data Type Used by the Specified Property
AM_PROPERTY_DVDCOPY_CHLG_KEY
AM_DVDCOPY_CHLGKEY
AM_PROPERTY_DVDCOPY_DVD_KEY1
AM_DVDCOPY_BUSKEY
AM_PROPERTY_DVDCOPY_DEC_KEY2
AM_DVDCOPY_BUSKEY
AM_PROPERTY_DVDCOPY_TITLE_KEY
AM_DVDCOPY_TITLEKEY
AM_PROPERTY_COPY_MACROVISION
AM_COPY_MACROVISION
AM_PROPERTY_DVDCOPY_REGION
Set exactly one appropriate region bit to the value 1.
AM_PROPERTY_DVDCOPY_DISC_KEY
AM_DVDCOPY_DISCKEY


AM_PROPERTY_DVDCOPYPROT Property Set

Data Types

DVD copy protection properties.


typedef enum {
    AM_PROPERTY_DVDCOPY_CHLG_KEY,
    AM_PROPERTY_DVDCOPY_DVD_KEY1,
    AM_PROPERTY_DVDCOPY_DEC_KEY2,
    AM_PROPERTY_DVDCOPY_TITLE_KEY,
    AM_PROPERTY_COPY_MACROVISION,
    AM_PROPERTY_DVDCOPY_REGION,
    AM_PROPERTY_DVDCOPY_DISC_KEY
} AM_PROPERTY_DVDCOPYPROT;
Values
AM_PROPERTY_DVDCOPY_CHLG_KEY
Both get and set are supported on this property. A get property requests the decoder to provide its bus challenge key. A set property provides the decoder with the bus challenge key from the DVD drive. The data passed in this property will be a structure of type AM_DVDCOPY_CHLGKEY.
AM_PROPERTY_DVDCOPY_DVD_KEY1
This is a set-only property. This property provides the DVD drive bus key 1 to the decoder. The data passed will be a structure of type AM_DVDCOPY_BUSKEY.
AM_PROPERTY_DVDCOPY_DEC_KEY2
This is a get-only property. This property requests that the decoder's bus key 2 be transferred to the DVD drive. The data passed will be a structure of type AM_DVDCOPY_BUSKEY.
AM_PROPERTY_DVDCOPY_TITLE_KEY
This is a set-only property. This provides Title Key from Current Content. The key is a structure of type AM_DVDCOPY_TITLEKEY.
AM_PROPERTY_COPY_MACROVISION
This is a set-only property. This property sets the Macrovision level for the NTSC encoder on the output end of the receiving pin.
AM_PROPERTY_DVDCOPY_REGION
Region code requests the Region definition that the decoder is allowed to play in as defined by the DVD consortium. The decoder shall set exactly one bit to the value '1' corresponding to the region in which the disc is allowed to play.
AM_PROPERTY_DVDCOPY_DISC_KEY
Set-only property. This provides Disc Key. The key is a structure of type AM_DVDCOPY_DISCKEY.
Remarks

Microsoft worked with the Copyright Protection Technical Working Group (CPTWG), which announced in November 1996 that its DVD technology subcommittee proposed solutions for preventing unauthorized copying of filmed entertainment from prerecorded DVD-Video. The subcommittee has proposed controls using a scrambling scheme first proposed by the DVD Consortium for encrypting disc content and licensing the decryption technology.

Microsoft will provide software that facilitates the authentication process required by this scheme, thus allowing a DVD-ROM drive to authenticate and transfer keys with a DVD decrypter. Microsoft has no current plans to ship a DVD decrypter and, instead, is providing operating system code that will act as the agent to allow either hardware or software decrypters to be authenticated.

The key exchange process is initiated and controlled by the DVD navigator. The DVD minidriver only needs to implement the properties above. The rest is handled by other components.

Each DVD input stream will receive copy protection properties. This is true even if all DVD streams are controlled by the same hardware


AM_DVDCOPY_CHLGKEY

Structures

DVD challenge key.

 typedef struct _AM_DVDCOPY_CHLGKEY {
    BYTE ChlgKey[10];
    BYTE Reserved[2];
} AM_DVDCOPY_CHLGKEY, *PAM_DVDCOPY_CHLGKEY;
Members
ChlgKey
Challenge key.
Reserved
Reserved.
Remarks

AM_PROPERTY_DVDCOPY_CHLG_KEY property uses this structure.


AM_DVDCOPY_BUSKEY

Structures

DVD bus key.

 typedef struct _AM_DVDCOPY_BUSKEY {
    BYTE BusKey[5];
    BYTE Reserved[1];
} AM_DVDCOPY_BUSKEY, *PAM_DVDCOPY_BUSKEY;
Members
BusKey
DVD drive bus key.
Reserved
Reserved.
Remarks

AM_PROPERTY_DVDCOPY_DVD_KEY1 and AM_PROPERTY_DVDCOPY_DEC_KEY2 properties use this structure.


AM_DVDCOPY_DISCKEY

Structures

DVD disc key.

 typedef struct _AM_DVDCOPY_DISCKEY {
    BYTE DiscKey[2048];
} AM_DVDCOPY_DISCKEY, *PAM_DVDCOPY_DISCKEY;
Members
DiscKey
DVD disc key.
Remarks

AM_PROPERTY_DVDCOPY_DISC_KEY property uses this structure.


AM_DVDCOPY_TITLEKEY

Structures

DVD title key from the current content.

 typedef struct AM_DVDCOPY_TITLEKEY {
    ULONG KeyFlags;
    UCHAR TitleKey[6];
    UCHAR Reserved[2];
} AM_DVDCOPY_TITLEKEY, *PAM_DVDCOPY_TITLEKEY;
Members
KeyFlags
Key flags.
TitleKey
Title key.
Reserved
Reserved.
Remarks

AM_PROPERTY_DVDCOPY_TITLE_KEY property uses this structure.


AM_COPY_MACROVISION

Structures

Macrovision level for the NTSC encoder.


typedef struct _AM_COPY_MACROVISION {
	ULONG MACROVISIONLevel;
} AM_COPY_MACROVISION, *PAM_COPY_MACROVISION;
Members
MACROVISIONLevel
Macrovision level for the NTSC encoder. Member of the AM_COPY_MACROVISION_LEVEL enumerated data type.
Remarks

AM_PROPERTY_COPY_MACROVISION property uses this structure.


AM_COPY_MACROVISION_LEVEL

Data Types

Macrovision level.


typedef enum {
	AM_MACROVISION_DISABLED,
	AM_MACROVISION_LEVEL1,
	AM_MACROVISION_LEVEL2,
	AM_MACROVISION_LEVEL3
} AM_COPY_MACROVISION_LEVEL, *PAM_COPY_MACROVISION_LEVEL;
Values
AM_MACROVISION_DISABLED
Disabled.
AM_MACROVISION_LEVEL1
Level 1.
AM_MACROVISION_LEVEL2
Level 2.
AM_MACROVISION_LEVEL3
Level 3.
Remarks

AM_COPY_MACROVISION structure uses this data type.

Capture Property Set

GUID: AMPROPSETID_Pin

Property Set enum: AMPROPERTY_PIN


AMPROPERTY_PIN Property Set

Data Types

Capture pin property set.

 typedef enum {
        AMPROPERTY_PIN_CATEGORY,
      } AMPROPERTY_PIN;
Values
AMPROPERTY_PIN_CATEGORY
Pin category. This property uses a GUID data type. DirectShow defines the following pin categories in Uuids.h which resides in the SDK Include directory.
PIN_CATEGORY_CAPTURE Capture pin.
PIN_CATEGORY_PREVIEW Preview pin.
PIN_CATEGORY_ANALOGVIDEOIN Input pin of the capture filter that takes analog and digitizes it.
PIN_CATEGORY_VBI Pin providing vertical blanking interval data.
PIN_CATEGORY_VIDEOPORT Pin to be connected to a VPE filter.
PIN_CATEGORY_NABTS Pin providing North American Videotext Standard data.
PIN_CATEGORY_EDS Pin providing Extended Data Services (line 21, even fields).
PIN_CATEGORY_TELETEXT Pin providing teletext (a closed captioning variant).
PIN_CATEGORY_CC Pin providing closed captioning data from line 21.
PIN_CATEGORY_STILL Pin providing a still image.
PIN_CATEGORY_TIMECODE Pin providing timecode data.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.