jackersson / gstreamer-python

167 stars 52 forks source link

Writable array requested but buffer is not writeable #17

Open subodh-malgonde opened 2 years ago

subodh-malgonde commented 2 years ago

I am trying to draw some shapes on the video stream using PyCairo:

with map_gst_buffer(buffer, Gst.MapFlags.READ | Gst.MapFlags.WRITE) as mapped:
     # code to draw shapes

However I get an error:

Writable array requested but buffer is not writeable

This error is raised in the map_gst_buffer function in gst_hacks.py

    if flags & Gst.MapFlags.WRITE and _libgst.gst_mini_object_is_writable(ptr) == 0:
        raise ValueError(
            "Writable array requested but buffer is not writeable")

What am I missing here?