// // 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. using System; using System.Reflection; namespace SharpDX.MediaFoundation { public partial class Activate { /// /// Creates an activation object for a Windows Runtime class. /// ///

The class identifier that is associated with the activatable runtime class.

///

An optional friendly name for the activation object. The friendly name is stored in the object's attribute. This parameter can be null.

/// ///

To create the Windows Runtime object, call or IClassFactory::CreateInstance.

///
/// hh162753 /// HRESULT MFCreateMediaExtensionActivate([In] const wchar_t* szActivatableClassId,[In, Optional] IUnknown* pConfiguration,[In] const GUID& riid,[Out] void** ppvObject) /// MFCreateMediaExtensionActivate public Activate(string activatableClassId, ComObject propertySet = null) { IntPtr temp; MediaFactory.CreateMediaExtensionActivate(activatableClassId, propertySet, Utilities.GetGuidFromType(typeof (Activate)), out temp); NativePointer = temp; } /// ///

Creates the object associated with this activation object.

///
///

Interface identifier (IID) of the requested interface.

///

A reference to the requested interface. The caller must release the interface.

/// ///

Some Microsoft Media Foundation objects must be shut down before being released. If so, the caller is responsible for shutting down the object that is returned in ppv. To shut down the object, do one of the following:

The method is generic to all object types. If the object does not require a shutdown method, ShutdownObject succeeds and has no effect. If you do not know the specific shutdown method for the object (or do not know the object type), call .

After the first call to ActivateObject, subsequent calls return a reference to the same instance, until the client calls either ShutdownObject or .

///
/// /// ms694292 /// HRESULT IMFActivate::ActivateObject([In] const GUID& riid,[Out] void** ppv) /// IMFActivate::ActivateObject public T ActivateObject(System.Guid riid) where T : SharpDX.ComObject { unsafe { IntPtr objectRef; ActivateObject(riid, out objectRef); return ComObject.FromPointer(objectRef); } } /// ///

Creates the object associated with this activation object. Riid is provided via reflection on the COM object type

///
///

A reference to the requested interface. The caller must release the interface.

/// ///

Some Microsoft Media Foundation objects must be shut down before being released. If so, the caller is responsible for shutting down the object that is returned in ppv. To shut down the object, do one of the following:

  • Call on the activation object, or
  • Call the object-specific shutdown method. This method will depend on the type of object. Possibilities include:
    • Media sources: Call .
    • Media sinks: Call .
    • Any object that supports the interface: Call .

The method is generic to all object types. If the object does not require a shutdown method, ShutdownObject succeeds and has no effect. If you do not know the specific shutdown method for the object (or do not know the object type), call .

After the first call to ActivateObject, subsequent calls return a reference to the same instance, until the client calls either ShutdownObject or .

///
/// /// ms694292 /// HRESULT IMFActivate::ActivateObject([In] const GUID& riid,[Out] void** ppv) /// IMFActivate::ActivateObject public T ActivateObject() where T : SharpDX.ComObject { unsafe { IntPtr objectRef; Guid riid = typeof(T).GetTypeInfo().GUID; ActivateObject(riid, out objectRef); return ComObject.FromPointer(objectRef); } } } }