/// <summary> /// Reads the next sample from the media source. /// </summary> public MFSample ReadSample(int streamIndex, int controlFlags, out int actualStreamIndex, out MFSourceReaderFlag streamFlags, out long timestamp) { MFSample sample; MediaFoundationException.Try(ReadSampleNative(streamIndex, controlFlags, out actualStreamIndex, out streamFlags, out timestamp, out sample), c, "ReadSample"); return(sample); }
/// <summary> /// Reads the next sample from the media source. /// </summary> /// <returns>HRESULT</returns> public unsafe int ReadSampleNative(int streamIndex, int controlFlags, out int actualStreamIndex, out MFSourceReaderFlag streamFlags, out long timestamp, out MFSample sample) { IntPtr psample = IntPtr.Zero; fixed (void* ptr0 = &actualStreamIndex, ptr1 = &streamFlags, ptr2 = ×tamp) { int result = InteropCalls.CalliMethodPtr(_basePtr, streamIndex, controlFlags, ptr0, ptr1, ptr2, &psample, ((void**)(*(void**)_basePtr))[9]); sample = psample == IntPtr.Zero ? null : new MFSample(psample); return result; } }
/// <summary> /// Reads the next sample from the media source. /// </summary> /// <returns>HRESULT</returns> public unsafe int ReadSampleNative(int streamIndex, int controlFlags, out int actualStreamIndex, out MFSourceReaderFlag streamFlags, out long timestamp, out MFSample sample) { IntPtr psample = IntPtr.Zero; fixed(void *ptr0 = &actualStreamIndex, ptr1 = &streamFlags, ptr2 = ×tamp) { int result = InteropCalls.CalliMethodPtr(_basePtr, streamIndex, controlFlags, ptr0, ptr1, ptr2, &psample, ((void **)(*(void **)_basePtr))[9]); sample = psample == IntPtr.Zero ? null : new MFSample(psample); return(result); } }
/// <summary> /// Reads the next sample from the media source. /// </summary> public MFSample ReadSample(int streamIndex, int controlFlags, out int actualStreamIndex, out MFSourceReaderFlag streamFlags, out long timestamp) { MFSample sample; MediaFoundationException.Try(ReadSampleNative(streamIndex, controlFlags, out actualStreamIndex, out streamFlags, out timestamp, out sample), c, "ReadSample"); return sample; }