// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. //------------------------------------------------------------------------------ // // Types declaration for SharpDX.MediaFoundation.DirectX namespace. // This code was generated by a tool. // Date : 6/17/2016 5:56:11 PM // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System; using System.Runtime.InteropServices; using System.Security; #if DESKTOP_APP namespace SharpDX.MediaFoundation.DirectX { // Disable warning : XML comment is not placed on a valid language element #pragma warning disable 419 #pragma warning disable 1587 #pragma warning disable 1574 /// ///

Enables two threads to share the same Direct3D 9 device, and provides access to the DirectX Video Acceleration (DXVA) features of the device.

///
/// ///

This interface is exposed by the Direct3D Device Manager. To create the Direct3D device manager, call .

To get this interface from the Enhanced Video Renderer (EVR), call . The service is . For the DirectShow EVR filter, call GetService on the filter's pins.

The Direct3D Device Manager supports Direct3D 9 devices only. It does not support DXGI devices.

Windows Store apps must use IMFDXGIDeviceManager and Direct3D 11 Video APIs.

///
/// /// ms704727 /// IDirect3DDeviceManager9 /// IDirect3DDeviceManager9 [Guid("a0cade0f-06d5-4cf4-a1c7-f3cdd725aa75")] public partial class Direct3DDeviceManager : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public Direct3DDeviceManager(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.Direct3DDeviceManager(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.Direct3DDeviceManager(nativePointer); } /// ///

Sets the Direct3D device or notifies the device manager that the Direct3D device was reset.

///
///

Pointer to the interface of the Direct3D device.

///

Token received in the pResetToken parameter of the function.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid token

Direct3D device error.

?

/// ///

When you first create the Direct3D device manager, call this method with a reference to the Direct3D device. The device manager does not create the device; the caller must provide the device reference initially.

Also call this method if the Direct3D device becomes lost and you need to reset the device or create a new device. This occurs if returns or . For more information about lost devices, see the Direct3D documentation.

The resetToken parameter ensures that only the component which originally created the device manager can invalidate the current device.

If this method succeeds, all open device handles become invalid.

///
/// /// ms693525 /// HRESULT IDirect3DDeviceManager9::ResetDevice([In] IDirect3DDevice9* pDevice,[In] unsigned int resetToken) /// IDirect3DDeviceManager9::ResetDevice public void ResetDevice(SharpDX.Direct3D9.Device deviceRef, int resetToken) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)((deviceRef == null)?IntPtr.Zero:deviceRef.NativePointer), resetToken,((void**)(*(void**)_nativePointer))[3]); __result__.CheckError(); } } /// ///

Gets a handle to the Direct3D device.

///
///

Receives the device handle.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

?

/// ///

To get the Direct3D device's reference, call with the handle returned in phDevice. Close the device handle when you are done using it, by calling .

To test whether a device handle is still valid, call .

///
/// /// ms698976 /// HRESULT IDirect3DDeviceManager9::OpenDeviceHandle([Out] void** phDevice) /// IDirect3DDeviceManager9::OpenDeviceHandle public void OpenDeviceHandle(out System.IntPtr hDeviceRef) { unsafe { SharpDX.Result __result__; fixed (void* hDeviceRef_ = &hDeviceRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, hDeviceRef_,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Closes a Direct3D device handle. Call this method to release a device handle retrieved by the method.

///
/// No documentation. ///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_HANDLE

Invalid handle.

?

/// /// ms697332 /// HRESULT IDirect3DDeviceManager9::CloseDeviceHandle([In] void* hDevice) /// IDirect3DDeviceManager9::CloseDeviceHandle public void CloseDeviceHandle(System.IntPtr hDevice) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)hDevice,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Tests whether a Direct3D device handle is valid.

///
///

Handle to a Direct3D device. To get a device handle, call .

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The device handle is valid.

E_HANDLE

The specified handle is not a Direct3D device handle.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

?

/// ///

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

///
/// /// ms704778 /// HRESULT IDirect3DDeviceManager9::TestDevice([In] void* hDevice) /// IDirect3DDeviceManager9::TestDevice public void TestDevice(System.IntPtr hDevice) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)hDevice,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Gives the caller exclusive access to the Direct3D device.

///
///

A handle to the Direct3D device. To get the device handle, call .

///

Receives a reference to the device's interface.

///

Specifies whether to wait for the device lock. If the device is already locked and this parameter is TRUE, the method blocks until the device is unlocked. Otherwise, if the device is locked and this parmater is , the method returns immediately with the error code DXVA2_E_VIDEO_DEVICE_LOCKED.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

DXVA2_E_VIDEO_DEVICE_LOCKED

The device is locked and fBlock is .

E_HANDLE

The specified handle is not a Direct3D device handle.

?

/// ///

When you are done using the Direct3D device, call to unlock to the device.

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

If fBlock is TRUE, this method can potentially deadlock. For example, it will deadlock if a thread calls LockDevice and then waits on another thread that calls LockDevice. It will also deadlock if a thread calls LockDevice twice without calling UnlockDevice in between.

///
/// /// ms697056 /// HRESULT IDirect3DDeviceManager9::LockDevice([In] void* hDevice,[Out] IDirect3DDevice9** ppDevice,[In] BOOL fBlock) /// IDirect3DDeviceManager9::LockDevice public void LockDevice(System.IntPtr hDevice, out SharpDX.Direct3D9.Device deviceOut, SharpDX.Mathematics.Interop.RawBool fBlock) { unsafe { IntPtr deviceOut_ = IntPtr.Zero; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint49(_nativePointer, (void*)hDevice, &deviceOut_, fBlock,((void**)(*(void**)_nativePointer))[7]); deviceOut= (deviceOut_ == IntPtr.Zero)?null:new SharpDX.Direct3D9.Device(deviceOut_); __result__.CheckError(); } } /// ///

Unlocks the Direct3D device. Call this method to release the device after calling .

///
/// No documentation. /// No documentation. ///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The specified device handle is not locked, or is not a valid handle.

?

/// /// ms704707 /// HRESULT IDirect3DDeviceManager9::UnlockDevice([In] void* hDevice,[In] BOOL fSaveState) /// IDirect3DDeviceManager9::UnlockDevice public void UnlockDevice(System.IntPtr hDevice, SharpDX.Mathematics.Interop.RawBool fSaveState) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint16(_nativePointer, (void*)hDevice, fSaveState,((void**)(*(void**)_nativePointer))[8]); __result__.CheckError(); } } /// ///

Gets a DirectX Video Acceleration (DXVA) service interface.

///
///

A handle to a Direct3D device. To get a device handle, call .

///

The interface identifier (IID) of the requested interface. The Direct3D device might support the following DXVA service interfaces:

///

Receives a reference to the requested interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

DXVA2_E_NEW_VIDEO_DEVICE

The device handle is invalid.

DXVA2_E_NOT_AVAILABLE

The Direct3D device does not support video acceleration.

DXVA2_E_NOT_INITIALIZED

The Direct3D device manager was not initialized. The owner of the device must call .

E_HANDLE

The specified handle is not a Direct3D device handle.

?

/// ///

If the method returns DXVA2_E_NEW_VIDEO_DEVICE, call to close the handle and then call OpenDeviceHandle again to get a new handle. The method invalidates all open device handles.

///
/// /// ms696198 /// HRESULT IDirect3DDeviceManager9::GetVideoService([In] void* hDevice,[In] const GUID& riid,[Out] void** ppService) /// IDirect3DDeviceManager9::GetVideoService public void GetVideoService(System.IntPtr hDevice, System.Guid riid, out System.IntPtr serviceOut) { unsafe { SharpDX.Result __result__; fixed (void* serviceOut_ = &serviceOut) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)hDevice, (void*)&riid, serviceOut_,((void**)(*(void**)_nativePointer))[9]); __result__.CheckError(); } } } /// ///

Gets the range of values for an image filter that the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device supports.

///
/// ///

To find out which image filters the device supports, check the FilterCaps member of the structure. Call the method to get this value.

///
/// /// dd373915 /// IDXVAHD_Device /// IDXVAHD_Device [Guid("95f12dfd-d77e-49be-815f-57d579634d6d")] public partial class HDDevice : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public HDDevice(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.HDDevice(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.HDDevice(nativePointer); } /// ///

Gets the capabilities of the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
/// /// dd373914 /// GetVideoProcessorDeviceCaps /// GetVideoProcessorDeviceCaps /// HRESULT IDXVAHD_Device::GetVideoProcessorDeviceCaps([Out] DXVAHD_VPDEVCAPS* pCaps) public SharpDX.MediaFoundation.DirectX.Vpdevcaps VideoProcessorDeviceCaps { get { SharpDX.MediaFoundation.DirectX.Vpdevcaps __output__; GetVideoProcessorDeviceCaps(out __output__); return __output__; } } /// ///

