Exemplo n.º 1
0
 /// <summary>
 /// <p> The <strong>Clone</strong> method creates a new stream object with its own seek reference that references the same bytes as the original stream.</p>
 /// </summary>
 /// <returns><dd> <p>When successful, reference to the location of an <strong><see cref = "SharpDX.Win32.IStream"/></strong> reference to the new stream object. If an error occurs, this parameter is <strong><c>null</c></strong>.</p> </dd></returns>
 /// <remarks>
 /// <p>The <strong>Clone</strong> method creates a new stream object for accessing the same bytes but using a separate seek reference. The new stream object sees the same data as the source-stream object. Changes written to one object are immediately visible in the other. Range locking is shared between the stream objects.</p><p>The initial setting of the seek reference in the cloned stream instance is the same as the current setting of the seek reference in the original stream at the time of the clone operation.</p>
 /// </remarks>
 /// <doc-id>aa380035</doc-id>
 /// <unmanaged>HRESULT IStream::Clone([Out] IStream** ppstm)</unmanaged>
 /// <unmanaged-short>IStream::Clone</unmanaged-short>
 public unsafe SharpDX.Win32.IStream Clone()
 {
     SharpDX.Win32.IStream stmOut;
     System.IntPtr         stmOut_ = System.IntPtr.Zero;
     SharpDX.Result        __result__;
     __result__ = SharpDX.LocalInterop.CalliStdCallint(this._nativePointer, &stmOut_, (*(void ***)this._nativePointer)[13]);
     if (stmOut_ != System.IntPtr.Zero)
     {
         stmOut = new SharpDX.Win32.ComStream(stmOut_);
     }
     else
     {
         stmOut = null;
     }
     __result__.CheckError();
     return(stmOut);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates the source reader from a byte stream.
 /// </summary>
 /// <param name="comStream"><dd> <p>A reference to the <strong><see cref="SharpDX.MediaFoundation.IByteStream"/></strong> interface of a byte stream. This byte stream will provide the source data for the source reader.</p> </dd></param>
 /// <param name="attributes"><dd> <p>Pointer to the <strong><see cref="SharpDX.MediaFoundation.MediaAttributes"/></strong> interface. You can use this parameter to configure the source reader. For more information, see Source Reader Attributes. This parameter can be <strong><c>null</c></strong>.</p> </dd></param>
 /// <remarks>
 /// <p>Call <strong>CoInitialize(Ex)</strong> and <strong><see cref="SharpDX.MediaFoundation.MediaFactory.Startup"/></strong> before calling this function.</p><p> Internally, the source reader calls the <strong><see cref="SharpDX.MediaFoundation.SourceResolver.CreateObjectFromByteStream_"/></strong> method to create a media source from the byte stream. Therefore, a byte-stream handler must be registered for the byte stream. For more information about byte-stream handlers, see Scheme Handlers and Byte-Stream Handlers. </p><p>This function is available on Windows?Vista if Platform Update Supplement for Windows?Vista is installed.</p>
 /// </remarks>
 /// <msdn-id>dd388106</msdn-id>
 /// <unmanaged>HRESULT MFCreateSourceReaderFromByteStream([In] IMFByteStream* pByteStream,[In, Optional] IMFAttributes* pAttributes,[Out, Fast] IMFSourceReader** ppSourceReader)</unmanaged>
 /// <unmanaged-short>MFCreateSourceReaderFromByteStream</unmanaged-short>
 public SourceReader(SharpDX.Win32.ComStream comStream, MediaAttributes attributes = null)
 {
     byteStream = new ByteStream(comStream);
     MediaFactory.CreateSourceReaderFromByteStream(byteStream.NativePointer, attributes, this);
 }