Changeset 503
- Timestamp:
- Sep 4, 2015, 11:47:45 PM (7 years ago)
- Location:
- trunk/DirectShowSpy
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DirectShowSpy/DirectShowSpy.vcxproj
r440 r503 456 456 <None Include="Module.def" /> 457 457 <None Include="Module.rgs" /> 458 <None Include="FilterGraphSpy.rgs" /> 459 <None Include="FilterMapperSpy.rgs" /> 460 <None Include="GenericClass.rgs" /> 458 <None Include="GenericClass %28Both%29.rgs" /> 461 459 <None Include="GenericPropertyPage.rgs" /> 462 460 </ItemGroup> … … 472 470 <ClInclude Include="FilterGraphList.h" /> 473 471 <ClInclude Include="FilterGraphSpy.h" /> 472 <ClInclude Include="FilterGraphTable.h" /> 474 473 <ClInclude Include="FilterMapperSpy.h" /> 475 474 <ClInclude Include="GraphBuilderCallbackPropertySheet.h" /> -
trunk/DirectShowSpy/DirectShowSpy.vcxproj.filters
r440 r503 43 43 </ItemGroup> 44 44 <ItemGroup> 45 <None Include="FilterGraphSpy.rgs">46 <Filter>Resource Files</Filter>47 </None>48 <None Include="FilterMapperSpy.rgs">49 <Filter>Resource Files</Filter>50 </None>51 <None Include="GenericClass.rgs">52 <Filter>Resource Files</Filter>53 </None>54 45 <None Include="..\..\Repository-Private\Utilities\EmailTools\_Bin\Win32\Release\EmailTools\EmailTools.tlb"> 55 46 <Filter>Resource Files</Filter> … … 65 56 </None> 66 57 <None Include="..\..\Repository-Private\Utilities\EmailTools\_Bin\EmailTools-Win32.tlb" /> 58 <None Include="GenericClass %28Both%29.rgs"> 59 <Filter>Resource Files</Filter> 60 </None> 67 61 </ItemGroup> 68 62 <ItemGroup> … … 118 112 <Filter>Header Files</Filter> 119 113 </ClInclude> 114 <ClInclude Include="FilterGraphTable.h"> 115 <Filter>Header Files</Filter> 116 </ClInclude> 120 117 </ItemGroup> 121 118 <ItemGroup> -
trunk/DirectShowSpy/FilterGraphList.h
r448 r503 23 23 #include "FilterGraphHelper.h" 24 24 #include "AboutDialog.h" 25 #include "FilterGraphTable.h" 25 26 26 27 #pragma comment(lib, "psapi.lib") … … 248 249 { 249 250 return ((CListPropertyPage*) nParameter)->SortGraphListViewItems(nItemParameter1, nItemParameter2); 251 } 252 static BOOL FindItem(CRoMapT<CStringW, CItem>& ItemMap, const CFilterGraphTable::CItem& TableItem) 253 { 254 for(auto&& MapItem: ItemMap.GetValues()) 255 { 256 if(MapItem.m_nProcessIdentifier != TableItem.m_nProcessIdentifier) 257 continue; 258 if(abs((LONG_PTR) MapItem.m_nInstance - (LONG_PTR) TableItem.m_nInstance) > 32) //if(MapItem.m_nInstance != TableItem.m_nInstance) 259 continue; 260 return TRUE; 261 } 262 return FALSE; 250 263 } 251 264 static VOID EnumerateItems(IRunningObjectTable* pRunningObjectTable, CRoMapT<CStringW, CItem>& ItemMap, const LONG* pnProcessIdentifier = NULL) … … 294 307 } 295 308 } 309 #pragma region Filter Graph Table 310 _ATLTRY 311 { 312 CLocalObjectPtr<CFilterGraphTable> pFilterGraphTable; 313 CFilterGraphTable::CItemArray ItemArray; 314 if(pFilterGraphTable->GetItems(ItemArray)) 315 { 316 for(auto&& TableItem: ItemArray) 317 { 318 if(FindItem(ItemMap, TableItem)) 319 continue; 320 if(pnProcessIdentifier && TableItem.m_nProcessIdentifier != (DWORD) *pnProcessIdentifier) 321 continue; // Skip 322 const CStringW sDisplayName = AtlFormatStringW(L"!FilterGraph %p pid %08x; FGT", TableItem.m_nInstance, TableItem.m_nProcessIdentifier); 323 CItem Item; 324 Item.m_sDisplayName = sDisplayName; 325 Item.m_nInstance = TableItem.m_nInstance; 326 Item.m_nProcessIdentifier = TableItem.m_nProcessIdentifier; 327 Item.m_pFilterGraphUnknown = TableItem.m_pFilterGraph; 328 Item.m_pFilterGraph = TableItem.m_pFilterGraph; 329 SYSTEMTIME Time; 330 _W(FileTimeToSystemTime(&reinterpret_cast<const FILETIME&>(TableItem.m_nTime), &Time)); 331 Item.m_sTime = AtlFormatString(_T("%02d:%02d:%02d"), Time.wHour, Time.wMinute, Time.wSecond); 332 _W(ItemMap.SetAt(sDisplayName, Item) >= 0); 333 } 334 } 335 } 336 _ATLCATCHALL() 337 { 338 _Z_EXCEPTION(); 339 } 340 #pragma endregion 296 341 } 297 342 _ATLCATCHALL() -
trunk/DirectShowSpy/FilterGraphSpy.h
r489 r503 21 21 #include "RunPropertyBag.h" 22 22 #include "MediaSampleTrace.h" 23 #include "FilterGraphTable.h" 23 24 24 25 HRESULT FilterGraphHelper_OpenGraphStudioNext(LONG nParentWindowHandle, LPCWSTR pszMonikerDisplayName, VARIANT_BOOL* pbResult); … … 681 682 _FilterGraphHelper::CRotRunningFilterGraph m_RunningFilterGraph; 682 683 INT m_nRunningFilterGraphReference; 684 CLocalObjectPtr<CFilterGraphTableItem> m_pFilterGraphTableItem; 683 685 SYSTEMTIME m_Time; 684 686 CStringW m_sMonikerDisplayName; … … 712 714 CStringW sMonikerDisplayName; 713 715 static CConstIntegerRegistryValue g_nEnableRotMonikerItemNameSuffix(_T("Enable ROT Moniker Item Name Suffix")); // 0 Default (Enabled), 1 Disabled, 2 Enabled 714 if(g_nEnableRotMonikerItemNameSuffix != 1) 716 if(g_nEnableRotMonikerItemNameSuffix != 1) // Disabled 715 717 { 716 718 TCHAR pszPath[MAX_PATH] = { 0 }; … … 727 729 m_sMonikerDisplayName = sMonikerDisplayName; 728 730 } 731 #pragma region Filter Graph Table Item 732 static CConstIntegerRegistryValue g_nAutomaticFilterGraphTableItem(_T("Automatic Filter Graph Table Item")); // 0 Default (Disabled), 1 Disabled, 2 Enabled 733 if(g_nAutomaticFilterGraphTableItem == 2) // Enabled 734 _ATLTRY 735 { 736 _A(!m_pFilterGraphTableItem->IsFilterGraphAvailable()); 737 m_pFilterGraphTableItem->SetFilterGraph(this); 738 Release(); 739 } 740 _ATLCATCHALL() 741 { 742 _Z_EXCEPTION(); 743 } 744 #pragma endregion 729 745 if(!m_bIsAggregated) 730 746 { … … 744 760 if(!m_RunningFilterGraph.GetCookie()) 745 761 return; 762 #pragma region Filter Graph Table Item 763 _ATLTRY 764 { 765 if(m_pFilterGraphTableItem->IsFilterGraphAvailable()) 766 { 767 AddRef(); 768 m_pFilterGraphTableItem->SetFilterGraph(NULL); 769 } 770 } 771 _ATLCATCHALL() 772 { 773 _Z_EXCEPTION(); 774 } 775 #pragma endregion 746 776 if(m_nRunningFilterGraphReference != 2) 747 777 AddRef(); … … 1029 1059 return FALSE; 1030 1060 } 1031 static BOOL LookupEventCodeName(LONG nEventCode, LPCSTR& pszName)1032 {1033 // NOTE: See Windows SDK evcode.h1034 static const struct { LONG nEventCode; LPCSTR pszName; } g_pMap[] =1035 {1036 #define A(x) { x, #x },1037 A(EC_COMPLETE)1038 A(EC_USERABORT)1039 A(EC_ERRORABORT)1040 A(EC_TIME)1041 A(EC_REPAINT)1042 A(EC_STREAM_ERROR_STOPPED)1043 A(EC_STREAM_ERROR_STILLPLAYING)1044 A(EC_ERROR_STILLPLAYING)1045 A(EC_PALETTE_CHANGED)1046 A(EC_VIDEO_SIZE_CHANGED)1047 A(EC_QUALITY_CHANGE)1048 A(EC_SHUTTING_DOWN)1049 A(EC_CLOCK_CHANGED)1050 A(EC_PAUSED)1051 A(EC_OPENING_FILE)1052 A(EC_BUFFERING_DATA)1053 A(EC_FULLSCREEN_LOST)1054 A(EC_ACTIVATE)1055 A(EC_NEED_RESTART)1056 A(EC_WINDOW_DESTROYED)1057 A(EC_DISPLAY_CHANGED)1058 A(EC_STARVATION)1059 A(EC_OLE_EVENT)1060 A(EC_NOTIFY_WINDOW)1061 A(EC_STREAM_CONTROL_STOPPED)1062 A(EC_STREAM_CONTROL_STARTED)1063 A(EC_END_OF_SEGMENT)1064 A(EC_SEGMENT_STARTED)1065 A(EC_LENGTH_CHANGED)1066 A(EC_DEVICE_LOST)1067 A(EC_SAMPLE_NEEDED)1068 A(EC_PROCESSING_LATENCY)1069 A(EC_SAMPLE_LATENCY)1070 A(EC_SCRUB_TIME)1071 A(EC_STEP_COMPLETE)1072 #undef A1073 };1074 for(SIZE_T nIndex = 0; nIndex < DIM(g_pMap); nIndex++)1075 if(g_pMap[nIndex].nEventCode == nEventCode)1076 {1077 pszName = g_pMap[nIndex].pszName;1078 return TRUE;1079 }1080 return FALSE;1081 }1082 1061 CStringW GetMonikerDisplayName() const 1083 1062 { … … 1560 1539 STDMETHOD(Notify)(LONG nEventCode, LONG_PTR nParameter1, LONG_PTR nParameter2) 1561 1540 { 1562 #if TRUE 1563 LPCSTR pszEventName = NULL; 1564 if(LookupEventCodeName(nEventCode, pszEventName)) 1565 { 1566 _Z4(atlTraceCOM, 4, _T("nEventCode %hs (0x%02X), nParameter1 0x%p, nParameter2 0x%p\n"), pszEventName, nEventCode, nParameter1, nParameter2); 1567 } else 1568 #endif 1569 _Z4(atlTraceCOM, 4, _T("nEventCode 0x%02X, nParameter1 0x%p, nParameter2 0x%p\n"), nEventCode, nParameter1, nParameter2); 1541 _Z4(atlTraceCOM, 4, _T("nEventCode %s, nParameter1 0x%p, nParameter2 0x%p\n"), _FilterGraphHelper::FormatEventCode(nEventCode), nParameter1, nParameter2); 1570 1542 #if defined(_M_IX86) 1571 1543 // WARN: Guarding section around might be preventing from walknig frame up the stack … … 1593 1565 const HRESULT nGetEventResult = m_pInnerMediaEventEx->GetEvent(pnEventCode, pnParameter1, pnParameter2, nTimeout); 1594 1566 if(pnEventCode && pnParameter1 && pnParameter2) 1595 _Z4(atlTraceCOM, (nGetEventResult != E_ABORT) ? 4 : 5, _T("nGetEventResult 0x% x, *pnEventCode 0x%02X, *pnParameter1 0x%p, *pnParameter2 0x%p\n"), nGetEventResult, *pnEventCode, *pnParameter1, *pnParameter2);1567 _Z4(atlTraceCOM, (nGetEventResult != E_ABORT) ? 4 : 5, _T("nGetEventResult 0x%08X, *pnEventCode %s, *pnParameter1 0x%p, *pnParameter2 0x%p\n"), nGetEventResult, _FilterGraphHelper::FormatEventCode(*pnEventCode), *pnParameter1, *pnParameter2); 1596 1568 return nGetEventResult; 1597 1569 } … … 1601 1573 const HRESULT nWaitForCompletionResult = m_pInnerMediaEventEx->WaitForCompletion(nTimeout, pnEventCode); 1602 1574 if(pnEventCode) 1603 _Z4(atlTraceCOM, 4, _T("nWaitForCompletionResult 0x% x, *pnEventCode 0x%02X\n"), nWaitForCompletionResult, *pnEventCode);1575 _Z4(atlTraceCOM, 4, _T("nWaitForCompletionResult 0x%08X, *pnEventCode %s\n"), nWaitForCompletionResult, _FilterGraphHelper::FormatEventCode(*pnEventCode)); 1604 1576 return nWaitForCompletionResult; 1605 1577 } 1606 1578 STDMETHOD(CancelDefaultHandling)(LONG nEventCode) 1607 1579 { 1608 #if TRUE 1609 LPCSTR pszEventName = NULL; 1610 if(LookupEventCodeName(nEventCode, pszEventName)) 1611 { 1612 _Z4(atlTraceCOM, 4, _T("nEventCode %hs (0x%02X)\n"), pszEventName, nEventCode); 1613 } else 1614 #endif 1615 _Z4(atlTraceCOM, 4, _T("nEventCode 0x%02X\n"), nEventCode); 1580 _Z4(atlTraceCOM, 4, _T("nEventCode %s\n"), _FilterGraphHelper::FormatEventCode(nEventCode)); 1616 1581 return m_pInnerMediaEventEx->CancelDefaultHandling(nEventCode); 1617 1582 } 1618 1583 STDMETHOD(RestoreDefaultHandling)(LONG nEventCode) 1619 1584 { 1620 #if TRUE 1621 LPCSTR pszEventName = NULL; 1622 if(LookupEventCodeName(nEventCode, pszEventName)) 1623 { 1624 _Z4(atlTraceCOM, 4, _T("nEventCode %hs (0x%02X)\n"), pszEventName, nEventCode); 1625 } else 1626 #endif 1627 _Z4(atlTraceCOM, 4, _T("nEventCode 0x%02X\n"), nEventCode); 1585 _Z4(atlTraceCOM, 4, _T("nEventCode %s\n"), _FilterGraphHelper::FormatEventCode(nEventCode)); 1628 1586 return m_pInnerMediaEventEx->RestoreDefaultHandling(nEventCode); 1629 1587 } 1630 1588 STDMETHOD(FreeEventParams)(LONG nEventCode, LONG_PTR nParameter1, LONG_PTR nParameter2) 1631 1589 { 1632 _Z4(atlTraceCOM, 4, _T("nEventCode 0x%02X, nParameter1 0x%p, nParameter2 0x%p\n"), nEventCode, nParameter1, nParameter2);1590 _Z4(atlTraceCOM, 4, _T("nEventCode %s, nParameter1 0x%p, nParameter2 0x%p\n"), _FilterGraphHelper::FormatEventCode(nEventCode), nParameter1, nParameter2); 1633 1591 return m_pInnerMediaEventEx->FreeEventParams(nEventCode, nParameter1, nParameter2); 1634 1592 } -
trunk/DirectShowSpy/Helper.cpp
r464 r503 17 17 #include "resource.h" 18 18 #include "FilterGraphHelper.h" 19 #include "FilterGraphTable.h" 19 20 #include "MediaSampleTrace.h" 20 21 … … 64 65 #endif // _DEVELOPMENT 65 66 66 #if _DEVELOPMENT //&& FALSE67 #if _DEVELOPMENT && FALSE 67 68 68 69 COMPILER_MESSAGE("Development: MediaSampleTrace test as Test") … … 266 267 267 268 #endif // _DEVELOPMENT 269 270 #if _DEVELOPMENT //&& FALSE 271 272 COMPILER_MESSAGE("Development: CFilterGraphHelper::DoPropertyFrameModal as Test") 273 274 #if defined(_WIN64) 275 extern "C" __declspec(dllexport) 276 #else 277 #pragma comment(linker, "/EXPORT:Test=_Test@0,PRIVATE") 278 extern "C" // __declspec(dllexport) 279 #endif // defined(_WIN64) 280 281 HRESULT STDMETHODCALLTYPE Test() 282 { 283 _ATLTRY 284 { 285 CSingleThreadedApartment SingleThreadedApartment; 286 /* 287 CGenericFilterGraph FilterGraph; 288 FilterGraph.CoCreateInstance(); 289 __C(FilterGraph.m_pFilterGraph->RenderFile(_T("E:\\Media\\Robotica_1080.wmv"), NULL)); 290 _ATLTRY 291 { 292 const CComQIPtr<ISpy> pSpy = FilterGraph.m_pFilterGraph; 293 if(pSpy) 294 __C(pSpy->put_FriendlyName(CComBSTR(_T("Test")))); 295 } 296 _ATLCATCHALL() 297 { 298 _Z_EXCEPTION(); 299 } 300 //CLocalObjectPtr<CFilterGraphTableItem> pFilterGraphTableItem; 301 //__C(pFilterGraphTableItem->put_FilterGraph(FilterGraph.m_pFilterGraph)); 302 //CLocalObjectPtr<CFilterGraphTable> pFilterGraphTable; 303 */ 304 CLocalObjectPtr<CFilterGraphHelper> pFilterGraphHelper; 305 pFilterGraphHelper->DoFilterGraphListModal(0); 306 //__C(pFilterGraphTableItem->put_FilterGraph(NULL)); 307 } 308 _ATLCATCH(Exception) 309 { 310 _C(Exception); 311 } 312 return S_OK; 313 } 314 315 #endif // _DEVELOPMENT 316 -
trunk/DirectShowSpy/Module.idl
r460 r503 276 276 [default] interface IUnknown; //IPropertyPage; 277 277 }; 278 [ 279 object, 280 uuid(ECDC55A1-FFD7-4999-BAB5-579D5773F0B6), 281 dual, 282 oleautomation, 283 nonextensible, 284 pointer_default(unique) 285 ] 286 interface IFilterGraphTableItem : IDispatch 287 { 288 [id(DISPID_VALUE), propget] HRESULT FilterGraph([out, retval] IUnknown** ppFilterGraphUnknown); 289 [id(DISPID_VALUE), propput] HRESULT FilterGraph([in] IUnknown* pFilterGraphUnknown); 290 [id(1), propget] HRESULT Time([out, retval] DATE* pfTime); 291 }; 292 [ 293 uuid(7B2E1768-3037-4975-ABA1-BA626397BF08) 294 ] 295 coclass FilterGraphTableItem 296 { 297 [default] interface IFilterGraphTableItem; 298 }; 299 [ 300 object, 301 uuid(15078C09-6D0C-4284-924C-F6CD13CA39F6), 302 dual, 303 oleautomation, 304 nonextensible, 305 pointer_default(unique) 306 ] 307 interface IFilterGraphTable : IDispatch 308 { 309 [id(DISPID_NEWENUM), propget, restricted] HRESULT _NewEnum([out, retval] IUnknown** ppEnum); 310 [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT vIndex, [out, retval] VARIANT* pvItem); 311 [id(1), propget] HRESULT Count([out, retval] LONG* pnCount); 312 }; 313 [ 314 uuid(44EF31BC-CC5F-4163-8832-BDC79ED59162) 315 ] 316 coclass FilterGraphTable 317 { 318 [default] interface IFilterGraphTable; 319 }; 320 [ 321 object, 322 uuid(D9A734F0-3230-4574-81FA-71DE297ACDF8), 323 dual, 324 oleautomation, 325 nonextensible, 326 pointer_default(unique) 327 ] 328 interface IFilterGraphTableActiveObject : IDispatch 329 { 330 [id(1)] HRESULT GetFilterGraphs([out] LONG* pnProcessIdentifier, [out] VARIANT* pvArray); 331 }; 278 332 }; -
trunk/DirectShowSpy/resource.h
r457 r503 156 156 #define IDR_SYSTEMDEVICEENUMERATORSPY 25003 157 157 #define IDR_FILTERGRAPHHELPER 25050 158 #define IDR_FILTERGRAPHTABLEITEM 25051 159 #define IDR_FILTERGRAPHTABLE 25052 158 160 #define IDD_ABOUT 29900 159 161 #define IDC_ABOUT_ICON 29901
Note: See TracChangeset
for help on using the changeset viewer.