Creates one or more Microsoft Direct3D video surfaces.

///
///

The width of each surface, in pixels.

///

The height of each surface, in pixels.

///

The pixel format, specified as a value or FOURCC code. For more information, see Video FOURCCs.

///

The memory pool in which the surface is created. This parameter must equal the InputPool member of the structure. Call the method to get this value.

///

Reserved. Set to 0.

///

The type of surface to create, specified as a member of the enumeration.

///

The number of surfaces to create.

///

A reference to an array of references. The NumSurfaces parameter specifies the number of elements in the array. The method fills the array with references to the new video surfaces. The caller must release the references.

///

Reserved. Set to null.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373911 /// HRESULT IDXVAHD_Device::CreateVideoSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Usage,[In] DXVAHD_SURFACE_TYPE Type,[In] unsigned int NumSurfaces,[Out, Buffer] IDirect3DSurface9** ppSurfaces,[InOut, Optional] void** pSharedHandle) /// IDXVAHD_Device::CreateVideoSurface public void CreateVideoSurface(int width, int height, SharpDX.Direct3D9.Format format, SharpDX.Direct3D9.Pool pool, int usage, SharpDX.MediaFoundation.DirectX.SurfaceTypeHD type, int numSurfaces, SharpDX.Direct3D9.Surface[] surfacesOut, System.IntPtr sharedHandleRef) { unsafe { IntPtr* surfacesOut_ = stackalloc IntPtr[surfacesOut.Length]; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, width, height, unchecked((int)format), unchecked((int)pool), usage, unchecked((int)type), numSurfaces, surfacesOut_, (void*)sharedHandleRef,((void**)(*(void**)_nativePointer))[3]); for (int i = 0; i < surfacesOut.Length; i++) surfacesOut[i] = (surfacesOut_[i] == IntPtr.Zero)?null:new SharpDX.Direct3D9.Surface(surfacesOut_[i]); __result__.CheckError(); } } /// ///

Gets the capabilities of the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

A reference to a structure that receives the device capabilities.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373914 /// HRESULT IDXVAHD_Device::GetVideoProcessorDeviceCaps([Out] DXVAHD_VPDEVCAPS* pCaps) /// IDXVAHD_Device::GetVideoProcessorDeviceCaps internal void GetVideoProcessorDeviceCaps(out SharpDX.MediaFoundation.DirectX.Vpdevcaps capsRef) { unsafe { capsRef = new SharpDX.MediaFoundation.DirectX.Vpdevcaps(); SharpDX.Result __result__; fixed (void* capsRef_ = &capsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, capsRef_,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Gets a list of the output formats supported by the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The number of formats to retrieve. This parameter must equal the OutputFormatCount member of the structure. Call the method to get this value.

///

A reference to an array of values. The Count parameter specifies the number of elements in the array. The method fills the array with a list of output formats.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// ///

The list of formats can include both values, such as , and FOURCC codes, such as 'NV12'. For more information, see Video FOURCCs.

///
/// /// dd373917 /// HRESULT IDXVAHD_Device::GetVideoProcessorOutputFormats([In] unsigned int Count,[Out, Buffer] D3DFORMAT* pFormats) /// IDXVAHD_Device::GetVideoProcessorOutputFormats public void GetVideoProcessorOutputFormats(int count, SharpDX.Direct3D9.Format[] formatsRef) { unsafe { SharpDX.Result __result__; fixed (void* formatsRef_ = formatsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, count, formatsRef_,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Gets a list of the input formats supported by the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The number of formats to retrieve. This parameter must equal the InputFormatCount member of the structure. Call the method to get this value.

///

A reference to an array of values. The Count parameter specifies the number of elements in the array. The method fills the array with a list of input formats.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// ///

The list of formats can include both values, such as , and FOURCC codes, such as 'NV12'. For more information, see Video FOURCCs.

///
/// /// dd373916 /// HRESULT IDXVAHD_Device::GetVideoProcessorInputFormats([In] unsigned int Count,[Out, Buffer] D3DFORMAT* pFormats) /// IDXVAHD_Device::GetVideoProcessorInputFormats public void GetVideoProcessorInputFormats(int count, SharpDX.Direct3D9.Format[] formatsRef) { unsafe { SharpDX.Result __result__; fixed (void* formatsRef_ = formatsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, count, formatsRef_,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Gets the capabilities of one or more Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processors.

///
///

The number of elements in the pCaps array. This parameter must equal the VideoProcessorCount member of the structure. Call the method to get this value.

///

A reference to an array of structures. The method fills the structures with the capabilities of the video processors supported by the driver.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373912 /// HRESULT IDXVAHD_Device::GetVideoProcessorCaps([In] unsigned int Count,[Out, Buffer] DXVAHD_VPCAPS* pCaps) /// IDXVAHD_Device::GetVideoProcessorCaps public void GetVideoProcessorCaps(int count, SharpDX.MediaFoundation.DirectX.Vpcaps[] capsRef) { unsafe { SharpDX.Result __result__; fixed (void* capsRef_ = capsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, count, capsRef_,((void**)(*(void**)_nativePointer))[7]); __result__.CheckError(); } } /// ///

Gets a list of custom rates that a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor supports. Custom rates are used for frame-rate conversion and inverse telecine (IVTC).

///
///

A that identifies the video processor to query. This must equal the valud of the VPGuid member from one of the structures retrieved by the method.

///

The number of rates to retrieve. This parameter must equal the CustomRateCount member of the structure for the video processor.

///

A reference to an array of structures. The Count parameter specifies the number of elements in the array. The method fills the array with a list of custom rates.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373913 /// HRESULT IDXVAHD_Device::GetVideoProcessorCustomRates([In] const GUID* pVPGuid,[In] unsigned int Count,[Out, Buffer] DXVAHD_CUSTOM_RATE_DATA* pRates) /// IDXVAHD_Device::GetVideoProcessorCustomRates public void GetVideoProcessorCustomRates(System.Guid vPGuidRef, int count, SharpDX.MediaFoundation.DirectX.CustomRateData[] ratesRef) { unsafe { SharpDX.Result __result__; fixed (void* ratesRef_ = ratesRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)&vPGuidRef, count, ratesRef_,((void**)(*(void**)_nativePointer))[8]); __result__.CheckError(); } } /// ///

Gets the range of values for an image filter that the Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device supports.

///
///

The type of image filter, specified as a member of the enumeration.

///

A reference to a structure. The method fills the structure with the range of values for the specified filter.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

The Filter parameter is invalid or the device does not support the specified filter.

?

/// ///

To find out which image filters the device supports, check the FilterCaps member of the structure. Call the method to get this value.

///
/// /// dd373915 /// HRESULT IDXVAHD_Device::GetVideoProcessorFilterRange([In] DXVAHD_FILTER Filter,[Out] DXVAHD_FILTER_RANGE_DATA* pRange) /// IDXVAHD_Device::GetVideoProcessorFilterRange public void GetVideoProcessorFilterRange(SharpDX.MediaFoundation.DirectX.Filter filter, out SharpDX.MediaFoundation.DirectX.FilterRangeData rangeRef) { unsafe { rangeRef = new SharpDX.MediaFoundation.DirectX.FilterRangeData(); SharpDX.Result __result__; fixed (void* rangeRef_ = &rangeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, unchecked((int)filter), rangeRef_,((void**)(*(void**)_nativePointer))[9]); __result__.CheckError(); } } /// ///

Creates a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

///
///

A that identifies the video processor to create. This must equal the value of the VPGuid member from one of the structures retrieved by the method.

///

Receives a reference to the interface. The caller must release the interface.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373910 /// HRESULT IDXVAHD_Device::CreateVideoProcessor([In] const GUID* pVPGuid,[Out] IDXVAHD_VideoProcessor** ppVideoProcessor) /// IDXVAHD_Device::CreateVideoProcessor public void CreateVideoProcessor(System.Guid vPGuidRef, out SharpDX.MediaFoundation.DirectX.HDVideoProcessor videoProcessorOut) { unsafe { IntPtr videoProcessorOut_ = IntPtr.Zero; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &vPGuidRef, &videoProcessorOut_,((void**)(*(void**)_nativePointer))[10]); videoProcessorOut= (videoProcessorOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.HDVideoProcessor(videoProcessorOut_); __result__.CheckError(); } } } /// ///

Represents a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) video processor.

