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

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-03-20 08:35:43 +03:00 committed by Alexandre Julliard
parent ca84c6e82e
commit d6acb0edb8
2 changed files with 27 additions and 3 deletions
dlls/mfreadwrite
include

View File

@ -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,

View File

@ -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),