gstreamer: Add GstLibcameraSrcState::clearRequests method
Add a clearRequests() function to GstLibcameraSrcState which clears the GstLibcameraSrcState::completedRequests_ queue. Use this new function in gst_libcamera_src_task_leave() instead of doing it manually. Signed-off-by: Jaslo Ziska <jaslo@ziska.de> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
9d4da0ca98
commit
bf231ead1c
1 changed files with 8 additions and 5 deletions
|
@ -133,6 +133,7 @@ struct GstLibcameraSrcState {
|
|||
int queueRequest();
|
||||
void requestCompleted(Request *request);
|
||||
int processRequest();
|
||||
void clearRequests();
|
||||
};
|
||||
|
||||
struct _GstLibcameraSrc {
|
||||
|
@ -318,6 +319,12 @@ int GstLibcameraSrcState::processRequest()
|
|||
return err;
|
||||
}
|
||||
|
||||
void GstLibcameraSrcState::clearRequests()
|
||||
{
|
||||
GLibLocker locker(&lock_);
|
||||
completedRequests_ = {};
|
||||
}
|
||||
|
||||
static bool
|
||||
gst_libcamera_src_open(GstLibcameraSrc *self)
|
||||
{
|
||||
|
@ -628,11 +635,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,
|
|||
GST_DEBUG_OBJECT(self, "Streaming thread is about to stop");
|
||||
|
||||
state->cam_->stop();
|
||||
|
||||
{
|
||||
GLibLocker locker(&state->lock_);
|
||||
state->completedRequests_ = {};
|
||||
}
|
||||
state->clearRequests();
|
||||
|
||||
{
|
||||
GLibRecLocker locker(&self->stream_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue