Changeset 103
- Timestamp:
- Aug 26, 2012, 6:21:32 AM (11 years ago)
- Location:
- trunk/Utilities/CaptureClock
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/CaptureClock/CaptureClock_i.c
r102 r103 7 7 8 8 /* File created by MIDL compiler version 7.00.0555 */ 9 /* at Sun Aug 26 1 5:46:0920129 /* at Sun Aug 26 16:17:50 2012 10 10 */ 11 11 /* Compiler settings for CaptureClock.idl: -
trunk/Utilities/CaptureClock/CaptureClock_i.h
r102 r103 5 5 6 6 /* File created by MIDL compiler version 7.00.0555 */ 7 /* at Sun Aug 26 1 5:46:0920127 /* at Sun Aug 26 16:17:50 2012 8 8 */ 9 9 /* Compiler settings for CaptureClock.idl: -
trunk/Utilities/CaptureClock/MainDialog.h
r102 r103 470 470 const BOOL bLog = ++m_nTimerEventIndex % 30 == 0; 471 471 CRoArrayT<CString> Array; 472 REFERENCE_TIME nSystemTime; 473 if(m_pReferenceClock) 474 { 475 _V(m_pReferenceClock->GetTime(&nSystemTime)); 476 nSystemTime -= m_nAnchorTime; 477 m_SystemTimeEdit.SetValue(AtlFormatString(_T("%s"), _FilterGraphHelper::FormatReferenceTime(nSystemTime))); 478 if(bLog) 479 Array.Add(AtlFormatString(_T("%I64d"), (nSystemTime + 5000i64 - 1) / 10000i64)); 480 } 472 481 if(m_pVideoRendererFilter) 473 482 { … … 480 489 Array.Add(AtlFormatString(_T("%d"), nCount)); 481 490 Array.Add(AtlFormatString(_T("%I64d"), (nTime + 5000i64 - 1) / 10000i64)); 491 Array.Add(AtlFormatString(_T("%I64d"), ((nTime - nSystemTime) + 5000i64 - 1) / 10000i64)); 482 492 } 483 493 } … … 492 502 Array.Add(AtlFormatString(_T("%d"), nCount)); 493 503 Array.Add(AtlFormatString(_T("%I64d"), (nTime + 5000i64 - 1) / 10000i64)); 504 Array.Add(AtlFormatString(_T("%I64d"), ((nTime - nSystemTime) + 5000i64 - 1) / 10000i64)); 494 505 } 495 506 } 496 if(m_pReferenceClock) 497 { 498 REFERENCE_TIME nTime; 499 _V(m_pReferenceClock->GetTime(&nTime)); 500 nTime -= m_nAnchorTime; 501 m_SystemTimeEdit.SetValue(AtlFormatString(_T("%s"), _FilterGraphHelper::FormatReferenceTime(nTime))); 502 if(bLog) 503 Array.InsertAt(0, AtlFormatString(_T("%I64d"), (nTime + 5000i64 - 1) / 10000i64)); 504 } 505 if(bLog && Array.GetCount() == 5) 507 if(bLog && Array.GetCount() == 1 + 3 + 3) 506 508 { 507 509 if(m_sLog.IsEmpty()) … … 512 514 _T("Video Sample Count"), 513 515 _T("Video Sample Time"), 516 _T("Relative Video Sample Time"), 514 517 _T("Audio Sample Count"), 515 518 _T("Audio Sample Time"), 519 _T("Relative Audio Sample Time"), 516 520 }; 517 521 m_sLog.Append(_StringHelper::Join(g_ppszHeader, _T("\t")) + _T("\r\n")); … … 579 583 pRendererFilter->Initialize(MEDIATYPE_Audio); 580 584 __C(m_FilterGraph->AddFilter(pRendererFilter, CT2CW(_T("Audio Renderer")))); 581 __C(m_FilterGraph->Connect(GetCapturePin(pSourceBaseFilter), pRendererFilter->GetInputPin())); 585 const CComPtr<IPin> pCapturePin = GetCapturePin(pSourceBaseFilter); 586 _ATLTRY 587 { 588 const CComQIPtr<IAMBufferNegotiation> pAmBufferNegotiation = pCapturePin; 589 __D(pAmBufferNegotiation, E_NOINTERFACE); 590 const CComQIPtr<IAMStreamConfig> pAmStreamConfig = pCapturePin; 591 __D(pAmStreamConfig, E_NOINTERFACE); 592 CMediaType pMediaType; 593 __C(pAmStreamConfig->GetFormat(&pMediaType)); 594 const CWaveFormatEx* pWaveFormatEx = pMediaType.GetWaveFormatEx(); 595 __D(pWaveFormatEx, E_UNNAMED); 596 ALLOCATOR_PROPERTIES Properties; 597 Properties.cbAlign = -1; 598 Properties.cbBuffer = pWaveFormatEx->nAvgBytesPerSec / 10; // 100 millisecond 599 Properties.cbPrefix = -1; 600 Properties.cBuffers = 50; // 50 buffers (5 seconds in total) 601 __C(pAmBufferNegotiation->SuggestAllocatorProperties(&Properties)); 602 } 603 _ATLCATCHALL() 604 { 605 _Z_EXCEPTION(); 606 } 607 __C(m_FilterGraph->Connect(pCapturePin, pRendererFilter->GetInputPin())); 582 608 m_pAudioRendererFilter = pRendererFilter; 583 609 } … … 616 642 if(!m_sLog.IsEmpty()) 617 643 { 618 SetClipboardText(m_hWnd, m_sLog); 644 CString sLog; 645 OSVERSIONINFO VersionInformation = { sizeof VersionInformation }; 646 _W(GetVersionEx(&VersionInformation)); 647 _A(VersionInformation.dwPlatformId == VER_PLATFORM_WIN32_NT); 648 sLog += AtlFormatString(_T("Windows Version") _T("\t") _T("%d.%d.%d %s") _T("\r\n"), VersionInformation.dwMajorVersion, VersionInformation.dwMinorVersion, VersionInformation.dwBuildNumber, VersionInformation.szCSDVersion); 649 CFilterData& VideoFilterData = m_VideoDeviceComboBox.GetItemData(m_VideoDeviceComboBox.GetCurSel()); 650 sLog += AtlFormatString(_T("Video Device") _T("\t") _T("%ls") _T("\t") _T("%ls") _T("\r\n"), VideoFilterData.GetFriendlyName(), VideoFilterData.GetMonikerDisplayName()); 651 CFilterData& AudioFilterData = m_AudioDeviceComboBox.GetItemData(m_AudioDeviceComboBox.GetCurSel()); 652 sLog += AtlFormatString(_T("Audio Device") _T("\t") _T("%ls") _T("\t") _T("%ls") _T("\r\n"), AudioFilterData.GetFriendlyName(), AudioFilterData.GetMonikerDisplayName()); 653 sLog += _T("\r\n"); 654 sLog += m_sLog; 655 SetClipboardText(m_hWnd, sLog); 619 656 MessageBeep(MB_OK); 620 657 }
Note: See TracChangeset
for help on using the changeset viewer.