[libcamera-devel] [PATCH v3] test: gstreamer: Add test for gstreamer single stream
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Aug 10 13:08:47 CEST 2021
Hi Vedant,
On 10/08/2021 11:56, Vedant Paranjape wrote:
> Hi Kieran,
> Thanks for the review.
>
> On Tue, Aug 10, 2021 at 3:35 PM Kieran Bingham
> <kieran.bingham at ideasonboard.com
> <mailto:kieran.bingham at ideasonboard.com>> wrote:
>
> Hi Vedant,
>
> Thank you for this, I'm very glad to see gstreamer tests being
> introduced!
>
>
> On 10/08/2021 10:38, paul.elder at ideasonboard.com
> <mailto:paul.elder at ideasonboard.com> wrote:
>
> <snip>
>
> >> --- /dev/null
> >> +++ b/test/gstreamer/meson.build
> >> @@ -0,0 +1,15 @@
> >> +# SPDX-License-Identifier: CC0-1.0
> >> +
> >> +gstreamer_tests = [
> >> + ['single_stream_test', 'gstreamer_single_stream_test.cpp'],
> >> +]
> >> +gstreamer_dep = dependency('gstreamer-1.0', required: true)
>
> instead of required: true, we should depend upon whether we are built
> with gstreamer_support.
>
> I think this would do it, but please check/test.
>
> gstreamer_dep =
> dependency('gstreamer-1.0', required: get_option('gstreamer'))
>
> And then we would want to skip all tests from being built if there is no
> gstreamer:
>
>
> if not gstreamer_dep.found()gstallocator_dep.found()
> subdir_done()
> endif
>
>
> This is needs to be added by my patch ? or it will added sometime in
> future ?
Your patch should add it.
But Laurent's suggestion is subtly different and better.
So you should start the meson.build by checking:
if not gst_enabled
subdir_done()
endif
Then your
gstreamer_dep = dependency('gstreamer-1.0', required: true)
line can stay as it is, because if gst_enabled is true, you /do/ require
the gstreamer_dep anyway .
So it's just Lauren'ts three lines to add to the beginning of the
meson.build.
--
Kieran
>
> I would put the dependency checking, and this subdir_done() addition at
> the beginning, before even listing the tests.
>
> --
> Kieran
>
>
> >> +
> >> +foreach t : gstreamer_tests
> >> + exe = executable(t[0], t[1],
> >> + dependencies : [libcamera_private,
> gstreamer_dep],
> >> + link_with : test_libraries,
> >> + include_directories : test_includes_internal)
> >> +
> >> + test(t[0], exe, suite : 'gstreamer', is_parallel : false)
> >> +endforeach
> >> diff --git a/test/meson.build b/test/meson.build
> >> index 3bceb5df..d0466f17 100644
> >> --- a/test/meson.build
> >> +++ b/test/meson.build
> >> @@ -11,6 +11,7 @@ subdir('libtest')
> >>
> >> subdir('camera')
> >> subdir('controls')
> >> +subdir('gstreamer')
> >> subdir('ipa')
> >> subdir('ipc')
> >> subdir('log')
> >> --
> >> 2.25.1
> >>
>
More information about the libcamera-devel
mailing list