waylandsink: Properly handle unrecoverable errors

Allocation failures cannot be recovered and should lead to an error
being posted on the bus. Otherwise the pipeline will just stall.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7903>
This commit is contained in:
Nicolas Dufresne 2024-11-07 13:06:03 -05:00
parent f9c01f6479
commit 0e2efb2de4
2 changed files with 18 additions and 10 deletions

View file

@ -1289,25 +1289,29 @@ no_window_size:
} }
no_buffer: no_buffer:
{ {
GST_WARNING_OBJECT (self, "could not create buffer"); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("could not create buffer"), (NULL));
ret = GST_FLOW_ERROR;
goto done; goto done;
} }
no_wl_buffer_shm: no_wl_buffer_shm:
{ {
GST_ERROR_OBJECT (self, "could not create wl_buffer out of wl_shm memory"); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("could not create wl_buffer out of wl_shm memory"), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }
no_wl_buffer: no_wl_buffer:
{ {
GST_ERROR_OBJECT (self, GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
"buffer %" GST_PTR_FORMAT " cannot have a wl_buffer", buffer); ("buffer %" GST_PTR_FORMAT " cannot have a wl_buffer", buffer), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }
activate_failed: activate_failed:
{ {
GST_ERROR_OBJECT (self, "failed to activate bufferpool."); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("failed to activate bufferpool."), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }

View file

@ -1070,25 +1070,29 @@ no_window_size:
} }
no_buffer: no_buffer:
{ {
GST_WARNING_OBJECT (self, "could not create buffer"); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("could not create buffer"), (NULL));
ret = GST_FLOW_ERROR;
goto done; goto done;
} }
no_wl_buffer_shm: no_wl_buffer_shm:
{ {
GST_ERROR_OBJECT (self, "could not create wl_buffer out of wl_shm memory"); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("could not create wl_buffer out of wl_shm memory"), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }
no_wl_buffer: no_wl_buffer:
{ {
GST_ERROR_OBJECT (self, GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
"buffer %" GST_PTR_FORMAT " cannot have a wl_buffer", buffer); ("buffer %" GST_PTR_FORMAT " cannot have a wl_buffer", buffer), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }
activate_failed: activate_failed:
{ {
GST_ERROR_OBJECT (self, "failed to activate bufferpool."); GST_ELEMENT_ERROR (self, RESOURCE, FAILED,
("failed to activate bufferpool."), (NULL));
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;
goto done; goto done;
} }