mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
libs/gst/base/gsttypefindhelper.c: If we are provided with the size, we should implement
Original commit message from CVS: * libs/gst/base/gsttypefindhelper.c: (helper_find_get_length), (gst_type_find_helper_get_range): If we are provided with the size, we should implement GstTypeFind::get_length, so that typefind functions who want to can actually peek at the middle of a file.
This commit is contained in:
parent
fe20af8eae
commit
b53dc49d8d
2 changed files with 25 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-03-09 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* libs/gst/base/gsttypefindhelper.c: (helper_find_get_length),
|
||||
(gst_type_find_helper_get_range):
|
||||
If we are provided with the size, we should implement
|
||||
GstTypeFind::get_length, so that typefind functions who
|
||||
want to can actually peek at the middle of a file.
|
||||
|
||||
2006-03-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* docs/manual/advanced-dataaccess.xml:
|
||||
|
|
|
@ -147,6 +147,17 @@ helper_find_suggest (gpointer data, guint probability, const GstCaps * caps)
|
|||
}
|
||||
}
|
||||
|
||||
static guint64
|
||||
helper_find_get_length (gpointer data)
|
||||
{
|
||||
GstTypeFindHelper *find = (GstTypeFindHelper *) data;
|
||||
|
||||
GST_LOG_OBJECT (find->obj, "'%s' called called get_length, returning %"
|
||||
G_GUINT64_FORMAT, GST_PLUGIN_FEATURE_NAME (find->factory), find->size);
|
||||
|
||||
return find->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_type_find_helper_get_range:
|
||||
* @obj: A #GstObject that will be passed as first argument to @func
|
||||
|
@ -195,7 +206,12 @@ gst_type_find_helper_get_range (GstObject * obj,
|
|||
gst_find.data = &find;
|
||||
gst_find.peek = helper_find_peek;
|
||||
gst_find.suggest = helper_find_suggest;
|
||||
gst_find.get_length = NULL;
|
||||
|
||||
if (size == 0 || size == (guint64) - 1) {
|
||||
gst_find.get_length = NULL;
|
||||
} else {
|
||||
gst_find.get_length = helper_find_get_length;
|
||||
}
|
||||
|
||||
walk = type_list;
|
||||
|
||||
|
|
Loading…
Reference in a new issue