/// <summary> /// Unlocks the attribute store. /// </summary> /// <returns>HRESULT</returns> public unsafe int UnlockStore() { return(InteropCalls.CalliMethodPtr(_basePtr, ((void **)(*(void **)_basePtr))[29])); }
/// <summary> /// Flushes one or more streams. /// <seealso cref="Flush"/> /// </summary> /// <param name="streamIndex">The zero-based index of the stream to flush, or <see cref="MF_SINK_WRITER_ALL_STREAMS"/> to flush all of the streams.</param> /// <returns>HRESULT</returns> public unsafe int FlushNative(int streamIndex) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, ((void **)(*(void **)UnsafeBasePtr))[10])); }
/// <summary> /// Shuts down the created object. /// <see cref="ShutdownObject"/> /// </summary> /// <returns>HRESULT</returns> public unsafe int ShutdownObjectNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[34])); }
/// <summary> /// Delivers a sample to the sink writer. /// <seealso cref="WriteSample"/> /// </summary> /// <param name="streamIndex">The zero-based index of the stream for this sample.</param> /// <param name="sample">The sample to write.</param> /// <returns>HRESULT</returns> /// <remarks>You must call <see cref="BeginWriting"/> before calling this method.</remarks> public unsafe int WriteSampleNative(int streamIndex, MFSample sample) { void *ps = (void *)(sample == null ? IntPtr.Zero : sample.BasePtr); return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, ps, ((void **)(*(void **)UnsafeBasePtr))[6])); }
/// <summary> /// Places a marker in the specified stream. /// <seealso cref="PlaceMarker"/> /// </summary> /// <param name="streamIndex">The zero-based index of the stream.</param> /// <param name="context">Pointer to an application-defined value. The value of this parameter is returned to the caller in the pvContext parameter of the caller's IMFSinkWriterCallback::OnMarker callback method. The application is responsible for any memory allocation associated with this data. This parameter can be NULL.</param> /// <returns>HRESULT</returns> public unsafe int PlaceMarkerNative(int streamIndex, IntPtr context) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, (void *)context, ((void **)(*(void **)UnsafeBasePtr))[8])); }
/// <summary> /// Removes all of the buffers from the sample. /// </summary> /// <returns>HRESULT</returns> public unsafe int RemoveAllBuffersNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[44])); }
/// <summary> /// Currently no flags are defined. Instead, metadata for samples is defined using /// attributes. To set attibutes on a sample, use the <see cref="MFAttributes"/> object, which /// IMFSample inherits. /// </summary> /// <param name="flags">Must be <see cref="MFSampleFlags.None"/>.</param> /// <returns>HRESULT</returns> public unsafe int SetSampleFlagsNative(MFSampleFlags flags) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, flags, ((void **)(*(void **)UnsafeBasePtr))[34])); }
/// <summary> /// Closes the stream and releases any resources associated with the stream, such as sockets or file handles. This method also cancels any pending asynchronous I/O requests. /// </summary> /// <returns>HRESULT</returns> public unsafe int CloseNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[17])); }
/// <summary> /// Sets the length of the stream. /// </summary> /// <param name="length">The length of the stream in bytes.</param> /// <returns>HRESULT</returns> /// <remarks>Use the <see cref="Length"/> property for easier usage with automated error handling.</remarks> public unsafe int SetLengthNative(long length) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, length, ((void **)(*(void **)UnsafeBasePtr))[5])); }
/// <summary> /// Sets the current read or write position. /// </summary> /// <param name="position">New position in the stream, as a byte offset from the start of the stream.</param> /// <returns>HRESULT</returns> public unsafe int SetCurrentPositionNative(long position) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, position, ((void **)(*(void **)UnsafeBasePtr))[7])); }
/// <summary> /// Begins an asynchronous write operation to the stream. /// </summary> /// <param name="buffer">Pointer to a buffer containing the data to write.</param> /// <param name="count">Size of the buffer in bytes.</param> /// <param name="callback">Pointer to the IMFAsyncCallback interface of a callback object. The caller must implement this interface.</param> /// <param name="unkState">Pointer to the IUnknown interface of a state object, defined by the caller. Can be Zero.</param> /// <returns>HRESULT</returns> public unsafe int BeginWriteNative(IntPtr buffer, int count, IntPtr callback, IntPtr unkState) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, buffer, count, callback, unkState, ((void **)(*(void **)UnsafeBasePtr))[13])); }
public unsafe int AddBufferNative(MFMediaBuffer buffer) { return(InteropCalls.CalliMethodPtr(_basePtr, (void *)((buffer == null) ? IntPtr.Zero : buffer.BasePtr), ((void **)(*(void **)_basePtr))[42])); }
/// <summary> /// Retrieves the value associated with a key. /// </summary> /// <returns>HRESULT</returns> public unsafe int GetItem(Guid key, IntPtr valueRef) { return(InteropCalls.CalliMethodPtr(_basePtr, &key, (void *)valueRef, ((void **)(*(void **)_basePtr))[3])); }
/// <summary> /// Copies all of the attributes from this object into another attribute store. /// </summary> /// <returns>HRESULT</returns> public unsafe int CopyAllItems(MFAttributes destination) { return(InteropCalls.CalliMethodPtr(_basePtr, (void *)((destination == null) ? IntPtr.Zero : destination.BasePtr), ((void **)(*(void **)_basePtr))[32])); }
/// <summary> /// Sets the duration of the sample. /// </summary> /// <param name="hnsSampleDuration">Duration of the sample, in 100-nanosecond units.</param> /// <returns>HRESULT</returns> public unsafe int SetSampleDurationNative(long hnsSampleDuration) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, hnsSampleDuration, ((void **)(*(void **)UnsafeBasePtr))[38])); }
/// <summary> /// Unlocks a buffer that was previously locked. Call this method once for every call to <see cref="Lock(out int,out int)"/>. /// </summary> /// <returns>HRESULT</returns> public unsafe int UnlockNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[4])); }
/// <summary> /// Removes a buffer at a specified index from the sample. /// </summary> /// <param name="index">Index of the buffer. To find the number of buffers in the sample, call <see cref="GetBufferCount"/>. Buffers are indexed from zero.</param> /// <returns>HRESULT</returns> public unsafe int RemoveBufferByIndexNative(int index) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, index, ((void **)(*(void **)UnsafeBasePtr))[43])); }
/// <summary> /// Sets the length of the valid data in the buffer. /// </summary> /// <seealso cref="CurrentLength"/> /// <param name="currentLength">Length of the valid data, in bytes. This value cannot be greater than the allocated size of the buffer, which is returned by the <see cref="GetMaxLength"/> method.</param> /// <returns>HRESULT</returns> public unsafe int SetCurrentLengthNative(int currentLength) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, currentLength, ((void **)(*(void **)UnsafeBasePtr))[6])); }
/// <summary> /// Copies the sample data to a buffer. This method concatenates the valid data from all of the buffers of the sample, in order. /// </summary> /// <param name="buffer">The <see cref="MFMediaBuffer"/> object of the destination buffer. /// The buffer must be large enough to hold the valid data in the sample. /// To get the size of the data in the sample, call <see cref="GetTotalLength"/>.</param> /// <returns>HRESULT</returns> public unsafe int CopyToBufferNative(MFMediaBuffer buffer) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, (void *)((buffer == null) ? IntPtr.Zero : buffer.BasePtr), ((void **)(*(void **)UnsafeBasePtr))[46])); }
/// <summary> /// Sets the media type for a stream. /// This media type defines the format that the <see cref="MFSourceReader"/> produces as output. It can differ from the native format provided by the media source. See Remarks for more information. /// </summary> /// <param name="streamIndex">The stream to configure. For more information, see <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd374667(v=vs.85).aspx"/>.</param> /// <param name="reserved">Reserved. Set to <see cref="IntPtr.Zero"/>.</param> /// <param name="mediaType">The media type to set.</param> /// <returns>HRESULT</returns> public unsafe int SetCurrentMediaTypeNative(int streamIndex, IntPtr reserved, MFMediaType mediaType) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, reserved, (void *)((mediaType == null) ? IntPtr.Zero : mediaType.BasePtr), ((void **)(*(void **)UnsafeBasePtr))[7])); }
/// <summary> /// Initializes the sink writer for writing. /// <seealso cref="BeginWritingNative"/> /// </summary> /// <returns>HRESULT</returns> public unsafe int BeginWritingNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[5])); }
/// <summary> /// Seeks to a new position in the media source. /// </summary> /// <param name="guidTimeFormat">A GUID that specifies the time format. The time format defines the units for the varPosition parameter. Pass <see cref="Guid.Empty"/> for "100-nanosecond units". Some media sources might support additional values.</param> /// <param name="position">The position from which playback will be started. The units are specified by the <paramref name="guidTimeFormat"/> parameter. If the <paramref name="guidTimeFormat"/> parameter is <see cref="Guid.Empty"/>, set the variant type to <see cref="VarEnum.VT_I8"/>.</param> /// <returns>HRESULT</returns> public unsafe int SetCurrentPositionNative(Guid guidTimeFormat, PropertyVariant position) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, &guidTimeFormat, &position, ((void **)(*(void **)UnsafeBasePtr))[8])); }
/// <summary> /// Indicates a gap in an input stream. /// <seealso cref="SendStreamTick"/> /// </summary> /// <param name="streamIndex">The zero-based index of the stream.</param> /// <param name="timeStamp">The position in the stream where the gap in the data occurs. The value is given in 100-nanosecond units, relative to the start of the stream.</param> /// <returns>HRESULT</returns> public unsafe int SendStreamTickNative(int streamIndex, long timeStamp) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, timeStamp, ((void **)(*(void **)UnsafeBasePtr))[7])); }
/// <summary> /// Selects or deselects one or more streams. /// </summary> /// <param name="streamIndex">The stream to set. For more information, see <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd374669(v=vs.85).aspx"/>.</param> /// <param name="selected">Specify <see cref="NativeBool.True"/> to select streams or <see cref="NativeBool.False"/> to deselect streams. If a stream is deselected, it will not generate data.</param> /// <returns>HRESULT</returns> public unsafe int SetStreamSelectionNative(int streamIndex, NativeBool selected) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, selected, ((void **)(*(void **)UnsafeBasePtr))[4])); }
/// <summary> /// Notifies the media sink that a stream has reached the end of a segment. /// <seealso cref="NotifyEndOfSegment"/> /// </summary> /// <param name="streamIndex">The zero-based index of a stream, or <see cref="MF_SINK_WRITER_ALL_STREAMS"/> to signal that all streams have reached the end of a segment.</param> /// <returns>HRESULT</returns> public unsafe int NotifyEndOfSegmentNative(int streamIndex) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, streamIndex, ((void **)(*(void **)UnsafeBasePtr))[9])); }
/// <summary> /// Frees memory that was allocated by the <see cref="GetRepresentation"/> method. /// </summary> /// <param name="guidRepresentation"><see cref="Guid"/> that was passed to the <see cref="GetRepresentation"/> method.</param> /// <param name="representation">Pointer to the buffer that was returned by the <see cref="GetRepresentation"/> method.</param> /// <returns>HRESULT</returns> /// <remarks>For more information, see <see href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms703846(v=vs.85).aspx"/>.</remarks> public unsafe int FreeRepresentationNative(Guid guidRepresentation, IntPtr representation) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, guidRepresentation, representation, ((void **)(*(void **)UnsafeBasePtr))[37])); }
/// <summary> /// Completes all writing operations on the sink writer. /// <seealso cref="FinalizeWriting"/> /// </summary> /// <returns>HRESULT</returns> public unsafe int FinalizeWritingNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[11])); }
/// <summary> /// Sets the presentation time of the sample. /// </summary> /// <param name="hnsSampleTime">The presentation time, in 100-nanosecond units.</param> /// <returns>HRESULT</returns> public unsafe int SetSampleTimeNative(long hnsSampleTime) { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, hnsSampleTime, ((void **)(*(void **)UnsafeBasePtr))[36])); }
/// <summary> /// Detaches the created object from the activation object. /// <see cref="DetachObject"/> /// </summary> /// <returns>HRESULT</returns> public unsafe int DetachObjectNative() { return(InteropCalls.CalliMethodPtr(UnsafeBasePtr, ((void **)(*(void **)UnsafeBasePtr))[35])); }
/// <summary> /// Associates an IUnknown pointer with a key. /// </summary> /// <returns>HRESULT</returns> public unsafe int SetUnknown(Guid key, IntPtr unknown) { return(InteropCalls.CalliMethodPtr(_basePtr, &key, unknown, ((void **)(*(void **)_basePtr))[27])); }