To get a reference to this interface, call the method.

///
/// /// dd373918 /// IDXVAHD_VideoProcessor /// IDXVAHD_VideoProcessor [Guid("95f4edf4-6e03-4cd7-be1b-3075d665aa52")] public partial class HDVideoProcessor : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public HDVideoProcessor(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.HDVideoProcessor(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.HDVideoProcessor(nativePointer); } /// ///

Sets a state parameter for a blit operation by a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The state parameter to set, specified as a member of the enumeration.

///

The size, in bytes, of the buffer pointed to by pData.

///

A reference to a buffer that contains the state data. The meaning of the data depends on the State parameter. Each state has a corresponding data structure; for more information, see . The caller allocates the buffer and fills in the parameter data before calling this method.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373921 /// HRESULT IDXVAHD_VideoProcessor::SetVideoProcessBltState([In] DXVAHD_BLT_STATE State,[In] unsigned int DataSize,[In, Buffer] const void* pData) /// IDXVAHD_VideoProcessor::SetVideoProcessBltState public void SetVideoProcessBltState(SharpDX.MediaFoundation.DirectX.BlitState state, int dataSize, System.IntPtr dataRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, unchecked((int)state), dataSize, (void*)dataRef,((void**)(*(void**)_nativePointer))[3]); __result__.CheckError(); } } /// ///

Gets the value of a state parameter for blit operations performed by a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The state parameter to query, specified as a member of the enumeration.

///

The size, in bytes, of the buffer pointed to by pData.

///

A reference to a buffer allocated by the caller. The method copies the state data into the buffer. The buffer must be large enough to hold the data structure that corresponds to the state parameter. For more information, see .

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373919 /// HRESULT IDXVAHD_VideoProcessor::GetVideoProcessBltState([In] DXVAHD_BLT_STATE State,[In] unsigned int DataSize,[Out, Buffer] void* pData) /// IDXVAHD_VideoProcessor::GetVideoProcessBltState public void GetVideoProcessBltState(SharpDX.MediaFoundation.DirectX.BlitState state, int dataSize, System.IntPtr dataRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, unchecked((int)state), dataSize, (void*)dataRef,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Sets a state parameter for an input stream on a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The zero-based index of the input stream. To get the maximum number of streams, call and check the MaxStreamStates member of the structure.

///

The state parameter to set, specified as a member of the enumeration.

///

The size, in bytes, of the buffer pointed to by pData.

///

A reference to a buffer that contains the state data. The meaning of the data depends on the State parameter. Each state has a corresponding data structure; for more information, see . The caller allocates the buffer and fills in the parameter data before calling this method.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// ///

Call this method to set state parameters that apply to individual input streams.

///
/// /// dd373922 /// HRESULT IDXVAHD_VideoProcessor::SetVideoProcessStreamState([In] unsigned int StreamNumber,[In] DXVAHD_STREAM_STATE State,[In] unsigned int DataSize,[In, Buffer] const void* pData) /// IDXVAHD_VideoProcessor::SetVideoProcessStreamState public void SetVideoProcessStreamState(int streamNumber, SharpDX.MediaFoundation.DirectX.StreamState state, int dataSize, System.IntPtr dataRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, streamNumber, unchecked((int)state), dataSize, (void*)dataRef,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Gets the value of a state parameter for an input stream on a Microsoft DirectX Video Acceleration High Definition (DXVA-HD) device.

///
///

The zero-based index of the input stream. To get the maximum number of streams, call and check the MaxStreamStates member of the structure.

///

The state parameter to query, specified as a member of the enumeration.

///

The size, in bytes, of the buffer pointed to by pData.

///

A reference to a buffer allocated by the caller. The method copies the state data into the buffer. The buffer must be large enough to hold the data structure that corresponds to the state parameter. For more information, see .

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// dd373920 /// HRESULT IDXVAHD_VideoProcessor::GetVideoProcessStreamState([In] unsigned int StreamNumber,[In] DXVAHD_STREAM_STATE State,[In] unsigned int DataSize,[Out, Buffer] void* pData) /// IDXVAHD_VideoProcessor::GetVideoProcessStreamState public void GetVideoProcessStreamState(int streamNumber, SharpDX.MediaFoundation.DirectX.StreamState state, int dataSize, System.IntPtr dataRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, streamNumber, unchecked((int)state), dataSize, (void*)dataRef,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Performs a video processing blit on one or more input samples and writes the result to a Microsoft Direct3D surface.

///
///

A reference to the interface of a Direct3D surface. The output of the video processing operation will be written to this surface. The following surface types can be used:

  • A video surface of type . See .
  • A render-target surface or texture surface created with usage.
  • A swap chain.
  • A swap chain with overlay support ().
///

Frame number of the output video frame, indexed from zero.

///

Number of input streams to process.

///

Pointer to an array of structures that contain information about the input streams. The caller allocates the array and fills in each structure. The number of elements in the array is given in the StreamCount parameter.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// ///

The maximum value of StreamCount is given in the MaxStreamStates member of the structure. The maximum numbr of streams that can be enabled at one time is given in the MaxInputStreams member of that structure.

///
/// /// dd373923 /// HRESULT IDXVAHD_VideoProcessor::VideoProcessBltHD([In] IDirect3DSurface9* pOutputSurface,[In] unsigned int OutputFrame,[In] unsigned int StreamCount,[In, Buffer] const DXVAHD_STREAM_DATA* pStreams) /// IDXVAHD_VideoProcessor::VideoProcessBltHD public void VideoProcessBltHD(SharpDX.Direct3D9.Surface outputSurfaceRef, int outputFrame, int streamCount, SharpDX.MediaFoundation.DirectX.StreamData[] streamsRef) { unsafe { SharpDX.Result __result__; fixed (void* streamsRef_ = streamsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)((outputSurfaceRef == null)?IntPtr.Zero:outputSurfaceRef.NativePointer), outputFrame, streamCount, streamsRef_,((void**)(*(void**)_nativePointer))[7]); __result__.CheckError(); } } } /// ///

Provides DirectX Video Acceleration (DXVA) services from a Direct3D device. To get a reference to this interface, call or .

///
/// ///

This is the base interface for DXVA services. The Direct3D device can support any of the following DXVA services, which derive from :

  • Video decoding:
  • Video processing:
///
/// /// ms697049 /// IDirectXVideoAccelerationService /// IDirectXVideoAccelerationService [Guid("fc51a550-d5e7-11d9-af55-00054e43ff02")] public partial class VideoAccelerationService : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoAccelerationService(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoAccelerationService(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoAccelerationService(nativePointer); } /// ///

Creates a DirectX Video Acceleration (DXVA) video processor or DXVA decoder render target.

///
///

The width of the surface, in pixels.

///

The height of the surface, in pixels.

///

The number of back buffers. The method creates BackBuffers + 1 surfaces.

///

The pixel format, specified as a value or FOURCC code. For more information, see the Direct3D documentation.

///

The memory pool in which to create the surface, specified as a value. For more information, see the Direct3D documentation. Decoders should generally use the value .

///

Reserved. Set this value to zero.

///

The type of surface to create. Use one of the following values.

ValueMeaning

Video decoder render target.

Video processor render target. Used for operations.

Software render target. This surface type is for use with software DXVA devices.

?

///

The address of an array of references allocated by the caller. The size of the array must be 1 + BackBuffers (enough for the back buffers plus one front buffer). The method fills the array with references. The caller must release all of the interface references. In addition, the front buffer holds a reference count on each of the back buffers. Therefore, the back buffers are never deleted until the front buffer is deleted.

///

A reference to a handle that is used to share the surfaces between Direct3D devices. Set this parameter to null.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Invalid parameter

E_FAIL

The DirectX Video Acceleration Manager is not initialized.

E_POINTER

null reference argument.

?

/// ///

If the method returns E_FAIL, try calling to reset the DirectX Video Acceleration Manager.

///
/// /// ms696227 /// HRESULT IDirectXVideoAccelerationService::CreateSurface([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int BackBuffers,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Usage,[In] unsigned int DxvaType,[Out, Buffer] IDirect3DSurface9** ppSurface,[InOut, Optional] void** pSharedHandle) /// IDirectXVideoAccelerationService::CreateSurface public void CreateSurface(int width, int height, int backBuffers, SharpDX.Direct3D9.Format format, SharpDX.Direct3D9.Pool pool, int usage, int dxvaType, SharpDX.Direct3D9.Surface[] surfaceOut, System.IntPtr sharedHandleRef) { unsafe { IntPtr* surfaceOut_ = stackalloc IntPtr[surfaceOut.Length]; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, width, height, backBuffers, unchecked((int)format), unchecked((int)pool), usage, dxvaType, surfaceOut_, (void*)sharedHandleRef,((void**)(*(void**)_nativePointer))[3]); for (int i = 0; i < surfaceOut.Length; i++) surfaceOut[i] = (surfaceOut_[i] == IntPtr.Zero)?null:new SharpDX.Direct3D9.Surface(surfaceOut_[i]); __result__.CheckError(); } } } /// ///

