Commit 151a3eec authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

qcap: Add Avi Mux input pin IMemInputPin::GetAllocator.

parent 0ea378e1
...@@ -1346,8 +1346,15 @@ static HRESULT WINAPI AviMuxIn_MemInputPin_GetAllocator( ...@@ -1346,8 +1346,15 @@ static HRESULT WINAPI AviMuxIn_MemInputPin_GetAllocator(
{ {
AviMuxIn *avimuxin = AviMuxIn_from_IMemInputPin(iface); AviMuxIn *avimuxin = AviMuxIn_from_IMemInputPin(iface);
AviMux *This = impl_from_in_IPin(&avimuxin->pin.pin.IPin_iface); AviMux *This = impl_from_in_IPin(&avimuxin->pin.pin.IPin_iface);
FIXME("(%p:%s)->(%p)\n", This, debugstr_w(avimuxin->pin.pin.pinInfo.achName), ppAllocator);
return E_NOTIMPL; TRACE("(%p:%s)->(%p)\n", This, debugstr_w(avimuxin->pin.pin.pinInfo.achName), ppAllocator);
if(!ppAllocator)
return E_POINTER;
IMemAllocator_AddRef(avimuxin->pin.pAllocator);
*ppAllocator = avimuxin->pin.pAllocator;
return S_OK;
} }
static HRESULT WINAPI AviMuxIn_MemInputPin_NotifyAllocator( static HRESULT WINAPI AviMuxIn_MemInputPin_NotifyAllocator(
...@@ -1545,6 +1552,13 @@ static HRESULT create_input_pin(AviMux *avimux) ...@@ -1545,6 +1552,13 @@ static HRESULT create_input_pin(AviMux *avimux)
avimux->in[avimux->input_pin_no]->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl; avimux->in[avimux->input_pin_no]->IPropertyBag_iface.lpVtbl = &AviMuxIn_PropertyBagVtbl;
avimux->in[avimux->input_pin_no]->IQualityControl_iface.lpVtbl = &AviMuxIn_QualityControlVtbl; avimux->in[avimux->input_pin_no]->IQualityControl_iface.lpVtbl = &AviMuxIn_QualityControlVtbl;
hr = CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
&IID_IMemAllocator, (void**)&avimux->in[avimux->input_pin_no]->pin.pAllocator);
if(FAILED(hr)) {
BaseInputPinImpl_Release(&avimux->in[avimux->input_pin_no]->pin.pin.IPin_iface);
return hr;
}
avimux->input_pin_no++; avimux->input_pin_no++;
return S_OK; return S_OK;
} }
......
...@@ -1234,6 +1234,7 @@ static void test_AviMux(void) ...@@ -1234,6 +1234,7 @@ static void test_AviMux(void)
IEnumMediaTypes *emt; IEnumMediaTypes *emt;
IMemInputPin *memin; IMemInputPin *memin;
ALLOCATOR_PROPERTIES props; ALLOCATOR_PROPERTIES props;
IMemAllocator *memalloc;
HRESULT hr; HRESULT hr;
init_test_filter(&source_filter, PINDIR_OUTPUT, SOURCE_FILTER); init_test_filter(&source_filter, PINDIR_OUTPUT, SOURCE_FILTER);
...@@ -1351,6 +1352,21 @@ static void test_AviMux(void) ...@@ -1351,6 +1352,21 @@ static void test_AviMux(void)
ok(props.cbBuffer == 0xdeadbee2, "cbBuffer = %d\n", props.cbBuffer); ok(props.cbBuffer == 0xdeadbee2, "cbBuffer = %d\n", props.cbBuffer);
ok(props.cbAlign == 1, "cbAlign = %d\n", props.cbAlign); ok(props.cbAlign == 1, "cbAlign = %d\n", props.cbAlign);
ok(props.cbPrefix == 8, "cbPrefix = %d\n", props.cbPrefix); ok(props.cbPrefix == 8, "cbPrefix = %d\n", props.cbPrefix);
hr = IMemInputPin_GetAllocator(memin, &memalloc);
ok(hr == S_OK, "GetAllocator returned %x\n", hr);
props.cBuffers = 0xdeadbee1;
props.cbBuffer = 0xdeadbee2;
props.cbAlign = 0xdeadbee3;
props.cbPrefix = 0xdeadbee4;
hr = IMemAllocator_GetProperties(memalloc, &props);
ok(hr == S_OK, "GetProperties returned %x\n", hr);
ok(props.cBuffers == 0, "cBuffers = %d\n", props.cBuffers);
ok(props.cbBuffer == 0, "cbBuffer = %d\n", props.cbBuffer);
ok(props.cbAlign == 0, "cbAlign = %d\n", props.cbAlign);
ok(props.cbPrefix == 0, "cbPrefix = %d\n", props.cbPrefix);
IMemAllocator_Release(memalloc);
IMemInputPin_Release(memin); IMemInputPin_Release(memin);
hr = IPin_Disconnect(avimux_out); hr = IPin_Disconnect(avimux_out);
......
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