Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 109bd7f

Browse files
authored
Merge pull request #1005 from battlebottle/SinkWriter_GetStatistics_fix
[MediaFoundation] SinkWriter.GetStatistics fix
2 parents 265f955 + 6cc309e commit 109bd7f

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Source/SharpDX.MediaFoundation/Mapping-core.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,9 @@
788788
<map interface="IMFAsyncCallbackLogging" name="IAsyncCallbackLogging" callback="true"/>
789789

790790
<map param="IMFByteStream::*.*::pb" type="void" attribute="in"/>
791+
792+
<map method="IMFSinkWriter::GetStatistics" name="GetStatistics_" check="false" visibility="internal"/>
793+
<map param="IMFSinkWriter::GetStatistics::pStats" type="void" attribute="in"/>
791794

792795
<map param="IMFByteStream::Begin[RW].*::punkState" type="void"/>
793796

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace SharpDX.MediaFoundation
7+
{
8+
public partial class SinkWriter
9+
{
10+
/// <summary>
11+
/// <p>Gets statistics about the performance of the sink writer.</p>
12+
/// </summary>
13+
/// <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>
14+
/// <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>
15+
/// <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>
16+
/// <remarks>
17+
/// <p>This interface is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.</p>
18+
/// </remarks>
19+
/// <include file='.\..\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IMFSinkWriter::GetStatistics']/*"/>
20+
/// <msdn-id>dd374650</msdn-id>
21+
/// <unmanaged>HRESULT IMFSinkWriter::GetStatistics([In] unsigned int dwStreamIndex,[Out] MF_SINK_WRITER_STATISTICS* pStats)</unmanaged>
22+
/// <unmanaged-short>IMFSinkWriter::GetStatistics</unmanaged-short>
23+
public void GetStatistics(int dwStreamIndex, out SharpDX.MediaFoundation.SinkWriterStatistics statsRef)
24+
{
25+
unsafe
26+
{
27+
statsRef = new SharpDX.MediaFoundation.SinkWriterStatistics();
28+
statsRef.Cb = sizeof(SharpDX.MediaFoundation.SinkWriterStatistics);
29+
fixed (void* statsRefPtr = &statsRef)
30+
{
31+
GetStatistics_(dwStreamIndex, new IntPtr(statsRefPtr));
32+
}
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)