Rémi Bernon : qasf: Implement ASF Reader filter pin DecideBufferSize.
Alexandre Julliard
julliard at winehq.org
Tue Aug 9 15:18:51 CDT 2022
Module: wine
Branch: master
Commit: 1a580f933011028a9efb67bf159a1e742811b07d
URL: https://gitlab.winehq.org/wine/wine/-/commit/1a580f933011028a9efb67bf159a1e742811b07d
Author: Rémi Bernon <rbernon at codeweavers.com>
Date: Fri May 20 22:19:00 2022 +0200
qasf: Implement ASF Reader filter pin DecideBufferSize.
---
dlls/qasf/asfreader.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/qasf/asfreader.c b/dlls/qasf/asfreader.c
index 738b6e63548..43a7a3534a8 100644
--- a/dlls/qasf/asfreader.c
+++ b/dlls/qasf/asfreader.c
@@ -198,8 +198,29 @@ static const struct strmbase_filter_ops filter_ops =
static HRESULT WINAPI asf_reader_DecideBufferSize(struct strmbase_source *iface,
IMemAllocator *allocator, ALLOCATOR_PROPERTIES *req_props)
{
- FIXME("iface %p, allocator %p, req_props %p stub!\n", iface, allocator, req_props);
- return E_NOTIMPL;
+ struct asf_stream *stream = impl_from_strmbase_pin(&iface->pin);
+ unsigned int buffer_size = 16384;
+ ALLOCATOR_PROPERTIES ret_props;
+
+ TRACE("iface %p, allocator %p, req_props %p.\n", iface, allocator, req_props);
+
+ if (IsEqualGUID(&stream->source.pin.mt.formattype, &FORMAT_VideoInfo))
+ {
+ VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)stream->source.pin.mt.pbFormat;
+ buffer_size = format->bmiHeader.biSizeImage;
+ }
+ else if (IsEqualGUID(&stream->source.pin.mt.formattype, &FORMAT_WaveFormatEx)
+ && (IsEqualGUID(&stream->source.pin.mt.subtype, &MEDIASUBTYPE_PCM)
+ || IsEqualGUID(&stream->source.pin.mt.subtype, &MEDIASUBTYPE_IEEE_FLOAT)))
+ {
+ WAVEFORMATEX *format = (WAVEFORMATEX *)stream->source.pin.mt.pbFormat;
+ buffer_size = format->nAvgBytesPerSec;
+ }
+
+ req_props->cBuffers = max(req_props->cBuffers, 1);
+ req_props->cbBuffer = max(req_props->cbBuffer, buffer_size);
+ req_props->cbAlign = max(req_props->cbAlign, 1);
+ return IMemAllocator_SetProperties(allocator, req_props, &ret_props);
}
static const struct strmbase_source_ops source_ops =
More information about the wine-cvs
mailing list