mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +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 *
|
||||
g_value_to_string (const GValue * val)
|
||||
{
|
||||
gchar *ret = NULL;
|
||||
|
||||
if (G_VALUE_TYPE (val) == GST_TYPE_BUFFER) {
|
||||
GstBuffer *buf = gst_value_get_buffer (val);
|
||||
GstMapInfo map;
|
||||
gchar *ret;
|
||||
|
||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||
ret = g_base64_encode (map.data, map.size);
|
||||
gst_buffer_unmap (buf, &map);
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
GValue s = { 0, };
|
||||
gchar *ret;
|
||||
|
||||
g_value_init (&s, G_TYPE_STRING);
|
||||
|
||||
if (!g_value_transform (val, &s)) {
|
||||
return NULL;
|
||||
if (g_value_transform (val, &s)) {
|
||||
ret = g_value_dup_string (&s);
|
||||
g_value_unset (&s);
|
||||
}
|
||||
|
||||
ret = g_value_dup_string (&s);
|
||||
g_value_unset (&s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue