Blame gst-libs/gst/audio/gstaudioclock.h

Packit 971217
/* GStreamer
Packit 971217
 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
Packit 971217
 *                    2005 Wim Taymans <wim@fluendo.com>
Packit 971217
 *
Packit 971217
 * gstaudioclock.h: Clock for use by audio plugins
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
Packit 971217
#ifndef __GST_AUDIO_AUDIO_H__
Packit 971217
#include <gst/audio/audio.h>
Packit 971217
#endif
Packit 971217
Packit 971217
#ifndef __GST_AUDIO_CLOCK_H__
Packit 971217
#define __GST_AUDIO_CLOCK_H__
Packit 971217
Packit 971217
#include <gst/gst.h>
Packit 971217
#include <gst/gstsystemclock.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
#define GST_TYPE_AUDIO_CLOCK \
Packit 971217
  (gst_audio_clock_get_type())
Packit 971217
#define GST_AUDIO_CLOCK(obj) \
Packit 971217
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CLOCK,GstAudioClock))
Packit 971217
#define GST_AUDIO_CLOCK_CLASS(klass) \
Packit 971217
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_CLOCK,GstAudioClockClass))
Packit 971217
#define GST_IS_AUDIO_CLOCK(obj) \
Packit 971217
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CLOCK))
Packit 971217
#define GST_IS_AUDIO_CLOCK_CLASS(klass) \
Packit 971217
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_CLOCK))
Packit 971217
#define GST_AUDIO_CLOCK_CAST(obj) \
Packit 971217
  ((GstAudioClock*)(obj))
Packit 971217
Packit 971217
typedef struct _GstAudioClock GstAudioClock;
Packit 971217
typedef struct _GstAudioClockClass GstAudioClockClass;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstAudioClockGetTimeFunc:
Packit 971217
 * @clock: the #GstAudioClock
Packit 971217
 * @user_data: user data
Packit 971217
 *
Packit 971217
 * This function will be called whenever the current clock time needs to be
Packit 971217
 * calculated. If this function returns #GST_CLOCK_TIME_NONE, the last reported
Packit 971217
 * time will be returned by the clock.
Packit 971217
 *
Packit 971217
 * Returns: the current time or #GST_CLOCK_TIME_NONE if the previous time should
Packit 971217
 * be used.
Packit 971217
 */
Packit 971217
typedef GstClockTime (*GstAudioClockGetTimeFunc) (GstClock *clock, gpointer user_data);
Packit 971217
Packit 971217
/**
Packit 971217
 * GstAudioClock:
Packit 971217
 *
Packit 971217
 * Opaque #GstAudioClock.
Packit 971217
 */
Packit 971217
struct _GstAudioClock {
Packit 971217
  GstSystemClock clock;
Packit 971217
Packit 971217
  /*< protected >*/
Packit 971217
  GstAudioClockGetTimeFunc func;
Packit 971217
  gpointer                 user_data;
Packit 971217
  GDestroyNotify           destroy_notify;
Packit 971217
Packit 971217
  /*< private >*/
Packit 971217
  GstClockTime             last_time;
Packit 971217
  GstClockTimeDiff         time_offset;
Packit 971217
Packit 971217
  gpointer _gst_reserved[GST_PADDING];
Packit 971217
};
Packit 971217
Packit 971217
struct _GstAudioClockClass {
Packit 971217
  GstSystemClockClass parent_class;
Packit 971217
Packit 971217
  /*< private >*/
Packit 971217
  gpointer _gst_reserved[GST_PADDING];
Packit 971217
};
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
GType           gst_audio_clock_get_type        (void);
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
GstClock*       gst_audio_clock_new             (const gchar *name, GstAudioClockGetTimeFunc func,
Packit 971217
                                                 gpointer user_data, GDestroyNotify destroy_notify);
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
void            gst_audio_clock_reset           (GstAudioClock *clock, GstClockTime time);
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
GstClockTime    gst_audio_clock_get_time        (GstAudioClock * clock);
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
GstClockTime    gst_audio_clock_adjust          (GstAudioClock * clock, GstClockTime time);
Packit 971217
Packit 971217
GST_AUDIO_API
Packit 971217
void            gst_audio_clock_invalidate      (GstAudioClock * clock);
Packit 971217
Packit 971217
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
Packit 971217
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAudioClock, gst_object_unref)
Packit 971217
#endif
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __GST_AUDIO_CLOCK_H__ */