mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gst/elements/gstbufferstore.c: fix bug where buffer was not assembled correctly
Original commit message from CVS: 2004-01-25 Benjamin Otte <in7y118@public.uni-hamburg.de> * gst/elements/gstbufferstore.c: (gst_buffer_store_get_buffer): fix bug where buffer was not assembled correctly * gst/elements/gsttee.c: (gst_tee_class_init), (gst_tee_init): silence by default * gst/elements/gsttypefind.c: (gst_type_find_element_chain): only seek if there's no more buffers that could work without seeking
This commit is contained in:
parent
f21808c6a8
commit
8a1bb576b2
7 changed files with 83 additions and 48 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-01-25 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* gst/elements/gstbufferstore.c: (gst_buffer_store_get_buffer):
|
||||||
|
fix bug where buffer was not assembled correctly
|
||||||
|
* gst/elements/gsttee.c: (gst_tee_class_init), (gst_tee_init):
|
||||||
|
silence by default
|
||||||
|
* gst/elements/gsttypefind.c: (gst_type_find_element_chain):
|
||||||
|
only seek if there's no more buffers that could work without seeking
|
||||||
|
|
||||||
2004-01-23 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
2004-01-23 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
* gst/gsttag.c: (_gst_tag_initialize):
|
* gst/gsttag.c: (_gst_tag_initialize):
|
||||||
|
|
|
@ -364,6 +364,7 @@ gst_buffer_store_get_buffer (GstBufferStore *store, guint64 offset, guint size)
|
||||||
walk = g_list_next (walk);
|
walk = g_list_next (walk);
|
||||||
tmp = MIN (GST_BUFFER_SIZE (current), size);
|
tmp = MIN (GST_BUFFER_SIZE (current), size);
|
||||||
memcpy (data, GST_BUFFER_DATA (current), tmp);
|
memcpy (data, GST_BUFFER_DATA (current), tmp);
|
||||||
|
data += tmp;
|
||||||
size -= tmp;
|
size -= tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ gst_tee_class_init (GstTeeClass *klass)
|
||||||
0, G_MAXINT, 0, G_PARAM_READABLE));
|
0, G_MAXINT, 0, G_PARAM_READABLE));
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
|
||||||
g_param_spec_boolean ("silent", "silent", "silent",
|
g_param_spec_boolean ("silent", "silent", "silent",
|
||||||
FALSE, G_PARAM_READWRITE));
|
TRUE, G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
|
||||||
g_param_spec_string ("last_message", "last_message", "last_message",
|
g_param_spec_string ("last_message", "last_message", "last_message",
|
||||||
NULL, G_PARAM_READABLE));
|
NULL, G_PARAM_READABLE));
|
||||||
|
@ -120,7 +120,6 @@ gst_tee_init (GstTee *tee)
|
||||||
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
|
||||||
tee->silent = FALSE;
|
|
||||||
tee->last_message = NULL;
|
tee->last_message = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,12 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
gst_pad_push (typefind->src, data);
|
gst_pad_push (typefind->src, data);
|
||||||
return;
|
return;
|
||||||
case MODE_TYPEFIND: {
|
case MODE_TYPEFIND: {
|
||||||
|
guint64 current_offset;
|
||||||
|
|
||||||
gst_buffer_store_add_buffer (typefind->store, GST_BUFFER (data));
|
gst_buffer_store_add_buffer (typefind->store, GST_BUFFER (data));
|
||||||
|
current_offset = GST_BUFFER_OFFSET_IS_VALID (data) ?
|
||||||
|
GST_BUFFER_OFFSET (data) + GST_BUFFER_SIZE (data) :
|
||||||
|
gst_buffer_store_get_size (typefind->store, 0);
|
||||||
gst_data_unref (data);
|
gst_data_unref (data);
|
||||||
if (typefind->possibilities == NULL) {
|
if (typefind->possibilities == NULL) {
|
||||||
/* not yet started, get all typefinding functions into our "queue" */
|
/* not yet started, get all typefinding functions into our "queue" */
|
||||||
|
@ -563,10 +568,17 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
/* set up typefind element for next iteration */
|
/* set up typefind element for next iteration */
|
||||||
typefind->possibilities = g_list_sort (typefind->possibilities, compare_type_find_entry);
|
typefind->possibilities = g_list_sort (typefind->possibilities, compare_type_find_entry);
|
||||||
|
|
||||||
walk = typefind->possibilities;
|
/* look for typefind functions that require data without seeking */
|
||||||
while (walk) {
|
for (walk = typefind->possibilities; walk; walk = g_list_next (walk)) {
|
||||||
|
entry = (TypeFindEntry *) walk->data;
|
||||||
|
if (entry->requested_offset <= current_offset &&
|
||||||
|
entry->requested_offset + entry->requested_size > current_offset)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!walk) {
|
||||||
|
/* find out if we should seek */
|
||||||
|
for (walk = typefind->possibilities; walk; walk = g_list_next (walk)) {
|
||||||
entry = (TypeFindEntry *) walk->data;
|
entry = (TypeFindEntry *) walk->data;
|
||||||
walk = g_list_next (walk);
|
|
||||||
if (entry->requested_size > 0) {
|
if (entry->requested_size > 0) {
|
||||||
/* FIXME: need heuristic to find out if we should seek */
|
/* FIXME: need heuristic to find out if we should seek */
|
||||||
gint64 seek_offset;
|
gint64 seek_offset;
|
||||||
|
@ -590,6 +602,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* throw out all entries that can't get more data */
|
/* throw out all entries that can't get more data */
|
||||||
walk = g_list_next (typefind->possibilities);
|
walk = g_list_next (typefind->possibilities);
|
||||||
while (walk) {
|
while (walk) {
|
||||||
|
|
|
@ -364,6 +364,7 @@ gst_buffer_store_get_buffer (GstBufferStore *store, guint64 offset, guint size)
|
||||||
walk = g_list_next (walk);
|
walk = g_list_next (walk);
|
||||||
tmp = MIN (GST_BUFFER_SIZE (current), size);
|
tmp = MIN (GST_BUFFER_SIZE (current), size);
|
||||||
memcpy (data, GST_BUFFER_DATA (current), tmp);
|
memcpy (data, GST_BUFFER_DATA (current), tmp);
|
||||||
|
data += tmp;
|
||||||
size -= tmp;
|
size -= tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ gst_tee_class_init (GstTeeClass *klass)
|
||||||
0, G_MAXINT, 0, G_PARAM_READABLE));
|
0, G_MAXINT, 0, G_PARAM_READABLE));
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT,
|
||||||
g_param_spec_boolean ("silent", "silent", "silent",
|
g_param_spec_boolean ("silent", "silent", "silent",
|
||||||
FALSE, G_PARAM_READWRITE));
|
TRUE, G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LAST_MESSAGE,
|
||||||
g_param_spec_string ("last_message", "last_message", "last_message",
|
g_param_spec_string ("last_message", "last_message", "last_message",
|
||||||
NULL, G_PARAM_READABLE));
|
NULL, G_PARAM_READABLE));
|
||||||
|
@ -120,7 +120,6 @@ gst_tee_init (GstTee *tee)
|
||||||
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
|
||||||
tee->silent = FALSE;
|
|
||||||
tee->last_message = NULL;
|
tee->last_message = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,12 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
gst_pad_push (typefind->src, data);
|
gst_pad_push (typefind->src, data);
|
||||||
return;
|
return;
|
||||||
case MODE_TYPEFIND: {
|
case MODE_TYPEFIND: {
|
||||||
|
guint64 current_offset;
|
||||||
|
|
||||||
gst_buffer_store_add_buffer (typefind->store, GST_BUFFER (data));
|
gst_buffer_store_add_buffer (typefind->store, GST_BUFFER (data));
|
||||||
|
current_offset = GST_BUFFER_OFFSET_IS_VALID (data) ?
|
||||||
|
GST_BUFFER_OFFSET (data) + GST_BUFFER_SIZE (data) :
|
||||||
|
gst_buffer_store_get_size (typefind->store, 0);
|
||||||
gst_data_unref (data);
|
gst_data_unref (data);
|
||||||
if (typefind->possibilities == NULL) {
|
if (typefind->possibilities == NULL) {
|
||||||
/* not yet started, get all typefinding functions into our "queue" */
|
/* not yet started, get all typefinding functions into our "queue" */
|
||||||
|
@ -563,10 +568,17 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
/* set up typefind element for next iteration */
|
/* set up typefind element for next iteration */
|
||||||
typefind->possibilities = g_list_sort (typefind->possibilities, compare_type_find_entry);
|
typefind->possibilities = g_list_sort (typefind->possibilities, compare_type_find_entry);
|
||||||
|
|
||||||
walk = typefind->possibilities;
|
/* look for typefind functions that require data without seeking */
|
||||||
while (walk) {
|
for (walk = typefind->possibilities; walk; walk = g_list_next (walk)) {
|
||||||
|
entry = (TypeFindEntry *) walk->data;
|
||||||
|
if (entry->requested_offset <= current_offset &&
|
||||||
|
entry->requested_offset + entry->requested_size > current_offset)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!walk) {
|
||||||
|
/* find out if we should seek */
|
||||||
|
for (walk = typefind->possibilities; walk; walk = g_list_next (walk)) {
|
||||||
entry = (TypeFindEntry *) walk->data;
|
entry = (TypeFindEntry *) walk->data;
|
||||||
walk = g_list_next (walk);
|
|
||||||
if (entry->requested_size > 0) {
|
if (entry->requested_size > 0) {
|
||||||
/* FIXME: need heuristic to find out if we should seek */
|
/* FIXME: need heuristic to find out if we should seek */
|
||||||
gint64 seek_offset;
|
gint64 seek_offset;
|
||||||
|
@ -590,6 +602,7 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* throw out all entries that can't get more data */
|
/* throw out all entries that can't get more data */
|
||||||
walk = g_list_next (typefind->possibilities);
|
walk = g_list_next (typefind->possibilities);
|
||||||
while (walk) {
|
while (walk) {
|
||||||
|
|
Loading…
Reference in a new issue