gst_bus_remove_watch was not declared in this scope

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_bus_remove_watch was not declared in this scope

Mikl
This post was updated on .
Hello,

I am compiling library on Debian using last Gstreamer (fresh from apt-get install gstreamer1.0)

On my code
    gst_bus_remove_watch(_bus);

i have error
error: 'gst_bus_remove_watch' was not declared in this scope
     gst_bus_remove_watch(_bus);

Can you help me what i am doing wrong, please?

Update:
in documentation it is mentioned
"Since: 1.6"

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-remove-watch

How i can check what do i have?
How to get correct version?

Mikl
Reply | Threaded
Open this post in threaded view
|

Re: gst_bus_remove_watch was not declared in this scope

Yasushi SHOJI-2
Hi,

On Fri, Dec 16, 2016 at 12:33 AM, Mikl <[hidden email]> wrote:

>
> I am compiling library on Debian using last Gstreamer (fresh from apt-get)
>
> On my code
>     gst_bus_remove_watch(_bus);
>
> i have error
> error: 'gst_bus_remove_watch' was not declared in this scope
>      gst_bus_remove_watch(_bus);
>
> Can you help me what i am doing wrong, please?

It'd be better to post a smallest possible code that can reproduce the error,
along with your compiler command line.

btw, this, doesn't make sense at all but, compiles fiine on a Debian Sid.

$ cat a.c
#include <gst/gst.h>

int main() {
    gst_bus_remove_watch(NULL);
    return 0;
}

$ g++ -Wall -Wextra -g $(pkg-config --cflags --libs gstreamer-1.0) a.c

Thanks,
--
            yashi

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_bus_remove_watch was not declared in this scope

Mikl
Hello, Yashi

(really strange... my answer from 3 days ago is disappeared. probably the reason, i send it from office 365)

But i found problem and already solved it:
In Debian packages GStreamer is 1.4.x. And 1.10.2 is only "testing"
In Ubuntu it is 1.8.x. So, i took it and happy now.

----------------------------------------------------------
my mail from 16.12.2016
----------------------------------------------------------

All information you asked is in the bottom of this post.

In my command line, without another "garbage", all from you line is present.
I am more thinking about "Since: 1.6".
Do i have wrong package?
How to check?
How to fix?

Thank you.

Mikl


My command line is

g++ -c -m32 -pipe -Wno-unknown-pragmas -g -std=c++0x -Wall -W -D_REENTRANT -fPIC -DQT_DLL -DGSTREAMERINSPECTOR_EXPORT -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/media/sf_VideoID/Modules/Utilities/Video/GStreamerInspector -I. -I/media/sf_VideoID/Modules/Utilities/Video/GStreamerInspector/GeneratedFiles -I/media/sf_VideoID/Modules/Utilities/Video/GStreamerInspector -I/media/sf_VideoID/Modules/Utilities/Video/GStreamerInspector/GeneratedFiles/Debug -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/home/tt/Qt/5.5/gcc/include -I/home/tt/Qt/5.5/gcc/include/QtGui -I/home/tt/Qt/5.5/gcc/include/QtCore -IGeneratedFiles/debug -I/home/tt/Qt/5.5/gcc/mkspecs/linux-g++-32 -o debug/gstreamerinspector.o /media/sf_VideoID/Modules/Utilities/Video/GStreamerInspector/gstreamerinspector.cpp

My code is

 
void GStreamerInspector::StartWaitgLoop()
{
//get pipeline bus
_bus = gst_pipeline_get_bus(GST_PIPELINE(_pipeline));

//register call back function for bus monitoring
gst_bus_add_watch(_bus, BusCallback, this);

//try to finf a better way to trabsfer exceptin
if (_loopError != nullptr)
delete _loopError;

_loopError = nullptr;

//run loop
g_main_loop_run(_loop);

//int GStreamerInspector::BusCallback(GstBus*, GstMessage* message, void* data)
        //will wait for EOS
        //and will do
        //g_main_loop_quit(_loop);

//stop watching
        gst_bus_remove_watch(_bus); <-compiler complain is here

//free recources
gst_object_unref(_bus);

if (_loopError != nullptr)
throw *_loopError; //throw first from list exception
}