From eed2a350cb6730808394a4dcde7845f5fb38d019 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 12 Jan 2011 16:03:57 +0200 Subject: [PATCH] typefind: code and comment cleanups Make code two places of the code the pushes the buffer store more similar. More comments and debug logging. --- plugins/elements/gsttypefindelement.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index e32adf71e5..e584e3e930 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -53,6 +53,9 @@ * is assumed that the peer element is happy with whatever format we * eventually read. * + * By default it tries to do pull based typefinding (this avoid joining received + * buffers and holding them back in store.) + * * When the element has no connected srcpad, and the sinkpad can operate in * getrange based mode, the element starts its own task to figure out the * type of the stream. @@ -646,15 +649,14 @@ gst_type_find_element_setcaps (GstPad * pad, GstCaps * caps) gst_type_find_element_send_cached_events (typefind); GST_OBJECT_LOCK (typefind); if (typefind->store) { - GstBuffer *store = typefind->store; + GstBuffer *store; + store = gst_buffer_make_metadata_writable (typefind->store); typefind->store = NULL; - GST_DEBUG_OBJECT (typefind, "Pushing store: %d", GST_BUFFER_SIZE (store)); - - store = gst_buffer_make_metadata_writable (store); gst_buffer_set_caps (store, typefind->caps); GST_OBJECT_UNLOCK (typefind); + GST_DEBUG_OBJECT (typefind, "Pushing store: %d", GST_BUFFER_SIZE (store)); gst_pad_push (typefind->src, store); } else { GST_OBJECT_UNLOCK (typefind); @@ -927,6 +929,8 @@ gst_type_find_element_activate (GstPad * pad) return gst_pad_activate_push (pad, TRUE); } + GST_DEBUG_OBJECT (typefind, "find type in pull mode"); + /* 2 */ { GstPad *peer;