Skip to content
Snippets Groups Projects
Commit bf8e9e42 authored by Patrick Godwin's avatar Patrick Godwin Committed by ChiWai Chan
Browse files

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

parent 23c1a386
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !114. Comments created here will be created in the context of that merge request.
......@@ -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