From https://bugzilla.gnome.org/show_bug.cgi?id=599166 """ > > We may also want to extract other kinds of stats from rtpbin, like the average > > bitrate, jitter, packet loss, etc. Farsight2 doesn't have an API for that, but > > I can either add one or just fish it out of rtpbin directly. > > I think the bitrate at least is worth displaying. How can I get it? Do you > think it should be exposed in the FS2 API? It's a bit annoying to get it out of Farsight2, I'll add apis for that.. To the FsStream. """
api exists in the tfrc branch
forget my last comment, the api in the tfrc branch is to SET the bitrate..
You can get it in a hackish way right now... FsConference *rtpconf = ...; FsSession *rtpsession = ...; FsStream *rtpstream = ....; guint my_ssrc; g_object_get(rtpsession, "ssrc", &my_ssrc, NULL); mybitrate = get_bitrate_for_ssrc (rtpcon, rtpsession, my_ssrc); You can get the ssrcs for the receiving side from the src pad names from a FsStream.. Yes, it's all pretty complicated... static guint64 get_bitrate_for_ssrc(FsConference *rtpconf, FsSession *rtpsession, guint ssrc) { GstElement *rtpbin = gst_bin_get_by_name(GST_BIN(rtpconf), "rtpbin"); GObject *session; guint64 bitrate = 0; g_signal_emit_by_name(rtpbin, "get-internal-session", ssrc, &session); if (session) { GObject *source; g_signal_emit_by_name(session, "get-source-by-ssrc", ssrc, &source) if (source) { GstStructure *stats; gbooolean is_sender = FALSE; g_object_get (source, "stats", &stats, NULL); gst_structure_get_boolean (stats, "is-sender", &is_sender); if (is_sender) gst_structure_get(stats, "bitrate", G_TYPE_UINT64, &bitrate, NULL); // there are a lot more stats in there.. gst_structure_free(stats); g_object_unref(source); } g_object_unref(session); } gst_object_unref(rtpbin); }
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/farstream/farstream/issues/8.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.