Commit d6acb0ed authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfreadwrite: Add partial implementation of SetCurrentPosition() for source reader.

parent ca84c6e8
......@@ -359,9 +359,21 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWO
static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReader *iface, REFGUID format, REFPROPVARIANT position)
{
srcreader *This = impl_from_IMFSourceReader(iface);
FIXME("%p, %s, %p\n", This, debugstr_guid(format), position);
return E_NOTIMPL;
struct source_reader *reader = impl_from_IMFSourceReader(iface);
DWORD flags;
HRESULT hr;
TRACE("%p, %s, %p.\n", iface, debugstr_guid(format), position);
/* FIXME: fail if we got pending samples. */
if (FAILED(hr = IMFMediaSource_GetCharacteristics(reader->source, &flags)))
return hr;
if (!(flags & MFMEDIASOURCE_CAN_SEEK))
return MF_E_INVALIDREQUEST;
return IMFMediaSource_Start(reader->source, reader->descriptor, format, position);
}
static HRESULT WINAPI src_reader_ReadSample(IMFSourceReader *iface, DWORD index,
......
......@@ -425,6 +425,18 @@ cpp_quote("HRESULT WINAPI MFGetService(IUnknown *object, REFGUID service, REFIID
cpp_quote("MFTIME WINAPI MFGetSystemTime(void);")
cpp_quote("HRESULT WINAPI MFShutdownObject(IUnknown *object);")
typedef enum _MFMEDIASOURCE_CHARACTERISTICS
{
MFMEDIASOURCE_IS_LIVE = 0x1,
MFMEDIASOURCE_CAN_SEEK = 0x2,
MFMEDIASOURCE_CAN_PAUSE = 0x4,
MFMEDIASOURCE_HAS_SLOW_SEEK = 0x8,
MFMEDIASOURCE_HAS_MULTIPLE_PRESENTATIONS = 0x10,
MFMEDIASOURCE_CAN_SKIPFORWARD = 0x20,
MFMEDIASOURCE_CAN_SKIPBACKWARD = 0x40,
MFMEDIASOURCE_DOES_NOT_USE_NETWORK = 0x80,
} MFMEDIASOURCE_CHARACTERISTICS;
[
object,
uuid(279a808d-aec7-40c8-9c6b-a6b492c78a66),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment