Skip to content

Undeclared variable src in gst_zedsrc_start (gst-zed-src/gstzedsrc.cpp:2209) #76

@fuchst

Description

@fuchst

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, feature request, or anything other than a bug report directly related to this project.

Description

In function gst_zedsrc_start src is used inside the conditional block before it was declared.
Changing it to bsrc fixes it and the compiled plugins run well.

nvidia@nvidia-desktop:~/zed/zed-gstreamer/build$ cmake ..
Running on NVIDIA Jetson
 * Found L4T v36.4.3
-- Checking for module 'gstreamer-rtsp-server-1.0>=1.14.5'
--   Found gstreamer-rtsp-server-1.0, version 1.20.1

Plugin install dir:
/usr/lib/aarch64-linux-gnu/gstreamer-1.0

Library install dir:
/usr/lib/aarch64-linux-gnu

Include install dir:
/usr/include/gstreamer-1.0/gst/zed

Executable install dir:
/usr/bin

 * gstzedmeta library added
   gstzedmeta: OS Unix
   gstzedmeta: Release mode
 * gstzedsrc plugin added
   gstzedsrc: OS Unix
   gstzedsrc: Release mode
 * gstzeddemux plugin added
   gstzeddemux: OS Unix
   gstzeddemux: Release mode
 * gstzeddatamux plugin added
   gstzeddatamux: OS Unix
   gstzeddatamux: Release mode
 * gstzeddatacsvsink plugin added
   gstzeddatacsvsink: OS Unix
   gstzeddatacsvsink: Release mode
 * gstzedodoverlay plugin added
   gstzedodoverlay: OS Unix
   gstzedodoverlay: Release mode
 * gst-zed-rtsp-launch RTSP server application
   gst-zed-rtsp-launch: OS Unix
   gst-zed-rtsp-launch: Release mode

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
-----------------------------------------------------------------------------
   * GStreamer - Required to build
   * GStreamer base library - Required to build
   * GStreamer video library - Required to build
   * GLib - Required to build
   * GObject - Required to build
   * ZED SDK - Required to build 'gstzed'
   * Nvidia CUDA library - Required to build 'gstzed'
   * OpenCV library - Required to build 'gstzedodoverlay'
   * GSTREAMER RTSP SERVER library - Required to build 'gstrtspserver'

-----------------------------------------------------------------------------
-- Congratulations! All external packages have been found.
-----------------------------------------------------------------------------

-- Configuring done
-- Generating done
-- Build files have been written to: /home/nvidia/zed/zed-gstreamer/build
nvidia@nvidia-desktop:~/zed/zed-gstreamer/build$ make -j4
[ 14%] Building CXX object gst-zed-meta/CMakeFiles/gstzedmeta.dir/gstzedmeta.cpp.o
[ 14%] Building CXX object gst-zed-rtsp-server/CMakeFiles/gst-zed-rtsp-launch.dir/zed-rtsp-launch.cpp.o
[ 21%] Linking CXX shared library libgstzedmeta.so
[ 21%] Built target gstzedmeta
[ 28%] Building CXX object gst-zed-demux/CMakeFiles/gstzeddemux.dir/gstzeddemux.cpp.o
[ 35%] Building CXX object gst-zed-src/CMakeFiles/gstzedsrc.dir/gstzedsrc.cpp.o
[ 42%] Building CXX object gst-zed-data-mux/CMakeFiles/gstzeddatamux.dir/gstzeddatamux.cpp.o
[ 50%] Linking CXX executable gst-zed-rtsp-launch
[ 50%] Built target gst-zed-rtsp-launch
[ 57%] Building CXX object gst-zed-data-csv-sink/CMakeFiles/gstzeddatacsvsink.dir/gstzeddatacsvsink.cpp.o
[ 64%] Linking CXX shared module libgstzeddatamux.so
[ 71%] Linking CXX shared module libgstzeddemux.so
[ 71%] Built target gstzeddatamux
[ 78%] Building CXX object gst-zed-od-overlay/CMakeFiles/gstzedodoverlay.dir/gstzedodoverlay.cpp.o
[ 78%] Built target gstzeddemux
In file included from /usr/include/gstreamer-1.0/gst/gst.h:55,
                 from /usr/include/gstreamer-1.0/gst/base/gstpushsrc.h:27,
                 from /home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:22:
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp: In function ‘gboolean gst_zedsrc_start(GstBaseSrc*)’:
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:23: error: ‘src’ was not declared in this scope; did you mean ‘bsrc’?
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |                       ^~~
/usr/include/gstreamer-1.0/gst/gstinfo.h:691:22: note: in definition of macro ‘GST_CAT_LEVEL_LOG’
  691 |         (GObject *) (object), __VA_ARGS__);                             \
      |                      ^~~~~~
