This repository has been archived by the owner on Mar 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 639
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added useful constructors for the CaptureEngineClassFactory and the C…
…aptureEngine.
- Loading branch information
1 parent
89cf255
commit 8d2906b
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SharpDX.MediaFoundation | ||
{ | ||
public partial class CaptureEngine | ||
{ | ||
/// <summary> | ||
/// <p>Creates an instance of the capture engine.</p> | ||
/// </summary> | ||
/// <param name="clsid"><dd> <p>The CLSID of the object to create. Currently, this parameter must equal <strong><see cref="SharpDX.MediaFoundation.CaptureEngine.ClsidMFCaptureEngine"/></strong>.</p> </dd></param> | ||
/// <param name="riid"><dd> <p>The IID of the requested interface. The capture engine supports the <strong><see cref="SharpDX.MediaFoundation.CaptureEngine"/></strong> interface.</p> </dd></param> | ||
/// <param name="vObjectOut"><dd> <p>Receives a reference to the requested interface. The caller must release the interface.</p> </dd></param> | ||
/// <returns><p>If this method succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns> | ||
/// <remarks> | ||
/// <p>Before calling this method, call the <strong><see cref="SharpDX.MediaFoundation.MediaFactory.Startup"/></strong> function.</p> | ||
/// </remarks> | ||
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IMFCaptureEngineClassFactory::CreateInstance']/*"/> | ||
/// <msdn-id>hh447848</msdn-id> | ||
/// <unmanaged>HRESULT IMFCaptureEngineClassFactory::CreateInstance([In] const GUID& clsid,[In] const GUID& riid,[Out] void** ppvObject)</unmanaged> | ||
/// <unmanaged-short>IMFCaptureEngineClassFactory::CreateInstance</unmanaged-short> | ||
public CaptureEngine(CaptureEngineClassFactory factory) | ||
{ | ||
IntPtr native; | ||
factory.CreateInstance(ClsidMFCaptureEngine, Utilities.GetGuidFromType(typeof(CaptureEngine)), out native); | ||
NativePointer = native; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Source/SharpDX.MediaFoundation/CaptureEngineClassFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#if DESKTOP_APP | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SharpDX.MediaFoundation | ||
{ | ||
public partial class CaptureEngineClassFactory | ||
{ | ||
public CaptureEngineClassFactory() | ||
{ | ||
Utilities.CreateComInstance(ClsidMFCaptureEngineClassFactory, Utilities.CLSCTX.ClsctxInproc, Utilities.GetGuidFromType(typeof(CaptureEngineClassFactory)), this); | ||
} | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters