2001-08-13 20:19:34 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wim.taymans@chello.be>
|
|
|
|
*
|
|
|
|
* gsttimecache.h: Header for GstTimeCache
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
#ifndef __GST_TIME_CACHE_H__
|
|
|
|
#define __GST_TIME_CACHE_H__
|
2001-08-13 20:19:34 +00:00
|
|
|
|
|
|
|
#include <gst/gstobject.h>
|
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
#define GST_TYPE_TIME_CACHE (gst_time_cache_get_type ())
|
|
|
|
#define GST_TIME_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TIME_CACHE, GstTimeCache))
|
|
|
|
#define GST_TIME_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TIME_CACHE, GstTimeCacheClass))
|
|
|
|
#define GST_IS_TIME_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TIME_CACHE))
|
|
|
|
#define GST_IS_TIME_CACHE_CLASS(obj) (GST_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TIME_CACHE))
|
2001-08-13 20:19:34 +00:00
|
|
|
|
|
|
|
typedef struct _GstTimeCacheEntry GstTimeCacheEntry;
|
|
|
|
typedef struct _GstTimeCacheGroup GstTimeCacheGroup;
|
|
|
|
typedef struct _GstTimeCache GstTimeCache;
|
|
|
|
typedef struct _GstTimeCacheClass GstTimeCacheClass;
|
|
|
|
|
|
|
|
typedef enum {
|
2002-04-11 20:35:18 +00:00
|
|
|
GST_TIME_CACHE_UNKNOWN,
|
|
|
|
GST_TIME_CACHE_CERTAIN,
|
|
|
|
GST_TIME_CACHE_FUZZY_LOCATION,
|
|
|
|
GST_TIME_CACHE_FUZZY_TIMESTAMP,
|
2002-07-09 10:27:22 +00:00
|
|
|
GST_TIME_CACHE_FUZZY
|
2001-08-13 20:19:34 +00:00
|
|
|
} GstTimeCacheCertainty;
|
|
|
|
|
|
|
|
struct _GstTimeCacheEntry {
|
|
|
|
guint64 location;
|
|
|
|
gint64 timestamp;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstTimeCacheGroup {
|
2001-10-21 18:00:31 +00:00
|
|
|
/* unique ID of group in cache */
|
2001-08-13 20:19:34 +00:00
|
|
|
gint groupnum;
|
|
|
|
|
2001-10-21 18:00:31 +00:00
|
|
|
/* list of entries */
|
2001-08-13 20:19:34 +00:00
|
|
|
GList *entries;
|
|
|
|
|
2001-10-21 18:00:31 +00:00
|
|
|
/* the certainty level of the group */
|
2001-08-13 20:19:34 +00:00
|
|
|
GstTimeCacheCertainty certainty;
|
|
|
|
|
2001-10-21 18:00:31 +00:00
|
|
|
/* peer group that contains more certain entries */
|
2001-08-13 20:19:34 +00:00
|
|
|
gint peergroup;
|
|
|
|
|
2001-10-21 18:00:31 +00:00
|
|
|
/* range variables */
|
2001-08-13 20:19:34 +00:00
|
|
|
gint64 mintimestamp,maxtimestamp;
|
|
|
|
guint64 minlocation,maxlocation;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstTimeCacheClass {
|
|
|
|
GstObjectClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstTimeCache {
|
|
|
|
GstObject object;
|
|
|
|
|
|
|
|
GList *groups;
|
|
|
|
GstTimeCacheGroup *curgroup;
|
|
|
|
gint maxgroup;
|
|
|
|
};
|
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
GType gst_time_cache_get_type (void);
|
|
|
|
GstTimeCache* gst_time_cache_new (void);
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-05-26 21:54:27 +00:00
|
|
|
gint gst_time_cache_get_group (GstTimeCache *tc);
|
|
|
|
gint gst_time_cache_new_group (GstTimeCache *tc);
|
|
|
|
gboolean gst_time_cache_set_group (GstTimeCache *tc, gint groupnum);
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
void gst_time_cache_set_certainty (GstTimeCache *tc, GstTimeCacheCertainty certainty);
|
|
|
|
GstTimeCacheCertainty gst_time_cache_get_certainty (GstTimeCache *tc);
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-05-26 21:54:27 +00:00
|
|
|
void gst_time_cache_add_entry (GstTimeCache *tc, guint64 location, gint64 timestamp);
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
gboolean gst_time_cache_find_location (GstTimeCache *tc, guint64 location, gint64 *timestamp);
|
|
|
|
gboolean gst_time_cache_find_timestamp (GstTimeCache *tc, gint64 timestamp, guint64 *location);
|
2001-08-13 20:19:34 +00:00
|
|
|
|
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_END_DECLS
|
2001-08-13 20:19:34 +00:00
|
|
|
|
2002-04-11 20:35:18 +00:00
|
|
|
#endif /* __GST_TIME_CACHE_H__ */
|