This repository has been archived by the owner on Mar 30, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1005 from battlebottle/SinkWriter_GetStatistics_fix
[MediaFoundation] SinkWriter.GetStatistics fix
- Loading branch information
Showing
2 changed files
with
39 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
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,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace SharpDX.MediaFoundation | ||
{ | ||
public partial class SinkWriter | ||
{ | ||
/// <summary> | ||
/// <p>Gets statistics about the performance of the sink writer.</p> | ||
/// </summary> | ||
/// <param name="dwStreamIndex"><dd> <p>The zero-based index of a stream to query, or <strong><see cref="SharpDX.MediaFoundation.SinkWriterIndex.AllStreams"/> </strong> to query the media sink itself.</p> </dd></param> | ||
/// <param name="statsRef"><dd> <p>A reference to an <strong><see cref="SharpDX.MediaFoundation.SinkWriterStatistics"/></strong> structure. Before calling the method, set the <strong>cb</strong> member to the size of the structure in bytes. The method fills the structure with statistics from the sink writer.</p> </dd></param> | ||
/// <returns><p>This method can return one of these values.</p><table> <tr><th>Return code</th><th>Description</th></tr> <tr><td> <dl> <dt><strong><see cref="SharpDX.Result.Ok"/></strong></dt> </dl> </td><td> <p>Success.</p> </td></tr> <tr><td> <dl> <dt><strong><see cref="SharpDX.MediaFoundation.ResultCode.InvalidStreamNumber"/></strong></dt> </dl> </td><td> <p>Invalid stream number.</p> </td></tr> </table><p>?</p></returns> | ||
/// <remarks> | ||
/// <p>This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.</p> | ||
/// </remarks> | ||
/// <include file='.\..\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IMFSinkWriter::GetStatistics']/*"/> | ||
/// <msdn-id>dd374650</msdn-id> | ||
/// <unmanaged>HRESULT IMFSinkWriter::GetStatistics([In] unsigned int dwStreamIndex,[Out] MF_SINK_WRITER_STATISTICS* pStats)</unmanaged> | ||
/// <unmanaged-short>IMFSinkWriter::GetStatistics</unmanaged-short> | ||
public void GetStatistics(int dwStreamIndex, out SharpDX.MediaFoundation.SinkWriterStatistics statsRef) | ||
{ | ||
unsafe | ||
{ | ||
statsRef = new SharpDX.MediaFoundation.SinkWriterStatistics(); | ||
statsRef.Cb = sizeof(SharpDX.MediaFoundation.SinkWriterStatistics); | ||
fixed (void* statsRefPtr = &statsRef) | ||
{ | ||
GetStatistics_(dwStreamIndex, new IntPtr(statsRefPtr)); | ||
} | ||
} | ||
} | ||
} | ||
} |