2021-03-05 14:19:01 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Austin English
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
#include "gst_private.h"
|
2021-03-05 14:19:01 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
|
|
|
|
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader
|
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct wm_reader reader;
|
|
|
|
|
2021-03-05 14:19:01 +01:00
|
|
|
IWMSyncReader2 IWMSyncReader2_iface;
|
2021-11-01 01:03:35 +01:00
|
|
|
|
|
|
|
WORD last_read_stream;
|
2021-10-07 17:47:08 +02:00
|
|
|
};
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-07 17:47:08 +02:00
|
|
|
static struct sync_reader *impl_from_IWMSyncReader2(IWMSyncReader2 *iface)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
return CONTAINING_RECORD(iface, struct sync_reader, IWMSyncReader2_iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_QueryInterface(IWMSyncReader2 *iface, REFIID iid, void **out)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
return IWMProfile3_QueryInterface(&reader->reader.IWMProfile3_iface, iid, out);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WMSyncReader_AddRef(IWMSyncReader2 *iface)
|
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
return IWMProfile3_AddRef(&reader->reader.IWMProfile3_iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI WMSyncReader_Release(IWMSyncReader2 *iface)
|
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
return IWMProfile3_Release(&reader->reader.IWMProfile3_iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_Close(IWMSyncReader2 *iface)
|
|
|
|
{
|
2021-10-26 01:52:11 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p.\n", reader);
|
|
|
|
|
|
|
|
return wm_reader_close(&reader->reader);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_GetMaxOutputSampleSize(IWMSyncReader2 *iface, DWORD output, DWORD *max)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %p): stub!\n", This, output, max);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_GetMaxStreamSampleSize(IWMSyncReader2 *iface, WORD stream, DWORD *max)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
FIXME("(%p)->(%d %p): stub!\n", This, stream, max);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2021-11-01 01:03:33 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetNextSample(IWMSyncReader2 *iface,
|
|
|
|
WORD stream_number, INSSBuffer **sample, QWORD *pts, QWORD *duration,
|
|
|
|
DWORD *flags, DWORD *output_number, WORD *ret_stream_number)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-01 01:03:33 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
2021-11-10 17:41:09 +01:00
|
|
|
HRESULT hr = NS_E_NO_MORE_SAMPLES;
|
2021-11-01 01:03:33 +01:00
|
|
|
struct wm_stream *stream;
|
2021-11-01 01:03:35 +01:00
|
|
|
WORD i;
|
2021-11-01 01:03:33 +01:00
|
|
|
|
|
|
|
TRACE("reader %p, stream_number %u, sample %p, pts %p, duration %p,"
|
|
|
|
" flags %p, output_number %p, ret_stream_number %p.\n",
|
|
|
|
reader, stream_number, sample, pts, duration, flags, output_number, ret_stream_number);
|
|
|
|
|
|
|
|
EnterCriticalSection(&reader->reader.cs);
|
|
|
|
|
|
|
|
if (!stream_number)
|
|
|
|
{
|
2021-11-01 01:03:35 +01:00
|
|
|
if (!output_number && !ret_stream_number)
|
|
|
|
{
|
|
|
|
LeaveCriticalSection(&reader->reader.cs);
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < reader->reader.stream_count; ++i)
|
|
|
|
{
|
|
|
|
WORD index = (i + reader->last_read_stream + 1) % reader->reader.stream_count;
|
2021-11-10 17:41:09 +01:00
|
|
|
struct wm_stream *stream = &reader->reader.streams[index];
|
2021-11-01 01:03:35 +01:00
|
|
|
|
2021-11-10 17:41:09 +01:00
|
|
|
if (stream->selection == WMT_OFF)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
hr = wm_reader_get_stream_sample(stream, sample, pts, duration, flags);
|
2021-11-01 01:03:35 +01:00
|
|
|
if (hr == S_OK)
|
|
|
|
{
|
|
|
|
if (output_number)
|
|
|
|
*output_number = index;
|
|
|
|
if (ret_stream_number)
|
|
|
|
*ret_stream_number = index + 1;
|
|
|
|
}
|
|
|
|
if (hr != NS_E_NO_MORE_SAMPLES)
|
|
|
|
{
|
|
|
|
reader->last_read_stream = index;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-11-01 01:03:33 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!(stream = wm_reader_get_stream_by_stream_number(&reader->reader, stream_number)))
|
|
|
|
{
|
|
|
|
LeaveCriticalSection(&reader->reader.cs);
|
|
|
|
return E_INVALIDARG;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = wm_reader_get_stream_sample(stream, sample, pts, duration, flags);
|
|
|
|
if (hr == S_OK && output_number)
|
|
|
|
*output_number = stream->index;
|
|
|
|
if (ret_stream_number)
|
|
|
|
*ret_stream_number = stream->index + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
LeaveCriticalSection(&reader->reader.cs);
|
|
|
|
return hr;
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-27 05:22:04 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputCount(IWMSyncReader2 *iface, DWORD *count)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-27 05:22:04 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, count %p.\n", reader, count);
|
|
|
|
|
|
|
|
EnterCriticalSection(&reader->reader.cs);
|
|
|
|
*count = reader->reader.stream_count;
|
|
|
|
LeaveCriticalSection(&reader->reader.cs);
|
|
|
|
return S_OK;
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-28 18:45:59 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputFormat(IWMSyncReader2 *iface,
|
|
|
|
DWORD output, DWORD index, IWMOutputMediaProps **props)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-28 18:45:59 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, index %lu, props %p.\n", reader, output, index, props);
|
2021-10-28 18:45:59 +02:00
|
|
|
|
|
|
|
return wm_reader_get_output_format(&reader->reader, output, index, props);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-28 18:46:00 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputFormatCount(IWMSyncReader2 *iface, DWORD output, DWORD *count)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-28 18:46:00 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, count %p.\n", reader, output, count);
|
2021-10-28 18:46:00 +02:00
|
|
|
|
|
|
|
return wm_reader_get_output_format_count(&reader->reader, output, count);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-27 05:22:07 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputNumberForStream(IWMSyncReader2 *iface,
|
|
|
|
WORD stream_number, DWORD *output)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-27 05:22:07 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, stream_number %u, output %p.\n", reader, stream_number, output);
|
|
|
|
|
|
|
|
*output = stream_number - 1;
|
|
|
|
return S_OK;
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-10-28 18:45:57 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputProps(IWMSyncReader2 *iface,
|
|
|
|
DWORD output, IWMOutputMediaProps **props)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-28 18:45:57 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
|
2021-10-28 18:45:57 +02:00
|
|
|
|
|
|
|
return wm_reader_get_output_props(&reader->reader, output, props);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_GetOutputSetting(IWMSyncReader2 *iface, DWORD output_num, const WCHAR *name,
|
|
|
|
WMT_ATTR_DATATYPE *type, BYTE *value, WORD *length)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %s %p %p %p): stub!\n", This, output_num, debugstr_w(name), type, value, length);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_GetReadStreamSamples(IWMSyncReader2 *iface, WORD stream_num, BOOL *compressed)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
FIXME("(%p)->(%d %p): stub!\n", This, stream_num, compressed);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2021-10-27 05:22:08 +02:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetStreamNumberForOutput(IWMSyncReader2 *iface,
|
|
|
|
DWORD output, WORD *stream_number)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-27 05:22:08 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, stream_number %p.\n", reader, output, stream_number);
|
2021-10-27 05:22:08 +02:00
|
|
|
|
|
|
|
*stream_number = output + 1;
|
2021-03-05 14:19:01 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2021-11-10 17:41:11 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_GetStreamSelected(IWMSyncReader2 *iface,
|
|
|
|
WORD stream_number, WMT_STREAM_SELECTION *selection)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-10 17:41:11 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, stream_number %u, selection %p.\n", reader, stream_number, selection);
|
|
|
|
|
|
|
|
return wm_reader_get_stream_selection(&reader->reader, stream_number, selection);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_Open(IWMSyncReader2 *iface, const WCHAR *filename)
|
|
|
|
{
|
2021-11-02 06:13:04 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, filename %s.\n", reader, debugstr_w(filename));
|
|
|
|
|
|
|
|
return wm_reader_open_file(&reader->reader, filename);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_OpenStream(IWMSyncReader2 *iface, IStream *stream)
|
|
|
|
{
|
2021-10-26 01:52:11 +02:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, stream %p.\n", reader, stream);
|
|
|
|
|
|
|
|
return wm_reader_open_stream(&reader->reader, stream);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-11-01 01:03:32 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_SetOutputProps(IWMSyncReader2 *iface, DWORD output, IWMOutputMediaProps *props)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-01 01:03:32 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, props %p.\n", reader, output, props);
|
2021-11-01 01:03:32 +01:00
|
|
|
|
|
|
|
return wm_reader_set_output_props(&reader->reader, output, props);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-11-02 06:13:01 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_SetOutputSetting(IWMSyncReader2 *iface, DWORD output,
|
|
|
|
const WCHAR *name, WMT_ATTR_DATATYPE type, const BYTE *value, WORD size)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-02 06:13:01 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
2022-02-04 01:45:24 +01:00
|
|
|
TRACE("reader %p, output %lu, name %s, type %#x, value %p, size %u.\n",
|
2021-11-02 06:13:01 +01:00
|
|
|
reader, output, debugstr_w(name), type, value, size);
|
|
|
|
|
|
|
|
if (!wcscmp(name, L"VideoSampleDurations"))
|
|
|
|
{
|
|
|
|
FIXME("Ignoring VideoSampleDurations setting.\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2022-02-08 12:45:52 +01:00
|
|
|
if (!wcscmp(name, L"EnableDiscreteOutput"))
|
|
|
|
{
|
|
|
|
FIXME("Ignoring EnableDiscreteOutput setting.\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
if (!wcscmp(name, L"SpeakerConfig"))
|
|
|
|
{
|
|
|
|
FIXME("Ignoring SpeakerConfig setting.\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2021-11-02 06:13:01 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("Unknown setting %s; returning E_NOTIMPL.\n", debugstr_w(name));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_SetRange(IWMSyncReader2 *iface, QWORD start, LONGLONG duration)
|
|
|
|
{
|
2021-11-01 01:03:36 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, start %I64u, duration %I64d.\n", reader, start, duration);
|
|
|
|
|
|
|
|
wm_reader_seek(&reader->reader, start, duration);
|
|
|
|
return S_OK;
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader_SetRangeByFrame(IWMSyncReader2 *iface, WORD stream_num, QWORD frame_num,
|
|
|
|
LONGLONG frames)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
FIXME("(%p)->(%d %s %s): stub!\n", This, stream_num, wine_dbgstr_longlong(frame_num), wine_dbgstr_longlong(frames));
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2021-11-11 02:05:50 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_SetReadStreamSamples(IWMSyncReader2 *iface, WORD stream_number, BOOL compressed)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-11 02:05:50 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, stream_index %u, compressed %d.\n", reader, stream_number, compressed);
|
|
|
|
|
|
|
|
return wm_reader_set_read_compressed(&reader->reader, stream_number, compressed);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
2021-11-10 17:41:09 +01:00
|
|
|
static HRESULT WINAPI WMSyncReader_SetStreamsSelected(IWMSyncReader2 *iface,
|
|
|
|
WORD count, WORD *stream_numbers, WMT_STREAM_SELECTION *selections)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-11-10 17:41:09 +01:00
|
|
|
struct sync_reader *reader = impl_from_IWMSyncReader2(iface);
|
|
|
|
|
|
|
|
TRACE("reader %p, count %u, stream_numbers %p, selections %p.\n",
|
|
|
|
reader, count, stream_numbers, selections);
|
|
|
|
|
|
|
|
return wm_reader_set_streams_selected(&reader->reader, count, stream_numbers, selections);
|
2021-03-05 14:19:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_SetRangeByTimecode(IWMSyncReader2 *iface, WORD stream_num,
|
|
|
|
WMT_TIMECODE_EXTENSION_DATA *start, WMT_TIMECODE_EXTENSION_DATA *end)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
FIXME("(%p)->(%u %p %p): stub!\n", This, stream_num, start, end);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_SetRangeByFrameEx(IWMSyncReader2 *iface, WORD stream_num, QWORD frame_num,
|
|
|
|
LONGLONG frames_to_read, QWORD *starttime)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2021-03-05 14:19:01 +01:00
|
|
|
FIXME("(%p)->(%u %s %s %p): stub!\n", This, stream_num, wine_dbgstr_longlong(frame_num),
|
|
|
|
wine_dbgstr_longlong(frames_to_read), starttime);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_SetAllocateForOutput(IWMSyncReader2 *iface, DWORD output_num, IWMReaderAllocatorEx *allocator)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %p): stub!\n", This, output_num, allocator);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_GetAllocateForOutput(IWMSyncReader2 *iface, DWORD output_num, IWMReaderAllocatorEx **allocator)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %p): stub!\n", This, output_num, allocator);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_SetAllocateForStream(IWMSyncReader2 *iface, DWORD stream_num, IWMReaderAllocatorEx *allocator)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %p): stub!\n", This, stream_num, allocator);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI WMSyncReader2_GetAllocateForStream(IWMSyncReader2 *iface, DWORD stream_num, IWMReaderAllocatorEx **allocator)
|
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *This = impl_from_IWMSyncReader2(iface);
|
2022-02-04 01:45:24 +01:00
|
|
|
FIXME("(%p)->(%lu %p): stub!\n", This, stream_num, allocator);
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IWMSyncReader2Vtbl WMSyncReader2Vtbl = {
|
|
|
|
WMSyncReader_QueryInterface,
|
|
|
|
WMSyncReader_AddRef,
|
|
|
|
WMSyncReader_Release,
|
|
|
|
WMSyncReader_Open,
|
|
|
|
WMSyncReader_Close,
|
|
|
|
WMSyncReader_SetRange,
|
|
|
|
WMSyncReader_SetRangeByFrame,
|
|
|
|
WMSyncReader_GetNextSample,
|
|
|
|
WMSyncReader_SetStreamsSelected,
|
|
|
|
WMSyncReader_GetStreamSelected,
|
|
|
|
WMSyncReader_SetReadStreamSamples,
|
|
|
|
WMSyncReader_GetReadStreamSamples,
|
|
|
|
WMSyncReader_GetOutputSetting,
|
|
|
|
WMSyncReader_SetOutputSetting,
|
|
|
|
WMSyncReader_GetOutputCount,
|
|
|
|
WMSyncReader_GetOutputProps,
|
|
|
|
WMSyncReader_SetOutputProps,
|
|
|
|
WMSyncReader_GetOutputFormatCount,
|
|
|
|
WMSyncReader_GetOutputFormat,
|
|
|
|
WMSyncReader_GetOutputNumberForStream,
|
|
|
|
WMSyncReader_GetStreamNumberForOutput,
|
|
|
|
WMSyncReader_GetMaxOutputSampleSize,
|
|
|
|
WMSyncReader_GetMaxStreamSampleSize,
|
|
|
|
WMSyncReader_OpenStream,
|
|
|
|
WMSyncReader2_SetRangeByTimecode,
|
|
|
|
WMSyncReader2_SetRangeByFrameEx,
|
|
|
|
WMSyncReader2_SetAllocateForOutput,
|
|
|
|
WMSyncReader2_GetAllocateForOutput,
|
|
|
|
WMSyncReader2_SetAllocateForStream,
|
|
|
|
WMSyncReader2_GetAllocateForStream
|
|
|
|
};
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
static struct sync_reader *impl_from_wm_reader(struct wm_reader *iface)
|
2021-03-05 14:19:03 +01:00
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
return CONTAINING_RECORD(iface, struct sync_reader, reader);
|
2021-03-05 14:19:03 +01:00
|
|
|
}
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
static void *sync_reader_query_interface(struct wm_reader *iface, REFIID iid)
|
2021-03-05 14:19:03 +01:00
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct sync_reader *reader = impl_from_wm_reader(iface);
|
2021-03-05 14:19:03 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
TRACE("reader %p, iid %s.\n", reader, debugstr_guid(iid));
|
2021-03-05 14:19:03 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
if (IsEqualIID(iid, &IID_IWMSyncReader)
|
|
|
|
|| IsEqualIID(iid, &IID_IWMSyncReader2))
|
|
|
|
return &reader->IWMSyncReader2_iface;
|
2021-03-05 14:19:03 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
return NULL;
|
2021-03-05 14:19:03 +01:00
|
|
|
}
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
static void sync_reader_destroy(struct wm_reader *iface)
|
2021-03-05 14:19:03 +01:00
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
struct sync_reader *reader = impl_from_wm_reader(iface);
|
2021-03-05 14:19:03 +01:00
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
TRACE("reader %p.\n", reader);
|
2021-03-05 14:19:03 +01:00
|
|
|
|
2021-10-26 01:52:11 +02:00
|
|
|
wm_reader_close(&reader->reader);
|
|
|
|
wm_reader_cleanup(&reader->reader);
|
2021-10-20 18:09:46 +02:00
|
|
|
free(reader);
|
2021-03-05 14:19:03 +01:00
|
|
|
}
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
static const struct wm_reader_ops sync_reader_ops =
|
2021-03-05 14:19:03 +01:00
|
|
|
{
|
2021-10-20 18:09:46 +02:00
|
|
|
.query_interface = sync_reader_query_interface,
|
|
|
|
.destroy = sync_reader_destroy,
|
2021-03-05 14:19:03 +01:00
|
|
|
};
|
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader)
|
2021-03-05 14:19:01 +01:00
|
|
|
{
|
2021-10-07 17:47:08 +02:00
|
|
|
struct sync_reader *object;
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
TRACE("reader %p.\n", reader);
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
if (!(object = calloc(1, sizeof(*object))))
|
2021-03-05 14:19:01 +01:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2021-10-20 18:09:46 +02:00
|
|
|
wm_reader_init(&object->reader, &sync_reader_ops);
|
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
object->IWMSyncReader2_iface.lpVtbl = &WMSyncReader2Vtbl;
|
2021-03-05 14:19:01 +01:00
|
|
|
|
2021-10-07 17:47:07 +02:00
|
|
|
TRACE("Created sync reader %p.\n", object);
|
|
|
|
*reader = (IWMSyncReader *)&object->IWMSyncReader2_iface;
|
2021-03-05 14:19:01 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|