public HResult Seek(MFByteStreamSeekOrigin SeekOrigin, long llSeekOffset, MFByteStreamSeekingFlags dwSeekFlags, out long pqwCurrentPosition) { throw new NotImplementedException(); }
/// <summary> /// Moves the current position in the stream by a specified offset. /// </summary> /// <param name="seekOrigin">Specifies the origin of the seek as a member of the <see cref="MFByteStreamSeekOrigin"/> enumeration. The offset is calculated relative to this position.</param> /// <param name="seekOffset">Specifies the new position, as a byte offset from the seek origin.</param> /// <param name="cancelPendingIO">Specifies whether all pending I/O requests are canceled after the seek request completes successfully.</param> /// <returns>The new position after the seek.</returns> public long Seek(MFByteStreamSeekOrigin seekOrigin, long seekOffset, bool cancelPendingIO) { long v; MediaFoundationException.Try(SeekNative(seekOrigin, seekOffset, cancelPendingIO, out v), InterfaceName, "Seek"); return(v); }
//TODO: Provide a better implementation for the BeginWrite/EndWrite methods /// <summary> /// Moves the current position in the stream by a specified offset. /// </summary> /// <param name="seekOrigin">Specifies the origin of the seek as a member of the <see cref="MFByteStreamSeekOrigin"/> enumeration. The offset is calculated relative to this position.</param> /// <param name="seekOffset">Specifies the new position, as a byte offset from the seek origin.</param> /// <param name="cancelPendingIO">Specifies whether all pending I/O requests are canceled after the seek request completes successfully.</param> /// <param name="currentPosition">Receives the new position after the seek.</param> /// <returns>The new position after the seek.</returns> public unsafe int SeekNative(MFByteStreamSeekOrigin seekOrigin, long seekOffset, bool cancelPendingIO, out long currentPosition) { // ReSharper disable once InconsistentNaming const int MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO = 0x00000001; int flags = cancelPendingIO ? MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO : 0x0; fixed(void *p = ¤tPosition) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, (int)seekOrigin, seekOffset, flags, p, ((void **)(*(void **)UnsafeBasePtr))[15])); } }
//TODO: Provide a better implementation for the BeginWrite/EndWrite methods /// <summary> /// Moves the current position in the stream by a specified offset. /// </summary> /// <param name="seekOrigin">Specifies the origin of the seek as a member of the <see cref="MFByteStreamSeekOrigin"/> enumeration. The offset is calculated relative to this position.</param> /// <param name="seekOffset">Specifies the new position, as a byte offset from the seek origin.</param> /// <param name="cancelPendingIO">Specifies whether all pending I/O requests are canceled after the seek request completes successfully.</param> /// <param name="currentPosition">Receives the new position after the seek.</param> /// <returns>The new position after the seek.</returns> public unsafe int SeekNative(MFByteStreamSeekOrigin seekOrigin, long seekOffset, bool cancelPendingIO, out long currentPosition) { // ReSharper disable once InconsistentNaming const int MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO = 0x00000001; int flags = cancelPendingIO ? MFBYTESTREAM_SEEK_FLAG_CANCEL_PENDING_IO : 0x0; fixed (void* p = ¤tPosition) { return InteropCalls.CalliMethodPtr(UnsafeBasePtr, (int) seekOrigin, seekOffset, flags, p, ((void**) (*(void**) UnsafeBasePtr))[15]); } }
/// <summary> /// Moves the current position in the stream by a specified offset. /// </summary> /// <param name="seekOrigin">Specifies the origin of the seek as a member of the <see cref="MFByteStreamSeekOrigin"/> enumeration. The offset is calculated relative to this position.</param> /// <param name="seekOffset">Specifies the new position, as a byte offset from the seek origin.</param> /// <param name="cancelPendingIO">Specifies whether all pending I/O requests are canceled after the seek request completes successfully.</param> /// <returns>The new position after the seek.</returns> public long Seek(MFByteStreamSeekOrigin seekOrigin, long seekOffset, bool cancelPendingIO) { long v; MediaFoundationException.Try(SeekNative(seekOrigin, seekOffset, cancelPendingIO, out v), InterfaceName, "Seek"); return v; }