For a particular problem I now need to access the output of `get-stats`, which is currently not covered by the Java wrapper. In analogy to the `createOffer` and `createAnswer` realisations I tried to roll my own `getStats` and succeeded to get at least a reply.
2019-07-08 13:23:22,327 WebRTCBinGStreamer$10 336 TRACE [GstBus]: application/x-webrtc-stats, peer-connection-stats=(structure)"peer-connection\,\ data-channels-opened\=\(uint\)0\,\ data-channels-closed\=\(uint\)0\,\ data-channels-requested\=\(uint\)0\,\ data-channels-accepted\=\(uint\)0\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)peer-connection-stats\;", codec-stats-sink_0=(structure)"codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)codec-stats-sink_0\,\ payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)1353669487\;", transport-stats_webrtcdtlstransport0=(structure)"transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)transport-stats_webrtcdtlstransport0\;", ice-candidate-pair_webrtcnicetransport0=(structure)"transport\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;", codec-stats-src_0=(structure)"codec\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)codec-stats-src_0\,\ payload-type\=\(uint\)100\,\ clock-rate\=\(uint\)90000\,\ ssrc\=\(uint\)1992815211\;", rtp-inbound-stream-stats_1992815211=(structure)"inbound-rtp\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_INBOUND_RTP\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)rtp-inbound-stream-stats_1992815211\,\ ssrc\=\(uint\)1992815211\,\ codec-id\=\(string\)codec-stats-src_0\,\ transport-id\=\(string\)transport-stats_webrtcdtlstransport0\,\ fir-count\=\(uint\)0\,\ pli-count\=\(uint\)0\,\ nack-count\=\(uint\)0\,\ packets-received\=\(guint64\)129\,\ bytes-received\=\(guint64\)102409\,\ packets-lost\=\(int\)0\,\ jitter\=\(double\)3.1948785117502877e-07\,\ remote-id\=\(string\)rtp-remote-outbound-stream-stats_1992815211\;", rtp-outbound-stream-stats_1992815211=(structure)"outbound-rtp\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_OUTBOUND_RTP\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)rtp-outbound-stream-stats_1992815211\,\ ssrc\=\(uint\)1992815211\,\ codec-id\=\(string\)codec-stats-src_0\,\ transport-id\=\(string\)transport-stats_webrtcdtlstransport0\,\ fir-count\=\(uint\)0\,\ pli-count\=\(uint\)0\,\ nack-count\=\(uint\)0\,\ bytes-sent\=\(guint64\)0\,\ packets-sent\=\(guint64\)0\,\ remote-id\=\(string\)rtp-remote-inbound-stream-stats_1992815211\;", rtp-remote-inbound-stream-stats_1992815211=(structure)"remote-inbound-rtp\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_REMOTE_INBOUND_RTP\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)rtp-remote-inbound-stream-stats_1992815211\,\ ssrc\=\(uint\)1992815211\,\ codec-id\=\(string\)codec-stats-src_0\,\ transport-id\=\(string\)transport-stats_webrtcdtlstransport0\,\ jitter\=\(double\)0\,\ packets-lost\=\(int\)0\,\ local-id\=\(string\)rtp-outbound-stream-stats_1992815211\,\ round-trip-time\=\(double\)0.0075836181640625\;", rtp-remote-outbound-stream-stats_1992815211=(structure)"remote-outbound-rtp\,\ type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_REMOTE_OUTBOUND_RTP\,\ timestamp\=\(double\)757152.97699999996\,\ id\=\(string\)rtp-remote-outbound-stream-stats_1992815211\,\ ssrc\=\(uint\)1992815211\,\ codec-id\=\(string\)codec-stats-src_0\,\ transport-id\=\(string\)transport-stats_webrtcdtlstransport0\,\ local-id\=\(string\)rtp-inbound-stream-stats_1992815211\;";
I'm now looking for a way to decode this into an object. I tried an analogue approach like the `createAnswer` API:
Structure reply = promise.getReply();
WebRTCSessionDescription description = (WebRTCSessionDescription)reply.getValue("answer");
listener.onAnswerCreated(description);
promise.dispose();
by attempting
Structure reply = promise.getReply();
Object o = reply.getValue("peer-connection-stats");
but o is alway NULL. Tried various other things to no avail.
Anybody able to provide a hint, how to make it a manageable structure/object?
TIA