[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: Gstreamermm using C Plugins
From:       Marcin Kolny via gtkmm-list <gtkmm-list () gnome ! org>
Date:       2020-10-29 23:55:58
Message-ID: CAHVGj5EeBNEps6jSSx3mEG21Ohn0L7JwvJv4FTQ5OVRE0yB-Lg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Franz,
You should be able to use any plugin from gstreamermm. Please have a look
at the examples in the gstreamermm repository, for example the oggplayer
[1]. As you can see there, we create filesrc element using ElementFactory
class, which returns an object of type Gst::Element:

Glib::RefPtr<Gst::Element> source = Gst::ElementFactory::create_element(
"filesrc");

This object has bunch of methods, and the one you might be interested in is
set_property which is equivalent to g_object_set and allows you setting
property values, e.g.

source->set_property("location", "/my/file.mp4");

Please let me know if you have any questions

[1]
https://gitlab.gnome.org/GNOME/gstreamermm/-/blob/master/examples/ogg_player/main.cc#L183


czw., 29 paź 2020 o 10:31 Franz Bender via gtkmm-list <gtkmm-list@gnome.org>
napisał(a):

> Dear gtkmm-Community,
>
> I'm working on a C++ project involving GStreamer, which is why I use
> gstreamermm as a C++ bridge. My problem is that I have to interface with a
> gstreamer plugin which is not wrapped by gstreamermm. I was unable to
> figure out how to implement this into my pipeline.
>
> Specifically I want to use NVidias nvinfer plugin (which is part of their
> deepstream-neural-network-efforts) in a C++ tool. What is the preferred way
> of adding these C-plugins to a Cpp-Gstreamermm Pipeline and setting their
> properties? Would I use the Gst::ElementFactory to create the Element?
>
> I would really appreciate a tiny example on how I could add a C plugin to
> this minimal pipeline example:
>
>
>
> Glib::RefPtr<Glib::MainLoop> mainLoop;
> Glib::RefPtr<Gst::Pipeline> pipeline;
>
> Gst::init();
> mainLoop = Glib::MainLoop::create();
> pipeline = Gst::Pipeline::create("Pipeline");
>
> // Add a pure C plugin, set a property to a value
> // and maybe connect a signal
>
> pipeline->set_state(Gst::STATE_PLAYING);
> mainLoop->run();
>
>
>
> Many thanks in advance for your efforts!
>
> Best regards from Berlin,
> Franz :)
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtkmm-list
>


-- 
Marcin Kolny

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr">Hi Franz,<div>You should be able to use any plugin from \
gstreamermm. Please have a look at the examples in the gstreamermm  repository, for \
example the oggplayer [1]. As you can see there, we create filesrc element using \
ElementFactory class, which returns an object of type \
Gst::Element:</div><div><br></div><div><code><span class="gmail-n">Glib</span><span \
class="gmail-o">::</span><span class="gmail-n">RefPtr</span><span \
class="gmail-o">&lt;</span><span class="gmail-n">Gst</span><span \
class="gmail-o">::</span><span class="gmail-n">Element</span><span \
class="gmail-o">&gt;</span> <span class="gmail-n">source</span> <span \
class="gmail-o">=</span> <span class="gmail-n">Gst</span><span \
class="gmail-o">::</span><span class="gmail-n">ElementFactory</span><span \
class="gmail-o">::</span><span class="gmail-n">create_element</span><span \
class="gmail-p">(</span><span class="gmail-s">&quot;filesrc&quot;</span><span \
class="gmail-p">);</span></code><br></div><div><br></div><div>This object has bunch \
of methods, and the one you might be interested in is set_property which is \
equivalent to g_object_set and allows you setting property values, \
e.g.</div><div><br></div><div><code><span class="gmail-n">source</span><span \
class="gmail-o">-&gt;</span><span class="gmail-n">set_property</span><span \
class="gmail-p">(</span><span class="gmail-s">&quot;location&quot;</span><span \
class="gmail-p">,</span> <span class="gmail-n">&quot;/my/file.mp4&quot;</span><span \
class="gmail-p">);</span></code><br></div><div><br></div><div>Please let me know if \
you have  any questions</div><div><br></div><div>[1]  <a \
href="https://gitlab.gnome.org/GNOME/gstreamermm/-/blob/master/examples/ogg_player/mai \
n.cc#L183">https://gitlab.gnome.org/GNOME/gstreamermm/-/blob/master/examples/ogg_player/main.cc#L183</a><br><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">czw., 29 paź 2020 o 10:31  \
Franz Bender via gtkmm-list &lt;<a \
href="mailto:gtkmm-list@gnome.org">gtkmm-list@gnome.org</a>&gt; \
napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear \
gtkmm-Community,<br> <br>
I'm working on a C++ project involving GStreamer, which is why I use gstreamermm as a \
C++ bridge. My problem is that I have to interface with a gstreamer plugin which is \
not wrapped by gstreamermm. I was unable to figure out how to implement this into my \
pipeline.<br> <br>
Specifically I want to use NVidias nvinfer plugin (which is part of their \
deepstream-neural-network-efforts) in a C++ tool. What is the preferred way of adding \
these C-plugins to a Cpp-Gstreamermm Pipeline and setting their properties? Would I \
use the Gst::ElementFactory to create the Element?<br> <br>
I would really appreciate a tiny example on how I could add a C plugin to this \
minimal pipeline example:<br> <br>
<br>
<br>
Glib::RefPtr&lt;Glib::MainLoop&gt; mainLoop;<br>
Glib::RefPtr&lt;Gst::Pipeline&gt; pipeline;<br>
<br>
Gst::init();<br>
mainLoop = Glib::MainLoop::create();<br>
pipeline = Gst::Pipeline::create(&quot;Pipeline");<br>
<br>
// Add a pure C plugin, set a property to a value<br>
// and maybe connect a signal<br>
<br>
pipeline-&gt;set_state(Gst::STATE_PLAYING);<br>
mainLoop-&gt;run();<br>
<br>
<br>
<br>
Many thanks in advance for your efforts!<br>
<br>
Best regards from Berlin,<br>
Franz :)<br>
_______________________________________________<br>
gtkmm-list mailing list<br>
<a href="mailto:gtkmm-list@gnome.org" target="_blank">gtkmm-list@gnome.org</a><br>
<a href="https://mail.gnome.org/mailman/listinfo/gtkmm-list" rel="noreferrer" \
target="_blank">https://mail.gnome.org/mailman/listinfo/gtkmm-list</a><br> \
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature">Marcin Kolny<br></div><img width="0" height="0" \
class="mailtrack-img" alt="" style="display:flex" \
src="https://mailtrack.io/trace/mail/0d373e2663e27c45d5f22b644edb0fd46d0e0c37.png?u=4942979"></div>




_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic