WPFMediaKit The D3DRenderer class provides basic functionality needed to render a D3D surface. This class is abstract. The D3DImage used to render video The Image control that has the source to the D3DImage We keep reference to the D3D surface so we can delay loading it to avoid a black flicker when loading new media Flag to tell us if we have a new D3D Surface available A weak reference of D3DRenderers that have been cloned Backing field for the RenderOnCompositionTargetRendering flag. Temporary storage for the RenderOnCompositionTargetRendering flag. This is used to remember the value for when the control is loaded and unloaded. TryLock timeout for the invalidate video image. Low values means higher UI responsivity, but more video dropped frames. Flag to reduce redundant calls to the AddDirtyRect when the rendering thread is busy. Int instead of bool for Interlocked support. Defines what rules are applied to the stretching of the video Gets or Sets the value that indicates how the video is scaled. This is a dependency property. Enables or disables rendering of the video Gets the natural pixel height of the current media. The value will be 0 if there is no video in the media. Internal method to set the read-only NaturalVideoHeight DP Gets the natural pixel width of the current media. The value will be 0 if there is no video in the media. Internal method to set the read-only NaturalVideoWidth DP Is true if the media contains renderable video Internal method for setting the read-only HasVideo DP Handler for when the D3DRenderer is unloaded Handler for when the D3DRenderer is loaded Initializes the D3DRenderer control Sets the backbuffer for any cloned D3DRenderers Configures D3DImage with a new surface. This happens immediately Invalidates any possible cloned renderer we may have Cleans up any dead references we may have to any cloned renderers Used as a clone for a D3DRenderer Renders the video with WPF's rendering using the CompositionTarget.Rendering event Configures D3DImage with a new surface. The back buffer is not set until we actually receive a frame, this way we can avoid a black flicker between media changes The unmanaged pointer to the Direct3D Surface Invalidates the entire Direct3D image, notifying WPF to redraw TryLock timeout for the invalidate video image. Low values means higher UI responsivity, but more video dropped frames. Creates a clone of the D3DRenderer. This is a work for the visual brush not working cross-threaded Creates a cloned D3DImage image of the current video frame. Return null in case of the frame is not valid. The image can be used thread-safe. Fires when a DVD specific error occurs Gets if the mouse is over a DVD button. This is a dependency property. Gets or sets if the DVD automatically plays when a DVD is inserted into the computer. This is a dependency property. This event is fired when a DVD is ejected from the computer. This is a bubbled, routed event. Fires when a DVD is inserted into the computer. This is a bubbled, routed event. Gets the current time the DVD playback is at. This is a read-only, dependency property. Gets or sets the directory the DVD is located at (ie D:\VIDEO_TS). If this is empty or null, then DirectShow will try to play the first DVD found in the computer. This is a dependency property. The SelectAngle method sets the new angle when the DVD Navigator is in an angle block Value of the new angle, which must be from 1 through 9 Returns the display from a submenu to its parent menu. Selects the specified relative button (upper, lower, right, left) Value indicating the button to select Leaves a menu and resumes playback. Plays the DVD forward at a specific speed The speed multiplier to play back. Plays the DVD backwards at a specific speed The speed multiplier to play back Play a title The index of the title to play back Plays the next chapter in the volume. Plays the previous chapter in the volume. Goes to the root menu of the DVD. Goes to the title menu of the DVD The Play method is overrided so we can set the source to the media The handler for when a new DVD is hit. The event is fired by the DVDPlayer class. The handler for when the mouse is over a DVD button. This event is fired by the DVD Player class. Fires when a new DVD is inserted into a DVD player on the computer. Fires when the DVD is ejected from the computer. This control is not finished. Do not use it ;) The MediaElementBase is the base WPF control for making custom media players. The MediaElement uses the D3DRenderer class for rendering video Fires when media has successfully been opened Fires when media has been closed Fires when media has completed playing Get the current state of the media player Defines the behavior of the control when it is unloaded Defines the behavior of the control when it is loaded Gets or sets the audio volume. Specifies the volume, as a number from 0 to 1. Full volume is 1, and 0 is silence. Gets or sets the balance on the audio. The value can range from -1 to 1. The value -1 means the right channel is attenuated by 100 dB and is effectively silent. The value 1 means the left channel is silent. The neutral value is 0, which means that both channels are at full volume. When one channel is attenuated, the other remains at full volume. Notifies when the media has failed and produced an exception Initializes the media player, hooking into events and other general setup. Fires the MediaFailed event The failed media arguments Executes when a media operation failed The failed event arguments Is executes when a new D3D surfaces has been allocated The pointer to the D3D surface Called for every frame in media that has video /// Called when the state of the player has changed Previous state New State Called when the media has been closed Called when the media has ended Executed when media has successfully been opened. Fires when the owner window is closed. Nothing will happen if the visual does not belong to the visual tree with a root of a WPF window Local handler for the Loaded event Local handler for the Unloaded event Runs when the Loaded event is fired and executes the LoadedBehavior Runs when the Unloaded event is fired and executes the UnloadedBehavior Executes the actions associated to a MediaState The MediaState to execute Plays the media Pauses the media Closes the media Stops the media Called when a MediaPlayerBase is required. This method must return a valid (not null) MediaPlayerBase The MediaSeekingElement adds media seeking functionality to the MediaElementBase class. This flag is used to ignore PropertyChangedCallbacks for when a DependencyProperty is needs to be updated from the media player thread Is invoked whenever the current media position is changed. Gets or sets the media position in units of CurrentPositionFormat Used to set the MediaPosition without firing the PropertyChanged callback The value to set the MediaPosition to Gets the duration of the media in the units of CurrentPositionFormat Internal method to set the read-only MediaDuration The current position format that the media is currently using The MediaPositionFormat that is prefered to be used Executes when a the prefered position format has changed Gets or sets the rate the media is played back Internal reference to the MediaSeekingPlayer Fires when a media operation has failed The failed arguments Occurs when the media player is being initialized. Here the method is overridden as to attach to media seeking related functionality A private handler for the MediaPositionChanged event of the media player Runs when the media player's position has changed Runs when the MediaPlayer has successfully opened media The MediaUriElement is a WPF control that plays media of a given Uri. The Uri can be a file path or a Url to media. The MediaUriElement inherits from the MediaSeekingElement, so where available, seeking is also supported. The current MediaUriPlayer Step the count of frames. count of frames to step The name of the audio renderer device to use. Null to disable audio. The Uri source to the media. This can be a file path or a URL source Gets or sets whether the media should return to the begining once the end has reached The Play method is overrided so we can set the source to the media The Pause method is overrided so we can set the source to the media Gets the instance of the media player to initialize our base classes with The private cache of the audio renderer names An array of audio renderer device names on the current system The private cache of the video input names An array of video input device names on the current system Converter used to convert MediaTime format to seconds if the current MediaSeekingElement is using MediaTime format. If the MediaSeekingElement is not using MediaTime, then the converter will return the input passed as the MediaTime. Converts MediaTime to seconds There are two parameters to pass. The first is a MediaSeekingElement, the second is a long of the MediaTime The time in seconds if MediaTime is being used, else the second input parameter is passed back The VideoCaptureElement is a WPF control that displays video from a capture device, such as a web cam. Handles changes to the UseYuv property. Provides derived classes an opportunity to handle changes to the UseYuv property. Sets the parameters to the video capture player The types of position formats that are available for seeking media Delegate signature to notify of a new surface The sender of the event The pointer to the D3D surface The arguments that store information about a failed media attempt The custom allocator interface. All custom allocators need to implement this interface. Invokes when a new frame has been allocated to a surface Invokes when a new surface has been allocated A low level window class that is used to provide interop with libraries that require an hWnd Invokes the windows procedure associated to this window The window message to send to window Specifies different types of DirectShow Video Renderers The MediaPlayerBase is a base class to build raw, DirectShow based players. It inherits from DispatcherObject to allow easy communication with COM objects from different apartment thread models. A static value to hold a count for all graphs. Each graph has it's own value that it uses and is updated by the GraphInstanceCookie property in the get method The custom windows message constant for graph events One second in 100ns units The IBasicAudio volume value for silence The IBasicAudio volume value for full volume The IBasicAudio balance max absolute value Rate which our DispatcherTimer polls the graph UserId value for the VMR9 Allocator - Not entirely useful for this application of the VMR Static lock. Seems multiple EVR controls instantiated at the same time crash DirectShow interface for controlling audio functions such as volume and balance The custom DirectShow allocator The DirectShow filter graph reference The hWnd pointer we use for D3D stuffs The DirectShow interface for controlling the filter graph. This provides, Play, Pause, Stop, etc functionality. The DirectShow interface for getting events that occur in the FilterGraph. Flag for if our media has video The natural video pixel height, if applicable The natural video pixel width, if applicable Our Win32 timer to poll the DirectShow graph The current state of the player This objects last stand The global instance Id of the graph. We use this for the WndProc callback method. The globally unqiue identifier of the graph Helper function to get a valid hWnd to use with DirectShow and Direct3D Is true if the media contains renderable video Gets the natural pixel width of the current media. The value will be 0 if there is no video in the media. Gets the natural pixel height of the current media. The value will be 0 if there is no video in the media. Gets or sets the audio volume. Specifies the volume, as a number from 0 to 1. Full volume is 1, and 0 is silence. Gets or sets the balance on the audio. The value can range from -1 to 1. The value -1 means the right channel is attenuated by 100 dB and is effectively silent. The value 1 means the left channel is silent. The neutral value is 0, which means that both channels are at full volume. When one channel is attenuated, the other remains at full volume. Get the current state of the player Event notifies when there is a new video frame to be rendered Event notifies when there is a new surface allocated Event notifies when the player changes state Frees any remaining memory Part of the dispose pattern Polls the graph for various data about the media that is playing Is called when a new media event code occurs on the graph The event code that occured The first parameter sent by the graph The second parameter sent by the graph Starts the graph polling timer to update possibly needed things like the media position Stops the graph polling timer Removes our hook that listens to windows messages Adds a hook that listens to windows messages Receives windows messages. This is primarily used to get events that happen on our graph The window handle The message Id The message's wParam value The message's lParam value A value that indicates whether the message was handled. Set the value to true if the message was handled; otherwise, false. Unhooks the IMediaEventEx from the notification hWnd Sets the MediaEventEx interface Configures all general DirectShow interfaces that the FilterGraph supplies. The FilterGraph to setup Sets the MediaControl interface Sets the basic audio interface for controlling volume and balance Notifies when the media has successfully been opened Notifies when the media has been closed Notifies when the media has failed and produced an exception Notifies when the media has completed Registers the custom allocator and hooks into it's supplied events Local event handler for the custom allocator's new surface event Local event handler for the custom allocator's new frame event Disposes of the current allocator Resets the local graph resources to their default settings Frees any allocated or unmanaged resources Creates a new renderer and configures it with a custom allocator The type of renderer we wish to choose The DirectShow graph to add the renderer to Number of input pins for the renderer An initialized DirectShow renderer Creates a new renderer and configures it with a custom allocator The type of renderer we wish to choose The DirectShow graph to add the renderer to An initialized DirectShow renderer Creates an instance of the EVR Creates a new VMR9 renderer and configures it with an allocator. COMException is transalted to the WPFMediaKitException. An initialized DirectShow VMR9 renderer. When creating of VMR9 fails. Creates a new VMR9 renderer and configures it with an allocator. An initialized DirectShow VMR9 renderer. When creating of VMR9 fails. When creating of VMR9 fails. Plays the media Stops the media Stops the media, but does not VerifyAccess() on the Dispatcher. This can be used by destructors because it happens on another thread and our DirectShow graph and COM run in MTA Closes the media and frees its resources Pauses the media Invokes the MediaEnded event, notifying any subscriber that media has reached the end Invokes the MediaOpened event, notifying any subscriber that media has successfully been opened Invokes the MediaClosed event, notifying any subscriber that the opened media has been closed Invokes the MediaFailed event, notifying any subscriber that there was a media exception. The MediaFailedEventArgs contains the exception that caused this event to fire Invokes the NewAllocatorFrame event, notifying any subscriber that new frame is ready to be presented. Invokes the NewAllocatorSurface event, notifying any subscriber of a new surface The COM pointer to the D3D surface Sets the natural pixel resolution the video in the graph The video renderer Gets the video resolution of a pin on a renderer. The renderer to inspect The direction the pin is The zero based index of the pin to inspect If successful a video resolution is returned. If not, a 0x0 size is returned Removes all filters from a DirectShow graph The DirectShow graph to remove all the filters from Adds a filter to a DirectShow graph based on it's name and filter category The graph builder to add the filter to The category the filter belongs to The friendly name of the filter Reference to the IBaseFilter that was added to the graph or returns null if unsuccessful Finds a pin that exists in a graph. The GUID of the major or minor type of the media The direction of the pin - in/out The graph to search in Returns null if the pin was not found, or if a pin is found, returns the first instance of it Prevent instantiation. The File Writer filter can be used to write files to disc regardless of format. The Filter Graph Manager builds and controls filter graphs. The WM ASF Writer filter accepts a variable number of input streams and creates an ASF file. The RecComp object creates new content recordings by concatenating existing recordings. The Recording object creates permanent recordings from streams that the Stream Buffer Sink filter captures. The WavDes filter writes an audio stream to a WAV file. The Decrypter/Detagger filter conditionally decrypts samples that are encrypted by the Encrypter/Tagger filter. Creates an instance of a COM object by class ID. The class ID of the component to instantiate. A new instance of the class. Arguments for an event reporting that the user's mouse is over a Dvd button. Flag that defines if the cursor is over a Dvd butotn Value indicating the button to select Left button Lower button Right button Upper button Defines Dvd error conditions Something unexpected happened; perhaps content is authored incorrectly. Playback is stopped. Key exchange for DVD copy protection failed. Playback is stopped. DVD-Video disc is authored incorrectly for specification version 1. x. Playback is stopped. The disc cannot be played because it is not authored to play in the system region. You can try fixing the region mismatch by changing the system region with Dvdrgn.exe. Player parental level is lower than the lowest parental level available in the DVD content. Playback is stopped. Analog copy protection distribution failed. Playback stopped. No discs can be played because the system region does not match the decoder region. The disc cannot be played because the disc is not authored to be played in the decoder's region. Arguments for an event reporting a new DVD time. The current Dvd time reported. Plays a DVD disc or will play DVD video files from a path. Normally, when a DVD is played with a custom allocator, IVideoWindow will be queried from the graph. Since there will be no IVideoWindow in this graph the IDvdControl2 will crash when we try to use the SelectAtPosition and ActivateAtPosition. We get around this by sacrificing the Line21 pin and connecting it to another video renderer that does have an IVideoWindow, but we make sure to keep the actual hWnd hidden. Constant value for converting media time back and forth to milliseconds; The current time the DVD playback is at Reference to the hidden render window The total number of DVD buttons currently on screen The main interface for DVD control The main interface for DVD information The DirectShow filter graph The renderer used to render video to WPF Used to store the dummy renderer target coords of the subpicture video The GUID of the DVD subpicture media type Flag to remember if we are over a DVD button. The input pin of the dummy renderer Fires when a DVD has been inserted Fires when a DVD has been ejected Fires when the DVD time changes Fires when the mouse is over a DVD button Fires when a DVD specific error occurs The directory to try to play the DVD from. If this is null then DirectShow will search for a DVD to play. Navigates to the Root menu of the DVD title Gets the total number of titles on the DVD Navigates to the Title menu of the DVD Returns the display from a submenu to its parent menu The SelectAngle method sets the new angle when the DVD Navigator is in an angle block Value of the new angle, which must be from 1 through 9 Leaves a menu and resumes playback. Selects the specified relative button (upper, lower, right, left) Selects a menu item at a certain position on the video The percentage to the right The percentage to the bottom Activates a menu item at a certain position on the video The ratio to the right The ratio to the bottom Sets the number of DVD buttons found in the current DVD video The total number of buttons Plays a specific title by a given title index Plays the next chapter of the DVD Plays the DVD forward The speed at which the playback is done Plays the DVD backwards The speed at the playback is done Plays the previous chapter of the DVD Builds the DVD DirectShow graph Configures our "dummy" IVideoWindow to work well with our interactive menus and to make sure the window remains hidden from view. Gets or sets the position in miliseconds of the media Here we extract out the new Dvd duration of the title currently being played Is called when a new media event code occurs on the graph The event code that occured The first parameter sent by the graph The second parameter sent by the graph Plays the Dvd Frees any allocated or unmanaged resources Helper class to load s from a file. It's not needed that the filter is registered. The GetProcAddress function retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). Handle to the DLL module that contains the function or variable. The LoadLibrary or GetModuleHandle function returns this handle. Pointer to a null-terminated string containing the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero. If the function succeeds, the return value is the address of the exported function or variable.


If the function fails, the return value is NULL. To get extended error information, call Marshal.GetLastWin32Error.
Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. Pointer to a null-terminated string that names the executable module (either a .dll or .exe file). The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file. This parameter is reserved for future use. It must be IntPtr.Zero. The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of the function. If the function succeeds, the return value is a handle to the module.
If the function fails, the return value is NULL. To get extended error information, call Marshal.GetLastWin32Error.
The FreeLibrary function decrements the reference count of the loaded dynamic-link library (DLL). When the reference count reaches zero, the module is unmapped from the address space of the calling process and the handle is no longer valid. Handle to the loaded DLL module. The LoadLibrary or GetModuleHandle function returns this handle. If the function succeeds, the return value is nonzero.


If the function fails, the return value is zero. To get extended error information, call Marshal.GetLastWin32Error.
Holds a list of dll handles and unloads the dlls in the destructor. Gets a class factory for a specific COM Class ID. The dll where the COM class is implemented. The requested Class ID. IClassFactory instance used to create instances of that class. Loads an COM .dll or .ax and creates an instance of the given Interface with IID . Filename of a .dll or .ax component Interface to create an object instance for Combine the given file name to a full path Instance or null Builds a full path for a given that is located in the same folder as the . File name Combined path Provides collections of devices and compression codecs installed on the system. Devices and compression codecs are implemented in DirectShow as filters, see the class for more information. To list the available video devices:
Filters filters = new Filters(); foreach ( Filter f in filters.VideoInputDevices ) { Debug.WriteLine( f.Name ); }
Collection of available video capture devices. Collection of available audio capture devices. Collection of available video compressors. Collection of available audio compressors. A collection of Filter objects (DirectShow filters). This is used by the class to provide lists of capture devices and compression filters. This class cannot be created directly. Populate the collection with a list of filters from a particular category. Populate the collection with a list of filters from a particular category. Populate the InnerList with a list of filters from a particular category Get the filter at the specified index. Represents a DirectShow filter (e.g. video capture device, compression codec). To save a chosen filer for later recall save the MonikerString property on the filter:
string savedMonikerString = myFilter.MonikerString;
To recall the filter create a new Filter class and pass the string to the constructor:
Filter mySelectedFilter = new Filter( savedMonikerString );
Human-readable name of the filter Unique string referencing this filter. This string can be used to recreate this filter. getAnyMoniker take very long time, so use a cached value Create a new filter from its moniker string. Create a new filter from its moniker Retrieve the a moniker's display name (i.e. it's unique string) Retrieve the human-readable name of the filter Get a moniker's human-readable name based on a moniker string. This method gets a System.Runtime.InteropServices.ComTypes.IMoniker object. HACK: The only way to create a System.Runtime.InteropServices.ComTypes.IMoniker from a moniker string is to use System.Runtime.InteropServices.ComTypes.IMoniker.ParseDisplayName(). So I need ANY System.Runtime.InteropServices.ComTypes.IMoniker object so that I can call ParseDisplayName(). Does anyone have a better solution? This assumes there is at least one video compressor filter installed on the system. Compares the current instance with another object of the same type. CLSID_AudioRendererCategory, audio render category CLSID_AudioInputDeviceCategory, audio capture category CLSID_VideoInputDeviceCategory, video capture category CLSID_VideoCompressorCategory, Video compressor category CLSID_AudioCompressorCategory, audio compressor category CLSID_LegacyAmFilterCategory, legacy filters #MW# CLSID_ActiveMovieCategory, a superset of all the available filters The MediaDetector class allows to query meta data from audio/video media files. This includes CODEC information and the ability to grab video snapshots. The video framerate The video CODEC tag The bits per pixel of the video The length of the video stream The length of the audio stream The number of bits per sample in the audio stream The HZ of the audio samples The number of audio channels in audio stream The filename of the loaded media The native pixel size of the video, if a video stream exists The total amount of streams that exist in the media Is true if the loaded media has an audio stream Is true if the loaded media has a video stream Frees any memory and resets to a default state Converts a FourCC code to a string Loads a media file. The full path of the media file to load Reads the audio stream information from the media file Reads the video stream information for the media file Gets an image snapshot from the media file that was opened The media time position for the requested thumbnail Returns a BitmapSource of the video position. The MediaSeekingPlayer adds media seeking functionality to to the MediaPlayerBase class Local cache of the current position The DirectShow media seeking interface Gets the duration in miliseconds, of the media that is opened Sets the rate at which the media plays back Gets or sets the position in miliseconds of the media The current position format the media is using The prefered position format to use with the media The current media positioning format The prefered media positioning format Notifies when the position of the media has changed This method is overriden to get out the seeking interfaces from the DirectShow graph Frees any allocated or unmanaged resources Polls the graph for various data about the media that is playing Converts a MediaPositionFormat enum to a DShow TimeFormat GUID Converts a DirectShow TimeFormat GUID to a MediaPositionFormat enum Setup the IMediaSeeking interface The MediaUriPlayer plays media files from a given Uri. The name of the default audio render. This is the same on all versions of windows Set the default audio renderer property backing The DirectShow graph interface. In this example We keep reference to this so we can dispose of it later. The media Uri Gets or sets the Uri source of the media Return Source as a string path or uri. The renderer type to use when rendering video Implementation of framestepinterface to step video forward by minimum of one frame e.g. by mousewheel step the frames The name of the audio renderer device Gets or sets if the media should play in loop or if it should just stop when the media is complete Is ran everytime a new media event occurs on the graph The Event code that occured The first event parameter sent by the graph The second event parameter sent by the graph Opens the media by initializing the DirectShow graph Inserts the audio renderer by the name. Frees all unmanaged memory and resets the object back to its initial state A Player that plays video from a video capture device. The video capture pixel height The video capture pixel width The video capture's frames per second Our DirectShow filter graph The DirectShow video renderer The capture device filter The name of the video capture source device Flag to detect if the capture source has changed The video capture device Flag to detect if the capture source device has changed The sample grabber interface used for getting samples in a callback Gets or sets if the instance fires an event for each of the samples Fires when a new video sample is ready The name of the video capture source to use The frames per-second to play the capture device back at Gets or sets if Yuv is the prefered color space The desired pixel width of the video The desired pixel height of the video Plays the video capture device Pauses the video capture device Configures the DirectShow graph to play the selected video capture device with the selected parameters Sets the capture parameters for the video capture device The Vmr9Allocator is a custom allocator for the VideoMixingRenderer9 Base constant for FAIL error codes The SDK version of D3D we are using Lock for shared resources Direct3D functions Direct3D functions of Vista The window handle, needed for D3D intialization The Direct3D device Lock for instance's resources Part of the "Dispose" pattern Applications use this interface to set a custom allocator-presenter and the allocator-presenter uses this interface to inform the VMR of changes to the system environment that affect the Direct3D surfaces. Fires each time a frame needs to be presented Fires when new D3D surfaces are allocated Private surface for YUV stuffs Private texture for YUV stuffs Creates a new VMR9 custom allocator to use with Direct3D Fires the OnNewAllocatorSurface event, notifying the subscriber that new surfaces are available Fires the NewAllocatorFrame event notifying the subscriber that a new frame is ready to be presented Frees any remaining unmanaged memory Part of the dispose pattern Current Direct3D surfaces our allocator has ready and allocated The StartPresenting method is called just before the video starts playing. The allocator-presenter should perform any necessary configuration in this method. An application-defined DWORD_PTR cookie that uniquely identifies this instance of the VMR for use in scenarios when one instance of the allocator-presenter is used with multiple VMR instances. Returns an HRESULT The StopPresenting method is called just after the video stops playing. The allocator-presenter should perform any necessary cleanup in this method. An application-defined DWORD_PTR cookie that uniquely identifies this instance of the VMR for use in scenarios when one instance of the allocator-presenter is used with multiple VMR instances. The PresentImage method is called at precisely the moment this video frame should be presented. An application-defined DWORD_PTR that uniquely identifies this instance of the VMR in scenarios when multiple instances of the VMR are being used with a single instance of an allocator-presenter. Specifies a VMR9PresentationInfo structure that contains information about the video frame. Returns an HRESULT Tests if the D3D device has been lost and if it has it is retored. This happens on XP with things like resolution changes or pressing ctrl + alt + del. With Vista, this will most likely never be called unless the video driver hangs or is changed. Gets the pointer to the adapter monitor The ordinal of the adapter A pointer to the adaptor monitor The InitializeDevice method is called by the Video Mixing Renderer 9 (VMR-9) when it needs the allocator-presenter to allocate surfaces. Application-defined identifier. This value is the same value that the application passed to the IVMRSurfaceAllocatorNotify9.AdviseSurfaceAllocator method in the dwUserID parameter. Pointer to a VMR9AllocationInfo structure that contains a description of the surfaces to create. On input, specifies the number of surfaces to create. When the method returns, this parameter contains the number of buffers that were actually allocated. Returns an HRESULT code The TerminateDevice method releases the Direct3D device. Application-defined identifier. This value is the same value that the application passed to the IVMRSurfaceAllocatorNotify9.AdviseSurfaceAllocator method in the dwUserID parameter. The GetSurface method retrieves a Direct3D surface Application-defined identifier. This value is the same value that the application passed to the IVMRSurfaceAllocatorNotify9.AdviseSurfaceAllocator method in the dwUserID parameter. Specifies the index of the surface to retrieve. Address of a variable that receives an IDirect3DSurface9 interface pointer. The caller must release the interface. The AdviseNotify method provides the allocator-presenter with the VMR-9 filter's interface for notification callbacks. If you are using a custom allocator-presenter, the application must call this method on the allocator-presenter, with a pointer to the VMR's IVMRSurfaceAllocatorNotify9 interface. The allocator-presenter uses this interface to communicate with the VMR. Specifies the IVMRSurfaceAllocatorNotify9 interface that the allocator-presenter will use to pass notifications back to the VMR. Returns an HRESULT value Gets a native pointer to a COM object. This method does not add a reference count. The RCW to the COM object Pointer to the COM object Gets if the current operating system is Windows Vista or higher. Creates a Direct3D device Releases reference to all allocated D3D surfaces CLSID_IDirect3DDevice9 This is a WPF pixel shader effect that will scale 16-235 HD-TV pixel output to 0-255 pixel values for deeper color on video. A logger. If the info level is enabled. If the debug level is enabled. Log the error without an exception. Logging to . No-op implementation of ILog. Log manager for the WPF-MediaKit. Set to change the logging. Main func to get an for the provided logger name. Default is set to . May be changed by the user code. Set to to switch off the logging. Returns an for the provided logger name. Retuns an for the provided logger name. Check if a COM Object is available The CLSID of this object true if the object is available, false if not Release a ComObject ref counter of the object Try (final) release a Com-Object and set the obj to null true if object is released (not null and a com object) Function to get a COM object from file (dll) a (unmanaged) dll-file where the COM object is implemented objects Guid a interface or null if not loaded Thrown if the method can't creat COM-object Thrown if the dll not found Utility class to get a Class Factory for a certain Class ID by loading the dll that implements that class Gets a class factory for a specific COM Class ID. The dll where the COM class is implemented The requested Class ID IClassFactory instance used to create instances of that class Thrown if the method can't creat COM-object Thrown if the dll not found Builds a full path for a given that is located in the same folder as the . File name Combined path The GetProcAddress function retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). Handle to the DLL module that contains the function or variable. The LoadLibrary or GetModuleHandle function returns this handle. Pointer to a null-terminated string containing the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero. If the function succeeds, the return value is the address of the exported function or variable.


If the function fails, the return value is NULL. To get extended error information, call Marshal.GetLastWin32Error.
LoadLibrary function maps the specified executable module into the address space of the calling process. Pointer to a null-terminated string that names the executable module. The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file. If the function succeeds, the return value is a handle to the module.


If the function fails, the return value is NULL. To get extended error information, call Marshal.GetLastWin32Error.
The FreeLibrary function decrements the reference count of the loaded dynamic-link library (DLL). When the reference count reaches zero, the module is unmapped from the address space of the calling process and the handle is no longer valid. Handle to the loaded DLL module. The LoadLibrary or GetModuleHandle function returns this handle. If the function succeeds, the return value is nonzero.


If the function fails, the return value is zero. To get extended error information, call Marshal.GetLastWin32Error.
GetDLLHandle the handle from registered dll The GUID of our EVR custom presenter COM object The custom EVR video presenter COM object Invokes when a new frame has been allocated to a surface Invokes when a new surface has been allocated Called by the custom EVR Presenter, notifying that there is a new D3D surface and/or there needs to be a frame rendered The Direct3D surface A HRESULT Create a new EVR video presenter Fires the NewAllocatorFrame event Fires the NewAlloctorSurface event D3D surface pointer Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. Custom dispatcher to deal with MTA and DShow, see https://groups.google.com/forum/#!topic/wpf-disciples/kLdMgVzeWig Flag to set if the dispatcher needs to shutdown Queue of delegates to execute The thread this dispatcher is running on The message to post to our message pump to wake it up for processing the managed delegate queue Windows message notifiying listener's of the pump we outta there and the pump is about to end The OS's thread identifier The thread that the dispatcher is running under Flag, that the dispatcher is in the shutting down process. Flag that the dispather has shut down. Async executes a method on our Dispatcher's thread The delegate to execute Wakes up the pump to notify there are delegates to execute Shuts down the dispatcher and completes any delegates or messages that are in the queue Forces execution of any messages in the queue Runs the message pump in the Dispatcher Executes all the queued delegates Posts a quit message to the message queue. This lets all pump listeners know that the end is near and abandon all resources The heart of the message pump. This method will not return until the message pump has been terminated.