Represents a DirectX Video Acceleration (DXVA) video decoder device.

To get a reference to this interface, call .

///
/// ///

The methods make calls to the Direct3D device. Therefore, the flags that you specify when creating the device can affect the behavior of this interface. For example, if you specify the flag, the Direct3D global critical section will be held during decode operations.

///
/// /// ms694281 /// IDirectXVideoDecoder /// IDirectXVideoDecoder [Guid("f2b0810a-fd00-43c9-918c-df94e2d8ef7d")] public partial class VideoDecoder : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoDecoder(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoDecoder(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoDecoder(nativePointer); } /// ///

Retrieves the DirectX Video Acceleration (DXVA) decoder service that created this decoder device.

///
/// /// ms694049 /// GetVideoDecoderService /// GetVideoDecoderService /// HRESULT IDirectXVideoDecoder::GetVideoDecoderService([Out] IDirectXVideoDecoderService** ppService) public SharpDX.MediaFoundation.DirectX.VideoDecoderService VideoDecoderService { get { SharpDX.MediaFoundation.DirectX.VideoDecoderService __output__; GetVideoDecoderService(out __output__); return __output__; } } /// ///

Retrieves the DirectX Video Acceleration (DXVA) decoder service that created this decoder device.

///
///

Receives a reference to interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms694049 /// HRESULT IDirectXVideoDecoder::GetVideoDecoderService([Out] IDirectXVideoDecoderService** ppService) /// IDirectXVideoDecoder::GetVideoDecoderService internal void GetVideoDecoderService(out SharpDX.MediaFoundation.DirectX.VideoDecoderService serviceOut) { unsafe { IntPtr serviceOut_ = IntPtr.Zero; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &serviceOut_,((void**)(*(void**)_nativePointer))[3]); serviceOut= (serviceOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.VideoDecoderService(serviceOut_); __result__.CheckError(); } } /// ///

Retrieves the parameters that were used to create this device.

///
///

Receives the device . This parameter can be null.

///

Pointer to a structure that receives a description of the video format. This parameter can be null.

///

Pointer to a structure structure that receives the decoder configuration. This parameter can be null.

///

Receives an array of interface references. These references represent the decoder render targets. The method allocates the memory for the array and calls AddRef on each of the references. The caller must release the references and call CoTaskMemFree to free the memory for the array. This parameter can be null.

///

Receives the number of elements in the pppDecoderRenderTargets array. This parameter can be null.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument. At least one parameter must be non-null.

?

/// ///

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

If you specify a non-null value for pppDecoderRenderTargets (to receive the render target surfaces), then pNumSurfaces cannot be null, because it receives the size of the array returned in pppDecoderRenderTargets.

///
/// /// ms697355 /// HRESULT IDirectXVideoDecoder::GetCreationParameters([Out, Optional] GUID* pDeviceGuid,[Out, Optional] DXVA2_VideoDesc* pVideoDesc,[Out, Optional] DXVA2_ConfigPictureDecode* pConfig,[Out, Buffer] IDirect3DSurface9*** pDecoderRenderTargets,[Out, Optional] unsigned int* pNumSurfaces) /// IDirectXVideoDecoder::GetCreationParameters public void GetCreationParameters(out System.Guid deviceGuidRef, out SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, out SharpDX.MediaFoundation.DirectX.ConfigPictureDecode configRef, SharpDX.Direct3D9.Surface[] decoderRenderTargetsRef, out int numSurfacesRef) { unsafe { deviceGuidRef = new System.Guid(); videoDescRef = new SharpDX.MediaFoundation.DirectX.VideoDesc(); configRef = new SharpDX.MediaFoundation.DirectX.ConfigPictureDecode(); IntPtr* decoderRenderTargetsRef_ = stackalloc IntPtr[decoderRenderTargetsRef.Length]; SharpDX.Result __result__; fixed (void* deviceGuidRef_ = &deviceGuidRef) fixed (void* videoDescRef_ = &videoDescRef) fixed (void* configRef_ = &configRef) fixed (void* numSurfacesRef_ = &numSurfacesRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, deviceGuidRef_, videoDescRef_, configRef_, (void*)decoderRenderTargetsRef_, numSurfacesRef_,((void**)(*(void**)_nativePointer))[4]); for (int i = 0; i < decoderRenderTargetsRef.Length; i++) decoderRenderTargetsRef[i] = (decoderRenderTargetsRef_[i] == IntPtr.Zero)?null:new SharpDX.Direct3D9.Surface(decoderRenderTargetsRef_[i]); __result__.CheckError(); } } /// ///

Retrieves a reference to a DirectX Video Acceleration (DXVA) decoder buffer.

///
///

Type of buffer to retrieve. Use one of the following values.

ValueMeaning

Picture decoding parameter buffer.

Macroblock control command buffer.

Residual difference block data buffer.

Deblocking filter control command buffer.

Inverse quantization matrix buffer.

Slice-control buffer.

Bitstream data buffer.

Motion vector buffer.

Film grain synthesis data buffer.

?

///

Receives a reference to the start of the memory buffer.

///

Receives the size of the buffer, in bytes.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// ///

The method locks the Direct3D surface that contains the buffer. When you are done using the buffer, call to unlock the surface.

This method might block if too many operations have been queued on the GPU. The method unblocks when a free buffer becomes available.

///
/// /// ms703992 /// HRESULT IDirectXVideoDecoder::GetBuffer([In] unsigned int BufferType,[Out] void** ppBuffer,[Out] unsigned int* pBufferSize) /// IDirectXVideoDecoder::GetBuffer public void GetBuffer(int bufferType, out System.IntPtr bufferOut, out int bufferSizeRef) { unsafe { SharpDX.Result __result__; fixed (void* bufferOut_ = &bufferOut) fixed (void* bufferSizeRef_ = &bufferSizeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, bufferType, bufferOut_, bufferSizeRef_,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Releases a buffer that was obtained by calling .

///
/// No documentation. ///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms704764 /// HRESULT IDirectXVideoDecoder::ReleaseBuffer([In] unsigned int BufferType) /// IDirectXVideoDecoder::ReleaseBuffer public void ReleaseBuffer(int bufferType) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, bufferType,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Starts the decoding operation.

///
///

Pointer to the interface of the render target where the decoded frame will be written.

///

Reserved; set to null.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid surface type. See Remarks.

?

/// ///

After this method is called, call to perform decoding operations. When all decoding operations have been executed, call .

Each call to BeginFrame must have a matching call to EndFrame, and BeginFrame calls cannot be nested.

DXVA 1.0 migration note: Unlike the IAMVideoAccelerator::BeginFrame method, which specifies the buffer as an index, this method takes a reference directly to the uncompressed buffer.

The surface pointed to by pRenderTarget must be created by calling with the value for DxvaType.

///
/// /// ms694840 /// HRESULT IDirectXVideoDecoder::BeginFrame([In] IDirect3DSurface9* pRenderTarget,[In, Optional] void* pvPVPData) /// IDirectXVideoDecoder::BeginFrame public void BeginFrame(SharpDX.Direct3D9.Surface renderTargetRef, System.IntPtr vPVPDataRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)((renderTargetRef == null)?IntPtr.Zero:renderTargetRef.NativePointer), (void*)vPVPDataRef,((void**)(*(void**)_nativePointer))[7]); __result__.CheckError(); } } /// ///

Signals the end of the decoding operation.

///
///

Reserved.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms697031 /// HRESULT IDirectXVideoDecoder::EndFrame([InOut, Optional] void** pHandleComplete) /// IDirectXVideoDecoder::EndFrame public void EndFrame(System.IntPtr handleCompleteRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)handleCompleteRef,((void**)(*(void**)_nativePointer))[8]); __result__.CheckError(); } } /// ///

Executes a decoding operation on the current frame.

///
///

Pointer to a structure that contains the information needed for the decoding operation.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// ///

You must call before calling this method.

