Changeset 460 for trunk/DirectShowSpy


Ignore:
Timestamp:
May 24, 2015, 8:35:20 AM (9 years ago)
Author:
roman
Message:

Added ability to highlight items programmatically

Location:
trunk/DirectShowSpy
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/DirectShowSpy/MediaSampleTrace.h

    r457 r460  
    8484                PAGEITEMFLAG_COMMENT = 3,
    8585                PAGEITEMFLAG_TYPE_MASK = 0x03,
     86                PAGEITEMFLAG_HIGHLIGHT_MASK = 0x3C,
     87                PAGEITEMFLAG_HIGHLIGHT_SHIFT = 2,
    8688        };
    8789
     
    208210                        Item.m_Item = *pItem;
    209211                        Item.m_PageItem = *pPageItem;
     212                        Item.m_nHighlightIndex = (Item.m_PageItem.nFlags & PAGEITEMFLAG_HIGHLIGHT_MASK) >> PAGEITEMFLAG_HIGHLIGHT_SHIFT;
    210213                }
    211214                VOID Sort()
     
    271274                static SIZE_T GetFileMappingCapacity()
    272275                {
    273                         return 1 << 20; // 1 MB
     276                        return 8 << 20; // 8 MB
    274277                }
    275278                static LPCTSTR GetFileMappingName()
     
    503506                        return m_ItemList.IsEmpty();
    504507                }
    505                 VOID Register(CPages& Pages, UINT64 nFilterIdentifier, const CStringW& sFilterName, LPCWSTR pszStreamName, const PAGEITEM& PageItem, LPCWSTR pszComment)
     508                VOID Register(CPages& Pages, UINT64 nFilterIdentifier, const CStringW& sFilterName, LPCWSTR pszStreamName, const PAGEITEM& PageItem, LPCWSTR pszComment, USHORT nHighlight)
    506509                {
    507510                        const UINT64 nTime = (UINT64) CUsAccurateFileTime::GetTime();
     
    518521                                                PAGEITEM* pPageItem = (PAGEITEM*) (pPageHeader + 1) + pPageHeader->nItemCount;
    519522                                                pPageItem->nFlags = PageItem.nFlags & PAGEITEMFLAG_TYPE_MASK;
     523                                                pPageItem->nFlags |= (nHighlight << PAGEITEMFLAG_HIGHLIGHT_SHIFT) & PAGEITEMFLAG_HIGHLIGHT_MASK;
    520524                                                pPageItem->nThreadIdentifier = GetCurrentThreadId();
    521525                                                pPageItem->nFilterIdentifier = nFilterIdentifier;
     
    639643
    640644// IMediaSampleTrace
    641         STDMETHOD(RegisterNewSegment)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, LONGLONG nStartTime, LONGLONG nStopTime, DOUBLE fRate, const WCHAR* pszComment)
    642         {
    643                 _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", nStartTime %I64d\n"), this, pBaseFilterUnknown, CString(pszStreamName), nStartTime);
     645        STDMETHOD(RegisterNewSegment)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, LONGLONG nStartTime, LONGLONG nStopTime, DOUBLE fRate, const WCHAR* pszComment, USHORT nHighlight)
     646        {
     647                _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", nStartTime %I64d, nHighlight %d\n"), this, pBaseFilterUnknown, CString(pszStreamName), nStartTime, nHighlight);
    644648                _ATLTRY
    645649                {
     
    650654                        PageItem.Data.NewSegment.fRate = fRate;
    651655                        CRoCriticalSectionLock DataLock(m_DataCriticalSection);
    652                         m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment);
     656                        m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment, nHighlight);
    653657                }
    654658                _ATLCATCH(Exception)
     
    658662                return S_OK;
    659663        }
    660         STDMETHOD(RegisterMediaSample)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const BYTE* pnSamplePropertiesData, const WCHAR* pszComment)
    661         {
    662                 _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", pnSamplePropertiesData 0x%p\n"), this, pBaseFilterUnknown, CString(pszStreamName), pnSamplePropertiesData);
     664        STDMETHOD(RegisterMediaSample)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const BYTE* pnSamplePropertiesData, const WCHAR* pszComment, USHORT nHighlight)
     665        {
     666                _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", pnSamplePropertiesData 0x%p, nHighlight %d\n"), this, pBaseFilterUnknown, CString(pszStreamName), pnSamplePropertiesData, nHighlight);
    663667                _ATLTRY
    664668                {
     
    668672                        PageItem.Data.MediaSample.Properties = *((const AM_SAMPLE2_PROPERTIES*) pnSamplePropertiesData);
    669673                        CRoCriticalSectionLock DataLock(m_DataCriticalSection);
    670                         m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment);
     674                        m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment, nHighlight);
    671675                }
    672676                _ATLCATCH(Exception)
     
    676680                return S_OK;
    677681        }
    678         STDMETHOD(RegisterEndOfStream)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const WCHAR* pszComment)
    679         {
    680                 _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\"\n"), this, pBaseFilterUnknown, CString(pszStreamName));
     682        STDMETHOD(RegisterEndOfStream)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const WCHAR* pszComment, USHORT nHighlight)
     683        {
     684                _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", nHighlight %d\n"), this, pBaseFilterUnknown, CString(pszStreamName), nHighlight);
    681685                _ATLTRY
    682686                {
     
    684688                        PageItem.nFlags = PAGEITEMFLAG_ENDOFSTREAM;
    685689                        CRoCriticalSectionLock DataLock(m_DataCriticalSection);
    686                         m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment);
     690                        m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment, nHighlight);
    687691                }
    688692                _ATLCATCH(Exception)
     
    692696                return S_OK;
    693697        }
    694         STDMETHOD(RegisterComment)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const WCHAR* pszComment)
    695         {
    696                 _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", pszComment \"%s\"\n"), this, pBaseFilterUnknown, CString(pszStreamName), CString(pszComment));
     698        STDMETHOD(RegisterComment)(IUnknown* pBaseFilterUnknown, const WCHAR* pszStreamName, const WCHAR* pszComment, USHORT nHighlight)
     699        {
     700                _Z5(atlTraceCOM, 5, _T("this 0x%p, pBaseFilterUnknown 0x%p, pszStreamName \"%s\", pszComment \"%s\", nHighlight %d\n"), this, pBaseFilterUnknown, CString(pszStreamName), CString(pszComment), nHighlight);
    697701                _ATLTRY
    698702                {
     
    700704                        PageItem.nFlags = PAGEITEMFLAG_COMMENT;
    701705                        CRoCriticalSectionLock DataLock(m_DataCriticalSection);
    702                         m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment);
     706                        m_Page.Register(m_Pages, (UINT_PTR) pBaseFilterUnknown, GetFilterName(pBaseFilterUnknown), pszStreamName, PageItem, pszComment, nHighlight);
    703707                }
    704708                _ATLCATCH(Exception)
  • trunk/DirectShowSpy/Module.idl

    r440 r460  
    5959        interface IMediaSampleTrace : IUnknown
    6060        {
    61                 HRESULT RegisterNewSegment([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] LONGLONG nStartTime, [in] LONGLONG nStopTime, [in] DOUBLE fRate, [in] const WCHAR* pszComment);
    62                 HRESULT RegisterMediaSample([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const BYTE* pnSamplePropertiesData, [in] const WCHAR* pszComment);
    63                 HRESULT RegisterEndOfStream([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const WCHAR* pszComment);
    64                 HRESULT RegisterComment([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const WCHAR* pszComment);
     61                HRESULT RegisterNewSegment([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] LONGLONG nStartTime, [in] LONGLONG nStopTime, [in] DOUBLE fRate, [in] const WCHAR* pszComment, [in] USHORT nHighlight);
     62                HRESULT RegisterMediaSample([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const BYTE* pnSamplePropertiesData, [in] const WCHAR* pszComment, [in] USHORT nHighlight);
     63                HRESULT RegisterEndOfStream([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const WCHAR* pszComment, [in] USHORT nHighlight);
     64                HRESULT RegisterComment([in] IUnknown* pBaseFilterUnknown, [in] const WCHAR* pszStreamName, [in] const WCHAR* pszComment, [in] USHORT nHighlight);
    6565        };
    6666        [
Note: See TracChangeset for help on using the changeset viewer.