//Widows Media Format Interfaces
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER
// REMAINS UNCHANGED.
//
// Email: yetiicb@hotmail.com
//
// Copyright (C) 2002-2004 Idael Cardoso.
//
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
namespace BSE.Platten.Audio.WMFSDK
{
/// <summary>
/// The WM_READER_CLIENTINFO structure describes the client reader (player) accessing the media stream.
/// </summary>
/// <remarks>
/// In earlier versions of this SDK, the pReserved member was named wszHostUniquePID. The application used
/// this member to specify an ID to send to the server. In the current version, the reader object
/// automatically generates a GUID for the ID, so this structure member is obsolete. It is present only to
/// provide binary compatibility with earlier versions of the SDK.
///
/// The GUID generated by the reader object represents a unique user on a particular computer.
/// The reader object stores this value in the registry. If the registry entry does not exist, the
/// SDK dynamically creates it. For more information, see IWMReaderAdvanced2.SetLogClientID.
/// </remarks>
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WM_READER_CLIENTINFO
{
/// <summary>
/// Size of the structure in bytes.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint cbSize;
/// <summary>
/// wo-letter or three-letter language code.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[MarshalAs(UnmanagedType.LPWStr)]
public string wszLang;
/// <summary>
/// The browser's user-agent string.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[MarshalAs(UnmanagedType.LPWStr)]
public string wszBrowserUserAgent;
/// <summary>
/// Web page that contains the plug-in.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[MarshalAs(UnmanagedType.LPWStr)]
public string wszBrowserWebPage;
/// <summary>
/// Reserved.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
ulong qwReserved;
/// <summary>
/// Unused. See Remarks.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
public IntPtr pReserved;
/// <summary>
/// Host application's .exe file; for example, Iexplore.exe.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[MarshalAs(UnmanagedType.LPWStr)]
public string wszHostExe;
/// <summary>
/// Version number of the host application. The value is four unsigned WORD values packed into a 64-bit integer.
/// When the client information is logged, each WORD value is unpacked and translated into its decimal
/// equivalent. For example, if the value is 0x0001000200030004, the version number is
/// logged as "1.2.3.4".
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public ulong qwHostVersion;
/// <summary>
/// String identifying the player application. For example, "WMPlayer/9.0.0.0" identifies version 9 of the
/// Windows Media Player.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
[MarshalAs(UnmanagedType.LPWStr)]
public string wszPlayerUserAgent;
};
/// <summary>
/// The WM_READER_STATISTICS structure describes the performance of a reading operation.
/// </summary>
/// <remarks>
/// You must set the cbSize member manually before using this structure. It should always be set to sizeof(WM_READER_STATISTICS).
/// </remarks>
[SuppressMessage("Microsoft.Naming", "CA1707:IdentifiersShouldNotContainUnderscores")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
[StructLayout(LayoutKind.Sequential)]
public struct WM_READER_STATISTICS
{
/// <summary>
/// The size of the WM_READER_STATISTICS structure, in bytes.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint cbSize;
/// <summary>
/// DWORD containing the bandwidth, in bits per second.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint dwBandwidth;
/// <summary>
/// Count of packets received.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint cPacketsReceived;
/// <summary>
/// Count of lost packets which were recovered. This value is only relevant during network playback.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint cPacketsRecovered;
/// <summary>
/// Count of lost packets which were not recovered. This value is only relevant during network playback.
/// </summary>
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint cPacketsLost;
/// <summary>
/// WORD containing the quality, which is the percentage of total packets that were received.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public uint wQuality;
};
/// <summary>
/// The <b>IWMReaderAllocatorEx</b> interface provides expanded alternatives to the <b>AllocateForOutput</b> and
/// AllocateForStream methods of the IWMReaderCallbackAdvanced interface. This interface is implemented by
/// the application, which passes this interface pointer to the synchronous reader object by calling
/// IWMSyncReader2.SetAllocateForStream or SetAllocateForOutput.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
[ComImport]
[Guid("9F762FA7-A22E-428d-93C9-AC82F3AAFE5A")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderAllocatorEx
{
/// <summary>
/// Allocates a buffer for samples delivered to the IWMReaderCallbackAdvanced.OnStreamSample method.
/// </summary>
/// <param name="wStreamNum"><b>WORD</b> containing the stream number.</param>
/// <param name="cbBuffer">Size of ppBuffer, in bytes.</param>
/// <param name="ppBuffer">Pointer to a pointer to an <see cref="INSSBuffer"/> object.</param>
/// <param name="dwFlags"><b>DWORD</b> containing the relevant flags.</param>
/// <param name="cnsSampleTime">Specifies the sample time, in 100-nanosecond units.</param>
/// <param name="cnsSampleDuration">Specifies the sample duration, in 100-nanosecond units.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is the context pointer
/// given to the IWMReader.Start method.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
[SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms")]
void AllocateForStreamEx([In] ushort wStreamNum,
[In] uint cbBuffer,
[Out] out INSSBuffer ppBuffer,
[In] uint dwFlags,
[In] ulong cnsSampleTime,
[In] ulong cnsSampleDuration,
[In] IntPtr pvContext);
/// <summary>
/// Allocates a buffer for samples delivered to the <b>IWMReaderCallback.OnSample</b> method.
/// </summary>
/// <param name="dwOutputNum"><b>DWORD</b> containing the output number.</param>
/// <param name="cbBuffer">Size of ppBuffer, in bytes.</param>
/// <param name="ppBuffer">Pointer to a pointer to an <see cref="INSSBuffer"/> object.</param>
/// <param name="dwFlags"><b>DWORD</b> containing the relevant flags.</param>
/// <param name="cnsSampleTime">Specifies the sample time, in 100-nanosecond units.</param>
/// <param name="cnsSampleDuration">Specifies the sample duration, in 100-nanosecond units.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is the context pointer
/// given to the IWMReader.Start method.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
[SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms")]
void AllocateForOutputEx([In] uint dwOutputNum,
[In] uint cbBuffer,
[Out] out INSSBuffer ppBuffer,
[In] uint dwFlags,
[In] ulong cnsSampleTime,
[In] ulong cnsSampleDuration,
[In] IntPtr pvContext);
}
/// <summary>
/// The IWMSyncReader interface provides the ability to read ASF files using synchronous calls. This is in
/// contrast to many of the methods in IWMReader, which are called asynchronously.
///
/// You get a pointer to an IWMSyncReader interface when you create a new synchronous reader object with a
/// call to WMCreateSyncReader.
///
/// In addition to enabling synchronous reading, the methods of IWMSyncReader are tailored to meet the
/// demands of editing applications. Default playback from IWMSyncReader delivers uncompressed samples for
/// the default streams of all outputs. However, you can manipulate the selected streams during streaming
/// without having to enable manual stream selection. You can also receive compressed or uncompressed samples,
/// though you cannot change between them during streaming. Samples are delivered by either output number
/// or stream number, so you can receive uncompressed samples from mutually exclusive streams.
///
/// Many of the methods in this interface are almost identical to corresponding methods in the asynchronous
/// reader.
///
/// Use of this interface, as well as the implementation of an IStream COM object that passes data to this
/// object, is demonstrated in the WMSyncReader SDK sample.
/// </summary>
[ComImport]
[Guid("9397F121-7705-4dc9-B049-98B698188414")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMSyncReader
{
/// <summary>
/// Opens a file for reading.
/// </summary>
/// <param name="pwszFilename">Pointer to a wide-character null-terminated string containing the file name
/// to open. This must be a valid file name with an ASF file extension or an MP3 file name.</param>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void Open([In, MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
/// <summary>
/// Removes a file from the synchronous reader.
/// </summary>
void Close();
/// <summary>
/// Sets a start time and duration for playback.
/// </summary>
/// <param name="cnsStartTime">Offset into the file at which to start playback. This value is measured
/// in 100-nanosecond units.</param>
/// <param name="cnsDuration">Duration in 100-nanosecond units, or zero to continue playback to the
/// end of the file.</param>
void SetRange([In] ulong cnsStartTime, [In] long cnsDuration);
/// <summary>
/// Sets a start time and duration for playback based upon the frame number of a frame-indexed video stream.
/// </summary>
/// <param name="wStreamNum">Stream number.</param>
/// <param name="qwFrameNumber">Frame number at which to begin playback. The first frame in a file is number 1.</param>
/// <param name="cFramesToRead">Count of frames to read. Pass 0 to continue playback to the
/// end of the file.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetRangeByFrame([In] ushort wStreamNum, [In] ulong qwFrameNumber, [In]long cFramesToRead);
/// <summary>
/// Gets the next sample from the file.
/// </summary>
/// <param name="wStreamNum"><b>WORD</b> containing the stream number for which you would like a sample.
/// If you pass zero, the next sample in the file is returned, regardless of stream number.</param>
/// <param name="ppSample">Pointer to a buffer that receives the sample. Set to NULL to retrieve the sample
/// time without getting the sample. If set to NULL, pcnsDuration and pdwFlags must both be set to
/// NULL as well.</param>
/// <param name="pcnsSampleTime">Pointer to a QWORD variable that receives the sample time in 100-nanosecond
/// units.</param>
/// <param name="pcnsDuration">Pointer to <b>QWORD</b> variable that receives the duration of the sample in
/// 100-nanosecond units.</param>
/// <param name="pdwFlags">Pointer to a DWORD containing one or more of the following flags.</param>
/// <param name="pdwOutputNum">Pointer to a DWORD that receives the output number.</param>
/// <param name="pwStreamNum">Pointer to a WORD that receives the stream number.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms")]
void GetNextSample([In] ushort wStreamNum,
[Out] out INSSBuffer ppSample,
[Out] out ulong pcnsSampleTime,
[Out] out ulong pcnsDuration,
[Out] out uint pdwFlags,
[Out] out uint pdwOutputNum,
[Out] out ushort pwStreamNum);
/// <summary>
/// Sets the streams for which the reader will deliver samples.
/// </summary>
/// <param name="cStreamCount">Count of streams listed at pwStreamNumbers.</param>
/// <param name="pwStreamNumbers">Pointer to an array of WORD values containing the stream numbers.</param>
/// <param name="pSelections">Pointer to an array of WMT_STREAM_SELECTION enumeration values. These values
/// correspond with the stream numbers listed at pwStreamNumbers. Each value specifies the samples
/// to deliver for the appropriate stream.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Retrieves whether or not a particular stream is selected for sample delivery.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pSelection">Pointer to a variable that receives one member of the WMT_STREAM_SELECTION
/// enumeration type on output. This value specifies the selection status for the
/// specified stream.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetStreamSelected([In]ushort wStreamNum,
[Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Sets a stream to deliver compressed or uncompressed samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="fCompressed">Boolean value that is True if samples will be compressed.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetReadStreamSamples([In] ushort wStreamNum,
[In, MarshalAs(UnmanagedType.Bool)] bool fCompressed);
/// <summary>
/// Ascertains whether a stream is configured to deliver uncompressed samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pfCompressed">Pointer to a flag that receives the status of compressed delivery
/// for the stream specified.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetReadStreamSamples([In] ushort wStreamNum,
[Out, MarshalAs(UnmanagedType.Bool)] out bool pfCompressed);
/// <summary>
/// Retrieves a setting for a particular output by name.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the name of the setting
/// for which you want the value. For a list of global constants representing setting names,
/// see Output Settings.</param>
/// <param name="pType">Pointer to a variable that receives one value from the WMT_ATTR_DATATYPE enumeration
/// type. The value received specifies the type of data in pValue.</param>
/// <param name="pValue">Pointer to a byte buffer containing the value. Pass NULL to retrieve the length
/// of the buffer required.</param>
/// <param name="pcbLength">On input, pointer to a variable containing the length of pValue. On output,
/// the variable contains the number of bytes in pValue used.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[Out] out WMT_ATTR_DATATYPE pType,
/*[out, size_is( *pcbLength )]*/ IntPtr pValue,
[In, Out] ref uint pcbLength);
/// <summary>
/// Sets a named setting for an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a null-terminated string containing the name of the setting.
/// For a list of global constants representing setting names, see Output Settings.</param>
/// <param name="Type">Member of the WMT_ATTR_DATATYPE enumeration type. This value specifies the type
/// of data in the buffer at pValue.</param>
/// <param name="pValue">Pointer to a byte array containing the value of the setting. The type of data
/// stored in this buffer is specified by Type.</param>
/// <param name="cbLength">Size of pValue in bytes.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void SetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[In] WMT_ATTR_DATATYPE Type,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] byte[] pValue,
[In] uint cbLength);
/// <summary>
/// Retrieves the number of outputs in the file.
/// </summary>
/// <param name="pcOutputs">Pointer to a DWORD that receives the number of outputs in the file.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void GetOutputCount([Out] out uint pcOutputs);
/// <summary>
/// Retrieves the current properties of an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="ppOutput">Pointer to a pointer to an IWMOutputMediaProps interface, which is created by
/// a successful call to this method.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputProps([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppOutput);
/// <summary>
/// Sets the properties of an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pOutput">Pointer to an IWMOutputMediaProps interface.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetOutputProps([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Interface)] IWMOutputMediaProps pOutput);
/// <summary>
/// Retrieves the number of formats supported by an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number for which you want to determine the
/// number of supported formats.</param>
/// <param name="pcFormats">Pointer to a DWORD that receives the number of supported formats.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputFormatCount([In] uint dwOutputNum, [Out] out uint pcFormats);
/// <summary>
/// Retrieves one output format for one output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="dwFormatNum">DWORD containing the format number.</param>
/// <param name="ppProps">Pointer to a pointer to an IWMOutputMediaProps interface. This object is
/// created by a successful call to this method.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputFormat([In] uint dwOutputNum,
[In] uint dwFormatNum,
[Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppProps);
/// <summary>
/// Retrieves the output number that corresponds to a stream in the file.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number for which you want to retrieve
/// the corresponding output number.</param>
/// <param name="pdwOutputNum">Pointer to a DWORD that will receive the output number that corresponds
/// to the stream number specified in wStreamNum.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputNumberForStream([In] ushort wStreamNum, [Out] out uint pdwOutputNum);
/// <summary>
/// Retrieves the current stream number that corresponds to an output number in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD value specifying the output number for which you want to retrieve
/// a stream number.</param>
/// <param name="pwStreamNum">Pointer to a WORD value that receives the stream number that corresponds
/// to the output specified by dwOutput.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetStreamNumberForOutput([In] uint dwOutputNum, [Out] out ushort pwStreamNum);
/// <summary>
/// Retrieves the maximum sample size for an output in the file.
/// </summary>
/// <param name="dwOutput">DWORD containing the output number for which you want to retrieve
/// the maximum sample size.</param>
/// <param name="pcbMax">Pointer to a DWORD value that receives the maximum sample size, in bytes,
/// for the output specified in dwOutput.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum sample size for a stream in the file.
/// </summary>
/// <param name="wStream">WORD containing the stream number for which you want to retrieve the
/// maximum sample size.</param>
/// <param name="pcbMax">Pointer to a DWORD value that receives the maximum sample size, in bytes,
/// for the stream specified in wStream.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Opens a stream for reading.
/// </summary>
/// <param name="pStream">Pointer to an IStream interface.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void OpenStream([In, MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IStream pStream);
}
/// <summary>
/// The IWMSyncReader2 interface provides advanced features for the synchronous reader. It contains methods
/// for allocating samples manually and for seeking to SMPTE time codes.
///
/// An IWMSyncReader2 interface exists for every synchronous reader object. You can obtain a pointer
/// to an instance of this interface by calling the QueryInterface method of any other interface
/// of the synchronous reader object.
/// </summary>
[ComImport]
[Guid("faed3d21-1b6b-4af7-8cb6-3e189bbc187b")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMSyncReader2 : IWMSyncReader
{
/// <summary>
/// Opens a file for reading.
/// </summary>
/// <param name="pwszFilename">Pointer to a wide-character null-terminated string containing the file name
/// to open. This must be a valid file name with an ASF file extension or an MP3 file name.</param>
new void Open([In, MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
/// <summary>
/// Removes a file from the synchronous reader.
/// </summary>
new void Close();
/// <summary>
/// Sets a start time and duration for playback.
/// </summary>
/// <param name="cnsStartTime">Offset into the file at which to start playback. This value is measured
/// in 100-nanosecond units.</param>
/// <param name="cnsDuration">Duration in 100-nanosecond units, or zero to continue playback to the
/// end of the file.</param>
new void SetRange([In] ulong cnsStartTime, [In] long cnsDuration);
/// <summary>
/// Sets a start time and duration for playback based upon the frame number of a frame-indexed video stream.
/// </summary>
/// <param name="wStreamNum">Stream number.</param>
/// <param name="qwFrameNumber">Frame number at which to begin playback. The first frame in a file is number 1.</param>
/// <param name="cFramesToRead">Count of frames to read. Pass 0 to continue playback to the
/// end of the file.</param>
new void SetRangeByFrame([In] ushort wStreamNum, [In] ulong qwFrameNumber, [In]long cFramesToRead);
/// <summary>
/// Gets the next sample from the file.
/// </summary>
/// <param name="wStreamNum"><b>WORD</b> containing the stream number for which you would like a sample.
/// If you pass zero, the next sample in the file is returned, regardless of stream number.</param>
/// <param name="ppSample">Pointer to a buffer that receives the sample. Set to NULL to retrieve the sample
/// time without getting the sample. If set to NULL, pcnsDuration and pdwFlags must both be set to
/// NULL as well.</param>
/// <param name="pcnsSampleTime">Pointer to a QWORD variable that receives the sample time in 100-nanosecond
/// units.</param>
/// <param name="pcnsDuration">Pointer to <b>QWORD</b> variable that receives the duration of the sample in
/// 100-nanosecond units.</param>
/// <param name="pdwFlags">Pointer to a DWORD containing one or more of the following flags.</param>
/// <param name="pdwOutputNum">Pointer to a DWORD that receives the output number.</param>
/// <param name="pwStreamNum">Pointer to a WORD that receives the stream number.</param>
new void GetNextSample([In] ushort wStreamNum,
[Out] out INSSBuffer ppSample,
[Out] out ulong pcnsSampleTime,
[Out] out ulong pcnsDuration,
[Out] out uint pdwFlags,
[Out] out uint pdwOutputNum,
[Out] out ushort pwStreamNum);
/// <summary>
/// Sets the streams for which the reader will deliver samples.
/// </summary>
/// <param name="cStreamCount">Count of streams listed at pwStreamNumbers.</param>
/// <param name="pwStreamNumbers">Pointer to an array of WORD values containing the stream numbers.</param>
/// <param name="pSelections">Pointer to an array of WMT_STREAM_SELECTION enumeration values. These values
/// correspond with the stream numbers listed at pwStreamNumbers. Each value specifies the samples
/// to deliver for the appropriate stream.</param>
new void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Retrieves whether or not a particular stream is selected for sample delivery.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pSelection">Pointer to a variable that receives one member of the WMT_STREAM_SELECTION
/// enumeration type on output. This value specifies the selection status for the
/// specified stream.</param>
new void GetStreamSelected([In]ushort wStreamNum,
[Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Sets a stream to deliver compressed or uncompressed samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="fCompressed">Boolean value that is True if samples will be compressed.</param>
new void SetReadStreamSamples([In] ushort wStreamNum,
[In, MarshalAs(UnmanagedType.Bool)] bool fCompressed);
/// <summary>
/// Ascertains whether a stream is configured to deliver uncompressed samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pfCompressed">Pointer to a flag that receives the status of compressed delivery
/// for the stream specified.</param>
new void GetReadStreamSamples([In] ushort wStreamNum,
[Out, MarshalAs(UnmanagedType.Bool)] out bool pfCompressed);
/// <summary>
/// Retrieves a setting for a particular output by name.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the name of the setting
/// for which you want the value. For a list of global constants representing setting names,
/// see Output Settings.</param>
/// <param name="pType">Pointer to a variable that receives one value from the WMT_ATTR_DATATYPE enumeration
/// type. The value received specifies the type of data in pValue.</param>
/// <param name="pValue">Pointer to a byte buffer containing the value. Pass NULL to retrieve the length
/// of the buffer required.</param>
/// <param name="pcbLength">On input, pointer to a variable containing the length of pValue. On output,
/// the variable contains the number of bytes in pValue used.</param>
new void GetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[Out] out WMT_ATTR_DATATYPE pType,
/*[out, size_is( *pcbLength )]*/ IntPtr pValue,
[In, Out] ref uint pcbLength);
/// <summary>
/// Sets a named setting for an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a null-terminated string containing the name of the setting.
/// For a list of global constants representing setting names, see Output Settings.</param>
/// <param name="Type">Member of the WMT_ATTR_DATATYPE enumeration type. This value specifies the type
/// of data in the buffer at pValue.</param>
/// <param name="pValue">Pointer to a byte array containing the value of the setting. The type of data
/// stored in this buffer is specified by Type.</param>
/// <param name="cbLength">Size of pValue in bytes.</param>
new void SetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[In] WMT_ATTR_DATATYPE Type,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] byte[] pValue,
[In] uint cbLength);
/// <summary>
/// Retrieves the number of outputs in the file.
/// </summary>
/// <param name="pcOutputs">Pointer to a DWORD that receives the number of outputs in the file.</param>
new void GetOutputCount([Out] out uint pcOutputs);
/// <summary>
/// Retrieves the current properties of an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="ppOutput">Pointer to a pointer to an IWMOutputMediaProps interface, which is created by
/// a successful call to this method.</param>
new void GetOutputProps([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppOutput);
/// <summary>
/// Sets the properties of an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pOutput">Pointer to an IWMOutputMediaProps interface.</param>
new void SetOutputProps([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Interface)] IWMOutputMediaProps pOutput);
/// <summary>
/// Retrieves the number of formats supported by an output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number for which you want to determine the
/// number of supported formats.</param>
/// <param name="pcFormats">Pointer to a DWORD that receives the number of supported formats.</param>
new void GetOutputFormatCount([In] uint dwOutputNum, [Out] out uint pcFormats);
/// <summary>
/// Retrieves one output format for one output in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="dwFormatNum">DWORD containing the format number.</param>
/// <param name="ppProps">Pointer to a pointer to an IWMOutputMediaProps interface. This object is
/// created by a successful call to this method.</param>
new void GetOutputFormat([In] uint dwOutputNum,
[In] uint dwFormatNum,
[Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppProps);
/// <summary>
/// Retrieves the output number that corresponds to a stream in the file.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number for which you want to retrieve
/// the corresponding output number.</param>
/// <param name="pdwOutputNum">Pointer to a DWORD that will receive the output number that corresponds
/// to the stream number specified in wStreamNum.</param>
new void GetOutputNumberForStream([In] ushort wStreamNum, [Out] out uint pdwOutputNum);
/// <summary>
/// Retrieves the current stream number that corresponds to an output number in the file.
/// </summary>
/// <param name="dwOutputNum">DWORD value specifying the output number for which you want to retrieve
/// a stream number.</param>
/// <param name="pwStreamNum">Pointer to a WORD value that receives the stream number that corresponds
/// to the output specified by dwOutput.</param>
new void GetStreamNumberForOutput([In] uint dwOutputNum, [Out] out ushort pwStreamNum);
/// <summary>
/// Retrieves the maximum sample size for an output in the file.
/// </summary>
/// <param name="dwOutput">DWORD containing the output number for which you want to retrieve
/// the maximum sample size.</param>
/// <param name="pcbMax">Pointer to a DWORD value that receives the maximum sample size, in bytes,
/// for the output specified in dwOutput.</param>
new void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum sample size for a stream in the file.
/// </summary>
/// <param name="wStream">WORD containing the stream number for which you want to retrieve the
/// maximum sample size.</param>
/// <param name="pcbMax">Pointer to a DWORD value that receives the maximum sample size, in bytes,
/// for the stream specified in wStream.</param>
new void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Opens a stream for reading.
/// </summary>
/// <param name="pStream">Pointer to an IStream interface.</param>
new void OpenStream([In, MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IStream pStream);
/// <summary>
/// Sets a start time and duration for playback using SMPTE time codes.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pStart">Pointer to a WMT_TIMECODE_EXTENSION_DATA structure containing
/// the starting time code.</param>
/// <param name="pEnd">Pointer to a WMT_TIMECODE_EXTENSION_DATA structure containing
/// the ending time code.</param>
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetRangeByTimecode([In] ushort wStreamNum,
[In] ref WMT_TIMECODE_EXTENSION_DATA pStart,
[In] ref WMT_TIMECODE_EXTENSION_DATA pEnd);
/// <summary>
/// Enables you to play a portion of a file specified by frame numbers.
/// </summary>
/// <param name="wStreamNum">Stream number.</param>
/// <param name="qwFrameNumber">Frame number at which to begin playback. The first frame in a file is number 1.</param>
/// <param name="cFramesToRead">Count of frames to read. Pass 0 to continue playback to the end of the file.</param>
/// <param name="pcnsStartTime">Start time in 100-nanosecond units.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
void SetRangeByFrameEx([In] ushort wStreamNum,
[In] ulong qwFrameNumber,
[In] long cFramesToRead,
[Out] out ulong pcnsStartTime);
/// <summary>
/// Sets an IWMReaderAllocatorEx interface for allocating output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pAllocator">Pointer to an IWMReaderAllocatorEx interface implemented in
/// your application.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetAllocateForOutput([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Interface)] IWMReaderAllocatorEx pAllocator);
/// <summary>
/// Retrieves an IWMReaderAllocatorEx interface for allocating output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="ppAllocator">Pointer to a pointer to an IWMReaderAllocatorEx interface.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetAllocateForOutput([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Interface)] out IWMReaderAllocatorEx ppAllocator);
/// <summary>
/// Sets an IWMReaderAllocatorEx interface for allocating stream samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.</param>
/// <param name="pAllocator">Pointer to an IWMReaderAllocatorEx interface implemented
/// in your application.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetAllocateForStream([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Interface)] IWMReaderAllocatorEx pAllocator);
/// <summary>
/// Retrieves an IWMReaderAllocatorEx interface for allocating stream samples.
/// </summary>
/// <param name="dwSreamNum">DWORD containing the stream number.</param>
/// <param name="ppAllocator">Pointer to a pointer to an IWMReaderAllocatorEx interface.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetAllocateForStream([In] ushort dwSreamNum, [Out, MarshalAs(UnmanagedType.Interface)] out IWMReaderAllocatorEx ppAllocator);
}
/// <summary>
/// The IWMReaderCallback is implemented by the application to handle data being read from a file.
/// A pointer to the interface is passed to IWMReader.Open.
///
/// Methods
///
/// The IWMReaderCallback interface inherits from IWMStatusCallback.
/// </summary>
[ComImport]
[Guid("96406BD8-2B2B-11d3-B36B-00C04F6108FF")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderCallback : IWMStatusCallback
{
/// <summary>
/// Called when status information must be communicated to the host application. This happens routinely
/// when an ASF file is being opened and read, and when errors occur during reading.
/// </summary>
/// <param name="Status">One member of the WMT_STATUS enumeration type. For a description of possible
/// WMT_STATUS values, see the tables in the Remarks section.</param>
/// <param name="hr">HRESULT error code. If this indicates failure, you should not process the status as normal,
/// as some error has occurred. Use if (FAILED(hr)) to check for a failed value. See the topic Error Codes
/// for a list of possible results.</param>
/// <param name="dwType">Member of the WMT_ATTR_DATATYPE enumeration type. This value specifies
/// the type of data in the buffer at pValue.</param>
/// <param name="pValue">Pointer to a byte array containing the value. The contents of this array
/// depend on the value of Status and the value of dwType.</param>
/// <param name="pvContext">Generic pointer provided by the application, for its own use. This pointer matches
/// the context pointer given to the IWMReader::Open, IWMIndexer.StartIndexing, and other methods.
/// The SDK makes no assumptions about the use of this pointer; it is simply provided by the application
/// and passed back to the application when a callback is made.</param>
new void OnStatus([In] WMT_STATUS Status,
[In] IntPtr hr,
[In] WMT_ATTR_DATATYPE dwType,
[In] IntPtr pValue,
[In] IntPtr pvContext);
/// <summary>
/// Called during the reading of a file (due to a Start call) indicating that new uncompressed data
/// is available.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the number of the output to which the sample belongs.</param>
/// <param name="cnsSampleTime">QWORD containing the sample time, in 100-nanosecond units.</param>
/// <param name="cnsSampleDuration">QWORD containing the sample duration, in 100-nanosecond units. For video
/// streams, if the SampleDuration data unit extension was set on this sample when the file was created,
/// then this parameter will contain that value. For more information on SampleDuration ,
/// see INSSBuffer3.GetProperty.</param>
/// <param name="dwFlags">he flags that can be specified in dwFlags have the following uses.</param>
/// <param name="pSample">Pointer to the INSSBuffer interface of an object containing the sample.
/// The reader calls SAFE_RELEASE on this pointer after your OnSample method returns. You can call
/// AddRef on this pointer if you need to keep a reference count on the buffer. Do not call Release
/// on this pointer unless you have called AddRef.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is the context
/// pointer given to the IWMReader::Start method.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms")]
void OnSample([In] uint dwOutputNum,
[In] ulong cnsSampleTime,
[In] ulong cnsSampleDuration,
[In] uint dwFlags,
[In, MarshalAs(UnmanagedType.Interface)] INSSBuffer pSample,
[In] IntPtr pvContext);
}
/// <summary>
/// The IWMReader interface is used to open, close, start, pause, resume, and unlock the WMReader object.
/// It is also used to stop reading files, and to get and set the output properties.
///
/// Many of the methods in this interface are asynchronous and send status notifications to the application
/// through an IWMStatusCallback::OnStatus method implemented in the application.
/// Methods
///
/// The IWMReader interface inherits the methods of the IUnknown interface.
/// </summary>
[ComImport]
[Guid("96406BD6-2B2B-11d3-B36B-00C04F6108FF")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReader
{
/// <summary>
/// Opens an ASF file for reading.
/// </summary>
/// <param name="pwszURL">Pointer to a wide-character null-terminated string containing the path and name
/// of the file to be opened. This method accepts a path to a folder on a local machine, a path to
/// a network share, or a uniform resource locator (URL).</param>
/// <param name="pCallback">Pointer to the object that implements the IWMReaderCallback interface.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This is passed to the application
/// in calls to OnStatus.</param>
[SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void Open([In, MarshalAs(UnmanagedType.LPWStr)] string pwszURL,
[In, MarshalAs(UnmanagedType.Interface)] IWMReaderCallback pCallback,
[In] IntPtr pvContext);
/// <summary>
/// Deletes all outputs on the reader and releases the file resources.
/// </summary>
void Close();
/// <summary>
/// Retrieves the number of uncompressed media streams sent from the reader.
/// </summary>
/// <param name="pcOutputs">Pointer to a count of outputs.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void GetOutputCount([Out] out uint pcOutputs);
/// <summary>
/// Retrieves the current properties of an uncompressed output stream.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="ppOutput">Pointer to a pointer to an IWMOutputMediaProps interface. This interface belongs to
/// an output media properties object created by a successful call to this method. Any changes made to
/// the output media properties object will have no effect on the output of the reader unless you pass
/// this interface in a call to IWMReader.SetOutputProps.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputProps([In] uint dwOutputNum,
[Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppOutput);
/// <summary>
/// Specifies the properties of an uncompressed output stream.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pOutput">Pointer to an IWMOutputMediaProps interface.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetOutputProps([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.Interface)] IWMOutputMediaProps pOutput);
/// <summary>
/// Retrieves the number of format types supported by this output media stream on the reader.
/// </summary>
/// <param name="dwOutputNumber">DWORD containing the output number.</param>
/// <param name="pcFormats">Pointer to a count of formats.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputFormatCount([In] uint dwOutputNumber, [Out] out uint pcFormats);
/// <summary>
/// Retrieves the supported formats for a specified output media stream.
/// </summary>
/// <param name="dwOutputNumber">DWORD containing the output number.</param>
/// <param name="dwFormatNumber">DWORD containing the format number.</param>
/// <param name="ppProps">Pointer to a pointer to an IWMOutputMediaProps interface. This interface belongs
/// to an output media properties object created by a successful call to this method. The properties
/// exposed by this interface represent formats than can be supported by the specified output;
/// the current properties set for the output can be obtained by calling IWMReader.GetOutputProps.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputFormat([In] uint dwOutputNumber,
[In] uint dwFormatNumber,
[Out, MarshalAs(UnmanagedType.Interface)] out IWMOutputMediaProps ppProps);
/// <summary>
/// Starts reading from the current time offset. Uncompressed data is passed to IWMReaderCallback.OnSample.
/// </summary>
/// <param name="cnsStart">Time within the file at which to start reading, in 100-nanosecond units.
/// If cnsStart is set to WM_START_CURRENTPOSITION, playback starts from the current position.</param>
/// <param name="cnsDuration">Duration of the read in 100-nanosecond units, or zero to read to the end
/// of the file.</param>
/// <param name="fRate">Playback speed. Normal speed is 1.0. Higher numbers cause faster playback,
/// and numbers less than zero indicate reverse rate (rewinding). The valid ranges are 1.0 through 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is passed back to
/// the OnSample method.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void Start([In] ulong cnsStart,
[In] ulong cnsDuration,
[In] float fRate,
[In] IntPtr pvContext);
/// <summary>
/// Stops reading, after which there is no current read position.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
void Stop();
/// <summary>
/// Pauses the current read operation.
/// </summary>
void Pause();
/// <summary>
/// Restarts read operation from the current time offset.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")]
void Resume();
}
/// <summary>
/// A call to QueryInterface from a reader object exposes the advanced functionality described in this
/// section.
/// Methods
///
/// The IWMReaderAdvanced interface inherits the methods of the IUnknown interface.
/// </summary>
[ComImport]
[Guid("96406BEA-2B2B-11d3-B36B-00C04F6108FF")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderAdvanced
{
/// <summary>
/// Specifies that a clock provided by the application is to be used.
/// </summary>
/// <param name="fUserClock">Boolean value that is True if an application-provided clock is to be used.</param>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetUserProvidedClock([In, MarshalAs(UnmanagedType.Bool)] bool fUserClock);
/// <summary>
/// Ascertains whether a user-provided clock has been specified.
/// </summary>
/// <param name="pfUserClock">Pointer to a Boolean value that is set to True if a user-provided clock has
/// been specified.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void GetUserProvidedClock([Out, MarshalAs(UnmanagedType.Bool)] out bool pfUserClock);
/// <summary>
/// Provides the reader with a clock time. This is used only when the application is providing the clock.
/// </summary>
/// <param name="cnsTime">The time, in 100-nanosecond units.</param>
void DeliverTime([In] ulong cnsTime);
/// <summary>
/// Specifies whether stream selection is to be controlled manually.
/// </summary>
/// <param name="fSelection">Boolean value that is True if manual selection is specified.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetManualStreamSelection([In, MarshalAs(UnmanagedType.Bool)] bool fSelection);
/// <summary>
/// Ascertains whether manual stream selection has been specified.
/// </summary>
/// <param name="pfSelection">Pointer to a Boolean value that is True if manual selection has
/// been specified.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void GetManualStreamSelection([Out, MarshalAs(UnmanagedType.Bool)] out bool pfSelection);
/// <summary>
/// Enables the selected state of a stream to be changed.
/// </summary>
/// <param name="cStreamCount">WORD containing the count of stream numbers in the pwStreamNumbers array.</param>
/// <param name="pwStreamNumbers">Pointer to an array containing the stream numbers. Stream numbers are
/// in the range of 1 through 63.</param>
/// <param name="pSelections">Pointer to an array, of equal length to pwStreamNumbers, with each entry
/// containing one member of the WMT_STREAM_SELECTION enumeration type.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Ascertains whether a particular stream is currently selected. This can be used only when manual stream
/// selection is specified.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1
/// through 63.</param>
/// <param name="pSelection">Pointer to one member of the WMT_STREAM_SELECTION enumeration type.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetStreamSelected([In] ushort wStreamNum, [Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Specifies a flag indicating whether receiving selection callbacks is to be activated.
/// </summary>
/// <param name="fGetCallbacks">Boolean value that is True if stream selections must generate callbacks.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetReceiveSelectionCallbacks([In, MarshalAs(UnmanagedType.Bool)] bool fGetCallbacks);
/// <summary>
/// Retrieves a flag that indicates whether receiving stream selection notifications has been specified.
/// </summary>
/// <param name="pfGetCallbacks">Pointer to a Boolean value that is set to True if stream selection
/// notifications are sent to IWMReaderCallbackAdvanced.OnStreamSelection.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void GetReceiveSelectionCallbacks([Out, MarshalAs(UnmanagedType.Bool)] out bool pfGetCallbacks);
/// <summary>
/// Specifies whether the reader must deliver compressed stream samples to the callback.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fReceiveStreamSamples">Boolean value that is True if stream samples are delivered.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetReceiveStreamSamples([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fReceiveStreamSamples);
/// <summary>
/// Ascertains whether the reader is configured to deliver stream samples (compressed samples).
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.
/// Stream numbers are in the range of 1 through 63.</param>
/// <param name="pfReceiveStreamSamples">Pointer to a Boolean value that is set to True if stream
/// samples are delivered to OnStreamSample.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetReceiveStreamSamples([In] ushort wStreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfReceiveStreamSamples);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="fAllocate">Boolean value that is True if the reader gets buffers from your application.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetAllocateForOutput([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the identifying number of the output media stream.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetAllocateForOutput([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for stream samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fAllocate">Boolean value that is True if the reader uses IWMReaderCallbackAdvanced
/// to allocate streams.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetAllocateForStream([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular stream.
/// </summary>
/// <param name="dwSreamNum">WORD containing the stream number.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetAllocateForStream([In] ushort dwSreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Retrieves the current reader statistics.
/// </summary>
/// <param name="pStatistics">Pointer to a WM_READER_STATISTICS structure.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetStatistics([In, Out] ref WM_READER_STATISTICS pStatistics);
/// <summary>
/// Sets client-side information used for logging.
/// </summary>
/// <param name="pClientInfo">Pointer to a WM_READER_CLIENTINFO structure allocated by the caller,
/// which contains information about the client.</param>
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SetClientInfo([In] ref WM_READER_CLIENTINFO pClientInfo);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for output samples for a specified media stream.
/// </summary>
/// <param name="dwOutput">DWORD specifying the output media stream.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for stream samples for a specified media stream.
/// </summary>
/// <param name="wStream">Stream number.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Used to notify the reader that it is delivering data to the application too slowly.
/// </summary>
/// <param name="cnsLateness">QWORD indicating how late the data is, in 100-nanosecond units.</param>
void NotifyLateDelivery(ulong cnsLateness);
}
/// <summary>
/// The IWMReaderAdvanced2 interface provides additional advanced methods for a reader object.
///
/// Methods
///
/// The IWMReaderAdvanced2 interface inherits from IWMReaderAdvanced.
/// </summary>
[ComImport]
[Guid("ae14a945-b90c-4d0d-9127-80d665f7d73e")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderAdvanced2 : IWMReaderAdvanced
{
/// <summary>
/// Specifies that a clock provided by the application is to be used.
/// </summary>
/// <param name="fUserClock">Boolean value that is True if an application-provided clock is to be used.</param>
new void SetUserProvidedClock([In, MarshalAs(UnmanagedType.Bool)] bool fUserClock);
/// <summary>
/// Ascertains whether a user-provided clock has been specified.
/// </summary>
/// <param name="pfUserClock">Pointer to a Boolean value that is set to True if a user-provided clock has
/// been specified.</param>
new void GetUserProvidedClock([Out, MarshalAs(UnmanagedType.Bool)] out bool pfUserClock);
/// <summary>
/// Provides the reader with a clock time. This is used only when the application is providing the clock.
/// </summary>
/// <param name="cnsTime">The time, in 100-nanosecond units.</param>
new void DeliverTime([In] ulong cnsTime);
/// <summary>
/// Specifies whether stream selection is to be controlled manually.
/// </summary>
/// <param name="fSelection">Boolean value that is True if manual selection is specified.</param>
new void SetManualStreamSelection([In, MarshalAs(UnmanagedType.Bool)] bool fSelection);
/// <summary>
/// Ascertains whether manual stream selection has been specified.
/// </summary>
/// <param name="pfSelection">Pointer to a Boolean value that is True if manual selection has
/// been specified.</param>
new void GetManualStreamSelection([Out, MarshalAs(UnmanagedType.Bool)] out bool pfSelection);
/// <summary>
/// Enables the selected state of a stream to be changed.
/// </summary>
/// <param name="cStreamCount">WORD containing the count of stream numbers in the pwStreamNumbers array.</param>
/// <param name="pwStreamNumbers">Pointer to an array containing the stream numbers. Stream numbers are
/// in the range of 1 through 63.</param>
/// <param name="pSelections">Pointer to an array, of equal length to pwStreamNumbers, with each entry
/// containing one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Ascertains whether a particular stream is currently selected. This can be used only when manual stream
/// selection is specified.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1
/// through 63.</param>
/// <param name="pSelection">Pointer to one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void GetStreamSelected([In] ushort wStreamNum, [Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Specifies a flag indicating whether receiving selection callbacks is to be activated.
/// </summary>
/// <param name="fGetCallbacks">Boolean value that is True if stream selections must generate callbacks.</param>
new void SetReceiveSelectionCallbacks([In, MarshalAs(UnmanagedType.Bool)] bool fGetCallbacks);
/// <summary>
/// Retrieves a flag that indicates whether receiving stream selection notifications has been specified.
/// </summary>
/// <param name="pfGetCallbacks">Pointer to a Boolean value that is set to True if stream selection
/// notifications are sent to IWMReaderCallbackAdvanced.OnStreamSelection.</param>
new void GetReceiveSelectionCallbacks([Out, MarshalAs(UnmanagedType.Bool)] out bool pfGetCallbacks);
/// <summary>
/// Specifies whether the reader must deliver compressed stream samples to the callback.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fReceiveStreamSamples">Boolean value that is True if stream samples are delivered.</param>
new void SetReceiveStreamSamples([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fReceiveStreamSamples);
/// <summary>
/// Ascertains whether the reader is configured to deliver stream samples (compressed samples).
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.
/// Stream numbers are in the range of 1 through 63.</param>
/// <param name="pfReceiveStreamSamples">Pointer to a Boolean value that is set to True if stream
/// samples are delivered to OnStreamSample.</param>
new void GetReceiveStreamSamples([In] ushort wStreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfReceiveStreamSamples);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="fAllocate">Boolean value that is True if the reader gets buffers from your application.</param>
new void SetAllocateForOutput([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the identifying number of the output media stream.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForOutput([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for stream samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fAllocate">Boolean value that is True if the reader uses IWMReaderCallbackAdvanced
/// to allocate streams.</param>
new void SetAllocateForStream([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular stream.
/// </summary>
/// <param name="dwSreamNum">WORD containing the stream number.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForStream([In] ushort dwSreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Retrieves the current reader statistics.
/// </summary>
/// <param name="pStatistics">Pointer to a WM_READER_STATISTICS structure.</param>
new void GetStatistics([In, Out] ref WM_READER_STATISTICS pStatistics);
/// <summary>
/// Sets client-side information used for logging.
/// </summary>
/// <param name="pClientInfo">Pointer to a WM_READER_CLIENTINFO structure allocated by the caller,
/// which contains information about the client.</param>
new void SetClientInfo([In] ref WM_READER_CLIENTINFO pClientInfo);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for output samples for a specified media stream.
/// </summary>
/// <param name="dwOutput">DWORD specifying the output media stream.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for stream samples for a specified media stream.
/// </summary>
/// <param name="wStream">Stream number.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Used to notify the reader that it is delivering data to the application too slowly.
/// </summary>
/// <param name="cnsLateness">QWORD indicating how late the data is, in 100-nanosecond units.</param>
new void NotifyLateDelivery(ulong cnsLateness);
/// <summary>
/// Specifies the current play mode.
/// </summary>
/// <param name="Mode">Variable containing one member of the WMT_PLAY_MODE enumeration type.</param>
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void SetPlayMode([In] WMT_PLAY_MODE Mode);
/// <summary>
/// Retrieves the current play mode.
/// </summary>
/// <param name="Mode">Pointer to a variable that receives a member of the WMT_PLAY_MODE
/// enumeration type.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetPlayMode([Out] out WMT_PLAY_MODE pMode);
/// <summary>
/// Retrieves the percentage of data that has been buffered, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been
/// buffered.</param>
/// <param name="pcnsBuffering">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// until all the buffering is completed.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetBufferProgress([Out] out uint pdwPercent, [Out] out ulong pcnsBuffering);
/// <summary>
/// Retrieves the percentage and amount of data that has been downloaded, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been downloaded.</param>
/// <param name="pqwBytesDownloaded">Pointer to a QWORD containing the number of bytes of data downloaded.</param>
/// <param name="pcnsDownload">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// for data to be downloaded.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetDownloadProgress([Out] out uint pdwPercent,
[Out] out ulong pqwBytesDownloaded,
[Out] out ulong pcnsDownload);
/// <summary>
/// Retrieves the percentage of data that has been saved.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been saved.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetSaveAsProgress([Out] out uint pdwPercent);
/// <summary>
/// Saves the current file.
/// </summary>
/// <param name="pwszFilename">Pointer to a wide-character null-terminated string containing the file name.</param>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SaveFileAs([In, MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
/// <summary>
/// Retrieves the name of the protocol that is currently being used.
/// </summary>
/// <param name="pwszProtocol">Pointer to a buffer that receives a string containing the protocol name.
/// Pass NULL to retrieve the length of the name.</param>
/// <param name="pcchProtocol">On input, pointer to a variable containing the length of pwszProtocol,
/// in characters. On output, the variable contains the length of the name, including
/// the terminating null character.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetProtocolName([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszProtocol,
[In, Out] ref uint pcchProtocol);
/// <summary>
/// Starts the reader from a specified marker.
/// </summary>
/// <param name="wMarkerIndex">WORD containing the marker index.</param>
/// <param name="cnsDuration">Specifies the duration, in 100-nanosecond units.</param>
/// <param name="fRate">Floating point number indicating rate. Normal-speed playback is 1.0; higher numbers
/// cause faster playback. Numbers less than zero indicate reverse rate (rewinding).
/// The valid range is 1.0 through 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void StartAtMarker([In] ushort wMarkerIndex,
[In] ulong cnsDuration,
[In] float fRate,
[In] IntPtr pvContext);
/// <summary>
/// Retrieves a setting for a particular output by name.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the setting name.
/// For a list of global constants representing setting names, see Output Settings.</param>
/// <param name="pType">Pointer to a member of the WMT_ATTR_DATATYPE enumeration type that specifies
/// the type of the value.</param>
/// <param name="pValue">Pointer to a byte buffer containing the value. Pass NULL to retrieve the length
/// of the buffer required.</param>
/// <param name="pcbLength">On input, pointer to a variable containing the length of pValue. On output,
/// the variable contains the number of bytes in pValue.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[Out] out WMT_ATTR_DATATYPE pType,
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] pValue,
[In, Out] ref ushort pcbLength);
/// <summary>
/// Specifies a named setting for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the name.
/// For a list of global constants that represent setting names, see Output Settings.</param>
/// <param name="Type">Member of the WMT_ATTR_DATATYPE enumeration type that specifies the type of the value.</param>
/// <param name="pValue">Pointer to a byte array containing the value.</param>
/// <param name="cbLength">Size of pValue.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void SetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[In] WMT_ATTR_DATATYPE Type,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] byte[] pValue,
[In] ushort cbLength);
/// <summary>
/// Begins prerolling the reader.
/// </summary>
/// <param name="cnsStart">Specifies the start time in 100-nanosecond units.</param>
/// <param name="cnsDuration">Specifies the duration in 100-nanosecond units.</param>
/// <param name="fRate">Specifies the data rate.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void Preroll([In] ulong cnsStart,
[In] ulong cnsDuration,
[In] float fRate);
/// <summary>
/// Specifies whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="fLogClientID"></param>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void SetLogClientID([In, MarshalAs(UnmanagedType.Bool)] bool fLogClientID);
/// <summary>
/// Queries whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="pfLogClientID">Pointer Boolean value that is set to True if the client's log
/// ID must be sent to the server.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void GetLogClientID([Out, MarshalAs(UnmanagedType.Bool)] out bool pfLogClientID);
/// <summary>
/// Requests that the reader stops buffering as soon as possible.
/// </summary>
void StopBuffering();
/// <summary>
/// Opens a Windows Media stream for reading.
/// </summary>
/// <param name="pStream">Pointer to an IStream interface.</param>
/// <param name="pCallback">Pointer to an IWMReaderCallback interface.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This is passed to the application
/// in calls to IWMReaderCallback.OnStatus.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void OpenStream([In, MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IStream pStream,
[In, MarshalAs(UnmanagedType.Interface)] IWMReaderCallback pCallback,
[In] IntPtr pvContext);
}
/// <summary>
/// The IWMReaderAdvanced3 interface provides additional functionality to the reader object. It contains
/// methods that enhance the ability to playback a file.
///
/// IWMReaderAdvanced3 exists for each instance of the reader objects created with the WMCreateReader function.
///
/// Methods
///
/// The IWMReaderAdvanced3 interface inherits from IWMReaderAdvanced2.
/// </summary>
[ComImport]
[Guid("5DC0674B-F04B-4a4e-9F2A-B1AFDE2C8100")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderAdvanced3 : IWMReaderAdvanced2
{
/// <summary>
/// Specifies that a clock provided by the application is to be used.
/// </summary>
/// <param name="fUserClock">Boolean value that is True if an application-provided clock is to be used.</param>
new void SetUserProvidedClock([In, MarshalAs(UnmanagedType.Bool)] bool fUserClock);
/// <summary>
/// Ascertains whether a user-provided clock has been specified.
/// </summary>
/// <param name="pfUserClock">Pointer to a Boolean value that is set to True if a user-provided clock has
/// been specified.</param>
new void GetUserProvidedClock([Out, MarshalAs(UnmanagedType.Bool)] out bool pfUserClock);
/// <summary>
/// Provides the reader with a clock time. This is used only when the application is providing the clock.
/// </summary>
/// <param name="cnsTime">The time, in 100-nanosecond units.</param>
new void DeliverTime([In] ulong cnsTime);
/// <summary>
/// Specifies whether stream selection is to be controlled manually.
/// </summary>
/// <param name="fSelection">Boolean value that is True if manual selection is specified.</param>
new void SetManualStreamSelection([In, MarshalAs(UnmanagedType.Bool)] bool fSelection);
/// <summary>
/// Ascertains whether manual stream selection has been specified.
/// </summary>
/// <param name="pfSelection">Pointer to a Boolean value that is True if manual selection has
/// been specified.</param>
new void GetManualStreamSelection([Out, MarshalAs(UnmanagedType.Bool)] out bool pfSelection);
/// <summary>
/// Enables the selected state of a stream to be changed.
/// </summary>
/// <param name="cStreamCount">WORD containing the count of stream numbers in the pwStreamNumbers array.</param>
/// <param name="pwStreamNumbers">Pointer to an array containing the stream numbers. Stream numbers are
/// in the range of 1 through 63.</param>
/// <param name="pSelections">Pointer to an array, of equal length to pwStreamNumbers, with each entry
/// containing one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Ascertains whether a particular stream is currently selected. This can be used only when manual stream
/// selection is specified.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1
/// through 63.</param>
/// <param name="pSelection">Pointer to one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void GetStreamSelected([In] ushort wStreamNum, [Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Specifies a flag indicating whether receiving selection callbacks is to be activated.
/// </summary>
/// <param name="fGetCallbacks">Boolean value that is True if stream selections must generate callbacks.</param>
new void SetReceiveSelectionCallbacks([In, MarshalAs(UnmanagedType.Bool)] bool fGetCallbacks);
/// <summary>
/// Retrieves a flag that indicates whether receiving stream selection notifications has been specified.
/// </summary>
/// <param name="pfGetCallbacks">Pointer to a Boolean value that is set to True if stream selection
/// notifications are sent to IWMReaderCallbackAdvanced.OnStreamSelection.</param>
new void GetReceiveSelectionCallbacks([Out, MarshalAs(UnmanagedType.Bool)] out bool pfGetCallbacks);
/// <summary>
/// Specifies whether the reader must deliver compressed stream samples to the callback.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fReceiveStreamSamples">Boolean value that is True if stream samples are delivered.</param>
new void SetReceiveStreamSamples([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fReceiveStreamSamples);
/// <summary>
/// Ascertains whether the reader is configured to deliver stream samples (compressed samples).
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.
/// Stream numbers are in the range of 1 through 63.</param>
/// <param name="pfReceiveStreamSamples">Pointer to a Boolean value that is set to True if stream
/// samples are delivered to OnStreamSample.</param>
new void GetReceiveStreamSamples([In] ushort wStreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfReceiveStreamSamples);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="fAllocate">Boolean value that is True if the reader gets buffers from your application.</param>
new void SetAllocateForOutput([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the identifying number of the output media stream.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForOutput([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for stream samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fAllocate">Boolean value that is True if the reader uses IWMReaderCallbackAdvanced
/// to allocate streams.</param>
new void SetAllocateForStream([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular stream.
/// </summary>
/// <param name="dwSreamNum">WORD containing the stream number.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForStream([In] ushort dwSreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Retrieves the current reader statistics.
/// </summary>
/// <param name="pStatistics">Pointer to a WM_READER_STATISTICS structure.</param>
new void GetStatistics([In, Out] ref WM_READER_STATISTICS pStatistics);
/// <summary>
/// Sets client-side information used for logging.
/// </summary>
/// <param name="pClientInfo">Pointer to a WM_READER_CLIENTINFO structure allocated by the caller,
/// which contains information about the client.</param>
new void SetClientInfo([In] ref WM_READER_CLIENTINFO pClientInfo);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for output samples for a specified media stream.
/// </summary>
/// <param name="dwOutput">DWORD specifying the output media stream.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for stream samples for a specified media stream.
/// </summary>
/// <param name="wStream">Stream number.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Used to notify the reader that it is delivering data to the application too slowly.
/// </summary>
/// <param name="cnsLateness">QWORD indicating how late the data is, in 100-nanosecond units.</param>
new void NotifyLateDelivery(ulong cnsLateness);
/// <summary>
/// Specifies the current play mode.
/// </summary>
/// <param name="Mode">Variable containing one member of the WMT_PLAY_MODE enumeration type.</param>
new void SetPlayMode([In] WMT_PLAY_MODE Mode);
/// <summary>
/// Retrieves the current play mode.
/// </summary>
/// <param name="Mode">Pointer to a variable that receives a member of the WMT_PLAY_MODE
/// enumeration type.</param>
new void GetPlayMode([Out] out WMT_PLAY_MODE pMode);
/// <summary>
/// Retrieves the percentage of data that has been buffered, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been
/// buffered.</param>
/// <param name="pcnsBuffering">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// until all the buffering is completed.</param>
new void GetBufferProgress([Out] out uint pdwPercent, [Out] out ulong pcnsBuffering);
/// <summary>
/// Retrieves the percentage and amount of data that has been downloaded, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been downloaded.</param>
/// <param name="pqwBytesDownloaded">Pointer to a QWORD containing the number of bytes of data downloaded.</param>
/// <param name="pcnsDownload">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// for data to be downloaded.</param>
new void GetDownloadProgress([Out] out uint pdwPercent,
[Out] out ulong pqwBytesDownloaded,
[Out] out ulong pcnsDownload);
/// <summary>
/// Retrieves the percentage of data that has been saved.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been saved.</param>
new void GetSaveAsProgress([Out] out uint pdwPercent);
/// <summary>
/// Saves the current file.
/// </summary>
/// <param name="pwszFilename">Pointer to a wide-character null-terminated string containing the file name.</param>
new void SaveFileAs([In, MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
/// <summary>
/// Retrieves the name of the protocol that is currently being used.
/// </summary>
/// <param name="pwszProtocol">Pointer to a buffer that receives a string containing the protocol name.
/// Pass NULL to retrieve the length of the name.</param>
/// <param name="pcchProtocol">On input, pointer to a variable containing the length of pwszProtocol,
/// in characters. On output, the variable contains the length of the name, including
/// the terminating null character.</param>
new void GetProtocolName([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszProtocol,
[In, Out] ref uint pcchProtocol);
/// <summary>
/// Starts the reader from a specified marker.
/// </summary>
/// <param name="wMarkerIndex">WORD containing the marker index.</param>
/// <param name="cnsDuration">Specifies the duration, in 100-nanosecond units.</param>
/// <param name="fRate">Floating point number indicating rate. Normal-speed playback is 1.0; higher numbers
/// cause faster playback. Numbers less than zero indicate reverse rate (rewinding).
/// The valid range is 1.0 through 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application.</param>
new void StartAtMarker([In] ushort wMarkerIndex,
[In] ulong cnsDuration,
[In] float fRate,
[In] IntPtr pvContext);
/// <summary>
/// Retrieves a setting for a particular output by name.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the setting name.
/// For a list of global constants representing setting names, see Output Settings.</param>
/// <param name="pType">Pointer to a member of the WMT_ATTR_DATATYPE enumeration type that specifies
/// the type of the value.</param>
/// <param name="pValue">Pointer to a byte buffer containing the value. Pass NULL to retrieve the length
/// of the buffer required.</param>
/// <param name="pcbLength">On input, pointer to a variable containing the length of pValue. On output,
/// the variable contains the number of bytes in pValue.</param>
new void GetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[Out] out WMT_ATTR_DATATYPE pType,
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] pValue,
[In, Out] ref ushort pcbLength);
/// <summary>
/// Specifies a named setting for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the name.
/// For a list of global constants that represent setting names, see Output Settings.</param>
/// <param name="Type">Member of the WMT_ATTR_DATATYPE enumeration type that specifies the type of the value.</param>
/// <param name="pValue">Pointer to a byte array containing the value.</param>
/// <param name="cbLength">Size of pValue.</param>
new void SetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[In] WMT_ATTR_DATATYPE Type,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] byte[] pValue,
[In] ushort cbLength);
/// <summary>
/// Begins prerolling the reader.
/// </summary>
/// <param name="cnsStart">Specifies the start time in 100-nanosecond units.</param>
/// <param name="cnsDuration">Specifies the duration in 100-nanosecond units.</param>
/// <param name="fRate">Specifies the data rate.</param>
new void Preroll([In] ulong cnsStart,
[In] ulong cnsDuration,
[In] float fRate);
/// <summary>
/// Specifies whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="fLogClientID"></param>
new void SetLogClientID([In, MarshalAs(UnmanagedType.Bool)] bool fLogClientID);
/// <summary>
/// Queries whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="pfLogClientID">Pointer Boolean value that is set to True if the client's log
/// ID must be sent to the server.</param>
new void GetLogClientID([Out, MarshalAs(UnmanagedType.Bool)] out bool pfLogClientID);
/// <summary>
/// Requests that the reader stops buffering as soon as possible.
/// </summary>
new void StopBuffering();
/// <summary>
/// Opens a Windows Media stream for reading.
/// </summary>
/// <param name="pStream">Pointer to an IStream interface.</param>
/// <param name="pCallback">Pointer to an IWMReaderCallback interface.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This is passed to the application
/// in calls to IWMReaderCallback.OnStatus.</param>
new void OpenStream([In, MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IStream pStream,
[In, MarshalAs(UnmanagedType.Interface)] IWMReaderCallback pCallback,
[In] IntPtr pvContext);
/// <summary>
/// Stops network streaming while received packets continue to be delivered.
/// </summary>
void StopNetStreaming();
/// <summary>
/// Provides the ability to specify a starting position using a variety of offsets.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number for which pvOffsetStart and pvDuration apply.
/// Passing zero signifies that the offset start and duration apply for all streams in the file.
/// If you pass zero, the only valid values for dwOffsetFormat are WMT_OFFSET_FORMAT_100NS and
/// WMT_OFFSET_FORMAT_PLAYLIST_OFFSET.</param>
/// <param name="pvOffsetStart">Void pointer to the address containing the offset start. The unit
/// of measurement for the offset is determined by dwOffsetFormat. The unit of measurement also dictates
/// the size of the variable pointed to.</param>
/// <param name="pvDuration">Void pointer to the address containing the duration of playback.
/// If zero is passed, playback will continue until the end of the file. The unit of measurement
/// for the duration is determined by dwOffsetFormat. The unit of measurement also dictates the size
/// of the variable pointed to.</param>
/// <param name="dwOffsetFormat">DWORD containing one member of the WMT_OFFSET_FORMAT enumeration type.</param>
/// <param name="fRate">Floating point number indicating playback rate. Normal-speed playback is 1.0;
/// higher numbers cause faster playback, and lower numbers cause slower playback.
/// Numbers less than zero indicate reverse rate (rewinding). The valid range is 1.0 through
/// 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is passed back
/// to the application on calls to IWMReaderCallback.</param>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void StartAtPosition([In] ushort wStreamNum,
[In] IntPtr pvOffsetStart,
[In] IntPtr pvDuration,
[In] WMT_OFFSET_FORMAT dwOffsetFormat,
[In] float fRate,
[In] IntPtr pvContext);
}
/// <summary>
/// The IWMReaderAdvanced4 interface provides additional functionality to the reader.
///
/// An IWMReaderAdvanced4 interface exists for every reader object. You can obtain a pointer to an instance
/// of this interface by calling the QueryInterface method of any other interface in the reader object.
///
/// Methods
///
/// The IWMReaderAdvanced4 interface inherits from IWMReaderAdvanced3.
/// </summary>
[ComImport]
[Guid("945A76A2-12AE-4d48-BD3C-CD1D90399B85")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IWMReaderAdvanced4 : IWMReaderAdvanced3
{
/// <summary>
/// Specifies that a clock provided by the application is to be used.
/// </summary>
/// <param name="fUserClock">Boolean value that is True if an application-provided clock is to be used.</param>
new void SetUserProvidedClock([In, MarshalAs(UnmanagedType.Bool)] bool fUserClock);
/// <summary>
/// Ascertains whether a user-provided clock has been specified.
/// </summary>
/// <param name="pfUserClock">Pointer to a Boolean value that is set to True if a user-provided clock has
/// been specified.</param>
new void GetUserProvidedClock([Out, MarshalAs(UnmanagedType.Bool)] out bool pfUserClock);
/// <summary>
/// Provides the reader with a clock time. This is used only when the application is providing the clock.
/// </summary>
/// <param name="cnsTime">The time, in 100-nanosecond units.</param>
new void DeliverTime([In] ulong cnsTime);
/// <summary>
/// Specifies whether stream selection is to be controlled manually.
/// </summary>
/// <param name="fSelection">Boolean value that is True if manual selection is specified.</param>
new void SetManualStreamSelection([In, MarshalAs(UnmanagedType.Bool)] bool fSelection);
/// <summary>
/// Ascertains whether manual stream selection has been specified.
/// </summary>
/// <param name="pfSelection">Pointer to a Boolean value that is True if manual selection has
/// been specified.</param>
new void GetManualStreamSelection([Out, MarshalAs(UnmanagedType.Bool)] out bool pfSelection);
/// <summary>
/// Enables the selected state of a stream to be changed.
/// </summary>
/// <param name="cStreamCount">WORD containing the count of stream numbers in the pwStreamNumbers array.</param>
/// <param name="pwStreamNumbers">Pointer to an array containing the stream numbers. Stream numbers are
/// in the range of 1 through 63.</param>
/// <param name="pSelections">Pointer to an array, of equal length to pwStreamNumbers, with each entry
/// containing one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void SetStreamsSelected([In] ushort cStreamCount,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ushort[] pwStreamNumbers,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] WMT_STREAM_SELECTION[] pSelections);
/// <summary>
/// Ascertains whether a particular stream is currently selected. This can be used only when manual stream
/// selection is specified.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1
/// through 63.</param>
/// <param name="pSelection">Pointer to one member of the WMT_STREAM_SELECTION enumeration type.</param>
new void GetStreamSelected([In] ushort wStreamNum, [Out] out WMT_STREAM_SELECTION pSelection);
/// <summary>
/// Specifies a flag indicating whether receiving selection callbacks is to be activated.
/// </summary>
/// <param name="fGetCallbacks">Boolean value that is True if stream selections must generate callbacks.</param>
new void SetReceiveSelectionCallbacks([In, MarshalAs(UnmanagedType.Bool)] bool fGetCallbacks);
/// <summary>
/// Retrieves a flag that indicates whether receiving stream selection notifications has been specified.
/// </summary>
/// <param name="pfGetCallbacks">Pointer to a Boolean value that is set to True if stream selection
/// notifications are sent to IWMReaderCallbackAdvanced.OnStreamSelection.</param>
new void GetReceiveSelectionCallbacks([Out, MarshalAs(UnmanagedType.Bool)] out bool pfGetCallbacks);
/// <summary>
/// Specifies whether the reader must deliver compressed stream samples to the callback.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fReceiveStreamSamples">Boolean value that is True if stream samples are delivered.</param>
new void SetReceiveStreamSamples([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fReceiveStreamSamples);
/// <summary>
/// Ascertains whether the reader is configured to deliver stream samples (compressed samples).
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number.
/// Stream numbers are in the range of 1 through 63.</param>
/// <param name="pfReceiveStreamSamples">Pointer to a Boolean value that is set to True if stream
/// samples are delivered to OnStreamSample.</param>
new void GetReceiveStreamSamples([In] ushort wStreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfReceiveStreamSamples);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for output samples.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="fAllocate">Boolean value that is True if the reader gets buffers from your application.</param>
new void SetAllocateForOutput([In] uint dwOutputNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the identifying number of the output media stream.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForOutput([In] uint dwOutputNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Specifies whether to allocate buffers from the user-supplied callback, or internally, for stream samples.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number. Stream numbers are in the range of 1 through 63.</param>
/// <param name="fAllocate">Boolean value that is True if the reader uses IWMReaderCallbackAdvanced
/// to allocate streams.</param>
new void SetAllocateForStream([In] ushort wStreamNum, [In, MarshalAs(UnmanagedType.Bool)] bool fAllocate);
/// <summary>
/// Ascertains whether the reader is configured to use the IWMReaderCallbackAdvanced interface to allocate
/// buffers for a particular stream.
/// </summary>
/// <param name="dwSreamNum">WORD containing the stream number.</param>
/// <param name="pfAllocate">Pointer to a Boolean value that is set to True if the reader uses
/// IWMReaderCallbackAdvanced to allocate samples.</param>
new void GetAllocateForStream([In] ushort dwSreamNum, [Out, MarshalAs(UnmanagedType.Bool)] out bool pfAllocate);
/// <summary>
/// Retrieves the current reader statistics.
/// </summary>
/// <param name="pStatistics">Pointer to a WM_READER_STATISTICS structure.</param>
new void GetStatistics([In, Out] ref WM_READER_STATISTICS pStatistics);
/// <summary>
/// Sets client-side information used for logging.
/// </summary>
/// <param name="pClientInfo">Pointer to a WM_READER_CLIENTINFO structure allocated by the caller,
/// which contains information about the client.</param>
new void SetClientInfo([In] ref WM_READER_CLIENTINFO pClientInfo);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for output samples for a specified media stream.
/// </summary>
/// <param name="dwOutput">DWORD specifying the output media stream.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxOutputSampleSize([In] uint dwOutput, [Out] out uint pcbMax);
/// <summary>
/// Retrieves the maximum buffer size to be allocated for stream samples for a specified media stream.
/// </summary>
/// <param name="wStream">Stream number.</param>
/// <param name="pcbMax">Pointer to the maximum buffer size to be allocated.</param>
new void GetMaxStreamSampleSize([In] ushort wStream, [Out] out uint pcbMax);
/// <summary>
/// Used to notify the reader that it is delivering data to the application too slowly.
/// </summary>
/// <param name="cnsLateness">QWORD indicating how late the data is, in 100-nanosecond units.</param>
new void NotifyLateDelivery(ulong cnsLateness);
/// <summary>
/// Specifies the current play mode.
/// </summary>
/// <param name="Mode">Variable containing one member of the WMT_PLAY_MODE enumeration type.</param>
new void SetPlayMode([In] WMT_PLAY_MODE Mode);
/// <summary>
/// Retrieves the current play mode.
/// </summary>
/// <param name="Mode">Pointer to a variable that receives a member of the WMT_PLAY_MODE
/// enumeration type.</param>
new void GetPlayMode([Out] out WMT_PLAY_MODE pMode);
/// <summary>
/// Retrieves the percentage of data that has been buffered, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been
/// buffered.</param>
/// <param name="pcnsBuffering">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// until all the buffering is completed.</param>
new void GetBufferProgress([Out] out uint pdwPercent, [Out] out ulong pcnsBuffering);
/// <summary>
/// Retrieves the percentage and amount of data that has been downloaded, and the time remaining to completion.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been downloaded.</param>
/// <param name="pqwBytesDownloaded">Pointer to a QWORD containing the number of bytes of data downloaded.</param>
/// <param name="pcnsDownload">Pointer to variable specifying the time remaining, in 100-nanosecond units,
/// for data to be downloaded.</param>
new void GetDownloadProgress([Out] out uint pdwPercent,
[Out] out ulong pqwBytesDownloaded,
[Out] out ulong pcnsDownload);
/// <summary>
/// Retrieves the percentage of data that has been saved.
/// </summary>
/// <param name="pdwPercent">Pointer to a DWORD containing the percentage of data that has been saved.</param>
new void GetSaveAsProgress([Out] out uint pdwPercent);
/// <summary>
/// Saves the current file.
/// </summary>
/// <param name="pwszFilename">Pointer to a wide-character null-terminated string containing the file name.</param>
new void SaveFileAs([In, MarshalAs(UnmanagedType.LPWStr)] string pwszFilename);
/// <summary>
/// Retrieves the name of the protocol that is currently being used.
/// </summary>
/// <param name="pwszProtocol">Pointer to a buffer that receives a string containing the protocol name.
/// Pass NULL to retrieve the length of the name.</param>
/// <param name="pcchProtocol">On input, pointer to a variable containing the length of pwszProtocol,
/// in characters. On output, the variable contains the length of the name, including
/// the terminating null character.</param>
new void GetProtocolName([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszProtocol,
[In, Out] ref uint pcchProtocol);
/// <summary>
/// Starts the reader from a specified marker.
/// </summary>
/// <param name="wMarkerIndex">WORD containing the marker index.</param>
/// <param name="cnsDuration">Specifies the duration, in 100-nanosecond units.</param>
/// <param name="fRate">Floating point number indicating rate. Normal-speed playback is 1.0; higher numbers
/// cause faster playback. Numbers less than zero indicate reverse rate (rewinding).
/// The valid range is 1.0 through 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application.</param>
new void StartAtMarker([In] ushort wMarkerIndex,
[In] ulong cnsDuration,
[In] float fRate,
[In] IntPtr pvContext);
/// <summary>
/// Retrieves a setting for a particular output by name.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the setting name.
/// For a list of global constants representing setting names, see Output Settings.</param>
/// <param name="pType">Pointer to a member of the WMT_ATTR_DATATYPE enumeration type that specifies
/// the type of the value.</param>
/// <param name="pValue">Pointer to a byte buffer containing the value. Pass NULL to retrieve the length
/// of the buffer required.</param>
/// <param name="pcbLength">On input, pointer to a variable containing the length of pValue. On output,
/// the variable contains the number of bytes in pValue.</param>
new void GetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[Out] out WMT_ATTR_DATATYPE pType,
[Out, MarshalAs(UnmanagedType.LPArray)] byte[] pValue,
[In, Out] ref ushort pcbLength);
/// <summary>
/// Specifies a named setting for a particular output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pszName">Pointer to a wide-character null-terminated string containing the name.
/// For a list of global constants that represent setting names, see Output Settings.</param>
/// <param name="Type">Member of the WMT_ATTR_DATATYPE enumeration type that specifies the type of the value.</param>
/// <param name="pValue">Pointer to a byte array containing the value.</param>
/// <param name="cbLength">Size of pValue.</param>
new void SetOutputSetting([In] uint dwOutputNum,
[In, MarshalAs(UnmanagedType.LPWStr)] string pszName,
[In] WMT_ATTR_DATATYPE Type,
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] byte[] pValue,
[In] ushort cbLength);
/// <summary>
/// Begins prerolling the reader.
/// </summary>
/// <param name="cnsStart">Specifies the start time in 100-nanosecond units.</param>
/// <param name="cnsDuration">Specifies the duration in 100-nanosecond units.</param>
/// <param name="fRate">Specifies the data rate.</param>
new void Preroll([In] ulong cnsStart,
[In] ulong cnsDuration,
[In] float fRate);
/// <summary>
/// Specifies whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="fLogClientID"></param>
new void SetLogClientID([In, MarshalAs(UnmanagedType.Bool)] bool fLogClientID);
/// <summary>
/// Queries whether the reader logs the client's unique ID or an anonymous session ID.
/// </summary>
/// <param name="pfLogClientID">Pointer Boolean value that is set to True if the client's log
/// ID must be sent to the server.</param>
new void GetLogClientID([Out, MarshalAs(UnmanagedType.Bool)] out bool pfLogClientID);
/// <summary>
/// Requests that the reader stops buffering as soon as possible.
/// </summary>
new void StopBuffering();
/// <summary>
/// Opens a Windows Media stream for reading.
/// </summary>
/// <param name="pStream">Pointer to an IStream interface.</param>
/// <param name="pCallback">Pointer to an IWMReaderCallback interface.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This is passed to the application
/// in calls to IWMReaderCallback.OnStatus.</param>
new void OpenStream([In, MarshalAs(UnmanagedType.Interface)] System.Runtime.InteropServices.ComTypes.IStream pStream,
[In, MarshalAs(UnmanagedType.Interface)] IWMReaderCallback pCallback,
[In] IntPtr pvContext);
/// <summary>
/// Stops network streaming while received packets continue to be delivered.
/// </summary>
new void StopNetStreaming();
/// <summary>
/// Provides the ability to specify a starting position using a variety of offsets.
/// </summary>
/// <param name="wStreamNum">WORD containing the stream number for which pvOffsetStart and pvDuration apply.
/// Passing zero signifies that the offset start and duration apply for all streams in the file.
/// If you pass zero, the only valid values for dwOffsetFormat are WMT_OFFSET_FORMAT_100NS and
/// WMT_OFFSET_FORMAT_PLAYLIST_OFFSET.</param>
/// <param name="pvOffsetStart">Void pointer to the address containing the offset start. The unit
/// of measurement for the offset is determined by dwOffsetFormat. The unit of measurement also dictates
/// the size of the variable pointed to.</param>
/// <param name="pvDuration">Void pointer to the address containing the duration of playback.
/// If zero is passed, playback will continue until the end of the file. The unit of measurement
/// for the duration is determined by dwOffsetFormat. The unit of measurement also dictates the size
/// of the variable pointed to.</param>
/// <param name="dwOffsetFormat">DWORD containing one member of the WMT_OFFSET_FORMAT enumeration type.</param>
/// <param name="fRate">Floating point number indicating playback rate. Normal-speed playback is 1.0;
/// higher numbers cause faster playback, and lower numbers cause slower playback.
/// Numbers less than zero indicate reverse rate (rewinding). The valid range is 1.0 through
/// 10.0, and -1.0 through -10.0.</param>
/// <param name="pvContext">Generic pointer, for use by the application. This pointer is passed back
/// to the application on calls to IWMReaderCallback.</param>
new void StartAtPosition([In] ushort wStreamNum,
[In] IntPtr pvOffsetStart,
[In] IntPtr pvDuration,
[In] WMT_OFFSET_FORMAT dwOffsetFormat,
[In] float fRate,
[In] IntPtr pvContext);
/// <summary>
/// Retrieves the total number of languages supported by an output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number.</param>
/// <param name="pwLanguageCount">Pointer to a WORD containing the language count.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetLanguageCount([In] uint dwOutputNum,
[Out] out ushort pwLanguageCount);
/// <summary>
/// Retrieves information about a language supported by an output.
/// </summary>
/// <param name="dwOutputNum">DWORD containing the output number for which you want to identify the language.</param>
/// <param name="wLanguage">WORD containing the language index of the supported language for which you want
/// the details.</param>
/// <param name="pwszLanguageString">Pointer to a wide-character null-terminated string containing the
/// RFC1766-compliant language string. Pass NULL to retrieve the size of the string, which will
/// be returned in pcbLanguageStringLength.</param>
/// <param name="pcchLanguageStringLength">Pointer to a WORD containing the size of pwszLanguageString in
/// wide characters. This size includes the terminating null character.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames")]
void GetLanguage([In] uint dwOutputNum,
[In] ushort wLanguage,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszLanguageString,
[In, Out] ref ushort pcchLanguageStringLength);
/// <summary>
/// Retrieves the maximum playback rate that can be delivered by the source.
/// </summary>
/// <param name="pdblFactor">Pointer to a variable that receives the maximum playback rate.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void GetMaxSpeedFactor([Out] out double pdblFactor);
/// <summary>
/// Queries whether the reader is using Fast Cache streaming.
/// </summary>
/// <param name="pfUsingFastCache">Pointer to a variable that receives a Boolean value. The value is True
/// if the reader is currently using Fast Cache streaming, or False otherwise.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void IsUsingFastCache([Out, MarshalAs(UnmanagedType.Bool)] out bool pfUsingFastCache);
/// <summary>
/// Adds a named value to the logging information that the reader object will send to the server.
/// </summary>
/// <param name="wszNameSpace">Optional wide-character string that contains the namespace for the log entry.
/// This parameter can be NULL. Namespace names are limited to 1024 wide characters.</param>
/// <param name="wszName">Wide-character string that contains the name of the log entry. Log entry names
/// are limited to 1024 wide characters.</param>
/// <param name="wszValue">Wide-character string that contains the value of the log entry. Log entry values
/// are limited to 1024 wide characters.</param>
[SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void AddLogParam([In, MarshalAs(UnmanagedType.LPWStr)] string wszNameSpace,
[In, MarshalAs(UnmanagedType.LPWStr)] string wszName,
[In, MarshalAs(UnmanagedType.LPWStr)] string wszValue);
/// <summary>
/// Sends log entries to the originating server.
/// </summary>
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
void SendLogParams();
/// <summary>
/// Determines whether content being read by the reader object can be saved using the
/// IWMReaderAdvanced2.SaveFileAs method.
/// </summary>
/// <param name="pfCanSave">Pointer to a Boolean value that is set to True if that the content being read
/// can be saved.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
void CanSaveFileAs([Out, MarshalAs(UnmanagedType.Bool)] out bool pfCanSave);
/// <summary>
/// Cancels a file save in progress.
/// </summary>
void CancelSaveFileAs();
/// <summary>
/// Retrieves the URL of the file being read.
/// </summary>
/// <param name="pwszURL">Pointer to a wide-character null-terminated string containing the URL
/// of the file.</param>
/// <param name="pcchURL">Pointer to a variable containing the number of wide characters in pwszURL.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
void GetURL([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszURL,
[In, Out] ref uint pcchURL);
}
}