///
/// /// ms696258 /// HRESULT IDirectXVideoDecoder::Execute([In] const DXVA2_DecodeExecuteParams* pExecuteParams) /// IDirectXVideoDecoder::Execute public void Execute(SharpDX.MediaFoundation.DirectX.DecodeExecuteParams executeParamsRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &executeParamsRef,((void**)(*(void**)_nativePointer))[9]); __result__.CheckError(); } } } /// ///

Provides access to DirectX Video Acceleration (DXVA) decoder services. Use this interface to query which hardware-accelerated decoding operations are available and to create DXVA video decoder devices.

To get a reference to this interface, call or with the interface identifier IID_IDirectXVideoDecoderService.

///
/// /// ms704820 /// IDirectXVideoDecoderService /// IDirectXVideoDecoderService [Guid("fc51a551-d5e7-11d9-af55-00054e43ff02")] public partial class VideoDecoderService : SharpDX.MediaFoundation.DirectX.VideoAccelerationService { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoDecoderService(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoDecoderService(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoDecoderService(nativePointer); } /// ///

Retrieves an array of GUIDs that identifies the decoder devices supported by the graphics hardware.

///
///

Receives the number of GUIDs.

///

Receives an array of GUIDs. The size of the array is retrieved in the Count parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Error from the Direct3D device.

E_FAIL

If the Microsoft Basic Display Adapter is being used or the Direct3D?11 device type is the reference rasterizer. These devices do not support video decoders.

?

/// ///

The following decoder GUIDs are defined. Some of these GUIDs have alternate names, shown in parentheses.

Description
DXVA2_ModeH264_A (DXVA2_ModeH264_MoComp_NoFGT)H.264 motion compensation (MoComp), no film grain technology (FGT).
DXVA2_ModeH264_B (DXVA2_ModeH264_MoComp_FGT)H.264 MoComp, FGT.
DXVA2_ModeH264_C (DXVA2_ModeH264_IDCT_NoFGT)H.264 inverse discrete cosine transform (IDCT), no FGT.
DXVA2_ModeH264_D (DXVA2_ModeH264_IDCT_FGT)H.264 IDCT, FGT.
DXVA2_ModeH264_E (DXVA2_ModeH264_VLD_NoFGT)H.264 VLD, no FGT.
DXVA2_ModeH264_F (DXVA2_ModeH264_VLD_FGT)H.264 variable-length decoder (VLD), FGT.
DXVA2_ModeMPEG2_IDCTMPEG-2 IDCT.
DXVA2_ModeMPEG2_MoCompMPEG-2 MoComp.
DXVA2_ModeMPEG2_VLDMPEG-2 VLD.
DXVA2_ModeVC1_A (DXVA2_ModeVC1_PostProc)VC-1 post processing.
DXVA2_ModeVC1_B (DXVA2_ModeVC1_MoComp)VC-1 MoComp.
DXVA2_ModeVC1_C (DXVA2_ModeVC1_IDCT)VC-1 IDCT.
DXVA2_ModeVC1_D (DXVA2_ModeVC1_VLD)VC-1 VLD.
DXVA2_ModeWMV8_A (DXVA2_ModeWMV8_PostProc)Windows Media Video 8 post processing.
DXVA2_ModeWMV8_B (DXVA2_ModeWMV8_MoComp)Windows Media Video 8 MoComp.
DXVA2_ModeWMV9_A (DXVA2_ModeWMV9_PostProc)Windows Media Video 9 post processing.
DXVA2_ModeWMV9_B (DXVA2_ModeWMV9_MoComp)Windows Media Video 9 MoComp.
DXVA2_ModeWMV9_C (DXVA2_ModeWMV9_IDCT)Windows Media Video 9 IDCT.

?

///
/// /// ms697067 /// HRESULT IDirectXVideoDecoderService::GetDecoderDeviceGuids([Out] unsigned int* pCount,[Out, Buffer, Optional] GUID** pGuids) /// IDirectXVideoDecoderService::GetDecoderDeviceGuids public void GetDecoderDeviceGuids(out int countRef, System.Guid[] guidsRef) { unsafe { System.Guid[] guidsRef__ = guidsRef; SharpDX.Result __result__; fixed (void* countRef_ = &countRef) fixed (void* guidsRef_ = guidsRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, countRef_, guidsRef_,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Retrieves the supported render targets for a specified decoder device.

///
///

that identifies the decoder device. To get the available device GUIDs, call .

///

Receives the number of formats.

///

Receives an array of formats, specified as values. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms703193 /// HRESULT IDirectXVideoDecoderService::GetDecoderRenderTargets([In] const GUID& Guid,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) /// IDirectXVideoDecoderService::GetDecoderRenderTargets public void GetDecoderRenderTargets(System.Guid guid, out int countRef, SharpDX.Direct3D9.Format[] formatsRef) { unsafe { SharpDX.Direct3D9.Format[] formatsRef__ = formatsRef; SharpDX.Result __result__; fixed (void* countRef_ = &countRef) fixed (void* formatsRef_ = formatsRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &guid, countRef_, formatsRef_,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Gets the configurations that are available for a decoder device.

///
///

A that identifies the decoder device. To get the available device GUIDs, call .

///

A reference to a structure that describes the video content.

///

Reserved. Set to null.

///

Receives the number of configurations.

///

Receives an array of structures. The size of the array is retrieved in the pCount parameter. The caller must free the memory for the array by calling CoTaskMemFree. This parameter can be null if you simply want the number of configurations (returned in pCount) but not the GUIDs.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// ms699833 /// HRESULT IDirectXVideoDecoderService::GetDecoderConfigurations([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] void* pReserved,[Out] unsigned int* pCount,[Out, Buffer, Optional] DXVA2_ConfigPictureDecode** ppConfigs) /// IDirectXVideoDecoderService::GetDecoderConfigurations public void GetDecoderConfigurations(System.Guid guid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, System.IntPtr reservedRef, out int countRef, SharpDX.MediaFoundation.DirectX.ConfigPictureDecode[] configsOut) { unsafe { SharpDX.MediaFoundation.DirectX.ConfigPictureDecode[] configsOut__ = configsOut; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* countRef_ = &countRef) fixed (void* configsOut_ = configsOut__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)&guid, videoDescRef_, (void*)reservedRef, countRef_, configsOut_,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Creates a video decoder device.

///
///

that specifies the decoder device to create. To get the available device GUIDs, call .

///

Pointer to a structure that describes the video content.

///

Pointer to a structure that specifies the decoder configuration.

///

Pointer to an array of references containing references to the decoder render targets. To create these surfaces, call . Specify for the DxvaType parameter.

///

Size of the ppDecoderRenderTargets array. This value cannot be zero.

///

Receives a reference to the decoder's interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms696175 /// HRESULT IDirectXVideoDecoderService::CreateVideoDecoder([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] const DXVA2_ConfigPictureDecode* pConfig,[In, Buffer] IDirect3DSurface9** ppDecoderRenderTargets,[In] unsigned int NumRenderTargets,[Out] IDirectXVideoDecoder** ppDecode) /// IDirectXVideoDecoderService::CreateVideoDecoder public void CreateVideoDecoder(System.Guid guid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, ref SharpDX.MediaFoundation.DirectX.ConfigPictureDecode configRef, SharpDX.Direct3D9.Surface[] decoderRenderTargetsOut, int numRenderTargets, out SharpDX.MediaFoundation.DirectX.VideoDecoder decodeOut) { unsafe { IntPtr* decoderRenderTargetsOut_ = (IntPtr*)0; if ( decoderRenderTargetsOut != null ) { IntPtr* decoderRenderTargetsOut__ = stackalloc IntPtr[decoderRenderTargetsOut.Length]; decoderRenderTargetsOut_ = decoderRenderTargetsOut__; for (int i = 0; i < decoderRenderTargetsOut.Length; i++) decoderRenderTargetsOut_[i] = (decoderRenderTargetsOut[i] == null)? IntPtr.Zero : decoderRenderTargetsOut[i].NativePointer; } IntPtr decodeOut_ = IntPtr.Zero; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* configRef_ = &configRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &guid, videoDescRef_, configRef_, decoderRenderTargetsOut_, numRenderTargets, &decodeOut_,((void**)(*(void**)_nativePointer))[7]); decodeOut= (decodeOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.VideoDecoder(decodeOut_); __result__.CheckError(); } } /// ///

Creates a video decoder device.

///
///

that specifies the decoder device to create. To get the available device GUIDs, call .

///

Pointer to a structure that describes the video content.

///

Pointer to a structure that specifies the decoder configuration.

///

Pointer to an array of references containing references to the decoder render targets. To create these surfaces, call . Specify for the DxvaType parameter.

///

Size of the ppDecoderRenderTargets array. This value cannot be zero.

