2005-04-12 10:52:55 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
2006-02-27 18:43:26 +00:00
|
|
|
* Copyright (C) 2000,2005 Wim Taymans <wim@fluendo.com>
|
|
|
|
* Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
|
2005-04-12 10:52:55 +00:00
|
|
|
*
|
2005-10-15 15:30:24 +00:00
|
|
|
* gsttypefindhelper.c:
|
2005-04-12 10:52:55 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2005-04-12 10:52:55 +00:00
|
|
|
*/
|
|
|
|
|
2006-02-27 19:19:40 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gsttypefindhelper
|
2017-01-16 14:26:16 +00:00
|
|
|
* @title: GstTypeFindHelper
|
|
|
|
* @short_description: Utility functions for typefinding
|
2006-02-27 19:19:40 +00:00
|
|
|
*
|
|
|
|
* Utility functions for elements doing typefinding:
|
|
|
|
* gst_type_find_helper() does typefinding in pull mode, while
|
|
|
|
* gst_type_find_helper_for_buffer() is useful for elements needing to do
|
|
|
|
* typefinding in push mode from a chain function.
|
|
|
|
*/
|
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2006-05-04 15:20:14 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
#include "gsttypefindhelper.h"
|
|
|
|
|
2006-02-27 19:45:31 +00:00
|
|
|
/* ********************** typefinding in pull mode ************************ */
|
|
|
|
|
2008-10-10 15:12:11 +00:00
|
|
|
static void
|
2016-11-14 19:32:51 +00:00
|
|
|
helper_find_suggest (gpointer data, guint probability, GstCaps * caps);
|
2008-10-10 15:12:11 +00:00
|
|
|
|
2012-03-30 14:53:05 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstMapInfo map;
|
|
|
|
} GstMappedBuffer;
|
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GSList *buffers; /* buffer cache */
|
2005-04-12 10:52:55 +00:00
|
|
|
guint64 size;
|
2007-10-03 12:05:17 +00:00
|
|
|
guint64 last_offset;
|
2006-03-02 13:45:32 +00:00
|
|
|
GstTypeFindHelperGetRangeFunction func;
|
2011-08-25 21:49:38 +00:00
|
|
|
GstTypeFindProbability best_probability;
|
2007-07-24 13:38:21 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
GstTypeFindFactory *factory; /* for logging */
|
|
|
|
GstObject *obj; /* for logging */
|
2011-11-17 15:14:34 +00:00
|
|
|
GstObject *parent;
|
2007-07-24 13:38:21 +00:00
|
|
|
} GstTypeFindHelper;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
/*
|
|
|
|
* helper_find_peek:
|
|
|
|
* @data: helper data struct
|
|
|
|
* @off: stream offset
|
|
|
|
* @size: block size
|
|
|
|
*
|
2007-10-03 12:05:17 +00:00
|
|
|
* Get data pointer within a stream. Keeps a cache of read buffers (partly
|
|
|
|
* for performance reasons, but mostly because pointers returned by us need
|
|
|
|
* to stay valid until typefinding has finished)
|
2007-07-24 13:38:21 +00:00
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (nullable): address of the data or %NULL if buffer does not cover
|
|
|
|
* the requested range.
|
2007-07-24 13:38:21 +00:00
|
|
|
*/
|
2011-03-21 17:13:55 +00:00
|
|
|
static const guint8 *
|
2005-04-12 10:52:55 +00:00
|
|
|
helper_find_peek (gpointer data, gint64 offset, guint size)
|
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GstTypeFindHelper *helper;
|
2005-04-12 10:52:55 +00:00
|
|
|
GstBuffer *buffer;
|
|
|
|
GstFlowReturn ret;
|
2007-10-03 12:05:17 +00:00
|
|
|
GSList *insert_pos = NULL;
|
2011-03-21 17:13:55 +00:00
|
|
|
gsize buf_size;
|
2008-06-20 11:24:03 +00:00
|
|
|
guint64 buf_offset;
|
2012-03-30 14:53:05 +00:00
|
|
|
GstMappedBuffer *bmap;
|
2011-05-08 10:46:17 +00:00
|
|
|
#if 0
|
2008-10-10 15:12:11 +00:00
|
|
|
GstCaps *caps;
|
2011-05-08 10:46:17 +00:00
|
|
|
#endif
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
helper = (GstTypeFindHelper *) data;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
GST_LOG_OBJECT (helper->obj, "'%s' called peek (%" G_GINT64_FORMAT
|
2011-05-24 16:17:24 +00:00
|
|
|
", %u)", GST_OBJECT_NAME (helper->factory), offset, size);
|
2005-08-21 10:54:47 +00:00
|
|
|
|
|
|
|
if (size == 0)
|
|
|
|
return NULL;
|
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
if (offset < 0) {
|
2007-07-24 13:38:21 +00:00
|
|
|
if (helper->size == -1 || helper->size < -offset)
|
2005-04-12 10:52:55 +00:00
|
|
|
return NULL;
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
offset += helper->size;
|
2005-04-12 10:52:55 +00:00
|
|
|
}
|
|
|
|
|
2005-10-10 10:43:15 +00:00
|
|
|
/* see if we have a matching buffer already in our list */
|
2007-10-03 12:05:17 +00:00
|
|
|
if (size > 0 && offset <= helper->last_offset) {
|
2005-10-10 10:43:15 +00:00
|
|
|
GSList *walk;
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
for (walk = helper->buffers; walk; walk = walk->next) {
|
2012-03-30 14:53:05 +00:00
|
|
|
GstMappedBuffer *bmp = (GstMappedBuffer *) walk->data;
|
|
|
|
GstBuffer *buf = GST_BUFFER_CAST (bmp->buffer);
|
2012-09-24 23:55:59 +00:00
|
|
|
|
|
|
|
buf_offset = GST_BUFFER_OFFSET (buf);
|
2013-04-16 17:04:48 +00:00
|
|
|
buf_size = bmp->map.size;
|
2005-10-10 10:43:15 +00:00
|
|
|
|
2008-05-16 21:09:45 +00:00
|
|
|
/* buffers are kept sorted by end offset (highest first) in the list, so
|
2017-01-16 14:26:16 +00:00
|
|
|
* at this point we save the current position and stop searching if
|
2008-05-16 21:09:45 +00:00
|
|
|
* we're after the searched end offset */
|
2007-10-03 12:05:17 +00:00
|
|
|
if (buf_offset <= offset) {
|
|
|
|
if ((offset + size) < (buf_offset + buf_size)) {
|
2012-03-30 14:53:05 +00:00
|
|
|
/* must already have been mapped before */
|
|
|
|
return (guint8 *) bmp->map.data + (offset - buf_offset);
|
2007-10-03 12:05:17 +00:00
|
|
|
}
|
2008-05-16 21:09:45 +00:00
|
|
|
} else if (offset + size >= buf_offset + buf_size) {
|
2007-10-03 12:05:17 +00:00
|
|
|
insert_pos = walk;
|
|
|
|
break;
|
|
|
|
}
|
2005-10-10 10:43:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
buffer = NULL;
|
2007-10-03 12:05:17 +00:00
|
|
|
/* some typefinders go in 1 byte steps over 1k of data and request
|
|
|
|
* small buffers. It is really inefficient to pull each time, and pulling
|
|
|
|
* a larger chunk is almost free. Trying to pull a larger chunk at the end
|
|
|
|
* of the file is also not a problem here, we'll just get a truncated buffer
|
|
|
|
* in that case (and we'll have to double-check the size we actually get
|
|
|
|
* anyway, see below) */
|
2011-11-17 15:14:34 +00:00
|
|
|
ret =
|
|
|
|
helper->func (helper->obj, helper->parent, offset, MAX (size, 4096),
|
|
|
|
&buffer);
|
2005-04-12 10:52:55 +00:00
|
|
|
|
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
goto error;
|
|
|
|
|
2011-05-08 10:46:17 +00:00
|
|
|
#if 0
|
2011-05-05 08:37:19 +00:00
|
|
|
caps = GST_BUFFER_CAPS (buffer);
|
2008-10-10 15:12:11 +00:00
|
|
|
|
|
|
|
if (caps && !gst_caps_is_empty (caps) && !gst_caps_is_any (caps)) {
|
|
|
|
GST_DEBUG ("buffer has caps %" GST_PTR_FORMAT ", suggest max probability",
|
|
|
|
caps);
|
|
|
|
|
|
|
|
gst_caps_replace (&helper->caps, caps);
|
|
|
|
helper->best_probability = GST_TYPE_FIND_MAXIMUM;
|
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-05-08 10:46:17 +00:00
|
|
|
#endif
|
2008-10-10 15:12:11 +00:00
|
|
|
|
2005-10-09 17:59:08 +00:00
|
|
|
/* getrange might silently return shortened buffers at the end of a file,
|
2014-06-05 19:38:20 +00:00
|
|
|
* we must, however, always return either the full requested data or %NULL */
|
2008-06-20 11:24:03 +00:00
|
|
|
buf_offset = GST_BUFFER_OFFSET (buffer);
|
2011-03-21 17:13:55 +00:00
|
|
|
buf_size = gst_buffer_get_size (buffer);
|
2008-06-20 11:24:03 +00:00
|
|
|
|
2018-01-13 03:08:00 +00:00
|
|
|
if (buf_size < size) {
|
|
|
|
GST_DEBUG ("dropping short buffer of size %" G_GSIZE_FORMAT ","
|
|
|
|
"requested size was %u", buf_size, size);
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (buf_offset != -1 && buf_offset != offset) {
|
|
|
|
GST_DEBUG ("dropping buffer with unexpected offset %" G_GUINT64_FORMAT ", "
|
|
|
|
"expected offset was %" G_GUINT64_FORMAT, buf_offset, offset);
|
2005-10-09 17:59:08 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2012-03-30 14:53:05 +00:00
|
|
|
bmap = g_slice_new0 (GstMappedBuffer);
|
2013-01-14 16:01:22 +00:00
|
|
|
|
|
|
|
if (!gst_buffer_map (buffer, &bmap->map, GST_MAP_READ))
|
|
|
|
goto map_failed;
|
|
|
|
|
2012-03-30 14:53:05 +00:00
|
|
|
bmap->buffer = buffer;
|
2013-01-14 16:01:22 +00:00
|
|
|
|
2007-10-03 12:05:17 +00:00
|
|
|
if (insert_pos) {
|
2012-03-30 14:53:05 +00:00
|
|
|
helper->buffers = g_slist_insert_before (helper->buffers, insert_pos, bmap);
|
2007-10-03 12:05:17 +00:00
|
|
|
} else {
|
|
|
|
/* if insert_pos is not set, our offset is bigger than the largest offset
|
|
|
|
* we have so far; since we keep the list sorted with highest offsets
|
|
|
|
* first, we need to prepend the buffer to the list */
|
2011-03-21 17:13:55 +00:00
|
|
|
helper->last_offset = GST_BUFFER_OFFSET (buffer) + buf_size;
|
2012-03-30 14:53:05 +00:00
|
|
|
helper->buffers = g_slist_prepend (helper->buffers, bmap);
|
2007-10-03 12:05:17 +00:00
|
|
|
}
|
2011-03-21 17:13:55 +00:00
|
|
|
|
2012-03-30 14:53:05 +00:00
|
|
|
return bmap->map.data;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
|
|
|
error:
|
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GST_INFO ("typefind function returned: %s", gst_flow_get_name (ret));
|
2005-04-12 10:52:55 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2013-01-14 16:01:22 +00:00
|
|
|
map_failed:
|
|
|
|
{
|
|
|
|
GST_ERROR ("map failed");
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
g_slice_free (GstMappedBuffer, bmap);
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-04-12 10:52:55 +00:00
|
|
|
}
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
/*
|
|
|
|
* helper_find_suggest:
|
|
|
|
* @data: helper data struct
|
|
|
|
* @probability: probability of the match
|
|
|
|
* @caps: caps of the type
|
|
|
|
*
|
|
|
|
* If given @probability is higher, replace previously store caps.
|
|
|
|
*/
|
2005-04-12 10:52:55 +00:00
|
|
|
static void
|
2016-11-11 18:30:44 +00:00
|
|
|
helper_find_suggest (gpointer data, guint probability, GstCaps * caps)
|
2005-04-12 10:52:55 +00:00
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GstTypeFindHelper *helper = (GstTypeFindHelper *) data;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
GST_LOG_OBJECT (helper->obj,
|
2011-09-07 11:14:38 +00:00
|
|
|
"'%s' called suggest (%u, %" GST_PTR_FORMAT ")",
|
2011-05-24 16:17:24 +00:00
|
|
|
GST_OBJECT_NAME (helper->factory), probability, caps);
|
2005-08-21 10:54:47 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
if (probability > helper->best_probability) {
|
2012-03-10 08:25:43 +00:00
|
|
|
gst_caps_replace (&helper->caps, caps);
|
2007-07-24 13:38:21 +00:00
|
|
|
helper->best_probability = probability;
|
2005-04-12 10:52:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-09 10:46:35 +00:00
|
|
|
static guint64
|
|
|
|
helper_find_get_length (gpointer data)
|
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GstTypeFindHelper *helper = (GstTypeFindHelper *) data;
|
2006-03-09 10:46:35 +00:00
|
|
|
|
2011-09-07 11:14:38 +00:00
|
|
|
GST_LOG_OBJECT (helper->obj, "'%s' called get_length, returning %"
|
2011-05-24 16:17:24 +00:00
|
|
|
G_GUINT64_FORMAT, GST_OBJECT_NAME (helper->factory), helper->size);
|
2006-03-09 10:46:35 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
return helper->size;
|
2006-03-09 10:46:35 +00:00
|
|
|
}
|
|
|
|
|
2005-11-09 16:44:40 +00:00
|
|
|
/**
|
2011-11-17 15:14:34 +00:00
|
|
|
* gst_type_find_helper_get_range:
|
2006-03-02 13:45:32 +00:00
|
|
|
* @obj: A #GstObject that will be passed as first argument to @func
|
2014-06-05 19:38:20 +00:00
|
|
|
* @parent: (allow-none): the parent of @obj or %NULL
|
2010-12-17 18:19:40 +00:00
|
|
|
* @func: (scope call): A generic #GstTypeFindHelperGetRangeFunction that will
|
|
|
|
* be used to access data at random offsets when doing the typefinding
|
2005-11-09 16:44:40 +00:00
|
|
|
* @size: The length in bytes
|
2010-12-07 18:35:56 +00:00
|
|
|
* @extension: extension of the media
|
|
|
|
* @prob: (out) (allow-none): location to store the probability of the found
|
2014-06-05 19:38:20 +00:00
|
|
|
* caps, or %NULL
|
2005-11-09 16:44:40 +00:00
|
|
|
*
|
2006-03-02 13:45:32 +00:00
|
|
|
* Utility function to do pull-based typefinding. Unlike gst_type_find_helper()
|
|
|
|
* however, this function will use the specified function @func to obtain the
|
|
|
|
* data needed by the typefind functions, rather than operating on a given
|
|
|
|
* source pad. This is useful mostly for elements like tag demuxers which
|
|
|
|
* strip off data at the beginning and/or end of a file and want to typefind
|
|
|
|
* the stripped data stream before adding their own source pad (the specified
|
|
|
|
* callback can then call the upstream peer pad with offsets adjusted for the
|
|
|
|
* tag size, for example).
|
2005-11-09 16:44:40 +00:00
|
|
|
*
|
2014-06-05 19:38:20 +00:00
|
|
|
* When @extension is not %NULL, this function will first try the typefind
|
2010-01-12 16:34:39 +00:00
|
|
|
* functions for the given extension, which might speed up the typefinding
|
|
|
|
* in many cases.
|
|
|
|
*
|
2010-12-07 18:35:56 +00:00
|
|
|
* Free-function: gst_caps_unref
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (transfer full) (nullable): the #GstCaps corresponding to the data
|
|
|
|
* stream. Returns %NULL if no #GstCaps matches the data stream.
|
2005-11-09 16:44:40 +00:00
|
|
|
*/
|
2005-04-12 10:52:55 +00:00
|
|
|
GstCaps *
|
2011-11-17 15:14:34 +00:00
|
|
|
gst_type_find_helper_get_range (GstObject * obj, GstObject * parent,
|
2006-03-02 13:45:32 +00:00
|
|
|
GstTypeFindHelperGetRangeFunction func, guint64 size,
|
2010-01-12 16:34:39 +00:00
|
|
|
const gchar * extension, GstTypeFindProbability * prob)
|
2005-04-12 10:52:55 +00:00
|
|
|
{
|
2007-07-24 13:38:21 +00:00
|
|
|
GstTypeFindHelper helper;
|
|
|
|
GstTypeFind find;
|
|
|
|
GSList *walk;
|
|
|
|
GList *l, *type_list;
|
2005-04-12 10:52:55 +00:00
|
|
|
GstCaps *result = NULL;
|
2010-01-12 16:34:39 +00:00
|
|
|
gint pos = 0;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2006-03-02 13:45:32 +00:00
|
|
|
g_return_val_if_fail (GST_IS_OBJECT (obj), NULL);
|
|
|
|
g_return_val_if_fail (func != NULL, NULL);
|
2005-08-21 10:54:47 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
helper.buffers = NULL;
|
|
|
|
helper.size = size;
|
2007-10-03 12:05:17 +00:00
|
|
|
helper.last_offset = 0;
|
2007-07-24 13:38:21 +00:00
|
|
|
helper.func = func;
|
2011-08-25 21:49:38 +00:00
|
|
|
helper.best_probability = GST_TYPE_FIND_NONE;
|
2007-07-24 13:38:21 +00:00
|
|
|
helper.caps = NULL;
|
|
|
|
helper.obj = obj;
|
2011-11-17 15:14:34 +00:00
|
|
|
helper.parent = parent;
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
find.data = &helper;
|
|
|
|
find.peek = helper_find_peek;
|
|
|
|
find.suggest = helper_find_suggest;
|
2006-03-09 10:46:35 +00:00
|
|
|
|
|
|
|
if (size == 0 || size == (guint64) - 1) {
|
2007-07-24 13:38:21 +00:00
|
|
|
find.get_length = NULL;
|
2006-03-09 10:46:35 +00:00
|
|
|
} else {
|
2007-07-24 13:38:21 +00:00
|
|
|
find.get_length = helper_find_get_length;
|
2006-03-09 10:46:35 +00:00
|
|
|
}
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
type_list = gst_type_find_factory_get_list ();
|
2005-08-21 10:54:47 +00:00
|
|
|
|
2010-01-12 16:34:39 +00:00
|
|
|
/* move the typefinders for the extension first in the list. The idea is that
|
|
|
|
* when one of them returns MAX we don't need to search further as there is a
|
|
|
|
* very high chance we got the right type. */
|
|
|
|
if (extension) {
|
|
|
|
GList *next;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "sorting typefind for extension %s to head",
|
|
|
|
extension);
|
|
|
|
|
|
|
|
for (l = type_list; l; l = next) {
|
2012-05-01 21:28:11 +00:00
|
|
|
const gchar *const *ext;
|
2010-01-12 16:34:39 +00:00
|
|
|
GstTypeFindFactory *factory;
|
|
|
|
|
|
|
|
next = l->next;
|
|
|
|
|
|
|
|
factory = GST_TYPE_FIND_FACTORY (l->data);
|
|
|
|
|
|
|
|
ext = gst_type_find_factory_get_extensions (factory);
|
|
|
|
if (ext == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "testing factory %s for extension %s",
|
2011-05-24 16:17:24 +00:00
|
|
|
GST_OBJECT_NAME (factory), extension);
|
2010-01-12 16:34:39 +00:00
|
|
|
|
2012-05-01 21:28:11 +00:00
|
|
|
while (*ext != NULL) {
|
|
|
|
if (strcmp (*ext, extension) == 0) {
|
2010-01-12 16:34:39 +00:00
|
|
|
/* found extension, move in front */
|
|
|
|
GST_LOG_OBJECT (obj, "moving typefind for extension %s to head",
|
|
|
|
extension);
|
|
|
|
/* remove entry from list */
|
|
|
|
type_list = g_list_delete_link (type_list, l);
|
|
|
|
/* insert at the position */
|
|
|
|
type_list = g_list_insert (type_list, factory, pos);
|
|
|
|
/* next element will be inserted after this one */
|
|
|
|
pos++;
|
|
|
|
break;
|
|
|
|
}
|
2012-05-01 21:28:11 +00:00
|
|
|
++ext;
|
2010-01-12 16:34:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
for (l = type_list; l; l = l->next) {
|
|
|
|
helper.factory = GST_TYPE_FIND_FACTORY (l->data);
|
|
|
|
gst_type_find_factory_call_function (helper.factory, &find);
|
|
|
|
if (helper.best_probability >= GST_TYPE_FIND_MAXIMUM)
|
2005-04-12 10:52:55 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-12-12 19:09:49 +00:00
|
|
|
gst_plugin_feature_list_free (type_list);
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2012-03-30 14:53:05 +00:00
|
|
|
for (walk = helper.buffers; walk; walk = walk->next) {
|
|
|
|
GstMappedBuffer *bmap = (GstMappedBuffer *) walk->data;
|
|
|
|
|
|
|
|
gst_buffer_unmap (bmap->buffer, &bmap->map);
|
|
|
|
gst_buffer_unref (bmap->buffer);
|
|
|
|
g_slice_free (GstMappedBuffer, bmap);
|
|
|
|
}
|
2007-07-24 13:38:21 +00:00
|
|
|
g_slist_free (helper.buffers);
|
2005-04-12 10:52:55 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
if (helper.best_probability > 0)
|
|
|
|
result = helper.caps;
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
|
2006-03-02 13:45:32 +00:00
|
|
|
if (prob)
|
2007-07-24 13:38:21 +00:00
|
|
|
*prob = helper.best_probability;
|
2006-03-02 13:45:32 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "Returning %" GST_PTR_FORMAT " (probability = %u)",
|
2007-07-24 13:38:21 +00:00
|
|
|
result, (guint) helper.best_probability);
|
2006-03-02 13:45:32 +00:00
|
|
|
|
2005-04-12 10:52:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
2006-02-27 18:43:26 +00:00
|
|
|
|
2006-03-02 13:45:32 +00:00
|
|
|
/**
|
|
|
|
* gst_type_find_helper:
|
|
|
|
* @src: A source #GstPad
|
|
|
|
* @size: The length in bytes
|
|
|
|
*
|
|
|
|
* Tries to find what type of data is flowing from the given source #GstPad.
|
|
|
|
*
|
2010-12-07 18:35:56 +00:00
|
|
|
* Free-function: gst_caps_unref
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (transfer full) (nullable): the #GstCaps corresponding to the data
|
|
|
|
* stream. Returns %NULL if no #GstCaps matches the data stream.
|
2006-03-02 13:45:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
GstCaps *
|
|
|
|
gst_type_find_helper (GstPad * src, guint64 size)
|
|
|
|
{
|
|
|
|
GstTypeFindHelperGetRangeFunction func;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_OBJECT (src), NULL);
|
|
|
|
g_return_val_if_fail (GST_PAD_GETRANGEFUNC (src) != NULL, NULL);
|
|
|
|
|
|
|
|
func = (GstTypeFindHelperGetRangeFunction) (GST_PAD_GETRANGEFUNC (src));
|
|
|
|
|
2011-11-17 15:14:34 +00:00
|
|
|
return gst_type_find_helper_get_range (GST_OBJECT (src),
|
|
|
|
GST_OBJECT_PARENT (src), func, size, NULL, NULL);
|
2006-03-02 13:45:32 +00:00
|
|
|
}
|
|
|
|
|
2006-02-27 18:43:26 +00:00
|
|
|
/* ********************** typefinding for buffers ************************* */
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2011-03-21 17:13:55 +00:00
|
|
|
const guint8 *data; /* buffer data */
|
|
|
|
gsize size;
|
2011-08-25 21:49:38 +00:00
|
|
|
GstTypeFindProbability best_probability;
|
2006-02-27 18:43:26 +00:00
|
|
|
GstCaps *caps;
|
2007-07-24 13:38:21 +00:00
|
|
|
GstTypeFindFactory *factory; /* for logging */
|
2006-02-27 18:43:26 +00:00
|
|
|
GstObject *obj; /* for logging */
|
|
|
|
} GstTypeFindBufHelper;
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
/*
|
|
|
|
* buf_helper_find_peek:
|
|
|
|
* @data: helper data struct
|
|
|
|
* @off: stream offset
|
|
|
|
* @size: block size
|
|
|
|
*
|
|
|
|
* Get data pointer within a buffer.
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (nullable): address inside the buffer or %NULL if buffer does not
|
|
|
|
* cover the requested range.
|
2007-07-24 13:38:21 +00:00
|
|
|
*/
|
2011-03-21 17:13:55 +00:00
|
|
|
static const guint8 *
|
2006-02-27 18:43:26 +00:00
|
|
|
buf_helper_find_peek (gpointer data, gint64 off, guint size)
|
|
|
|
{
|
|
|
|
GstTypeFindBufHelper *helper;
|
|
|
|
|
|
|
|
helper = (GstTypeFindBufHelper *) data;
|
|
|
|
GST_LOG_OBJECT (helper->obj, "'%s' called peek (%" G_GINT64_FORMAT ", %u)",
|
2011-05-24 16:17:24 +00:00
|
|
|
GST_OBJECT_NAME (helper->factory), off, size);
|
2006-02-27 18:43:26 +00:00
|
|
|
|
|
|
|
if (size == 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (off < 0) {
|
|
|
|
GST_LOG_OBJECT (helper->obj, "'%s' wanted to peek at end; not supported",
|
2011-05-24 16:17:24 +00:00
|
|
|
GST_OBJECT_NAME (helper->factory));
|
2006-02-27 18:43:26 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2017-11-04 10:45:54 +00:00
|
|
|
/* If we request beyond the available size, we're sure we can't return
|
|
|
|
* anything regardless of the requested offset */
|
|
|
|
if (size > helper->size)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* Only return data if there's enough room left for the given offset.
|
|
|
|
* This is the same as "if (off + size <= helper->size)" except that
|
|
|
|
* it doesn't exceed type limits */
|
|
|
|
if (off <= helper->size - size)
|
2006-02-27 18:43:26 +00:00
|
|
|
return helper->data + off;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
/*
|
|
|
|
* buf_helper_find_suggest:
|
|
|
|
* @data: helper data struct
|
|
|
|
* @probability: probability of the match
|
|
|
|
* @caps: caps of the type
|
|
|
|
*
|
|
|
|
* If given @probability is higher, replace previously store caps.
|
|
|
|
*/
|
2006-02-27 18:43:26 +00:00
|
|
|
static void
|
2016-11-11 18:30:44 +00:00
|
|
|
buf_helper_find_suggest (gpointer data, guint probability, GstCaps * caps)
|
2006-02-27 18:43:26 +00:00
|
|
|
{
|
|
|
|
GstTypeFindBufHelper *helper = (GstTypeFindBufHelper *) data;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (helper->obj,
|
2011-09-07 11:14:38 +00:00
|
|
|
"'%s' called suggest (%u, %" GST_PTR_FORMAT ")",
|
2011-05-24 16:17:24 +00:00
|
|
|
GST_OBJECT_NAME (helper->factory), probability, caps);
|
2006-02-27 18:43:26 +00:00
|
|
|
|
|
|
|
/* Note: not >= as we call typefinders in order of rank, highest first */
|
2007-07-24 13:38:21 +00:00
|
|
|
if (probability > helper->best_probability) {
|
2012-03-10 08:25:43 +00:00
|
|
|
gst_caps_replace (&helper->caps, caps);
|
2007-07-24 13:38:21 +00:00
|
|
|
helper->best_probability = probability;
|
2006-02-27 18:43:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-03-21 17:13:55 +00:00
|
|
|
* gst_type_find_helper_for_data:
|
2014-06-05 19:38:20 +00:00
|
|
|
* @obj: (allow-none): object doing the typefinding, or %NULL (used for logging)
|
2011-03-21 17:13:55 +00:00
|
|
|
* @data: (in) (transfer none): a pointer with data to typefind
|
2016-04-20 08:45:28 +00:00
|
|
|
* @size: (in): the size of @data
|
2010-12-07 18:35:56 +00:00
|
|
|
* @prob: (out) (allow-none): location to store the probability of the found
|
2014-06-05 19:38:20 +00:00
|
|
|
* caps, or %NULL
|
2006-02-27 18:43:26 +00:00
|
|
|
*
|
2011-03-21 17:13:55 +00:00
|
|
|
* Tries to find what type of data is contained in the given @data, the
|
|
|
|
* assumption being that the data represents the beginning of the stream or
|
2006-02-27 18:43:26 +00:00
|
|
|
* file.
|
|
|
|
*
|
|
|
|
* All available typefinders will be called on the data in order of rank. If
|
2014-06-05 19:38:20 +00:00
|
|
|
* a typefinding function returns a probability of %GST_TYPE_FIND_MAXIMUM,
|
2006-02-27 18:43:26 +00:00
|
|
|
* typefinding is stopped immediately and the found caps will be returned
|
|
|
|
* right away. Otherwise, all available typefind functions will the tried,
|
2014-06-05 19:38:20 +00:00
|
|
|
* and the caps with the highest probability will be returned, or %NULL if
|
2011-03-21 17:13:55 +00:00
|
|
|
* the content of @data could not be identified.
|
2006-02-27 18:43:26 +00:00
|
|
|
*
|
2010-12-07 18:35:56 +00:00
|
|
|
* Free-function: gst_caps_unref
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (transfer full) (nullable): the #GstCaps corresponding to the data,
|
|
|
|
* or %NULL if no type could be found. The caller should free the caps
|
|
|
|
* returned with gst_caps_unref().
|
2006-02-27 18:43:26 +00:00
|
|
|
*/
|
|
|
|
GstCaps *
|
2011-03-21 17:13:55 +00:00
|
|
|
gst_type_find_helper_for_data (GstObject * obj, const guint8 * data, gsize size,
|
2006-02-27 18:43:26 +00:00
|
|
|
GstTypeFindProbability * prob)
|
|
|
|
{
|
|
|
|
GstTypeFindBufHelper helper;
|
|
|
|
GstTypeFind find;
|
|
|
|
GList *l, *type_list;
|
2007-07-24 13:38:21 +00:00
|
|
|
GstCaps *result = NULL;
|
2006-02-27 18:43:26 +00:00
|
|
|
|
2011-03-21 17:13:55 +00:00
|
|
|
g_return_val_if_fail (data != NULL, NULL);
|
2006-02-27 18:43:26 +00:00
|
|
|
|
2011-03-21 17:13:55 +00:00
|
|
|
helper.data = data;
|
|
|
|
helper.size = size;
|
2011-08-25 21:49:38 +00:00
|
|
|
helper.best_probability = GST_TYPE_FIND_NONE;
|
2006-02-27 18:43:26 +00:00
|
|
|
helper.caps = NULL;
|
|
|
|
helper.obj = obj;
|
|
|
|
|
|
|
|
if (helper.data == NULL || helper.size == 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
find.data = &helper;
|
|
|
|
find.peek = buf_helper_find_peek;
|
|
|
|
find.suggest = buf_helper_find_suggest;
|
|
|
|
find.get_length = NULL;
|
|
|
|
|
|
|
|
type_list = gst_type_find_factory_get_list ();
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
for (l = type_list; l; l = l->next) {
|
|
|
|
helper.factory = GST_TYPE_FIND_FACTORY (l->data);
|
|
|
|
gst_type_find_factory_call_function (helper.factory, &find);
|
2006-02-27 18:43:26 +00:00
|
|
|
if (helper.best_probability >= GST_TYPE_FIND_MAXIMUM)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_plugin_feature_list_free (type_list);
|
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
if (helper.best_probability > 0)
|
|
|
|
result = helper.caps;
|
2006-02-27 18:43:26 +00:00
|
|
|
|
|
|
|
if (prob)
|
|
|
|
*prob = helper.best_probability;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "Returning %" GST_PTR_FORMAT " (probability = %u)",
|
2007-07-24 13:38:21 +00:00
|
|
|
result, (guint) helper.best_probability);
|
2006-02-27 18:43:26 +00:00
|
|
|
|
2007-07-24 13:38:21 +00:00
|
|
|
return result;
|
2006-02-27 18:43:26 +00:00
|
|
|
}
|
2009-01-21 11:48:18 +00:00
|
|
|
|
2011-03-21 17:13:55 +00:00
|
|
|
/**
|
|
|
|
* gst_type_find_helper_for_buffer:
|
2014-06-05 19:38:20 +00:00
|
|
|
* @obj: (allow-none): object doing the typefinding, or %NULL (used for logging)
|
2011-03-21 17:13:55 +00:00
|
|
|
* @buf: (in) (transfer none): a #GstBuffer with data to typefind
|
|
|
|
* @prob: (out) (allow-none): location to store the probability of the found
|
2014-06-05 19:38:20 +00:00
|
|
|
* caps, or %NULL
|
2011-03-21 17:13:55 +00:00
|
|
|
*
|
|
|
|
* Tries to find what type of data is contained in the given #GstBuffer, the
|
|
|
|
* assumption being that the buffer represents the beginning of the stream or
|
|
|
|
* file.
|
|
|
|
*
|
|
|
|
* All available typefinders will be called on the data in order of rank. If
|
2014-06-05 19:38:20 +00:00
|
|
|
* a typefinding function returns a probability of %GST_TYPE_FIND_MAXIMUM,
|
2011-03-21 17:13:55 +00:00
|
|
|
* typefinding is stopped immediately and the found caps will be returned
|
|
|
|
* right away. Otherwise, all available typefind functions will the tried,
|
2014-06-05 19:38:20 +00:00
|
|
|
* and the caps with the highest probability will be returned, or %NULL if
|
2011-03-21 17:13:55 +00:00
|
|
|
* the content of the buffer could not be identified.
|
|
|
|
*
|
|
|
|
* Free-function: gst_caps_unref
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (transfer full) (nullable): the #GstCaps corresponding to the data,
|
|
|
|
* or %NULL if no type could be found. The caller should free the caps
|
|
|
|
* returned with gst_caps_unref().
|
2011-03-21 17:13:55 +00:00
|
|
|
*/
|
|
|
|
GstCaps *
|
|
|
|
gst_type_find_helper_for_buffer (GstObject * obj, GstBuffer * buf,
|
|
|
|
GstTypeFindProbability * prob)
|
|
|
|
{
|
|
|
|
GstCaps *result;
|
2012-01-20 13:23:57 +00:00
|
|
|
GstMapInfo info;
|
2011-03-21 17:13:55 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (buf != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_BUFFER (buf), NULL);
|
|
|
|
g_return_val_if_fail (GST_BUFFER_OFFSET (buf) == 0 ||
|
|
|
|
GST_BUFFER_OFFSET (buf) == GST_BUFFER_OFFSET_NONE, NULL);
|
|
|
|
|
2012-01-31 11:10:21 +00:00
|
|
|
if (!gst_buffer_map (buf, &info, GST_MAP_READ))
|
|
|
|
return NULL;
|
2012-01-20 13:23:57 +00:00
|
|
|
result = gst_type_find_helper_for_data (obj, info.data, info.size, prob);
|
|
|
|
gst_buffer_unmap (buf, &info);
|
2011-03-21 17:13:55 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2009-01-21 11:48:18 +00:00
|
|
|
/**
|
|
|
|
* gst_type_find_helper_for_extension:
|
2014-06-05 19:38:20 +00:00
|
|
|
* @obj: (allow-none): object doing the typefinding, or %NULL (used for logging)
|
2009-01-21 11:48:18 +00:00
|
|
|
* @extension: an extension
|
|
|
|
*
|
|
|
|
* Tries to find the best #GstCaps associated with @extension.
|
|
|
|
*
|
|
|
|
* All available typefinders will be checked against the extension in order
|
|
|
|
* of rank. The caps of the first typefinder that can handle @extension will be
|
|
|
|
* returned.
|
|
|
|
*
|
2010-12-07 18:35:56 +00:00
|
|
|
* Free-function: gst_caps_unref
|
|
|
|
*
|
2014-06-12 00:12:20 +00:00
|
|
|
* Returns: (transfer full) (nullable): the #GstCaps corresponding to
|
|
|
|
* @extension, or %NULL if no type could be found. The caller should free
|
|
|
|
* the caps returned with gst_caps_unref().
|
2009-01-21 11:48:18 +00:00
|
|
|
*/
|
|
|
|
GstCaps *
|
|
|
|
gst_type_find_helper_for_extension (GstObject * obj, const gchar * extension)
|
|
|
|
{
|
|
|
|
GList *l, *type_list;
|
|
|
|
GstCaps *result = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (extension != NULL, NULL);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "finding caps for extension %s", extension);
|
|
|
|
|
|
|
|
type_list = gst_type_find_factory_get_list ();
|
|
|
|
|
|
|
|
for (l = type_list; l; l = g_list_next (l)) {
|
|
|
|
GstTypeFindFactory *factory;
|
2012-05-01 21:28:11 +00:00
|
|
|
const gchar *const *ext;
|
2009-01-21 11:48:18 +00:00
|
|
|
|
|
|
|
factory = GST_TYPE_FIND_FACTORY (l->data);
|
|
|
|
|
2010-01-12 16:34:39 +00:00
|
|
|
/* we only want to check those factories without a function */
|
2012-05-01 21:33:30 +00:00
|
|
|
if (gst_type_find_factory_has_function (factory))
|
2010-01-12 16:34:39 +00:00
|
|
|
continue;
|
|
|
|
|
2009-01-21 11:48:18 +00:00
|
|
|
/* get the extension that this typefind factory can handle */
|
|
|
|
ext = gst_type_find_factory_get_extensions (factory);
|
|
|
|
if (ext == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* there are extension, see if one of them matches the requested
|
|
|
|
* extension */
|
2012-05-01 21:28:11 +00:00
|
|
|
while (*ext != NULL) {
|
|
|
|
if (strcmp (*ext, extension) == 0) {
|
2009-05-22 10:57:10 +00:00
|
|
|
/* we found a matching extension, take the caps */
|
|
|
|
if ((result = gst_type_find_factory_get_caps (factory))) {
|
2009-01-21 11:48:18 +00:00
|
|
|
gst_caps_ref (result);
|
2009-05-22 10:57:10 +00:00
|
|
|
goto done;
|
|
|
|
}
|
2009-01-21 11:48:18 +00:00
|
|
|
}
|
2012-05-01 21:28:11 +00:00
|
|
|
++ext;
|
2009-01-21 11:48:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
done:
|
|
|
|
gst_plugin_feature_list_free (type_list);
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (obj, "Returning %" GST_PTR_FORMAT, result);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|