Поделиться через


DirectShow Registry Settings (Windows Embedded CE 6.0)

1/6/2010

The DirectShow registry settings allow you to configure Windows Media codec playback performance, maintain a smooth audio or video playback, control the settings of the video renderer, establish quality levels and associated parameters for image encoding, control the number and size of the buffers that are available on the input pin, and specify the number and size of MediaSamples that are allocated for the connection between the MPEG-2 Program Stream Multiplexer Filter and the DVR Engine Sink filter.

The following topics describe programming elements that can add, delete, enumerate, or represent DirectShow registry settings:

Ee492726.collapse(en-US,WinEmbedded.60).gifWindows Media Video Codec Performance

The WMVDecoder subkey allows you to adjust Windows Media video codec playback performance and quality for x86 processors only. This subkey is not available for other architectures.

By default, each frame from a Windows Media video stream undergoes some level of post-processing after it is decoded. This smoothes the video frame by deblocking the image to smooth artifacts that are inherent to the digital compression process, and by de-ringing the image to correct for certain motion artifacts. The level of post-processing depends on the level of CPU performance.

How much post-processing is used directly affects the device's CPU usage. You can adjust the level of post-processing that the Windows Media video codec performs with the following registry subkey:

[HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\WMVDecoder]
    "PostProcessing"=dword:FFFFFFFF

The following table describes the settings that can be used for the PostProcessing named value.

PostProcessing setting Description

FFFFFFFF

Automatic.

The Windows Media codec automatically sets the level of post-processing based on the incoming data and the CPU of the target device.

0

Disabled.

All post-processing is disabled.

Disabling post-processing produces the highest frame rates during playback, but it does so at the expense of video quality.

1

Fast deblocking.

The codec runs each frame through a coarse deblocking filter.

2

Full deblocking.

The codec runs each frame through a fine deblocking filter.

3

Fast deblocking and deringing.

The codec runs each frame through both a coarse deblocking filter and a coarse deringing filter.

4

Full deblocking and deringing.

The codec runs each frame through both a fine deblocking filter and a fine deringing filter.

This setting requires the highest CPU usage. It produces the highest quality image for each individual frame; however, the overall frame rate may be reduced.

Ee492726.collapse(en-US,WinEmbedded.60).gifAudio and Video Thread Priorities

If DirectShow is using a high percentage of the available CPU on a device when the device is decoding video, the audio and video performance may be uneven if other threads with higher priorities also need to use the CPU.

To maintain a smooth audio or smooth video playback at all times, you can use the following registry subkey to fine tune the priorities for the audio and video threads: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ThreadPriority

The following table describes the named values for this subkey.

Value Type Description

Highest

DWORD

Sets a new thread priority for DirectShow threads that are running with a priority of THREAD_PRIORITY_HIGHEST.

The default setting is the hexadecimal value F9, which is identical to the remapped value of THREAD_PRIORITY_HIGHEST (249).

AboveNormal

DWORD

Sets a new thread priority for DirectShow threads that are running with a priority of THREAD_PRIORITY_ABOVE_NORMAL.

The default setting is the hexadecimal value FA, which is identical to the remapped value of THREAD_PRIORITY_ABOVE_NORMAL (250).

Normal

DWORD

Sets a new thread priority for DirectShow threads that are running with a priority of THREAD_PRIORITY_NORMAL.

The default setting is the hexadecimal value FB, which is identical to the remapped value of THREAD_PRIORITY_NORMAL (251).

BelowNormal

DWORD

Sets a new thread priority for DirectShow threads that are running with a priority of THREAD_PRIORITY_BELOW_NORMAL.

The default setting is the hexadecimal value FC, which is identical to the remapped value of THREAD_PRIORITY_BELOW_NORMAL (252).

Video

DWORD

Sets a new thread priority for the video rendering thread in DirectShow.

The default setting is the hexadecimal value FB, which is identical to the remapped value of THREAD_PRIORITY_NORMAL (251).

The setting for Normal does not affect the video rendering thread.

The named values Highest, AboveNormal, Normal, and BelowNormal are all associated with standard operating system thread priority levels.

DirectShow threads that are identified with the standard operating system thread priorities run at the priority levels that are specified by those registry settings instead of the values that are described in the preceding table. These settings affect only threads that are owned by DirectShow. They do not affect the global operating system thread priority levels, and they do not affect threads that are owned by Windows Media Player.

For more information about Windows Embedded CE thread priorities, see Priority Levels.

The following registry key example shows the default values for the registry subkey

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ThreadPriority.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ThreadPriority]
    "Highest"=DWORD:F9
    "AboveNormal"= DWORD:FA
    "Normal"= DWORD:FB
    "BelowNormal"= DWORD:FC
    "Video"= DWORD:FB

Notes

  • The default settings for DirectShow thread priorities provide satisfactory results for almost all devices; these values should not be changed unless absolutely necessary.
  • Changing values for DirectShow thread priorities from their default values can be very risky because the new values can cause unexpected performance problems for other applications that are running concurrently with DirectShow. It can be difficult to test for, diagnose, and resolve these types of problems.
  • If you must adjust the DirectShow audio and video thread priorities, make sure that the DirectShow priorities are higher than the audio and video driver priorities in your operating system design. Also, make sure that the audio priority is higher than the priority of the software mixer. Failing to take these steps almost always results in audio and video playback performance problems.

Ee492726.collapse(en-US,WinEmbedded.60).gifVideo Renderer Settings

You can control the settings of the video renderer with the registry subkey:HKEY_LOCAL_MACHINE\Software\Microsoft\DirectX\DirectShow\Video Renderer

The following table shows the named values for this subkey.

Value Type Description

MaxBackBuffers

DWORD

Controls the number of back buffers the video renderer can use.

SurfaceTypes

DWORD

Defines the types of video surfaces that the video renderer uses.

It is a bitwise combination of the DirectShow DirectDraw Surface (AMDDS) definitions that are described in the next table.

Always set this to a hexadecimal value, not to a symbolic constant.

If you set this value to 0x00 (AMDDS_NONE), the video renderer uses GDI.

UseOverlayStretch

DWORD

Controls aspect ratio preservation in the overlay area.

The default setting is 1.

Set this value to 1 to stretch the video image to fill the overlay area.

Set this value to 0 to preserve the aspect ratio of the video image.

UseScanLine

DWORD

Defines whether the video renderer will use IDirectDraw::GetScanLine to determine when to blit or flip.

This is typically an expensive operation, so it is turned off by default. The default setting is 0.

Set this value to 1 to turn it on.

KeyColor

DWORD

Defines the color key when playing back video using an overlay on a non-palletized display, that is, a display with a color depth that is greater than 8 bpp.

This is a hexadecimal RGB value.

KeyIndex

DWORD

Defines the color key when the device plays back video by using an overlay on a palletized display, that is, a display with a color depth of less than or equal to 8 bpp.

This is a hexadecimal value in the range of 0 to 2^(color depth) - 1.

The following table describes the AMDDS flag values to use with the SurfaceTypes named value.

Flag Hexadecimal value Description

AMDDS_NONE

0x00

No support for Device Control Interface (DCI) or DirectDraw.

AMDDS_DCIPS

0x01

Uses DCI primary surface.

AMDDS_PS

0x02

Uses DirectDraw primary surface.

AMDDS_RGBOVR

0x04

Uses RGB overlay surfaces.

AMDDS_YUVOVR

0x08

Uses YUV overlay surfaces.

AMDDS_RGBOFF

0x10

Uses RGB off-screen surfaces.

AMDDS_YUVOFF

0x20

Uses YUV off-screen surfaces.

AMDDS_RGBFLP

0x40

Uses RGB flipping surfaces.

AMDDS_YUVFLP

0x80

Uses YUV flipping surfaces.

AMDDS_ALL

0xFF

Uses all available surfaces.

AMDDS_DEFAULT

0xFF

Uses all available surfaces.

AMDDS_YUV

0xA8

(AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP)

AMDDS_RGB

0x58

(AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP)

AMDDS_PRIMARY

0x03

(AMDDS_DCIPS | AMDDS_PS)

Ee492726.collapse(en-US,WinEmbedded.60).gifEncoder Quality Settings

You can establish quality levels and associated parameters for image encoding with the following registry subkey:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ImageSink\Quality\<Quality Level>\<File Extension>\<Parameter Name>

