How to get RTPSession from tobin

172 views
Skip to first unread message

Jan Andersson

unread,
Jul 8, 2021, 9:21:39 AM7/8/21
to gstreamer-java
I'm new to GStreamer and the GStreamer Java API, but have created a working RTP pipeline receiving audio over RTP. Now I want to get statistics from the RTP session.

Is it possible to get the internal RTPSession from rtpbin?
What I have tried:

int sessionId = 0;
Element rtpBin = pipeline.getElementByName("rtpbin");
GObject session = rtpBin.emit(GObject.class, "get-internal-session", sessionId);

but this throws a java.lang.InstantiationException.

What I planned to do after this is to get the stats property from the session (RTPSession) objekt. But oviously this isn't the way to do this...

Thanks,
/Jan

Neil C Smith

unread,
Jul 8, 2021, 11:24:19 AM7/8/21
to gstream...@googlegroups.com
On Thu, 8 Jul 2021 at 14:21, Jan Andersson <jan.an...@pureload.com> wrote:
> GObject session = rtpBin.emit(GObject.class, "get-internal-session", sessionId);
>
> but this throws a java.lang.InstantiationException.

Unfortunately, for "reasons" that are probably no longer relevant,
GObject is abstract. You could try doing a local build of the library
making it non-abstract to see if that works. Or use the type registry
and register your own RTPSession type extending GObject - see
https://javadoc.io/static/org.freedesktop.gstreamer/gst1-java-core/1.4.0/org/freedesktop/gstreamer/glib/Natives.html#registration-java.lang.Class-java.lang.String-java.util.function.Function-

Feel free to raise an issue on GitHub for making GObject non-abstract
if this fixes your problem.

Best wishes,

Neil


--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD

Jan Andersson

unread,
Jul 12, 2021, 2:01:35 PM7/12/21
to gstreamer-java
Hi Niel,
I registered my own RTPSession class and this works works fine for me.

Many thanks for your help and a great Java API,
/Jan

Neil C Smith

unread,
Jul 13, 2021, 4:23:38 AM7/13/21
to gstream...@googlegroups.com
On Mon, 12 Jul 2021 at 19:01, Jan Andersson <jan.an...@pureload.com> wrote:
> I registered my own RTPSession class and this works works fine for me.
>
> Many thanks for your help and a great Java API,

Great, glad it's working. And thanks.
Reply all
Reply to author
Forward
0 new messages