///

Receives a reference to the decoder's interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms696175 /// HRESULT IDirectXVideoDecoderService::CreateVideoDecoder([In] const GUID& Guid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] const DXVA2_ConfigPictureDecode* pConfig,[In, Buffer] IDirect3DSurface9** ppDecoderRenderTargets,[In] unsigned int NumRenderTargets,[Out] IDirectXVideoDecoder** ppDecode) /// IDirectXVideoDecoderService::CreateVideoDecoder public void CreateVideoDecoder(System.Guid guid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, ref SharpDX.MediaFoundation.DirectX.ConfigPictureDecode configRef, SharpDX.ComArray decoderRenderTargetsOut, int numRenderTargets, out SharpDX.MediaFoundation.DirectX.VideoDecoder decodeOut) { unsafe { IntPtr decodeOut_ = IntPtr.Zero; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* configRef_ = &configRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &guid, videoDescRef_, configRef_, (void*)((decoderRenderTargetsOut == null)?IntPtr.Zero:decoderRenderTargetsOut.NativePointer), numRenderTargets, &decodeOut_,((void**)(*(void**)_nativePointer))[7]); decodeOut= (decodeOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.VideoDecoder(decodeOut_); __result__.CheckError(); } } } /// ///

Sets the type of video memory for uncompressed video surfaces. This interface is used by video decoders and transforms.

The DirectShow enhanced video renderer (EVR) filter exposes this interface as a service on the filter's input pins. To obtain a reference to this interface, call with the service identifier .

A video decoder can use this interface to enumerate the EVR filter's preferred surface types and then select the surface type. The decoder should then create surfaces of that type to hold the results of the decoding operation.

This interface does not define a way to clear the surface type. In the case of DirectShow, disconnecting two filters invalidates the surface type.

///
/// /// ms703164 /// IDirectXVideoMemoryConfiguration /// IDirectXVideoMemoryConfiguration [Guid("b7f916dd-db3b-49c1-84d7-e45ef99ec726")] public partial class VideoMemoryConfiguration : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoMemoryConfiguration(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoMemoryConfiguration(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoMemoryConfiguration(nativePointer); } /// ///

Sets the video surface type that a decoder will use for DirectX Video Acceleration (DVXA) 2.0.

///
/// ///

By calling this method, the caller agrees to create surfaces of the type specified in the dwType parameter.

In DirectShow, during pin connection, a video decoder that supports DVXA 2.0 should call SetSurface with the value . This notifies the video renderer that the decoder will provide the allocator and will create the Direct3D surfaces for decoding. For more information, see Supporting DXVA 2.0 in DirectShow.

The only way to undo the setting is to break the pin connection.

///
/// /// ms693977 /// SetSurfaceType /// SetSurfaceType /// HRESULT IDirectXVideoMemoryConfiguration::SetSurfaceType([In] DXVA2_SurfaceType dwType) public SharpDX.MediaFoundation.DirectX.SurfaceType SurfaceType { set { SetSurfaceType(value); } } /// ///

Retrieves a supported video surface type.

///
///

Zero-based index of the surface type to retrieve. Surface types are indexed in order of preference, starting with the most preferred type.

///

Receives a member of the enumeration that specifies the surface type.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The index was out of range.

?

/// /// ms697493 /// HRESULT IDirectXVideoMemoryConfiguration::GetAvailableSurfaceTypeByIndex([In] unsigned int dwTypeIndex,[Out] DXVA2_SurfaceType* pdwType) /// IDirectXVideoMemoryConfiguration::GetAvailableSurfaceTypeByIndex public void GetAvailableSurfaceTypeByIndex(int dwTypeIndex, out SharpDX.MediaFoundation.DirectX.SurfaceType dwTypeRef) { unsafe { SharpDX.Result __result__; fixed (void* dwTypeRef_ = &dwTypeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, dwTypeIndex, dwTypeRef_,((void**)(*(void**)_nativePointer))[3]); __result__.CheckError(); } } /// ///

Sets the video surface type that a decoder will use for DirectX Video Acceleration (DVXA) 2.0.

///
///

Member of the enumeration specifying the surface type. Currently, the only supported value is .

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

The renderer does not support the specified surface type.

?

/// ///

By calling this method, the caller agrees to create surfaces of the type specified in the dwType parameter.

In DirectShow, during pin connection, a video decoder that supports DVXA 2.0 should call SetSurface with the value . This notifies the video renderer that the decoder will provide the allocator and will create the Direct3D surfaces for decoding. For more information, see Supporting DXVA 2.0 in DirectShow.

The only way to undo the setting is to break the pin connection.

///
/// /// ms693977 /// HRESULT IDirectXVideoMemoryConfiguration::SetSurfaceType([In] DXVA2_SurfaceType dwType) /// IDirectXVideoMemoryConfiguration::SetSurfaceType internal void SetSurfaceType(SharpDX.MediaFoundation.DirectX.SurfaceType dwType) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, unchecked((int)dwType),((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } } /// ///

Retrieves the parameters that were used to create this device.

///
/// ///

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

///
/// /// ms704783 /// IDirectXVideoProcessor /// IDirectXVideoProcessor [Guid("8c3a39f0-916e-4690-804f-4c8001355d25")] public partial class VideoProcessor : SharpDX.ComObject { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoProcessor(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoProcessor(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoProcessor(nativePointer); } /// ///

Retrieves the DirectX Video Acceleration (DXVA) video processor service that created this video processor device.

///
/// /// ms700812 /// GetVideoProcessorService /// GetVideoProcessorService /// HRESULT IDirectXVideoProcessor::GetVideoProcessorService([Out] IDirectXVideoProcessorService** ppService) public SharpDX.MediaFoundation.DirectX.VideoProcessorService VideoProcessorService { get { SharpDX.MediaFoundation.DirectX.VideoProcessorService __output__; GetVideoProcessorService(out __output__); return __output__; } } /// ///

Retrieves the capabilities of the video processor device.

///
/// /// ms704831 /// GetVideoProcessorCaps /// GetVideoProcessorCaps /// HRESULT IDirectXVideoProcessor::GetVideoProcessorCaps([Out] DXVA2_VideoProcessorCaps* pCaps) public SharpDX.MediaFoundation.DirectX.VideoProcessorCaps VideoProcessorCaps { get { SharpDX.MediaFoundation.DirectX.VideoProcessorCaps __output__; GetVideoProcessorCaps(out __output__); return __output__; } } /// ///

Retrieves the DirectX Video Acceleration (DXVA) video processor service that created this video processor device.

///
///

Receives a reference to interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms700812 /// HRESULT IDirectXVideoProcessor::GetVideoProcessorService([Out] IDirectXVideoProcessorService** ppService) /// IDirectXVideoProcessor::GetVideoProcessorService internal void GetVideoProcessorService(out SharpDX.MediaFoundation.DirectX.VideoProcessorService serviceOut) { unsafe { IntPtr serviceOut_ = IntPtr.Zero; SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &serviceOut_,((void**)(*(void**)_nativePointer))[3]); serviceOut= (serviceOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.VideoProcessorService(serviceOut_); __result__.CheckError(); } } /// ///

Retrieves the parameters that were used to create this device.

///
///

Receives the device . This parameter can be null.

///

Pointer to a structure allocated by the caller. The method fills the structure with a description of the video format. This parameter can be null.

///

Receives the render target format, specified as a value. For more information, see the Direct3D documentation. This parameter can be null.

///

Receives the maximum number of streams supported by the device. This parameter can be null.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

E_INVALIDARG

Invalid argument. At least one parameter must be non-null.

?

/// ///

You can set any parameter to null if you are not interested in the result. At least one parameter must be non-null.

///
/// /// ms704783 /// HRESULT IDirectXVideoProcessor::GetCreationParameters([Out, Optional] GUID* pDeviceGuid,[Out, Optional] DXVA2_VideoDesc* pVideoDesc,[Out, Optional] D3DFORMAT* pRenderTargetFormat,[Out, Optional] unsigned int* pMaxNumSubStreams) /// IDirectXVideoProcessor::GetCreationParameters public void GetCreationParameters(out System.Guid deviceGuidRef, out SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, out SharpDX.Direct3D9.Format renderTargetFormatRef, out int maxNumSubStreamsRef) { unsafe { deviceGuidRef = new System.Guid(); videoDescRef = new SharpDX.MediaFoundation.DirectX.VideoDesc(); SharpDX.Result __result__; fixed (void* deviceGuidRef_ = &deviceGuidRef) fixed (void* videoDescRef_ = &videoDescRef) fixed (void* renderTargetFormatRef_ = &renderTargetFormatRef) fixed (void* maxNumSubStreamsRef_ = &maxNumSubStreamsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, deviceGuidRef_, videoDescRef_, renderTargetFormatRef_, maxNumSubStreamsRef_,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Retrieves the capabilities of the video processor device.

///
///

Pointer to a structure that receives the video processor capabilities.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms704831 /// HRESULT IDirectXVideoProcessor::GetVideoProcessorCaps([Out] DXVA2_VideoProcessorCaps* pCaps) /// IDirectXVideoProcessor::GetVideoProcessorCaps internal void GetVideoProcessorCaps(out SharpDX.MediaFoundation.DirectX.VideoProcessorCaps capsRef) { unsafe { capsRef = new SharpDX.MediaFoundation.DirectX.VideoProcessorCaps(); SharpDX.Result __result__; fixed (void* capsRef_ = &capsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, capsRef_,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Retrieves the range of values for a video processor (ProcAmp) setting on this video processor device.

///
///

The ProcAmp setting to query. See ProcAmp Settings.

///

Pointer to a structure that receives the range of values for the setting specified in ProcAmpCaps.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// ms704610 /// HRESULT IDirectXVideoProcessor::GetProcAmpRange([In] unsigned int ProcAmpCap,[Out] DXVA2_ValueRange* pRange) /// IDirectXVideoProcessor::GetProcAmpRange public void GetProcAmpRange(int procAmpCap, out SharpDX.MediaFoundation.DirectX.ValueRange rangeRef) { unsafe { rangeRef = new SharpDX.MediaFoundation.DirectX.ValueRange(); SharpDX.Result __result__; fixed (void* rangeRef_ = &rangeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, procAmpCap, rangeRef_,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Retrieves the range of values for an image filter supported by this device.

///
///

Filter setting to query. For more information, see DXVA Image Filter Settings.

///

Pointer to a structure that receives the range of values for the setting specified in FilterSetting.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms697209 /// HRESULT IDirectXVideoProcessor::GetFilterPropertyRange([In] unsigned int FilterSetting,[Out] DXVA2_ValueRange* pRange) /// IDirectXVideoProcessor::GetFilterPropertyRange public void GetFilterPropertyRange(int filterSetting, out SharpDX.MediaFoundation.DirectX.ValueRange rangeRef) { unsafe { rangeRef = new SharpDX.MediaFoundation.DirectX.ValueRange(); SharpDX.Result __result__; fixed (void* rangeRef_ = &rangeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, filterSetting, rangeRef_,((void**)(*(void**)_nativePointer))[7]); __result__.CheckError(); } } /// ///

Performs a video process operation on one or more input samples and writes the result to a Direct3D9 surface.

///
///

A reference to the interface of a Direct3D surface. The output of the video processing operation will be written to this surface. The surface may be any of the following types:

  • A surface created by calling with the DXVA2_VideoProcessRenderTarget flag. You can also use the flag, but only when the device is DXVA2_VideoProcSoftwareDevice (software video processing device).
  • A surface created from a Direct3D device with the usage flag.
  • A Direct3D swap chain.
///

A reference to a structure that describes the video processing operation to perform.

///

A reference to an array of structures that contain the input samples. There must be at least one element in the array.

The maximum number of input samples is given by the constant MAX_DEINTERLACE_SURFACES, defined in the header file dxva2api.h.

///

The number of elements in the pSamples array.

///

Reserved; set to null.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

Internal driver error.

E_INVALIDARG

Invalid arguments.

?

/// ///

When the method returns, the operation might not be complete.

If the method returns E_INVALIDARG, check for the following:

  • The number of input samples (NumSamples) must be less than or equal to MAX_DEINTERLACE_SURFACES.
  • The Direct3D surface must be a valid target for VideoProcessBlt. See the description of the pRT parameter for details.
  • The presentation time (TargetFrame) given in pBltParams must match the start and end times for the current picture from the primary stream. Specifically, it must be less than the end time and greater than or equal to the start time. Note that the first sample in pSamples might not be the current picture, if the pSamples array contains backward reference pictures. For more information, see Input Sample Order.
  • The target rectangle (TargetRect) given in pBltParams cannot be larger than the destination surface (pRT).
  • The constriction size (ConstrictionSize) given in pBltParams cannot be less than zero or larger than the target rectangle.
  • The alpha component of the background color must be opqaue.
  • The ProcAmp values given in pBltParams must be valid. For any ProcAmp settings that are supported by the driver, these values must fall within the ranges returned by the method.
  • The noise and detail filters given in pBltParams must be valid. For any filters that are supported by the driver, these values must fall within the ranges returned by the method.
  • The alpha value given in pBltParams must be in the range [0...1] inclusive.
  • For each input sample given in pSamples:
    • The start time cannot be greater than the end time.
    • A valid reference must be provided.
    • The source rectangle cannot be larger than the input surface.
    • The destination rectangle cannot be larger than than the destination surface.
    • The planar alpha must be in the range [0...1] inclusive.
  • For all rectangles (source, destination, and target), the rectangle cannot be inverted (left > right or top > bottom) or have negative values.
///
/// /// ms697022 /// HRESULT IDirectXVideoProcessor::VideoProcessBlt([In] IDirect3DSurface9* pRenderTarget,[In] const DXVA2_VideoProcessBltParams* pBltParams,[In, Buffer] const DXVA2_VideoSample* pSamples,[In] unsigned int NumSamples,[InOut, Optional] void** pHandleComplete) /// IDirectXVideoProcessor::VideoProcessBlt public void VideoProcessBlt(SharpDX.Direct3D9.Surface renderTargetRef, ref SharpDX.MediaFoundation.DirectX.VideoProcessBltParams bltParamsRef, SharpDX.MediaFoundation.DirectX.VideoSample[] samplesRef, int numSamples, System.IntPtr handleCompleteRef) { unsafe { SharpDX.MediaFoundation.DirectX.VideoSample.__Native[] samplesRef__ = new SharpDX.MediaFoundation.DirectX.VideoSample.__Native[samplesRef.Length]; for (int i = 0; i < samplesRef.Length; i++) samplesRef[i].__MarshalTo(ref samplesRef__[i]); SharpDX.Result __result__; fixed (void* bltParamsRef_ = &bltParamsRef) fixed (void* samplesRef_ = samplesRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)((renderTargetRef == null)?IntPtr.Zero:renderTargetRef.NativePointer), bltParamsRef_, samplesRef_, numSamples, (void*)handleCompleteRef,((void**)(*(void**)_nativePointer))[8]); for (int i = 0; i < samplesRef.Length; i++) samplesRef[i].__MarshalFree(ref samplesRef__[i]); __result__.CheckError(); } } } /// ///

Provides access to DirectX Video Acceleration (DXVA) video processing services.

Use this interface to query which hardware-accelerated video processing operations are available and to create DXVA video processor devices. To obtain a reference to this interface, call or with the interface identifier IID_IDirectXVideoProcessorService.

///
/// /// ms705631 /// IDirectXVideoProcessorService /// IDirectXVideoProcessorService [Guid("fc51a552-d5e7-11d9-af55-00054e43ff02")] public partial class VideoProcessorService : SharpDX.MediaFoundation.DirectX.VideoAccelerationService { /// /// Initializes a new instance of the class. /// /// The native pointer. public VideoProcessorService(IntPtr nativePtr) : base(nativePtr) { } /// /// Performs an explicit conversion from to . (This method is a shortcut to ) /// /// The native pointer. /// /// The result of the conversion. /// public static explicit operator SharpDX.MediaFoundation.DirectX.VideoProcessorService(IntPtr nativePointer) { return nativePointer == IntPtr.Zero ? null : new SharpDX.MediaFoundation.DirectX.VideoProcessorService(nativePointer); } /// ///

Registers a software video processing device.

///
///

Pointer to an initialization function.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms696262 /// HRESULT IDirectXVideoProcessorService::RegisterVideoProcessorSoftwareDevice([In] void* pCallbacks) /// IDirectXVideoProcessorService::RegisterVideoProcessorSoftwareDevice public void RegisterVideoProcessorSoftwareDevice(System.IntPtr callbacksRef) { unsafe { SharpDX.Result __result__; __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)callbacksRef,((void**)(*(void**)_nativePointer))[4]); __result__.CheckError(); } } /// ///

Gets an array of GUIDs which identify the video processors supported by the graphics hardware.

///
///

Pointer to a structure that describes the video content.

///

Receives the number of GUIDs.

///

Receives an array of GUIDs. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// ///

