gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

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

gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

pjsanfil

Hi,

Using gstreamermm-1.0 I am trying to set a DrawingArea to place video frames in. Using the following code to try and set the XID for where to place the frames:
        Glib::RefPtr<Gst::Element> element = Glib::RefPtr<Gst::Element>::cast_dynamic(msg->get_source());
        Glib::RefPtr< Gst::ElementInterfaced<Gst::XOverlay> > xoverlay =
        Gst::Interface::cast <Gst::XOverlay>(element);

I get compiler errors saying ElementInterfaced is not a member of Gst   and XOverlay is not a member of Gst.

When I search through my header files for XOverlay I do not see it defined anywhere. The instructions for the Gst::VideoOverlay class say to set the XID this way.

Thanks,
Paul


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

Re: gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

Tim Müller
On Sat, 2016-06-18 at 15:34 -0500, pjsanfil wrote:

Hi,

> Using gstreamermm-1.0 I am trying to set a DrawingArea to place video
> frames in. Using the following code to try and set the XID for where
> to place the frames:
>         Glib::RefPtr<Gst::Element> element =
> Glib::RefPtr<Gst::Element>::cast_dynamic(msg->get_source());
>         Glib::RefPtr< Gst::ElementInterfaced<Gst::XOverlay> >
> xoverlay =
>         Gst::Interface::cast <Gst::XOverlay>(element);
> I get compiler errors saying ElementInterfaced is not a member of
> Gst   and XOverlay is not a member of Gst.
> When I search through my header files for XOverlay I do not see it
> defined anywhere. The instructions for the Gst::VideoOverlay class
> say to set the XID this way.
> Thanks,

It sounds like the gstreamer-mm documentation needs to be updated then.
You probably need to use ::VideoOverlay instead of ::XOverlay.

Cheers
 -Tim
--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

pjsanfil
I tried using VideoOverlay and then using   set_window_handle(XID);
and that compiled but did not work. Once I ran the program the default behavior of creating a new window to put the video stream in occurred. The documentation saying to use XOverlay is in the VideoOverlay class documentation.

Thanks,
Paul


On Mon, Jun 20, 2016 at 3:51 AM, Tim Müller <[hidden email]> wrote:
On Sat, 2016-06-18 at 15:34 -0500, pjsanfil wrote:

Hi,

> Using gstreamermm-1.0 I am trying to set a DrawingArea to place video
> frames in. Using the following code to try and set the XID for where
> to place the frames:
>         Glib::RefPtr<Gst::Element> element =
> Glib::RefPtr<Gst::Element>::cast_dynamic(msg->get_source());
>         Glib::RefPtr< Gst::ElementInterfaced<Gst::XOverlay> >
> xoverlay =
>         Gst::Interface::cast <Gst::XOverlay>(element);
> I get compiler errors saying ElementInterfaced is not a member of
> Gst   and XOverlay is not a member of Gst.
> When I search through my header files for XOverlay I do not see it
> defined anywhere. The instructions for the Gst::VideoOverlay class
> say to set the XID this way.
> Thanks,

It sounds like the gstreamer-mm documentation needs to be updated then.
You probably need to use ::VideoOverlay instead of ::XOverlay.

Cheers
 -Tim
--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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

Re: gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

Tim Müller
On Mon, 2016-06-20 at 15:37 -0500, pjsanfil wrote:

> I tried using VideoOverlay and then using   set_window_handle(XID);
> and that compiled but did not work. Once I ran the program the
> default behavior of creating a new window to put the video stream in
> occurred. The documentation saying to use XOverlay is in the
> VideoOverlay class documentation.
>

The interface got renamed a few years ago in the 0.10 -> 1.x
transition. It's VideoOverlay, XOverlay no longer exists.

If it does not work, that's a separate issue. It's hard to help without
further details (e.g. code, what exactly happens vs. expected
behaviour, etc.).

Cheers
 -Tim

--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gstreamermm Gst::ElementInterfaced and Gst::XOverlay cannot be resolved

pjsanfil
My code is below. I'm trying to get it to put the video in an existing window Gtk DrawingArea object. Instead it appears to create a new window and put the video frames in that window. The same thing happens whether or not I comment out this code so it appears this code has no effect.

Thanks,
Paul

// this callback is connected to bus->signal_sync_message()
void Camera::onSyncMsg(const Glib::RefPtr<Gst::Message>& msg){
    if(msg->get_message_type() != Gst::MESSAGE_ELEMENT){
        return;
    }
    if(msg->get_structure().has_name("prepare-xwindow-id")){
        std::cout << "prepare-xwindow-id message sent\n";
        //msg->get_source()->set_property("force-aspect-ratio", true);
        Glib::RefPtr<Gst::Element> element = Glib::RefPtr<Gst::Element>::cast_dynamic(msg->get_source()); // get element from msg
        Glib::RefPtr<Gst::VideoOverlay> xvid = Glib::RefPtr<Gst::VideoOverlay>::cast_dynamic(element); // turn element into overlay
        xvid->set_window_handle(m_xid);
        // TODO this line actually has no effect, I think set_window_handle is completely wrong function
        //Glib::RefPtr<Gst::VideoOverlay>::cast_dynamic(msg->get_source())->set_window_handle(m_xid);
}


On Mon, Jun 20, 2016 at 4:01 PM, Tim Müller <[hidden email]> wrote:
On Mon, 2016-06-20 at 15:37 -0500, pjsanfil wrote:

> I tried using VideoOverlay and then using   set_window_handle(XID);
> and that compiled but did not work. Once I ran the program the
> default behavior of creating a new window to put the video stream in
> occurred. The documentation saying to use XOverlay is in the
> VideoOverlay class documentation.
>

The interface got renamed a few years ago in the 0.10 -> 1.x
transition. It's VideoOverlay, XOverlay no longer exists.

If it does not work, that's a separate issue. It's hard to help without
further details (e.g. code, what exactly happens vs. expected
behaviour, etc.).

Cheers
 -Tim

--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel