PanaceaMuffin

IMF C# port

Jan 2nd, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 19.21 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Windows.Storage;
  8. using Windows.Media;
  9. using Microsoft.VisualBasic;
  10. using System.IO;
  11. using System.Diagnostics;
  12.  
  13. namespace MFSourceReaderPort
  14. {
  15.     public class Reader
  16.     {
  17.         public static async Task TestFromWin8(Uri src_uri, Stream dst_stream)
  18.         {
  19.             Interop.IMFSourceReader pReader = null;
  20.             if(src_uri.Scheme != "file")
  21.             {
  22.                 Interop.MFCreateSourceReaderFromURL(src_uri.ToString(), IntPtr.Zero, ref pReader);
  23.             }
  24.             else
  25.             {
  26.                 StorageFile src_file = await StorageFile.GetFileFromPathAsync(src_uri.LocalPath);
  27.                 using (var src_stream = await src_file.OpenAsync(FileAccessMode.Read))
  28.                 {
  29.                     Interop.IMFByteStream src_byteStream = null;
  30.                     Interop.MFCreateMFByteStreamOnStreamEx(src_stream, ref src_byteStream);
  31.                     Interop.MFCreateSourceReaderFromByteStream(src_byteStream, IntPtr.Zero, ref pReader);
  32.                     Marshal.ReleaseComObject(src_byteStream);
  33.                 }
  34.             }
  35.  
  36.             await ConvertToWavAsync(pReader, dst_stream);
  37.  
  38.             Marshal.ReleaseComObject(pReader);
  39.             pReader = null;
  40.         }
  41.  
  42.         static async Task ConvertToWavAsync(Interop.IMFSourceReader pReader, Stream dest)
  43.         {
  44.             // We'll ask it for PCM data, 44100Hz, 2 channels, 16 bits per sample
  45.             pReader.SetStreamSelection((int)Interop.MF_SOURCE_READER_ALL_STREAMS, false);
  46.             pReader.SetStreamSelection(Interop.MF_SOURCE_READER_FIRST_AUDIO_STREAM, true);
  47.             Interop.IMFMediaType pRequestedType = null;
  48.             Interop.MFCreateMediaType(ref pRequestedType);
  49.             pRequestedType.SetGUID(Interop.MF_MT_MAJOR_TYPE, Interop.MFMediaType_Audio);
  50.             pRequestedType.SetGUID(Interop.MF_MT_SUBTYPE, Interop.MFAudioFormat_PCM);
  51.             pRequestedType.SetUINT32(Interop.MF_MT_AUDIO_NUM_CHANNELS, 2);
  52.             pRequestedType.SetUINT32(Interop.MF_MT_AUDIO_BITS_PER_SAMPLE, 16);
  53.             pRequestedType.SetUINT32(Interop.MF_MT_AUDIO_SAMPLES_PER_SECOND, 44100);
  54.             pReader.SetCurrentMediaType(Interop.MF_SOURCE_READER_FIRST_AUDIO_STREAM, IntPtr.Zero, pRequestedType);
  55.             Marshal.ReleaseComObject(pRequestedType);
  56.             pRequestedType = null;
  57.  
  58.             // It can tell us the authoritative wave format that it picked
  59.             Interop.IMFMediaType pAudioType = null;
  60.             pReader.GetCurrentMediaType(Interop.MF_SOURCE_READER_FIRST_AUDIO_STREAM, ref pAudioType);
  61.             int cbBlockSize = 0;
  62.             pAudioType.GetUINT32(Interop.MF_MT_AUDIO_BLOCK_ALIGNMENT, ref cbBlockSize);
  63.             int cbBytesPerSecond = 0;
  64.             pAudioType.GetUINT32(Interop.MF_MT_AUDIO_AVG_BYTES_PER_SECOND, ref cbBytesPerSecond);
  65.             IntPtr pWav = IntPtr.Zero;
  66.             int cbFormat = 0;
  67.             Interop.MFCreateWaveFormatExFromMFMediaType(pAudioType, ref pWav, ref cbFormat);
  68.             byte[] wfx = new byte[cbFormat];
  69.             Marshal.Copy(pWav, wfx, 0, cbFormat);
  70.             pReader.SetStreamSelection(Interop.MF_SOURCE_READER_FIRST_AUDIO_STREAM, true);
  71.             Marshal.ReleaseComObject(pAudioType);
  72.             pAudioType = null;
  73.  
  74.             //WAV files have pretty straightforward headers
  75.             byte[] header = new byte[] { (byte)(Strings.AscW("R")), (byte)(Strings.AscW("I")), (byte)(Strings.AscW("F")), (byte)(Strings.AscW("F")), 0, 0, 0, 0, (byte)(Strings.AscW("W")), (byte)(Strings.AscW("A")), (byte)(Strings.AscW("V")), (byte)(Strings.AscW("E")), (byte)(Strings.AscW("f")), (byte)(Strings.AscW("m")), (byte)(Strings.AscW("t")), (byte)(Strings.AscW(" ")), (byte)(cbFormat & 255), (byte)((cbFormat >> 8) & 255), (byte)((cbFormat >> 16) & 255), (byte)((cbFormat >> 24) & 255) };
  76.  
  77.             byte[] dataHeader = new byte[] { (byte)(Strings.AscW("d")), (byte)(Strings.AscW("a")), (byte)(Strings.AscW("t")), (byte)(Strings.AscW("a")), 0, 0, 0, 0 };
  78.  
  79.             await dest.WriteAsync(header, 0, header.Length);
  80.             await dest.WriteAsync(wfx, 0, wfx.Length);
  81.             await dest.WriteAsync(dataHeader, 0, dataHeader.Length);
  82.             Marshal.FreeCoTaskMem(pWav);
  83.             int cbHeader = header.Length + cbFormat + dataHeader.Length;
  84.             int cbAudioData = 0;
  85.  
  86.             int dwflags = 0;
  87.             Interop.IMFSample pSample = null;  
  88.            
  89.             do
  90.             {
  91.                 pReader.ReadSample(Interop.MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, 0, ref dwflags, 0, ref pSample);
  92.                 int sample = 0;
  93.                 pSample.GetSampleFlags(ref sample);
  94.                 Interop.IMFMediaBuffer pBuffer = null;
  95.                 try
  96.                 {
  97.                     pSample.ConvertToContiguousBuffer(ref pBuffer);
  98.                 }
  99.                 catch (COMException e)
  100.                 {
  101.                     Debug.WriteLine(e.Message);
  102.                 }
  103.                 IntPtr pAudioData = IntPtr.Zero;
  104.                 int cbBuffer = 0;
  105.                 pBuffer.Lock(ref pAudioData, 0, ref cbBuffer);
  106.                 byte[] buf = new byte[cbBuffer - 1];
  107.                 Marshal.Copy(pAudioData, buf, 0, cbBuffer);
  108.                 await dest.WriteAsync(buf, 0, cbBuffer);
  109.                 cbAudioData += cbBuffer;
  110.                 pBuffer.Unlock();
  111.  
  112.                 Marshal.ReleaseComObject(pBuffer);
  113.                 Marshal.ReleaseComObject(pSample);
  114.                 pBuffer = null;
  115.                 pSample = null;
  116.  
  117.             } while (dwflags != 0);
  118.  
  119.             int cbRiffFileSize = cbHeader + cbAudioData - 8;
  120.             dest.Seek(4, SeekOrigin.Begin);
  121.             await dest.WriteAsync(BitConverter.GetBytes(cbRiffFileSize), 0, 4);
  122.             dest.Seek(cbHeader - 4, SeekOrigin.Begin);
  123.             await dest.WriteAsync(BitConverter.GetBytes(cbAudioData), 0, 4);
  124.         }
  125.     }
  126.  
  127.     public class Interop
  128.     {
  129.         #region DLL Imports
  130.  
  131.         [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]
  132.         extern static public void MFStartup(int version, int dwFlags = 0);
  133.  
  134.         [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]
  135.         extern static public void MFShutdown();
  136.  
  137.         [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]
  138.         extern static public void MFCreateMediaType(ref IMFMediaType MFType);
  139.  
  140.         [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]
  141.         extern static public void MFCreateWaveFormatExFromMFMediaType(IMFMediaType MFType, ref IntPtr pWF, ref int cbSize, int flags = 0);
  142.  
  143.         [DllImport("mfreadwrite.dll", ExactSpelling = true, PreserveSig = false)]
  144.         extern static public void MFCreateSourceReaderFromURL([MarshalAs(UnmanagedType.LPWStr)] string wszURL, IntPtr pAttributes, ref IMFSourceReader sourceReader);
  145.  
  146.         [DllImport("mfreadwrite.dll", ExactSpelling = true, PreserveSig = false)]
  147.         extern static public void MFCreateSourceReaderFromByteStream(IMFByteStream byteStream, IntPtr pAttributes, ref IMFSourceReader sourceReader);
  148.  
  149.         [DllImport("mfplat.dll", ExactSpelling = true, PreserveSig = false)]
  150.         extern static public void MFCreateMFByteStreamOnStreamEx([MarshalAs(UnmanagedType.IUnknown)] object punkStream, ref IMFByteStream byteStream);
  151.  
  152.         #endregion
  153.  
  154.         #region Constants
  155.  
  156.         public const int MF_SOURCE_READER_ALL_STREAMS = unchecked((int)0xFFFFFFFE);
  157.         public const int MF_SOURCE_READER_FIRST_AUDIO_STREAM = unchecked((int)0xFFFFFFFD);
  158.         public const int MF_SDK_VERSION = 0x2;
  159.         public const int MF_API_VERSION = 0x70;
  160.         public const int MF_VERSION = (MF_SDK_VERSION << 16) | MF_API_VERSION;
  161.         public static readonly Guid MF_MT_MAJOR_TYPE = new Guid("48eba18e-f8c9-4687-bf11-0a74c9f96a8f");
  162.         public static readonly Guid MF_MT_SUBTYPE = new Guid("f7e34c9a-42e8-4714-b74b-cb29d72c35e5");
  163.         public static readonly Guid MF_MT_AUDIO_BLOCK_ALIGNMENT = new Guid("322de230-9eeb-43bd-ab7a-ff412251541d");
  164.         public static readonly Guid MF_MT_AUDIO_AVG_BYTES_PER_SECOND = new Guid("1aab75c8-cfef-451c-ab95-ac034b8e1731");
  165.         public static readonly Guid MF_MT_AUDIO_NUM_CHANNELS = new Guid("37e48bf5-645e-4c5b-89de-ada9e29b696a");
  166.         public static readonly Guid MF_MT_AUDIO_SAMPLES_PER_SECOND = new Guid("5faeeae7-0290-4c31-9e8a-c534f68d9dba");
  167.         public static readonly Guid MF_MT_AUDIO_BITS_PER_SAMPLE = new Guid("f2deb57f-40fa-4764-aa33-ed4f2d1ff669");
  168.         public static readonly Guid MFMediaType_Audio = new Guid("73647561-0000-0010-8000-00AA00389B71");
  169.         public static readonly Guid MFAudioFormat_PCM = new Guid("00000001-0000-0010-8000-00AA00389B71");
  170.  
  171.         #endregion
  172.  
  173.         #region COM Imports
  174.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("70ae66f2-c809-4e4f-8915-bdcb406b7993")]
  175.         public interface IMFSourceReader
  176.         {
  177.             void GetStreamSelection([In] int dwStreamIndex, [MarshalAs(UnmanagedType.Bool)] ref bool pSelected);
  178.             void SetStreamSelection([In] int dwStreamIndex, [In, MarshalAs(UnmanagedType.Bool)] bool pSelected);
  179.             void GetNativeMediaType([In] int dwStreamIndex, [In] int dwMediaTypeIndex, ref IntPtr ppMediaType);
  180.             void GetCurrentMediaType([In] int dwStreamIndex, ref IMFMediaType ppMediaType);
  181.             void SetCurrentMediaType([In] int dwStreamIndex, IntPtr pdwReserved, [In] IMFMediaType pMediaType);
  182.             void SetCurrentPosition([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidTimeFormat, [In] object varPosition);
  183.             void ReadSample([In] int dwStreamIndex, [In] int dwControlFlags, ref int pdwActualStreamIndex, ref int pdwStreamFlags, ref UInt64 pllTimestamp, ref IMFSample ppSample);
  184.             void Flush([In] int dwStreamIndex);
  185.             void GetServiceForStream([In] int dwStreamIndex, [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidService, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, ref IntPtr ppvObject);
  186.             void GetPresentationAttribute([In] int dwStreamIndex, [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidAttribute, ref IntPtr pvarAttribute);
  187.         }
  188.  
  189.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("2CD2D921-C447-44A7-A13C-4ADABFC247E3")]
  190.         public interface IMFAttributes
  191.         {
  192.             void GetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr pValue);
  193.             void GetItemType([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref int pType);
  194.             void CompareItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr Value, [MarshalAs(UnmanagedType.Bool)] ref bool pbResult);
  195.             void Compare([MarshalAs(UnmanagedType.Interface)] IMFAttributes pTheirs, int MatchType, [MarshalAs(UnmanagedType.Bool)] ref bool pbResult);
  196.             void GetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref int punValue);
  197.             void GetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref long punValue);
  198.             void GetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref double pfValue);
  199.             void GetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref Guid pguidValue);
  200.             void GetStringLength([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref int pcchLength);
  201.             void GetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszValue, int cchBufSize, ref int pcchLength);
  202.             void GetAllocatedString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [MarshalAs(UnmanagedType.LPWStr)] ref string ppwszValue, ref int pcchLength);
  203.             void GetBlobSize([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref int pcbBlobSize);
  204.             void GetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [MarshalAs(UnmanagedType.LPArray)] ref byte pBuf, int cbBufSize, ref int pcbBlobSize);
  205.             void GetAllocatedBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, ref IntPtr ip, ref int pcbSize);
  206.             void GetUnknown([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, [MarshalAs(UnmanagedType.IUnknown)] ref object ppv);
  207.             void SetItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, IntPtr Value);
  208.             void DeleteItem([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey);
  209.             void DeleteAllItems();
  210.             void SetUINT32([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, int unValue);
  211.             void SetUINT64([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, long unValue);
  212.             void SetDouble([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, double fValue);
  213.             void SetGUID([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidValue);
  214.             void SetString([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPWStr)] string wszValue);
  215.             void SetBlob([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] byte pBuf, int cbBufSize);
  216.             void SetUnknown([In, MarshalAs(UnmanagedType.LPStruct)] Guid guidKey, [In, MarshalAs(UnmanagedType.IUnknown)] object pUnknown);
  217.             void LockStore();
  218.             void UnlockStore();
  219.             void GetCount(ref int pcItems);
  220.             void GetItemByIndex(int unIndex, ref Guid pguidKey, IntPtr pValue);
  221.             void CopyAllItems([In, MarshalAs(UnmanagedType.Interface)] IMFAttributes pDest);
  222.         }
  223.  
  224.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("44AE0FA8-EA31-4109-8D2E-4CAE4997C555")]
  225.         public interface IMFMediaType : IMFAttributes
  226.         {
  227.             void GetMajorType(ref Guid pguidMajorType);
  228.             void IsCompressedFormat([MarshalAs(UnmanagedType.Bool)] ref bool pfCompressed);
  229.             //<Runtime.InteropServices.PreserveSig> Function IsEqual(<Runtime.InteropServices.In, Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.Interface)> pIMediaType As IMFMediaType, ByRef pdwFlags As Integer) As Integer;
  230.             [PreserveSig]
  231.             int IsEqual([In, MarshalAs(UnmanagedType.Interface)] IMFMediaType pIMediaType, ref int pdwFlags);
  232.             void GetRepresentation([In, MarshalAs(UnmanagedType.Struct)] Guid guidRepresentation, ref IntPtr ppvRepresentation);
  233.             void FreeRepresentation([In, MarshalAs(UnmanagedType.Struct)] Guid guidRepresentation, [In] IntPtr pvRepresentation);
  234.         }
  235.  
  236.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("c40a00f2-b93a-4d80-ae8c-5a1c634f58e4")]
  237.         public interface IMFSample : IMFAttributes
  238.         {
  239.             void GetSampleFlags(ref int pdwSampleFlags);
  240.             void SetSampleFlags(int dwSampleFlags);
  241.             void GetSampleTime(ref long phnsSampletime);
  242.             void SetSampleTime(long hnsSampleTime);
  243.             void GetSampleDuration(ref long phnsSampleDuration);
  244.             void SetSampleDuration(long hnsSampleDuration);
  245.             void GetBufferCount(ref int pdwBufferCount);
  246.             void GetBufferByIndex(int dwIndex, ref IMFMediaBuffer ppBuffer);
  247.             void ConvertToContiguousBuffer(ref IMFMediaBuffer ppBuffer);
  248.             void AddBuffer(IMFMediaBuffer pBuffer);
  249.             void RemoveBuferByindex(int dwIndex);
  250.             void RemoveAllBuffers();
  251.             void GetTotalLength(ref int pcbTotalLength);
  252.             void CopyToByffer(IMFMediaBuffer pBuffer);
  253.         }
  254.  
  255.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("045FA593-8799-42b8-BC8D-8968C6453507")]
  256.         public interface IMFMediaBuffer
  257.         {
  258.             void Lock(ref IntPtr ppbBuffer, ref int pcbMaxLength, ref int pcbCurrentLength);
  259.             void Unlock();
  260.             void GetCurrentLength(ref int pcbCurrentLength);
  261.             void SetCurrentLength(int cbCurrentLength);
  262.             void GetMaxLength(ref int pcbMaxLength);
  263.         }
  264.  
  265.         [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("ad4c1b00-4bf7-422f-9175-756693d9130d")]
  266.         public interface IMFByteStream
  267.         {
  268.             //virtual HRESULT STDMETHODCALLTYPE GetCapabilities(/*[out]*/ __RPC__out DWORD *pdwCapabilities) = 0;
  269.             void GetCapabilities(ref int pdwCapabiities);
  270.             //virtual HRESULT STDMETHODCALLTYPE GetLength(/*[out]*/ __RPC__out QWORD *pqwLength) = 0;
  271.             void GetLength(ref long pqwLength);
  272.             //'virtual HRESULT STDMETHODCALLTYPE SetLength(/*[in]*/ QWORD qwLength) = 0;
  273.             void SetLength(long qwLength);
  274.             // 'virtual HRESULT STDMETHODCALLTYPE GetCurrentPosition(/*[out]*/ __RPC__out QWORD *pqwPosition) = 0;
  275.             void GetCurrentPosition(ref long pqwPosition);
  276.             // 'virtual HRESULT STDMETHODCALLTYPE SetCurrentPosition(/*[in]*/ QWORD qwPosition) = 0;
  277.             void SetCurrentPosition(long qwPosition);
  278.             // 'virtual HRESULT STDMETHODCALLTYPE IsEndOfStream(/*[out]*/ __RPC__out BOOL *pfEndOfStream) = 0;
  279.             void IsEndOfStream([MarshalAs(UnmanagedType.Bool)] ref bool pfEndOfStream);
  280.             // 'virtual HRESULT STDMETHODCALLTYPE Read(/*[size_is][out]*/ __RPC__out_ecount_full(cb) BYTE *pb, /*[in]*/ ULONG cb, /*[out]*/ __RPC__out ULONG *pcbRead) = 0;
  281.             void Read(IntPtr pb, int cb, ref int pcbRead);
  282.             // 'virtual /*[local]*/ HRESULT STDMETHODCALLTYPE BeginRead(/*[out]*/ _Out_writes_bytes_(cb)  BYTE *pb, /*[in]*/ ULONG cb, /*[in]*/ IMFAsyncCallback *pCallback, /*[in]*/ IUnknown *punkState) = 0;
  283.             void BeginRead(IntPtr pb, int cb, IntPtr pCallback, IntPtr punkState);
  284.             // 'virtual /*[local]*/ HRESULT STDMETHODCALLTYPE EndRead(/*[in]*/ IMFAsyncResult *pResult, /*[out]*/ _Out_  ULONG *pcbRead) = 0;
  285.             void EndRead(IntPtr pResult, ref int pcbRead);
  286.             // 'virtual HRESULT STDMETHODCALLTYPE Write(/*[size_is][in]*/ __RPC__in_ecount_full(cb) const BYTE *pb, /*[in]*/ ULONG cb, /*[out]*/ __RPC__out ULONG *pcbWritten) = 0;
  287.             void Write(IntPtr pb, int cb, ref int pcbWritten);
  288.             //  'virtual /*[local]*/ HRESULT STDMETHODCALLTYPE BeginWrite(/*[in]*/ _In_reads_bytes_(cb)  const BYTE *pb, /*[in]*/ ULONG cb, /*[in]*/ IMFAsyncCallback *pCallback, /*[in]*/ IUnknown *punkState) = 0;
  289.             void BeginWrite(IntPtr pb, int cb, IntPtr pCallback, IntPtr punkState);
  290.             //'virtual /*[local]*/ HRESULT STDMETHODCALLTYPE EndWrite(/*[in]*/ IMFAsyncResult *pResult, /*[out]*/ _Out_  ULONG *pcbWritten) = 0;
  291.             void EndWrite(IntPtr pResult, ref int pcbWritten);
  292.             //'virtual HRESULT STDMETHODCALLTYPE Seek(/*[in]*/ MFBYTESTREAM_SEEK_ORIGIN SeekOrigin, /*[in]*/ LONGLONG llSeekOffset, /*[in]*/ DWORD dwSeekFlags, /*[out]*/ __RPC__out QWORD *pqwCurrentPosition) = 0;
  293.             void Seek(int SeekOrigin, long llSeekOffset, int dwSeekFlags, ref long pqwCurrentPosition);
  294.             //'virtual HRESULT STDMETHODCALLTYPE Flush( void) = 0;
  295.             void Flush();
  296.             //'virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
  297.             void Close();
  298.         }
  299.         #endregion
  300.     }
  301. }
Add Comment
Please, Sign In to add comment