Changeset 217 for trunk/Utilities/DumpMediaSamples/DumpMediaSamples.cpp
- Timestamp:
- Sep 20, 2013, 6:30:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/DumpMediaSamples/DumpMediaSamples.cpp
r152 r217 172 172 CMediaType m_pMediaType; 173 173 CComPtr<CAbstractHandler> m_pHandler; 174 DWORD m_nPreviousFlags; 175 REFERENCE_TIME m_nPreviousStartTime; 176 REFERENCE_TIME m_nPreviousStopTime; 174 177 175 178 public: … … 188 191 _A(!m_pModule && pModule); 189 192 m_pModule = pModule; 193 m_nPreviousFlags = 0; 190 194 } 191 195 VOID SetName(const CString& sName) … … 268 272 CMediaSampleProperties Properties(pMediaSample); 269 273 _A(!Properties.pMediaType); 274 CRoArrayT<CString> TimeArray; 275 if(Properties.dwSampleFlags & AM_SAMPLE_TIMEVALID) 276 { 277 CRoCriticalSectionLock DataLock(m_DataCriticalSection); 278 TimeArray.Add(_FilterGraphHelper::FormatReferenceTime(Properties.tStart)); 279 if(m_nPreviousFlags & AM_SAMPLE_TIMEVALID) 280 TimeArray.Add(_FilterGraphHelper::FormatReferenceTime(Properties.tStart - m_nPreviousStartTime)); 281 else 282 TimeArray.Add(_T("")); 283 if(m_nPreviousFlags & AM_SAMPLE_STOPVALID) 284 TimeArray.Add(_FilterGraphHelper::FormatReferenceTime(Properties.tStart - m_nPreviousStopTime)); 285 else 286 TimeArray.Add(_T("")); 287 if(Properties.dwSampleFlags & AM_SAMPLE_STOPVALID) 288 { 289 TimeArray.Add(_FilterGraphHelper::FormatReferenceTime(Properties.tStop)); 290 TimeArray.Add(_FilterGraphHelper::FormatReferenceTime(Properties.tStop - Properties.tStart)); 291 } 292 } 270 293 CRoCriticalSectionLock PrintLock(m_pModule->m_PrintCriticalSection); 271 294 _tprintf(_T("%s") _T("fSampleTime %s, .dwTypeSpecificFlags 0x%08x%s, .dwSampleFlags 0x%08x%s, .tStart %s, .tStop %s, .dwStreamId %d\n"), … … 275 298 Properties.dwSampleFlags, Properties.dwSampleFlags ? (LPCTSTR) AtlFormatString(_T(" (%s)"), StringFromSampleFlags(Properties.dwSampleFlags)) : _T(""), 276 299 _FilterGraphHelper::FormatReferenceTime(Properties.tStart), 277 _FilterGraphHelper::FormatReferenceTime(Properties.tStop), 300 _FilterGraphHelper::FormatReferenceTime(Properties.tStop), 278 301 Properties.dwStreamId, 279 302 0); … … 296 319 0); 297 320 } 321 //_tprintf(_T("%s") _T("Time, %s") _T("\n"), 322 // m_sNamePrefix, 323 // _StringHelper::Join(TimeArray, _T(", ")), 324 // 0); 298 325 if(m_pHandler) 299 326 m_pHandler->HandleSample(Properties); 300 327 _tprintf(_T("\n")); 328 m_nPreviousFlags = Properties.dwSampleFlags; 329 m_nPreviousStartTime = Properties.tStart; 330 m_nPreviousStopTime = Properties.tStop; 331 301 332 } 302 333 _ATLCATCH(Exception) … … 317 348 CPath m_sPath; 318 349 BOOL m_bNoReferenceClock; 350 BOOL m_bSuppressLoadFailure; 319 351 mutable CRoCriticalSection m_PrintCriticalSection; 320 352 … … 347 379 //m_sPath = GetDefaultPath(); 348 380 m_bNoReferenceClock = FALSE; 381 m_bSuppressLoadFailure = FALSE; 349 382 } 350 383 ~CModule() … … 360 393 CGenericFilterGraph FilterGraph; 361 394 FilterGraph.CoCreateInstance(); 362 LoadGraphBuilderFromFile(FilterGraph.m_pFilterGraph, m_sPath); 395 _ATLTRY 396 { 397 LoadGraphBuilderFromFile(FilterGraph.m_pFilterGraph, m_sPath); 398 } 399 _ATLCATCH(Exception) 400 { 401 _tprintf(_T("Error loading filter graph: %s\n"), Ds::FormatResult(Exception)); 402 if(!m_bSuppressLoadFailure) 403 _ATLRETHROW; 404 } 363 405 #pragma region Sample Grabbers 364 406 _FilterGraphHelper::CFilterArray FilterArray; … … 493 535 { 494 536 Module.m_bNoReferenceClock = TRUE; 537 } else 538 if(_tcschr(_T("Ee"), sArgument[0])) // Suppress Load Failure 539 { 540 Module.m_bSuppressLoadFailure = TRUE; 495 541 } 496 542 continue;
Note: See TracChangeset
for help on using the changeset viewer.