Changeset 143 for trunk


Ignore:
Timestamp:
Nov 15, 2012, 12:09:33 PM (11 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/DumpMediaSamples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/DumpMediaSamples/DumpMediaSamples.cpp

    r142 r143  
    167167
    168168        private:
     169                CModule* m_pModule;
    169170                CString m_sName;
    170171                CString m_sNamePrefix;
     
    174175        public:
    175176        // CSampleGrabberCallback
     177                CSampleGrabberCallback() :
     178                        m_pModule(NULL)
     179                {
     180                        _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
     181                }
     182                ~CSampleGrabberCallback()
     183                {
     184                        _Z4(atlTraceRefcount, 4, _T("this 0x%p\n"), this);
     185                }
     186                VOID Initialize(CModule* pModule)
     187                {
     188                        _A(!m_pModule && pModule);
     189                        m_pModule = pModule;
     190                }
    176191                VOID SetName(const CString& sName)
    177192                {
     
    186201                        m_pMediaType = pMediaType;
    187202                }
    188                 static VOID PrintMediaType(const CMediaType& pMediaType)
    189                 {
    190                         _tprintf(_T("Media Type:\n\n"));
     203                VOID PrintMediaType(const CMediaType& pMediaType)
     204                {
     205                        _tprintf(_T("%s") _T("Media Type:\n\n"), m_sNamePrefix);
    191206                        _tprintf(_T("majortype %ls, subtype %ls, pUnk 0x%08x\n"), _PersistHelper::StringFromIdentifier(pMediaType->majortype), _PersistHelper::StringFromIdentifier(pMediaType->subtype), (LONG) (LONG_PTR) pMediaType->pUnk);
    192207                        _tprintf(_T("bFixedSizeSamples %d, bTemporalCompression %d, lSampleSize %d\n"), pMediaType->bFixedSizeSamples, pMediaType->bTemporalCompression, pMediaType->lSampleSize);
     
    241256
    242257        // ISampleGrabberCB
    243         STDMETHOD(SampleCB)(DOUBLE fSampleTime, IMediaSample* pMediaSample) throw()
     258        STDMETHOD(SampleCB)(DOUBLE fSampleTime, IMediaSample* pMediaSample)
    244259                {
    245260                        _A(pMediaSample);
     
    248263                                CMediaSampleProperties Properties(pMediaSample);
    249264                                _A(!Properties.pMediaType);
     265                                CRoCriticalSectionLock PrintLock(m_pModule->m_PrintCriticalSection);
    250266                                _tprintf(_T("%s") _T("fSampleTime %s, .dwTypeSpecificFlags 0x%08x%s, .dwSampleFlags 0x%08x%s, .tStart %s, .tStop %s, .dwStreamId %d\n"),
    251267                                        m_sNamePrefix,
     
    283299                        return S_OK;
    284300                }
    285         STDMETHOD(BufferCB)(DOUBLE fSampleTime, BYTE* pnBuffer, LONG nBufferSize) throw()
     301        STDMETHOD(BufferCB)(DOUBLE fSampleTime, BYTE* pnBuffer, LONG nBufferSize)
    286302                {
    287303                        return S_OK;
     
    294310        CPath m_sPath;
    295311        BOOL m_bNoReferenceClock;
     312        mutable CRoCriticalSection m_PrintCriticalSection;
    296313
    297314public:
     
    319336                return pszPath;
    320337        }
    321         CModule() throw()
     338        CModule()
    322339        {
    323340                //m_sPath = GetDefaultPath();
    324341                m_bNoReferenceClock = FALSE;
    325342        }
    326         ~CModule() throw()
     343        ~CModule()
    327344        {
    328345        }
     
    349366                        CObjectPtr<CSampleGrabberCallback> pSampleGrabberCallback;
    350367                        pSampleGrabberCallback.Construct();
     368                        pSampleGrabberCallback->Initialize(this);
    351369                        if(FilterArray.GetCount() > 1)
    352370                                pSampleGrabberCallback->SetName(AtlFormatString(_T("%c"), 'A' + nSampleGrabberIndex));
  • trunk/Utilities/DumpMediaSamples/DumpMediaSamples.vcxproj.filters

    r142 r143  
    33  <ItemGroup>
    44    <Filter Include="Source Files">
    5       <UniqueIdentifier>{107cb1f6-e3bf-4bb8-bea5-8d5990c208fd}</UniqueIdentifier>
     5      <UniqueIdentifier>{0399a72a-f850-4b5d-a481-3e32e763561e}</UniqueIdentifier>
    66      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
    77    </Filter>
    88    <Filter Include="Header Files">
    9       <UniqueIdentifier>{a595f9cc-033d-4760-abad-3fc43fd8c042}</UniqueIdentifier>
     9      <UniqueIdentifier>{16237c05-6860-49ec-a0cf-fa7c9efefbfe}</UniqueIdentifier>
    1010      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
    1111    </Filter>
    1212    <Filter Include="Resource Files">
    13       <UniqueIdentifier>{d711e111-1804-4c3c-88c4-660ec21a1d5c}</UniqueIdentifier>
     13      <UniqueIdentifier>{a7c3bd78-bfbe-4980-8cb7-96c550521289}</UniqueIdentifier>
    1414      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
    1515    </Filter>
Note: See TracChangeset for help on using the changeset viewer.