Skip to content
Snippets Groups Projects
Commit dd8ad2af authored by Patrick Godwin's avatar Patrick Godwin Committed by Madeline Wade
Browse files

stream.py: cast memoryview to bytes as from_buffer() methods do not handle this case

parent 3d98280b
No related branches found
No related tags found
No related merge requests found
......@@ -374,7 +374,12 @@ class Stream(ElementRegistry):
success, mapinfo = memory.map(Gst.MapFlags.READ)
assert success
if mapinfo.data:
rows = cls._caps_buffer_map[caps.to_string()](mapinfo.data)
# FIXME: gst-python 1.18 returns a memoryview
# instead of a read-only bytes-like object, so
# cast to bytes. this is likely inefficient but
# a proper solution will require .from_buffer()
# to leverage the buffer protocol instead
rows = cls._caps_buffer_map[caps.to_string()](bytes(mapinfo.data))
data.extend(rows)
memory.unmap(mapinfo)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment