qcap: Add Avi Mux IConfigInterleaving::put_Mode implementation.

This commit is contained in:
Piotr Caban 2014-02-24 12:11:12 +01:00 committed by Alexandre Julliard
parent 43bef66e8b
commit 6017d55d07
2 changed files with 34 additions and 2 deletions

View File

@ -54,6 +54,7 @@ typedef struct {
IPersistMediaPropertyBag IPersistMediaPropertyBag_iface;
ISpecifyPropertyPages ISpecifyPropertyPages_iface;
InterleavingMode mode;
AviMuxOut *out;
int input_pin_no;
AviMuxIn *in[MAX_PIN_NO-1];
@ -331,8 +332,28 @@ static HRESULT WINAPI ConfigInterleaving_put_Mode(
IConfigInterleaving *iface, InterleavingMode mode)
{
AviMux *This = impl_from_IConfigInterleaving(iface);
FIXME("(%p)->(%d)\n", This, mode);
return E_NOTIMPL;
HRESULT hr = S_OK;
TRACE("(%p)->(%d)\n", This, mode);
if(mode>INTERLEAVE_NONE_BUFFERED)
return E_INVALIDARG;
if(This->mode != mode) {
int i;
for(i=0; i<This->input_pin_no; i++) {
if(!This->in[i]->pin.pin.pConnectedTo)
continue;
hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, &This->in[i]->pin.pin.IPin_iface);
if(FAILED(hr))
return hr;
}
}
This->mode = mode;
return S_OK;
}
static HRESULT WINAPI ConfigInterleaving_get_Mode(

View File

@ -1235,6 +1235,7 @@ static void test_AviMux(void)
IMemInputPin *memin;
ALLOCATOR_PROPERTIES props;
IMemAllocator *memalloc;
IConfigInterleaving *ci;
HRESULT hr;
init_test_filter(&source_filter, PINDIR_OUTPUT, SOURCE_FILTER);
@ -1369,6 +1370,16 @@ static void test_AviMux(void)
IMemAllocator_Release(memalloc);
IMemInputPin_Release(memin);
hr = IBaseFilter_QueryInterface(avimux, &IID_IConfigInterleaving, (void**)&ci);
ok(hr == S_OK, "QueryInterface(IID_IConfigInterleaving) returned %x\n", hr);
hr = IConfigInterleaving_put_Mode(ci, 5);
ok(hr == E_INVALIDARG, "put_Mode returned %x\n", hr);
SET_EXPECT(Reconnect);
hr = IConfigInterleaving_put_Mode(ci, INTERLEAVE_FULL);
ok(hr == S_OK, "put_Mode returned %x\n", hr);
CHECK_CALLED(Reconnect);
IConfigInterleaving_Release(ci);
hr = IPin_Disconnect(avimux_out);
ok(hr == S_OK, "Disconnect returned %x\n", hr);