GstTimeCache

Name

GstTimeCache -- Cache time and byteoffsets.

Synopsis


#include <gst/gst.h>


struct      GstTimeCacheEntry;
struct      GstTimeCacheGroup;
enum        GstTimeCacheCertainty;
GstTimeCache* gst_time_cache_new            (void);
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);
void        gst_time_cache_set_certainty    (GstTimeCache *tc,
                                             GstTimeCacheCertainty certainty);
GstTimeCacheCertainty gst_time_cache_get_certainty
                                            (GstTimeCache *tc);
void        gst_time_cache_add_entry        (GstTimeCache *tc,
                                             guint64 location,
                                             gint64 timestamp);
gboolean    gst_time_cache_find_location    (GstTimeCache *tc,
                                             guint64 location,
                                             gint64 *timestamp);
gboolean    gst_time_cache_find_timestamp   (GstTimeCache *tc,
                                             gint64 timestamp,
                                             guint64 *location);

Object Hierarchy


  GObject
   +----GstObject
         +----GstTimeCache

Description

This class is used by plugins to manage time vs byte offsets. It is mainly used for efficient seeking.

Details

struct GstTimeCacheEntry

struct GstTimeCacheEntry {
  guint64 location;
  gint64 timestamp;
};


struct GstTimeCacheGroup

struct GstTimeCacheGroup {
  /* unique ID of group in cache */
  gint groupnum;

  /* list of entries */
  GList *entries;

  /* the certainty level of the group */
  GstTimeCacheCertainty certainty;

  /* peer group that contains more certain entries */
  gint peergroup;

  /* range variables */
  gint64 mintimestamp,maxtimestamp;
  guint64 minlocation,maxlocation;
};


enum GstTimeCacheCertainty

typedef enum {
  GST_TIME_CACHE_UNKNOWN,
  GST_TIME_CACHE_CERTAIN,
  GST_TIME_CACHE_FUZZY_LOCATION,
  GST_TIME_CACHE_FUZZY_TIMESTAMP,
  GST_TIME_CACHE_FUZZY
} GstTimeCacheCertainty;


gst_time_cache_new ()

GstTimeCache* gst_time_cache_new            (void);

Create a new tilecache object

Returns : a new timecache object


gst_time_cache_get_group ()

gint        gst_time_cache_get_group        (GstTimeCache *tc);

Get the id of the current group.

tc : the timecache to get the current group from
Returns : the id of the current group.


gst_time_cache_new_group ()

gint        gst_time_cache_new_group        (GstTimeCache *tc);

Create a new group for the given timecache. It will be set as the current group.

tc : the timecache to create the new group in
Returns : the id of the newly created group.


gst_time_cache_set_group ()

gboolean    gst_time_cache_set_group        (GstTimeCache *tc,
                                             gint groupnum);

Set the current groupnumber to the given argument.

tc : the timecache to set the new group in
groupnum : the groupnumber to set
Returns : TRUE if the operation succeeded, FALSE if the group did not exist.


gst_time_cache_set_certainty ()

void        gst_time_cache_set_certainty    (GstTimeCache *tc,
                                             GstTimeCacheCertainty certainty);

Set the certainty of the given timecache.

tc : the timecache to set the certainty on
certainty : the certainty to set


gst_time_cache_get_certainty ()

GstTimeCacheCertainty gst_time_cache_get_certainty
                                            (GstTimeCache *tc);

Get the certainty of the given timecache.

tc : the timecache to get the certainty of
Returns : the certainty of the timecache.


gst_time_cache_add_entry ()

void        gst_time_cache_add_entry        (GstTimeCache *tc,
                                             guint64 location,
                                             gint64 timestamp);

Associate the given timestamp with the given location in the timecache.

tc : the timecache to add the entry to
location : the location
timestamp : the timestamp


gst_time_cache_find_location ()

gboolean    gst_time_cache_find_location    (GstTimeCache *tc,
                                             guint64 location,
                                             gint64 *timestamp);

Look up the associated timestamp for the given location in the timecache.

tc : the timecache to find the timestamp in
location : the location
timestamp : the timestamp
Returns : TRUE if the location was found in the timecache.


gst_time_cache_find_timestamp ()

gboolean    gst_time_cache_find_timestamp   (GstTimeCache *tc,
                                             gint64 timestamp,
                                             guint64 *location);

Look up the associated location for the given timestamp in the timecache.

tc : the timecache to find the location in
timestamp : the timestamp
location : the location
Returns : TRUE if the timestamp was found in the timecache.