[ros-diffs] [janderwald] 46180: [KSPROXY] - Add support for IPersist interface - Create clock handle when request for IKsClockPropertySet / IReferenceClock arrives - Print out requested format - Implement IPersist::GetClassID, IBaseFilter::QueryVendorInfo for CKsProxy

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sat Mar 13 19:45:51 CET 2010


Author: janderwald
Date: Sat Mar 13 19:45:51 2010
New Revision: 46180

URL: http://svn.reactos.org/svn/reactos?rev=46180&view=rev
Log:
[KSPROXY]
- Add support for IPersist interface
- Create clock handle when request for IKsClockPropertySet / IReferenceClock arrives
- Print out requested format
- Implement IPersist::GetClassID, IBaseFilter::QueryVendorInfo for CKsProxy

Modified:
    trunk/reactos/dll/directx/ksproxy/proxy.cpp

Modified: trunk/reactos/dll/directx/ksproxy/proxy.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ksproxy/proxy.cpp?rev=46180&r1=46179&r2=46180&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/ksproxy/proxy.cpp [iso-8859-1] Sat Mar 13 19:45:51 2010
@@ -17,6 +17,7 @@
 const GUID KSPROPSETID_Clock = {0xDF12A4C0L, 0xAC17, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
 const GUID KSEVENTSETID_Clock = {0x364D8E20L, 0x62C7, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
 const GUID KSPROPSETID_Stream = {0x65aaba60L, 0x98ae, 0x11cf, {0xa1, 0x0d, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
+const GUID IID_IPersist = {0x0000010c, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
 #endif
 
 const GUID IID_IBDA_DeviceControl = {0xFD0A5AF3, 0xB41D, 0x11d2, {0x9C, 0x95, 0x00, 0xC0, 0x4F, 0x79, 0x71, 0xE0}};
@@ -234,6 +235,12 @@
         reinterpret_cast<IPersistStream*>(*Output)->AddRef();
         return NOERROR;
     }
+    else if (IsEqualGUID(refiid, IID_IPersist))
+    {
+        *Output = (IPersistStream*)(this);
+        reinterpret_cast<IPersist*>(*Output)->AddRef();
+        return NOERROR;
+    }
     else if (IsEqualGUID(refiid, IID_IKsObject))
     {
         *Output = (IKsObject*)(this);
@@ -248,6 +255,13 @@
     }
     else if (IsEqualGUID(refiid, IID_IReferenceClock))
     {
+        if (!m_hClock)
+        {
+            HRESULT hr = CreateClockInstance();
+            if (FAILED(hr))
+                return hr;
+        }
+
         *Output = (IReferenceClock*)(this);
         reinterpret_cast<IReferenceClock*>(*Output)->AddRef();
         return NOERROR;
@@ -290,6 +304,13 @@
     }
     else if (IsEqualGUID(refiid, IID_IKsClockPropertySet))
     {
+        if (!m_hClock)
+        {
+            HRESULT hr = CreateClockInstance();
+            if (FAILED(hr))
+                return hr;
+        }
+
         *Output = (IKsClockPropertySet*)(this);
         reinterpret_cast<IKsClockPropertySet*>(*Output)->AddRef();
         return NOERROR;
@@ -890,7 +911,11 @@
     ULONG Index;
     HRESULT hr = S_FALSE;
 
-    OutputDebugStringW(L"CKsProxy::IsFormatSupported\n");
+    WCHAR Buffer[100];
+    LPOLESTR pstr;
+    StringFromCLSID(*pFormat, &pstr);
+    swprintf(Buffer, L"CKsProxy::IsFormatSupported %s\n",pstr);
+    OutputDebugStringW(Buffer);
 
     if (!pFormat)
         return E_POINTER;
@@ -899,6 +924,9 @@
     hr = GetMediaSeekingFormats(&FormatList);
     if (SUCCEEDED(hr))
     {
+        swprintf(Buffer, L"CKsProxy::IsFormatSupported NumFormat %lu\n",FormatList->Count);
+        OutputDebugStringW(Buffer);
+
         //iterate through format list
         pGuid = (LPGUID)(FormatList + 1);
         for(Index = 0; Index < FormatList->Count; Index++)
@@ -2447,8 +2475,10 @@
 CKsProxy::GetClassID(
     CLSID *pClassID)
 {
-    OutputDebugStringW(L"CKsProxy::GetClassID : NotImplemented\n");
-    return E_NOTIMPL;
+    OutputDebugStringW(L"CKsProxy::GetClassID\n");
+    CopyMemory(pClassID, &CLSID_Proxy, sizeof(GUID));
+
+    return S_OK;
 }
 
 HRESULT
@@ -2688,8 +2718,7 @@
 CKsProxy::QueryVendorInfo(
     LPWSTR *pVendorInfo)
 {
-    OutputDebugStringW(L"CKsProxy::QueryVendorInfo : NotImplemented\n");
-    return E_NOTIMPL;
+    return StringFromCLSID(CLSID_Proxy, pVendorInfo);
 }
 
 //-------------------------------------------------------------------




More information about the Ros-diffs mailing list