armbox: gstreamer tags support

Origin commit data
------------------
Branch: master
Commit: d908c7a947
Author: TangoCash <eric@loxat.de>
Date: 2017-10-28 (Sat, 28 Oct 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2017-10-28 18:10:04 +02:00
parent d9b083e71e
commit 5819ef8b83

View File

@@ -230,6 +230,12 @@ GstBusSyncReply Gst_bus_call(GstBus * bus, GstMessage *msg, gpointer user_data)
result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_REPLACE);
if (result)
{
if (m_stream_tags && gst_tag_list_is_equal(m_stream_tags, result))
{
gst_tag_list_free(tags);
gst_tag_list_free(result);
break;
}
if (m_stream_tags)
gst_tag_list_free(m_stream_tags);
m_stream_tags = result;
@@ -949,6 +955,62 @@ void cPlayback::GetMetadata(std::vector<std::string> &keys, std::vector<std::str
{
keys.clear();
values.clear();
if (gst_tag_list_is_empty (m_stream_tags))
return;
for (guint i = 0, icnt = gst_tag_list_n_tags(m_stream_tags); i < icnt; i++)
{
const gchar *name = gst_tag_list_nth_tag_name(m_stream_tags, i);
if (!name)
{
continue;
}
for (guint j = 0, jcnt = gst_tag_list_get_tag_size(m_stream_tags, name); j < jcnt; j++)
{
const GValue *val;
val = gst_tag_list_get_value_index(m_stream_tags, name, j);
if (G_VALUE_HOLDS_STRING(val))
{
keys.push_back(name);
values.push_back(g_value_get_string(val));
}
else if (G_VALUE_HOLDS_UINT(val))
{
char buffer [50];
keys.push_back(name);
sprintf (buffer, "%u", g_value_get_uint(val));
values.push_back(buffer);
}
else if (G_VALUE_HOLDS_DOUBLE(val))
{
char buffer [50];
keys.push_back(name);
sprintf (buffer, "%f", g_value_get_double(val));
values.push_back(buffer);
}
else if (G_VALUE_HOLDS_BOOLEAN(val))
{
keys.push_back(name);
values.push_back(g_value_get_boolean(val) ? "true" : "false");
}
else if (GST_VALUE_HOLDS_DATE_TIME(val))
{
GstDateTime *dt = (GstDateTime *) g_value_get_boxed(val);
keys.push_back(name);
values.push_back(gst_date_time_to_iso8601_string(dt));
}
else if (G_VALUE_HOLDS(val, G_TYPE_DATE))
{
keys.push_back(name);
values.push_back(gst_value_serialize(val));
}
}
}
printf("%s:%s %d tags found\n", FILENAME, __func__, (int)keys.size());
}
void cPlayback::FindAllTeletextsubtitlePids(int *, unsigned int *numpids, std::string *, int *, int *)