* It is up to the caller of the #GstTypeFindFunction to interpret these values.
*/
void
-gst_type_find_suggest (GstTypeFind * find, guint probability,
- const GstCaps * caps)
+gst_type_find_suggest (GstTypeFind * find, guint probability, GstCaps * caps)
{
g_return_if_fail (find->suggest != NULL);
g_return_if_fail (probability <= 100);
void (* suggest) (gpointer data,
guint probability,
- const GstCaps * caps);
+ GstCaps *caps);
gpointer data;
void gst_type_find_suggest (GstTypeFind * find,
guint probability,
- const GstCaps * caps);
+ GstCaps * caps);
void gst_type_find_suggest_simple (GstTypeFind * find,
guint probability,
/* ********************** typefinding in pull mode ************************ */
static void
-helper_find_suggest (gpointer data, guint probability, const GstCaps * caps);
+helper_find_suggest (gpointer data, guint probability, GstCaps * caps);
typedef struct
{
*/
static void
helper_find_suggest (gpointer data, GstTypeFindProbability probability,
- const GstCaps * caps)
+ GstCaps * caps)
{
GstTypeFindHelper *helper = (GstTypeFindHelper *) data;
GST_OBJECT_NAME (helper->factory), probability, caps);
if (probability > helper->best_probability) {
- GstCaps *copy = gst_caps_copy (caps);
-
- gst_caps_take (&helper->caps, copy);
+ gst_caps_replace (&helper->caps, caps);
helper->best_probability = probability;
}
}
*/
static void
buf_helper_find_suggest (gpointer data, GstTypeFindProbability probability,
- const GstCaps * caps)
+ GstCaps * caps)
{
GstTypeFindBufHelper *helper = (GstTypeFindBufHelper *) data;
/* Note: not >= as we call typefinders in order of rank, highest first */
if (probability > helper->best_probability) {
- GstCaps *copy = gst_caps_copy (caps);
-
- gst_caps_replace (&helper->caps, copy);
- gst_caps_unref (copy);
+ gst_caps_replace (&helper->caps, caps);
helper->best_probability = probability;
}
}
static void
gst_type_find_element_have_type (GstTypeFindElement * typefind,
- guint probability, const GstCaps * caps)
+ guint probability, GstCaps * caps)
{
- GstCaps *copy;
-
g_assert (caps != NULL);
GST_INFO_OBJECT (typefind, "found caps %" GST_PTR_FORMAT ", probability=%u",
GST_OBJECT_LOCK (typefind);
if (typefind->caps)
gst_caps_unref (typefind->caps);
- typefind->caps = gst_caps_copy (caps);
- copy = gst_caps_ref (typefind->caps);
+ typefind->caps = gst_caps_ref (caps);
GST_OBJECT_UNLOCK (typefind);
- gst_pad_push_event (typefind->src, gst_event_new_caps (copy));
- gst_caps_unref (copy);
+ gst_pad_push_event (typefind->src, gst_event_new_caps (caps));
}
static void
/* signals */
void (*have_type) (GstTypeFindElement *element,
- guint probability,
- const GstCaps * caps);
+ guint probability,
+ GstCaps *caps);
};
GType gst_type_find_element_get_type (void);