libcamera/test/gstreamer
Vedant Paranjape c7daf645d4 test: gstreamer: Simplify elements' ownerships
In gstreamer, when elements are created, usually a floating [1]
reference is returned which simply means, there is no ownership
transfer (yet). Once can simply check for NULL and return through
an error path, without bothering to clean up. Hence, g_autoptr is
not much of help here.

If the NULL checks have been passed successfully, elements are ready
to use. However, we must claim ownership/reference it before using
them via g_object_ref_sink().

This patch build upon this principle and removes the g_autoptr
from gstreamer test base class (gstreamer_test.cpp) whereever
necessary to tide up the code.

[1] https://gstreamer.freedesktop.org/documentation/additional/design/MT-refcounting.html?gi-language=c#refcounting1

Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
2021-09-23 16:03:15 +09:00
..
gstreamer_single_stream_test.cpp test: gstreamer: Simplify single stream test using functions from GstUtils 2021-09-23 16:03:08 +09:00
gstreamer_test.cpp test: gstreamer: Simplify elements' ownerships 2021-09-23 16:03:15 +09:00
gstreamer_test.h test: gstreamer: Factor out code into a base class 2021-09-08 17:40:53 +09:00
meson.build test: gstreamer: Factor out code into a base class 2021-09-08 17:40:53 +09:00