mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
mxf-example: merge returns in g_value_to_string()
This commit is contained in:
parent
7d058c8523
commit
d240c98225
1 changed files with 6 additions and 12 deletions
|
@ -29,31 +29,25 @@ static GtkTreeStore *treestore = NULL;
|
||||||
static gchar *
|
static gchar *
|
||||||
g_value_to_string (const GValue * val)
|
g_value_to_string (const GValue * val)
|
||||||
{
|
{
|
||||||
|
gchar *ret = NULL;
|
||||||
|
|
||||||
if (G_VALUE_TYPE (val) == GST_TYPE_BUFFER) {
|
if (G_VALUE_TYPE (val) == GST_TYPE_BUFFER) {
|
||||||
GstBuffer *buf = gst_value_get_buffer (val);
|
GstBuffer *buf = gst_value_get_buffer (val);
|
||||||
GstMapInfo map;
|
GstMapInfo map;
|
||||||
gchar *ret;
|
|
||||||
|
|
||||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||||
ret = g_base64_encode (map.data, map.size);
|
ret = g_base64_encode (map.data, map.size);
|
||||||
gst_buffer_unmap (buf, &map);
|
gst_buffer_unmap (buf, &map);
|
||||||
|
|
||||||
return ret;
|
|
||||||
} else {
|
} else {
|
||||||
GValue s = { 0, };
|
GValue s = { 0, };
|
||||||
gchar *ret;
|
|
||||||
|
|
||||||
g_value_init (&s, G_TYPE_STRING);
|
g_value_init (&s, G_TYPE_STRING);
|
||||||
|
if (g_value_transform (val, &s)) {
|
||||||
if (!g_value_transform (val, &s)) {
|
ret = g_value_dup_string (&s);
|
||||||
return NULL;
|
g_value_unset (&s);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_value_dup_string (&s);
|
|
||||||
g_value_unset (&s);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue