Damjan Jovanovic : qcap: Use the BaseOutputPin's IMemAllocator.

Alexandre Julliard julliard at winehq.org
Tue Jan 15 13:46:17 CST 2013


Module: wine
Branch: master
Commit: 632d82f4ac0f51a1c2773667d5dccc800bd27dc0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=632d82f4ac0f51a1c2773667d5dccc800bd27dc0

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Tue Jan 15 08:46:28 2013 +0200

qcap: Use the BaseOutputPin's IMemAllocator.

---

 dlls/qcap/v4l.c |   34 +++++-----------------------------
 1 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index 2562c48..41cc752 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -684,7 +684,6 @@ HRESULT qcap_driver_run(Capture *capBox, FILTER_STATE *state)
         *state = State_Running;
         if (!capBox->iscommitted++)
         {
-            IMemAllocator * pAlloc = NULL;
             ALLOCATOR_PROPERTIES ap, actual;
             BaseOutputPin *out;
 
@@ -698,16 +697,11 @@ HRESULT qcap_driver_run(Capture *capBox, FILTER_STATE *state)
             ap.cbPrefix = 0;
 
             out = (BaseOutputPin *)capBox->pOut;
-            hr = IMemInputPin_GetAllocator(out->pMemInputPin, &pAlloc);
 
-            if (SUCCEEDED(hr))
-                hr = IMemAllocator_SetProperties(pAlloc, &ap, &actual);
+            hr = IMemAllocator_SetProperties(out->pAllocator, &ap, &actual);
 
             if (SUCCEEDED(hr))
-                hr = IMemAllocator_Commit(pAlloc);
-
-            if (pAlloc)
-                IMemAllocator_Release(pAlloc);
+                hr = IMemAllocator_Commit(out->pAllocator);
 
             TRACE("Committing allocator: %x\n", hr);
         }
@@ -765,32 +759,14 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state)
         capBox->thread = 0;
         if (capBox->iscommitted)
         {
-            IMemInputPin *pMem = NULL;
-            IMemAllocator * pAlloc = NULL;
-            IPin *pConnect = NULL;
+            BaseOutputPin *out;
             HRESULT hr;
 
             capBox->iscommitted = 0;
 
-            hr = IPin_ConnectedTo(capBox->pOut, &pConnect);
-
-            if (SUCCEEDED(hr))
-                hr = IPin_QueryInterface(pConnect, &IID_IMemInputPin, (void **) &pMem);
-
-            if (SUCCEEDED(hr))
-                hr = IMemInputPin_GetAllocator(pMem, &pAlloc);
-
-            if (SUCCEEDED(hr))
-                hr = IMemAllocator_Decommit(pAlloc);
-
-            if (pAlloc)
-                IMemAllocator_Release(pAlloc);
-
-            if (pMem)
-                IMemInputPin_Release(pMem);
+            out = (BaseOutputPin*)capBox->pOut;
 
-            if (pConnect)
-                IPin_Release(pConnect);
+            hr = IMemAllocator_Decommit(out->pAllocator);
 
             if (hr != S_OK && hr != VFW_E_NOT_COMMITTED)
                 WARN("Decommitting allocator: %x\n", hr);




More information about the wine-cvs mailing list