gstsystemclock.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* GStreamer
  2. * Copyright (C) 1999,2000 Erik Walthinsen <[email protected]>
  3. * 2000 Wim Taymans <[email protected]>
  4. * 2005 Wim Taymans <[email protected]>
  5. *
  6. * gstsystemclock.h: A clock implementation based on system time
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  21. * Boston, MA 02110-1301, USA.
  22. */
  23. #ifndef __GST_SYSTEM_CLOCK_H__
  24. #define __GST_SYSTEM_CLOCK_H__
  25. #include <gst/gstclock.h>
  26. G_BEGIN_DECLS
  27. #define GST_TYPE_SYSTEM_CLOCK (gst_system_clock_get_type ())
  28. #define GST_SYSTEM_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SYSTEM_CLOCK, GstSystemClock))
  29. #define GST_SYSTEM_CLOCK_CAST(obj) ((GstSystemClock *)(obj))
  30. #define GST_IS_SYSTEM_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SYSTEM_CLOCK))
  31. #define GST_SYSTEM_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SYSTEM_CLOCK, GstSystemClockClass))
  32. #define GST_IS_SYSTEM_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SYSTEM_CLOCK))
  33. #define GST_SYSTEM_CLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SYSTEM_CLOCK, GstSystemClockClass))
  34. typedef struct _GstSystemClock GstSystemClock;
  35. typedef struct _GstSystemClockClass GstSystemClockClass;
  36. typedef struct _GstSystemClockPrivate GstSystemClockPrivate;
  37. /**
  38. * GstClockType:
  39. * @GST_CLOCK_TYPE_REALTIME: time since Epoch
  40. * @GST_CLOCK_TYPE_MONOTONIC: monotonic time since some unspecified starting
  41. * point
  42. * @GST_CLOCK_TYPE_OTHER: some other time source is used (Since: 1.0.5)
  43. *
  44. * The different kind of clocks.
  45. */
  46. typedef enum {
  47. GST_CLOCK_TYPE_REALTIME = 0,
  48. GST_CLOCK_TYPE_MONOTONIC = 1,
  49. GST_CLOCK_TYPE_OTHER = 2
  50. } GstClockType;
  51. /**
  52. * GstSystemClock:
  53. *
  54. * The default implementation of a #GstClock that uses the system time.
  55. */
  56. struct _GstSystemClock {
  57. GstClock clock;
  58. /*< private >*/
  59. GstSystemClockPrivate *priv;
  60. gpointer _gst_reserved[GST_PADDING];
  61. };
  62. struct _GstSystemClockClass {
  63. GstClockClass parent_class;
  64. /*< private >*/
  65. gpointer _gst_reserved[GST_PADDING];
  66. };
  67. GType gst_system_clock_get_type (void);
  68. GstClock* gst_system_clock_obtain (void);
  69. void gst_system_clock_set_default (GstClock *new_clock);
  70. G_END_DECLS
  71. #endif /* __GST_SYSTEM_CLOCK_H__ */