The IImageSinkFilter Interface interface uses this subkey to obtain parameter values that are passed on to the image encoding factory. The designated encoder quality level, the file extension, and the parameter name are all integral to the path of the registry subkey.

The following table shows the named values for a parameter. Each of these values corresponds to a member of a StructEncoderParameter structure.

Value Type Description

GUID

BINARY

The GUID for the encoding parameter.

There is no default setting.

NumberOfValues

DWORD

The number of parameter values that are contained in Value.

There is no default setting.

Type

DWORD

The data type for the parameter.

There is no default setting.

Value

DWORD

The value of the parameter.

If NumberOfValues is greater than1, Value must be provided with binary data that encodes all of these values.

There is no default setting.

The following example shows a registry entry that sets a value for the Compression parameter when the device is encoding a .jpg file at quality level 0.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectShow\ImageSink\Quality\0\jpg\Compression]
"GUID"="0xe09d739d-ccd4-44ee-8eba-3fbf8be4fc58"
"Value"=dword:00000003
"Type"=dword:00000004
"NumberOfValues"=dword:00000001

Ee492726.collapse(en-US,WinEmbedded.60).gifMemory Use and Performance During Streaming

You can use the following registry key to control how much memory is allowed for the buffer during streamed playback of media by using Windows Media Technologies:

HKEY_CURRENT_USER\Software\Microsoft\Netshow\Player\

This key allows you to choose between memory use and performance. For high bit-rate, High Definition video files, you must allow a large amount of memory to prevent the device from running out of buffer space when a long stream of hard frames arrives.

The registry key named values are multipliers of the pre-roll values that are set in the file. The values should be specified as percentage numbers. For example, a number of 300 denotes a multiplier of 3x, and 1 denotes a multiplier of 0.01X.

Value Type Description

PrerollMinMultiplier

DWORD

This is the low-water mark. A freeze is issued if the buffer space goes below the multiplier * pre-roll value.

PrerollMaxMultiplier

DWORD

This is the high-water mark. Buffering is limited to the amount of memory that is specified by the pre-roll * multiplier value.

For more information about registry settings for Windows Media Technologies, see Windows Media Technologies Registry Settings.

Ee492726.collapse(en-US,WinEmbedded.60).gifSettings for the MPEG-2 Program Stream Multiplexer Filter

You can specify the number and size of MediaSamples that are allocated for the connection between the MPEG-2 Program Stream Multiplexer Filter and the DVR Engine Sink filter by using the following subkey:

HKEY_LOCAL_MACHINE\Software\Microsoft\Dvr\DvrPsMux

The following table shows the named values for this subkey. These values are not set by default.

Value Type Description

OutputBufferCount

DWORD

The number of samples.

Choose a value on the basis of system memory constraints and performance requirementsI

OutputBufferSize

DWORD

The media sample size.

The default is 128Kb.

This value is the most important.

If you want the device to process video streams that are larger than the MPEG-2 video constraints that are specified in the DVD-Video specification (section 5.4.1.2), increase the media sample size to a value that is greater than the default value.

You must choose a sample size that is large enough to hold a complete I-frame, plus any audio data that may accompany it.

The default registry values vary depending on what Catalog items are included in your operating system design. For more information about these settings, see Default Registry Settings.

The following is a list of topics that provide in-depth discussions about other DirectShow registry settings:

The following is a list of topics about programming elements that can add, delete, enumerate, or represent DirectShow registry settings:

Ee492726.collapse(en-US,WinEmbedded.60).gifMPEG Splitter Settings

You can control the number and size of the buffers that are available on the input pin of the MPEG-1 Parser/Splitter with the following registry subkey: HKEY_LOCAL_MACHINE\Software\Microsoft\Multimedia\DirectShow\MPEG Splitter

This subkey is used by the upstream asynchronous file source filter during pin negotiation. For more information about this filter, see File Source (Async) Filter.

The following table describes the named values for this subkey.

Value Type Description

BufferCount

DWORD

Controls the number of buffers that is used by the MPEG-1 Stream Splitter Filter.

The default setting is 4.

BufferSize

DWORD

Defines the size, in bytes, of each buffer.

The default setting is 10000.

See Also

Reference

DMO Wrapper Filter

Other Resources

DirectShow
DirectShow Application Development