The following video processor GUIDs are predefined.

Description
DXVA2_VideoProcBobDeviceBob deinterlace device. This device uses a "bob" algorithm to deinterlace the video. Bob algorithms create missing field lines by interpolating the lines in a single field.
DXVA2_VideoProcProgressiveDeviceProgressive video device. This device is available for progressive video, which does not require a deinterlace algorithm.
DXVA2_VideoProcSoftwareDeviceReference (software) device.

?

The graphics device may define additional vendor-specific GUIDs. The driver provides the list of GUIDs in descending quality order. The mode with the highest quality is first in the list. To get the capabilities of each mode, call and pass in the for the mode.

///
/// /// ms695370 /// HRESULT IDirectXVideoProcessorService::GetVideoProcessorDeviceGuids([In] const DXVA2_VideoDesc* pVideoDesc,[Out] unsigned int* pCount,[Out, Buffer, Optional] GUID** pGuids) /// IDirectXVideoProcessorService::GetVideoProcessorDeviceGuids public void GetVideoProcessorDeviceGuids(ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, out int countRef, System.Guid[] guidsRef) { unsafe { System.Guid[] guidsRef__ = guidsRef; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* countRef_ = &countRef) fixed (void* guidsRef_ = guidsRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, videoDescRef_, countRef_, guidsRef_,((void**)(*(void**)_nativePointer))[5]); __result__.CheckError(); } } /// ///

Gets the render target formats that a video processor device supports. The list may include RGB and YUV formats.

///
///

A that identifies the video processor device. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

Receives the number of formats.

///

Receives an array of formats, specified as values. The size of the array is retrieved in the pCount parameter. The method allocates the memory for the array. The caller must free the memory by calling CoTaskMemFree.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms702118 /// HRESULT IDirectXVideoProcessorService::GetVideoProcessorRenderTargets([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) /// IDirectXVideoProcessorService::GetVideoProcessorRenderTargets public void GetVideoProcessorRenderTargets(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, out int countRef, SharpDX.Direct3D9.Format[] formatsRef) { unsafe { SharpDX.Direct3D9.Format[] formatsRef__ = formatsRef; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* countRef_ = &countRef) fixed (void* formatsRef_ = formatsRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)&videoProcDeviceGuid, videoDescRef_, countRef_, formatsRef_,((void**)(*(void**)_nativePointer))[6]); __result__.CheckError(); } } /// ///

Gets a list of substream formats supported by a specified video processor device.

///
///

A that identifies the video processor device. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

///

Receives the number of elements returned in the ppFormats array.

///

Receives an array of values. The caller must free the array by calling CoTaskMemFree. The array can contain both RGB and YUB pixel formats.

///

If this method succeeds, it returns . Otherwise, it returns an error code.

/// /// ms694271 /// HRESULT IDirectXVideoProcessorService::GetVideoProcessorSubStreamFormats([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[Out] unsigned int* pCount,[Out, Buffer, Optional] D3DFORMAT** pFormats) /// IDirectXVideoProcessorService::GetVideoProcessorSubStreamFormats public void GetVideoProcessorSubStreamFormats(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, SharpDX.Direct3D9.Format renderTargetFormat, out int countRef, SharpDX.Direct3D9.Format[] formatsRef) { unsafe { SharpDX.Direct3D9.Format[] formatsRef__ = formatsRef; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* countRef_ = &countRef) fixed (void* formatsRef_ = formatsRef__) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)&videoProcDeviceGuid, videoDescRef_, unchecked((int)renderTargetFormat), countRef_, formatsRef_,((void**)(*(void**)_nativePointer))[7]); __result__.CheckError(); } } /// ///

Gets the capabilities of a specified video processor device.

///
///

A that identifies the video processor device. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

///

A reference to a structure that receives the video processor capabilities.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms702988 /// HRESULT IDirectXVideoProcessorService::GetVideoProcessorCaps([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[Out] DXVA2_VideoProcessorCaps* pCaps) /// IDirectXVideoProcessorService::GetVideoProcessorCaps public void GetVideoProcessorCaps(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, SharpDX.Direct3D9.Format renderTargetFormat, out SharpDX.MediaFoundation.DirectX.VideoProcessorCaps capsRef) { unsafe { capsRef = new SharpDX.MediaFoundation.DirectX.VideoProcessorCaps(); SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* capsRef_ = &capsRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, (void*)&videoProcDeviceGuid, videoDescRef_, unchecked((int)renderTargetFormat), capsRef_,((void**)(*(void**)_nativePointer))[8]); __result__.CheckError(); } } /// ///

Gets the range of values for a video processor (ProcAmp) setting.

///
///

A that identifies the video processor device. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

///

The ProcAmp setting to query. See ProcAmp Settings.

///

A reference to a structure that receives the range of values for the setting specified in ProcAmpCaps.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms702244 /// HRESULT IDirectXVideoProcessorService::GetProcAmpRange([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int ProcAmpCap,[Out] DXVA2_ValueRange* pRange) /// IDirectXVideoProcessorService::GetProcAmpRange public void GetProcAmpRange(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, SharpDX.Direct3D9.Format renderTargetFormat, int procAmpCap, out SharpDX.MediaFoundation.DirectX.ValueRange rangeRef) { unsafe { rangeRef = new SharpDX.MediaFoundation.DirectX.ValueRange(); SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* rangeRef_ = &rangeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &videoProcDeviceGuid, videoDescRef_, unchecked((int)renderTargetFormat), procAmpCap, rangeRef_,((void**)(*(void**)_nativePointer))[9]); __result__.CheckError(); } } /// ///

Retrieves the range of values for an image filter supported by a video processor device.

///
///

A that identifies the video processor device. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

///

The filter setting to query. See DXVA Image Filter Settings.

///

A reference to a structure that receives range of values for the image filter setting specified in FilterSetting.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms694173 /// HRESULT IDirectXVideoProcessorService::GetFilterPropertyRange([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int FilterSetting,[Out] DXVA2_ValueRange* pRange) /// IDirectXVideoProcessorService::GetFilterPropertyRange public void GetFilterPropertyRange(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, SharpDX.Direct3D9.Format renderTargetFormat, int filterSetting, out SharpDX.MediaFoundation.DirectX.ValueRange rangeRef) { unsafe { rangeRef = new SharpDX.MediaFoundation.DirectX.ValueRange(); SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) fixed (void* rangeRef_ = &rangeRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &videoProcDeviceGuid, videoDescRef_, unchecked((int)renderTargetFormat), filterSetting, rangeRef_,((void**)(*(void**)_nativePointer))[10]); __result__.CheckError(); } } /// ///

Creates a video processor device.

///
///

A that specifies the video processor to create. To get the list of video processor GUIDs, call .

///

A reference to a structure that describes the video content.

///

The format of the render target surface, specified as a value. For more information, see the Direct3D documentation. You can also use a FOURCC code to specify a format that is not defined in the enumeration. See Video FOURCCs.

///

The maximum number of substreams that will be used with this device.

///

Receives a reference to the video processor's interface. The caller must release the interface.

///

The method returns an . Possible values include, but are not limited to, those in the following table.

Return codeDescription

The method succeeded.

?

/// /// ms694848 /// HRESULT IDirectXVideoProcessorService::CreateVideoProcessor([In] const GUID& VideoProcDeviceGuid,[In] const DXVA2_VideoDesc* pVideoDesc,[In] D3DFORMAT RenderTargetFormat,[In] unsigned int MaxNumSubStreams,[Out] IDirectXVideoProcessor** ppVidProcess) /// IDirectXVideoProcessorService::CreateVideoProcessor public void CreateVideoProcessor(System.Guid videoProcDeviceGuid, ref SharpDX.MediaFoundation.DirectX.VideoDesc videoDescRef, SharpDX.Direct3D9.Format renderTargetFormat, int maxNumSubStreams, out SharpDX.MediaFoundation.DirectX.VideoProcessor vidProcessOut) { unsafe { IntPtr vidProcessOut_ = IntPtr.Zero; SharpDX.Result __result__; fixed (void* videoDescRef_ = &videoDescRef) __result__= SharpDX.MediaFoundation.LocalInterop.Calliint(_nativePointer, &videoProcDeviceGuid, videoDescRef_, unchecked((int)renderTargetFormat), maxNumSubStreams, &vidProcessOut_,((void**)(*(void**)_nativePointer))[11]); vidProcessOut= (vidProcessOut_ == IntPtr.Zero)?null:new SharpDX.MediaFoundation.DirectX.VideoProcessor(vidProcessOut_); __result__.CheckError(); } } } } #endif