mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
value: Add support for parsing short fourccs from strings
For example "Y16 " and "Y8 ".
This commit is contained in:
parent
6ea0bdadd5
commit
28fdbee35a
1 changed files with 9 additions and 0 deletions
|
@ -727,6 +727,15 @@ gst_value_deserialize_fourcc (GValue * dest, const char *s)
|
|||
if (strlen (s) == 4) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], s[2], s[3]);
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 3) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], s[2], ' ');
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 2) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], s[1], ' ', ' ');
|
||||
ret = TRUE;
|
||||
} else if (strlen (s) == 1) {
|
||||
fourcc = GST_MAKE_FOURCC (s[0], ' ', ' ', ' ');
|
||||
ret = TRUE;
|
||||
} else if (g_ascii_isdigit (*s)) {
|
||||
fourcc = strtoul (s, &end, 0);
|
||||
if (*end == 0) {
|
||||
|
|
Loading…
Reference in a new issue