Skip to content

Commit

Permalink
typefind: use new gst_type_find_suggest_empty_simple()
Browse files Browse the repository at this point in the history
gst_type_find_suggest_simple() now requires a NULL terminator.
Use the new, simpler API for no-parameter calls.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774#note_861492

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1092>
  • Loading branch information
cxw42 committed Apr 2, 2021
1 parent 3d9e705 commit abd99b8
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions gst/typefind/gsttypefindfunctions.c
Expand Up @@ -4310,7 +4310,7 @@ pnm_type_find (GstTypeFind * tf, gpointer unused)
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM, media_type,
"width", G_TYPE_INT, w, "height", G_TYPE_INT, h, NULL);
} else {
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_LIKELY, media_type, NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_LIKELY, media_type);
}
}

Expand Down Expand Up @@ -4622,7 +4622,7 @@ matroska_type_find (GstTypeFind * tf, gpointer unused)
else
prob = GST_TYPE_FIND_MAXIMUM;

gst_type_find_suggest_simple (tf, prob, type_name, NULL);
gst_type_find_suggest_empty_simple (tf, prob, type_name);
}

/*** application/mxf ***/
Expand Down Expand Up @@ -4816,7 +4816,7 @@ ogganx_type_find (GstTypeFind * tf, gpointer private)
media_type, hdr_count[OGG_AUDIO], hdr_count[OGG_VIDEO],
hdr_count[OGG_ANNODEX], hdr_count[OGG_SKELETON], hdr_count[OGG_OTHER]);

gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM, media_type, NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_MAXIMUM, media_type);
}

/*** audio/x-vorbis ***/
Expand Down Expand Up @@ -4905,11 +4905,11 @@ kate_type_find (GstTypeFind * tf, gpointer private)
if (strcmp (category, "subtitles") == 0 || strcmp (category, "SUB") == 0 ||
strcmp (category, "spu-subtitles") == 0 ||
strcmp (category, "K-SPU") == 0) {
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM,
"subtitle/x-kate", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_MAXIMUM,
"subtitle/x-kate");
} else {
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM,
"application/x-kate", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_MAXIMUM,
"application/x-kate");
}
}

Expand Down Expand Up @@ -5493,7 +5493,7 @@ xdgmime_typefind (GstTypeFind * find, gpointer user_data)
* non-media formats, so suggest the type with a probability that trumps
* uncertain results of our typefinders, but not more than that. */
GST_LOG ("Suggesting '%s' with probability POSSIBLE", mimetype);
gst_type_find_suggest_simple (find, GST_TYPE_FIND_POSSIBLE, mimetype, NULL);
gst_type_find_suggest_empty_simple (find, GST_TYPE_FIND_POSSIBLE, mimetype);
g_free (mimetype);
}
#endif /* USE_GIO */
Expand Down Expand Up @@ -5538,8 +5538,8 @@ windows_icon_typefind (GstTypeFind * find, gpointer user_data)
|| size + offset > datalen)
return;

gst_type_find_suggest_simple (find, GST_TYPE_FIND_NEARLY_CERTAIN,
"image/x-icon", NULL);
gst_type_find_suggest_empty_simple (find, GST_TYPE_FIND_NEARLY_CERTAIN,
"image/x-icon");
}

/*** WAP WBMP typefinder ***/
Expand Down Expand Up @@ -5593,8 +5593,8 @@ wbmp_typefind (GstTypeFind * find, gpointer user_data)
size += h * (GST_ROUND_UP_8 (w) / 8);

if (datalen == size) {
gst_type_find_suggest_simple (find, GST_TYPE_FIND_POSSIBLE - 10,
"image/vnd.wap.wbmp", NULL);
gst_type_find_suggest_empty_simple (find, GST_TYPE_FIND_POSSIBLE - 10,
"image/vnd.wap.wbmp");
}
}

Expand All @@ -5619,8 +5619,8 @@ degas_type_find (GstTypeFind * tf, gpointer private)
if (len == 32034) {
/* could be DEGAS */
if (resolution <= 2)
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas");
} else if (len == 32066) {
/* could be DEGAS Elite */
if (resolution <= 2) {
Expand All @@ -5631,8 +5631,8 @@ degas_type_find (GstTypeFind * tf, gpointer private)
if (GST_READ_UINT16_BE (data + n * 2) > 2)
return;
}
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas");
}
} else if (len >= 66 && len < 32066) {
/* could be compressed DEGAS Elite, but it's compressed and so we can't rely on size,
Expand All @@ -5645,8 +5645,8 @@ degas_type_find (GstTypeFind * tf, gpointer private)
if (GST_READ_UINT16_BE (data + n * 2) > 2)
return;
}
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_POSSIBLE + 5,
"image/x-degas");
}
}
}
Expand Down Expand Up @@ -5687,8 +5687,8 @@ dvdiso_type_find (GstTypeFind * tf, gpointer private)
return;

/* May need more inspection, we may be able to demux some of them */
gst_type_find_suggest_simple (tf, GST_TYPE_FIND_LIKELY,
"application/octet-stream", NULL);
gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_LIKELY,
"application/octet-stream");
}

/* SSA/ASS subtitles
Expand Down

0 comments on commit abd99b8

Please sign in to comment.