Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. // COUNTERS.H
  2. //
  3. // Global performance counters for H.263 video codec
  4. //
  5. // Created 13-Nov-96 [JonT] <for NAC.DLL>
  6. // Added H.263 counters 30-Jan-97 [PhilF]
  7. #ifndef _COUNTERS_H
  8. #define _COUNTER_H
  9. #if defined(DECODE_TIMINGS_ON) || defined(ENCODE_TIMINGS_ON) || defined(DETAILED_DECODE_TIMINGS_ON) || defined(DETAILED_ENCODE_TIMINGS_ON) // { #if defined(DECODE_TIMINGS_ON) || defined(ENCODE_TIMINGS_ON) || defined(DETAILED_DECODE_TIMINGS_ON) || defined(DETAILED_ENCODE_TIMINGS_ON)
  10. #include <objbase.h>
  11. #include "icounter.h"
  12. #include "stats.h"
  13. // Interface pointer to counter manager object.
  14. // If this pointer is NULL, stats are not around (or not initialized)
  15. extern ICounterMgr* g_pCtrMgr;
  16. // Counter pointers. All available counters should be listed here
  17. extern ICounter* g_pctrCompressionTimePerFrame;
  18. extern ICounter* g_pctrDecompressionTimePerFrame;
  19. extern ICounter* g_pctrBEFTimePerFrame;
  20. // Helper function prototypes (COUNTER.CPP)
  21. extern "C" BOOL WINAPI InitCounters(void);
  22. extern "C" void WINAPI DoneCounters(void);
  23. // Function helpers (better than using macros)
  24. void __inline DEFINE_COUNTER(ICounter** ppctr, char* szName, DWORD dwFlags)
  25. {
  26. if (g_pCtrMgr->CreateCounter(ppctr) == S_OK)
  27. (*ppctr)->Initialize(szName, dwFlags);
  28. }
  29. void __inline DELETE_COUNTER(ICounter** ppctr)
  30. {
  31. ICounter* pctrT;
  32. if (*ppctr)
  33. {
  34. pctrT = *ppctr;
  35. *ppctr = NULL;
  36. pctrT->Release();
  37. }
  38. }
  39. void __inline UPDATE_COUNTER(ICounter* pctr, int nValue)
  40. {
  41. if (pctr)
  42. pctr->Update(nValue);
  43. }
  44. #endif // } #if defined(DECODE_TIMINGS_ON) || defined(ENCODE_TIMINGS_ON) || defined(DETAILED_DECODE_TIMINGS_ON) || defined(DETAILED_ENCODE_TIMINGS_ON)
  45. #endif // #ifndef _COUNTERS_H