gstreamer: Associate libcamera::Stream with GstPad
Instead of trying to figure out which libcamera::Stream, the GstPad is configured with (from the libcamera pool), associate the Stream with the GstPad directly. The association can be set using gst_pad_set_element_private(). Add the gst_libcamera_pad_set_stream() helper to associate the stream with the pad. Additionally, modify the gst_libcamera_pad_get_stream() to use to the getter helper gst_pad_get_element_private(). Signed-off-by: Umang Jain <uajain@igalia.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
79be15a5f1
commit
f6f5bd28dc
@@ -192,12 +192,13 @@ void gst_libcamera_pad_set_video_info(GstPad *pad, const GstVideoInfo *info)
|
||||
Stream *
|
||||
gst_libcamera_pad_get_stream(GstPad *pad)
|
||||
{
|
||||
auto *self = GST_LIBCAMERA_PAD(pad);
|
||||
return static_cast<Stream *>(gst_pad_get_element_private(pad));
|
||||
}
|
||||
|
||||
if (self->pool)
|
||||
return gst_libcamera_pool_get_stream(self->pool);
|
||||
|
||||
return nullptr;
|
||||
void
|
||||
gst_libcamera_pad_set_stream(GstPad *pad, Stream *stream)
|
||||
{
|
||||
gst_pad_set_element_private(pad, stream);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user