• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • JeremyAnsel.DirectX.MediaFoundation
      • MF2DBuffer
      • MFAttributes
      • MFDXGIDeviceManager
      • MFFactory
      • MFHelpers
      • MFMediaBuffer
      • MFMediaFormatGuids
      • MFMediaFormatGuids.Audio
      • MFMediaFormatGuids.Image
      • MFMediaFormatGuids.Video
      • MFMediaType
      • MFMediaTypeGuids
      • MFMediaTypeMajorGuids
      • MFReadWriteGuids
      • MFSample
      • MFSinkWriter
      • MFSinkWriterGuids
      • MFSourceReader
      • MFSourceReaderControlFlags
      • MFSourceReaderFlags
      • MFSourceReaderGuids
      • MFVideoInterlaceMode

    Class MFFactory

    Inheritance
    object
    MFFactory
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: JeremyAnsel.DirectX.MediaFoundation
    Assembly: JeremyAnsel.DirectX.MediaFoundation.dll
    Syntax
    [SecurityCritical]
    public sealed class MFFactory : IDisposable

    Constructors

    | Edit this page View Source

    MFFactory()

    Initializes the platform object. Must be called before using Media Foundation. A matching MFShutdown call must be made when the application is done using Media Foundation. The "Version" parameter should be set to MF_API_VERSION. Application should not call MFStartup / MFShutdown from workqueue threads.

    Declaration
    public MFFactory()

    Methods

    | Edit this page View Source

    CreateAttributes()

    Creates a MFAttributes.

    Declaration
    public MFAttributes CreateAttributes()
    Returns
    Type Description
    MFAttributes
    | Edit this page View Source

    CreateAttributes(uint)

    Creates a MFAttributes.

    Declaration
    public MFAttributes CreateAttributes(uint cInitialSize)
    Parameters
    Type Name Description
    uint cInitialSize
    Returns
    Type Description
    MFAttributes
    | Edit this page View Source

    CreateDXGIDeviceManager(out uint)

    Declaration
    public MFDXGIDeviceManager CreateDXGIDeviceManager(out uint resetToken)
    Parameters
    Type Name Description
    uint resetToken
    Returns
    Type Description
    MFDXGIDeviceManager
    | Edit this page View Source

    CreateDXGISurfaceBuffer(Guid, nint, uint, bool)

    Creates a MFMediaBuffer for a D3D11Texture2D or a D3D12Resource.

    Declaration
    public MFMediaBuffer CreateDXGISurfaceBuffer(Guid riid, nint punkSurface, uint uSubresourceIndex, bool fBottomUpWhenLinear)
    Parameters
    Type Name Description
    Guid riid
    nint punkSurface
    uint uSubresourceIndex
    bool fBottomUpWhenLinear
    Returns
    Type Description
    MFMediaBuffer
    | Edit this page View Source

    CreateMediaBufferWrapper(nint, uint, uint)

    Creates a MFMediaBuffer wrapper at the given offset and length within an existing MFMediaBuffer

    Declaration
    public MFMediaBuffer CreateMediaBufferWrapper(nint pBuffer, uint cbOffset, uint dwLength)
    Parameters
    Type Name Description
    nint pBuffer
    uint cbOffset
    uint dwLength
    Returns
    Type Description
    MFMediaBuffer
    | Edit this page View Source

    CreateMediaType()

    Declaration
    public MFMediaType CreateMediaType()
    Returns
    Type Description
    MFMediaType
    | Edit this page View Source

    CreateMemoryBuffer(uint)

    Creates a MFMediaBuffer in memory.

    Declaration
    public MFMediaBuffer CreateMemoryBuffer(uint cbMaxLength)
    Parameters
    Type Name Description
    uint cbMaxLength
    Returns
    Type Description
    MFMediaBuffer
    | Edit this page View Source

    CreateSample()

    Creates a MFSample.

    Declaration
    public MFSample CreateSample()
    Returns
    Type Description
    MFSample
    | Edit this page View Source

    CreateSinkWriterFromURL(string, MFAttributes)

    Declaration
    public MFSinkWriter CreateSinkWriterFromURL(string pwszOutputURL, MFAttributes pAttributes)
    Parameters
    Type Name Description
    string pwszOutputURL
    MFAttributes pAttributes
    Returns
    Type Description
    MFSinkWriter
    | Edit this page View Source

    CreateSourceReaderFromURL(string, MFAttributes)

    This function is used to instantiate an MF Source Reader object for the specified URL.

    Declaration
    public MFSourceReader CreateSourceReaderFromURL(string pwszURL, MFAttributes pAttributes)
    Parameters
    Type Name Description
    string pwszURL

    URL that specifies the location of the media content to open.

    MFAttributes pAttributes

    Optional parameter specifying additional Source Reader configuration. See: section below on MF Source Reader Attributes

    Returns
    Type Description
    MFSourceReader
    Remarks

    This function is synchronous and performs I/O that can block the calling thread.

    | Edit this page View Source

    Dispose()

    Shuts down the platform object. Releases all resources including threads. Application should call MFShutdown the same number of times as MFStartup. Application should not call MFStartup / MFShutdown from workqueue threads.

    Declaration
    public void Dispose()

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2026 Jérémy Ansel