2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wim.taymans@chello.be>
5 * gsttimecache.h: Header for GstTimeCache
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_TIME_CACHE_H__
24 #define __GST_TIME_CACHE_H__
26 #include <gst/gstobject.h>
30 #define GST_TYPE_TIME_CACHE (gst_time_cache_get_type ())
31 #define GST_TIME_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TIME_CACHE, GstTimeCache))
32 #define GST_TIME_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TIME_CACHE, GstTimeCacheClass))
33 #define GST_IS_TIME_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TIME_CACHE))
34 #define GST_IS_TIME_CACHE_CLASS(obj) (GST_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TIME_CACHE))
36 typedef struct _GstTimeCacheEntry GstTimeCacheEntry;
37 typedef struct _GstTimeCacheGroup GstTimeCacheGroup;
38 typedef struct _GstTimeCache GstTimeCache;
39 typedef struct _GstTimeCacheClass GstTimeCacheClass;
42 GST_TIME_CACHE_UNKNOWN,
43 GST_TIME_CACHE_CERTAIN,
44 GST_TIME_CACHE_FUZZY_LOCATION,
45 GST_TIME_CACHE_FUZZY_TIMESTAMP,
47 } GstTimeCacheCertainty;
49 struct _GstTimeCacheEntry {
54 struct _GstTimeCacheGroup {
55 /* unique ID of group in cache */
61 /* the certainty level of the group */
62 GstTimeCacheCertainty certainty;
64 /* peer group that contains more certain entries */
68 gint64 mintimestamp,maxtimestamp;
69 guint64 minlocation,maxlocation;
72 struct _GstTimeCacheClass {
73 GstObjectClass parent_class;
76 struct _GstTimeCache {
80 GstTimeCacheGroup *curgroup;
84 GType gst_time_cache_get_type (void);
85 GstTimeCache* gst_time_cache_new (void);
87 gint gst_time_cache_get_group (GstTimeCache *tc);
88 gint gst_time_cache_new_group (GstTimeCache *tc);
89 gboolean gst_time_cache_set_group (GstTimeCache *tc, gint groupnum);
91 void gst_time_cache_set_certainty (GstTimeCache *tc, GstTimeCacheCertainty certainty);
92 GstTimeCacheCertainty gst_time_cache_get_certainty (GstTimeCache *tc);
94 void gst_time_cache_add_entry (GstTimeCache *tc, guint64 location, gint64 timestamp);
96 gboolean gst_time_cache_find_location (GstTimeCache *tc, guint64 location, gint64 *timestamp);
97 gboolean gst_time_cache_find_timestamp (GstTimeCache *tc, gint64 timestamp, guint64 *location);
102 #endif /* __GST_TIME_CACHE_H__ */