コード例 #1
0
ファイル: ComStreamShadow.cs プロジェクト: conankzhang/fez
            private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer)
            {
                streamPointer = IntPtr.Zero;
                Result result = Result.Ok;

                try
                {
                    IStream stream = ((IStream)CppObjectShadow.ToShadow <ComStreamShadow>(thisPtr).Callback).Clone();
                    streamPointer = ComStream.ToIntPtr(stream);
                }
                catch (SharpDXException ex)
                {
                    result = ex.ResultCode;
                }
                catch (Exception ex)
                {
                    result = (Result)Result.Fail.Code;
                }
                return(result);
            }
コード例 #2
0
ファイル: ComStreamShadow.cs プロジェクト: oeoen/SharpDX
            private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer)
            {
                streamPointer = IntPtr.Zero;
                var result = Result.Ok;

                try
                {
                    var shadow   = ToShadow <ComStreamShadow>(thisPtr);
                    var callback = ((IStream)shadow.Callback);
                    var clone    = callback.Clone();
                    streamPointer = ComStream.ToIntPtr(clone);
                }
                catch (SharpDXException exception)
                {
                    result = exception.ResultCode;
                }
                catch (Exception)
                {
                    result = Result.Fail.Code;
                }
                return(result);
            }
コード例 #3
0
ファイル: ByteStream.cs プロジェクト: nkast/SharpDX
 /// <summary>
 /// Instantiates a new instance <see cref="ByteStream"/> from a <see cref="Stream"/>.
 /// </summary>
 /// <msdn-id>hh162754</msdn-id>	
 /// <unmanaged>HRESULT MFCreateMFByteStreamOnStreamEx([In] IUnknown* punkStream,[Out] IMFByteStream** ppByteStream)</unmanaged>	
 /// <unmanaged-short>MFCreateMFByteStreamOnStreamEx</unmanaged-short>	
 public ByteStream(ComStream sourceStream)
 {
     this.comStream = sourceStream;
     IByteStream localStream;
     MediaFactory.CreateMFByteStreamOnStream(sourceStream.NativePointer, out localStream);
     NativePointer = ((ByteStream)localStream).NativePointer;
 }
コード例 #4
0
ファイル: ComStream.cs プロジェクト: conankzhang/fez
 public long CopyTo(IStream streamDest, long numberOfBytesToCopy, out long bytesWritten)
 {
     this.CopyTo_(ComStream.ToIntPtr(streamDest), numberOfBytesToCopy, out bytesWritten);
     return(bytesWritten);
 }