strmbase_private.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Header file for private strmbase implementations
  3. *
  4. * Copyright 2012 Aric Stewart, CodeWeavers
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  19. */
  20. #ifndef __WINE_STRMBASE_PRIVATE_H
  21. #define __WINE_STRMBASE_PRIVATE_H
  22. #include <assert.h>
  23. #define NONAMELESSUNION
  24. #define NONAMELESSSTRUCT
  25. #define COBJMACROS
  26. #include "dshow.h"
  27. #include "uuids.h"
  28. #include "wine/debug.h"
  29. #include "wine/heap.h"
  30. #include "wine/list.h"
  31. #include "wine/strmbase.h"
  32. static inline const char *debugstr_time(REFERENCE_TIME time)
  33. {
  34. ULONGLONG abstime = time >= 0 ? time : -time;
  35. unsigned int i = 0, j = 0;
  36. char buffer[23], rev[23];
  37. while (abstime || i <= 8)
  38. {
  39. buffer[i++] = '0' + (abstime % 10);
  40. abstime /= 10;
  41. if (i == 7) buffer[i++] = '.';
  42. }
  43. if (time < 0) buffer[i++] = '-';
  44. while (i--) rev[j++] = buffer[i];
  45. while (rev[j-1] == '0' && rev[j-2] != '.') --j;
  46. rev[j] = 0;
  47. return wine_dbg_sprintf("%s", rev);
  48. }
  49. #endif /* __WINE_STRMBASE_PRIVATE_H */