winegstreamer: Implement INSSBuffer::GetBuffer().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-11-08 15:24:29 -06:00 committed by Alexandre Julliard
parent d68ea16266
commit dc1a1ae450
2 changed files with 22 additions and 4 deletions

View File

@ -243,8 +243,12 @@ static HRESULT WINAPI buffer_GetMaxLength(INSSBuffer *iface, DWORD *size)
static HRESULT WINAPI buffer_GetBuffer(INSSBuffer *iface, BYTE **data) static HRESULT WINAPI buffer_GetBuffer(INSSBuffer *iface, BYTE **data)
{ {
FIXME("iface %p, data %p, stub!\n", iface, data); struct buffer *buffer = impl_from_INSSBuffer(iface);
return E_NOTIMPL;
TRACE("buffer %p, data %p.\n", buffer, data);
*data = buffer->data;
return S_OK;
} }
static HRESULT WINAPI buffer_GetBufferAndLength(INSSBuffer *iface, BYTE **data, DWORD *size) static HRESULT WINAPI buffer_GetBufferAndLength(INSSBuffer *iface, BYTE **data, DWORD *size)

View File

@ -602,9 +602,9 @@ static void test_sync_reader_streaming(void)
IWMProfile *profile; IWMProfile *profile;
QWORD pts, duration; QWORD pts, duration;
INSSBuffer *sample; INSSBuffer *sample;
BYTE *data, *data2;
HANDLE file; HANDLE file;
HRESULT hr; HRESULT hr;
BYTE *data;
BOOL ret; BOOL ret;
file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
@ -677,6 +677,11 @@ static void test_sync_reader_streaming(void)
{ {
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size); hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = INSSBuffer_GetBuffer(sample, &data2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
ref = INSSBuffer_Release(sample); ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
@ -737,6 +742,11 @@ static void test_sync_reader_streaming(void)
{ {
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size); hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = INSSBuffer_GetBuffer(sample, &data2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
ref = INSSBuffer_Release(sample); ref = INSSBuffer_Release(sample);
ok(!ref, "Got outstanding refcount %d.\n", ref); ok(!ref, "Got outstanding refcount %d.\n", ref);
} }
@ -1183,9 +1193,9 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
QWORD time, QWORD duration, DWORD flags, INSSBuffer *sample, void *context) QWORD time, QWORD duration, DWORD flags, INSSBuffer *sample, void *context)
{ {
struct callback *callback = impl_from_IWMReaderCallback(iface); struct callback *callback = impl_from_IWMReaderCallback(iface);
BYTE *data, *data2;
HRESULT hr; HRESULT hr;
DWORD size; DWORD size;
BYTE *data;
if (winetest_debug > 1) if (winetest_debug > 1)
trace("%u: %04x: IWMReaderCallback::OnSample(output %u, time %I64u, duration %I64u, flags %#x)\n", trace("%u: %04x: IWMReaderCallback::OnSample(output %u, time %I64u, duration %I64u, flags %#x)\n",
@ -1196,6 +1206,10 @@ static HRESULT WINAPI callback_OnSample(IWMReaderCallback *iface, DWORD output,
hr = INSSBuffer_GetBufferAndLength(sample, &data, &size); hr = INSSBuffer_GetBufferAndLength(sample, &data, &size);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = INSSBuffer_GetBuffer(sample, &data2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(data2 == data, "Data pointers didn't match.\n");
ok(callback->got_started > 0, "Got %u WMT_STARTED callbacks.\n", callback->got_started); ok(callback->got_started > 0, "Got %u WMT_STARTED callbacks.\n", callback->got_started);
ok(!callback->got_eof, "Got %u WMT_EOF callbacks.\n", callback->got_eof); ok(!callback->got_eof, "Got %u WMT_EOF callbacks.\n", callback->got_eof);
++callback->got_sample; ++callback->got_sample;