/usr/include/gstreamer-1.0/gst/gstelement.h:561:5: note: in expansion of macro ‘GST_WARNING_OBJECT’
  561 |     GST_WARNING_OBJECT (el, "error: %s", __txt);                        \
      |     ^~~~~~~~~~~~~~~~~~
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:5: note: in expansion of macro ‘GST_ELEMENT_ERROR’
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |     ^~~~~~~~~~~~~~~~~
[ 85%] Linking CXX shared module libgstzeddatacsvsink.so
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:23: error: ‘src’ was not declared in this scope; did you mean ‘bsrc’?
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |                       ^~~
/usr/include/gstreamer-1.0/gst/gstinfo.h:691:22: note: in definition of macro ‘GST_CAT_LEVEL_LOG’
  691 |         (GObject *) (object), __VA_ARGS__);                             \
      |                      ^~~~~~
/usr/include/gstreamer-1.0/gst/gstelement.h:563:5: note: in expansion of macro ‘GST_WARNING_OBJECT’
  563 |     GST_WARNING_OBJECT (el, "error: %s", __dbg);                        \
      |     ^~~~~~~~~~~~~~~~~~
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:5: note: in expansion of macro ‘GST_ELEMENT_ERROR’
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |     ^~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:24,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/gstreamer-1.0/gst/gstenumtypes.h:6,
                 from /usr/include/gstreamer-1.0/gst/gst.h:31,
                 from /usr/include/gstreamer-1.0/gst/base/gstpushsrc.h:27,
                 from /home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:22:
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:23: error: ‘src’ was not declared in this scope; did you mean ‘bsrc’?
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |                       ^~~
/usr/include/glib-2.0/gobject/gtype.h:2458:66: note: in definition of macro ‘_G_TYPE_CIC’
 2458 |     ((ct*) (void *) g_type_check_instance_cast ((GTypeInstance*) ip, gt))
      |                                                                  ^~
/usr/include/gstreamer-1.0/gst/gstelement.h:198:42: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’
  198 | #define GST_ELEMENT(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ELEMENT, GstElement))
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gstreamer-1.0/gst/gstelement.h:564:29: note: in expansion of macro ‘GST_ELEMENT’
  564 |   gst_element_message_full (GST_ELEMENT(el),                            \
      |                             ^~~~~~~~~~~
/home/nvidia/zed/zed-gstreamer/gst-zed-src/gstzedsrc.cpp:2209:5: note: in expansion of macro ‘GST_ELEMENT_ERROR’
 2209 |     GST_ELEMENT_ERROR(src, LIBRARY, FAILED,
      |     ^~~~~~~~~~~~~~~~~
[ 85%] Built target gstzeddatacsvsink
make[2]: *** [gst-zed-src/CMakeFiles/gstzedsrc.dir/build.make:76: gst-zed-src/CMakeFiles/gstzedsrc.dir/gstzedsrc.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:286: gst-zed-src/CMakeFiles/gstzedsrc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 92%] Linking CXX shared module libgstzedodoverlay.so
[ 92%] Built target gstzedodoverlay
make: *** [Makefile:136: all] Error 2

Steps to Reproduce

The code was compiled directly on an Nvidia Orin system.

  1. git clone https://github.com/stereolabs/zed-gstreamer.git
  2. cd zed-gstreamer
  3. mkdir build && cd build
  4. cmake -DCMAKE_BUILD_TYPE=Release ..
  5. make

Expected Result

Code should compile

Actual Result

Compilation fails

ZED Camera model

ZED2

Environment

OS: Nvidia L4T 36.4.3
CPU: Arm64
GPU: Nvidia Orin Nano
ZED SDK: 5.0.3

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions