mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
parsebin: Use pbutils utils to identify more stream types
Handles all cases provided they are identified in the pbutils descriptions list. Fixes #1081 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6153>
This commit is contained in:
parent
34a1245905
commit
479c0c5bb4
1 changed files with 14 additions and 1 deletions
|
@ -3971,6 +3971,7 @@ guess_stream_type_from_caps (GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
|
GstPbUtilsCapsDescriptionFlags desc;
|
||||||
|
|
||||||
if (gst_caps_get_size (caps) < 1)
|
if (gst_caps_get_size (caps) < 1)
|
||||||
return GST_STREAM_TYPE_UNKNOWN;
|
return GST_STREAM_TYPE_UNKNOWN;
|
||||||
|
@ -3993,7 +3994,19 @@ guess_stream_type_from_caps (GstCaps * caps)
|
||||||
g_str_has_prefix (name, "closedcaption/"))
|
g_str_has_prefix (name, "closedcaption/"))
|
||||||
return GST_STREAM_TYPE_TEXT;
|
return GST_STREAM_TYPE_TEXT;
|
||||||
|
|
||||||
return GST_STREAM_TYPE_UNKNOWN;
|
/* Use information from pbutils. Note that we only care about elementary
|
||||||
|
* streams which is why we check flag equality */
|
||||||
|
desc = gst_pb_utils_get_caps_description_flags (caps);
|
||||||
|
switch (desc) {
|
||||||
|
case GST_PBUTILS_CAPS_DESCRIPTION_FLAG_AUDIO:
|
||||||
|
return GST_STREAM_TYPE_AUDIO;
|
||||||
|
case GST_PBUTILS_CAPS_DESCRIPTION_FLAG_VIDEO:
|
||||||
|
return GST_STREAM_TYPE_VIDEO;
|
||||||
|
case GST_PBUTILS_CAPS_DESCRIPTION_FLAG_SUBTITLE:
|
||||||
|
return GST_STREAM_TYPE_TEXT;
|
||||||
|
default:
|
||||||
|
return GST_STREAM_TYPE_UNKNOWN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue