After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733265 - srtpenc: remove get-rollover-counter signal and add stats property
srtpenc: remove get-rollover-counter signal and add stats property
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.9.1
Assigned To: Josep Torra Valles
GStreamer Maintainers
Depends on:
Blocks: 730539
 
 
Reported: 2014-07-16 15:49 UTC by Aleix Conchillo Flaqué
Modified: 2016-06-13 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
remove get-rollover-counter and add stats (7.83 KB, patch)
2014-07-16 15:49 UTC, Aleix Conchillo Flaqué
none Details | Review
remove get-rollover-counter and add stats fixup (7.63 KB, patch)
2014-07-17 10:33 UTC, Aleix Conchillo Flaqué
none Details | Review
remove get-rollover-counter and add stats 2nd fixup + leak fixes (7.89 KB, patch)
2014-10-30 22:55 UTC, Aleix Conchillo Flaqué
none Details | Review
remove get-rollover-counter and add stats (1.8.0) (7.64 KB, patch)
2016-04-27 13:36 UTC, Aleix Conchillo Flaqué
none Details | Review
remove get-rollover-counter and add stats (1.8.0, revised) (5.06 KB, patch)
2016-06-11 00:33 UTC, Aleix Conchillo Flaqué
none Details | Review
remove get-rollover-counter and add stats (1.8.0, revised 2) (5.05 KB, patch)
2016-06-13 05:37 UTC, Aleix Conchillo Flaqué
committed Details | Review

Description Aleix Conchillo Flaqué 2014-07-16 15:49:47 UTC
Created attachment 280868 [details] [review]
remove get-rollover-counter and add stats

We've been talking with Wim today about the ROC and SRTP caps properties (see bug 730539). This is a first patch towards an improved SRTP caps.

From the commit log:

    We remove get-rollover-counter signal in favor of the "stats"
    property. The "stats" property is a GstStructure with caps
    application/x-multiplexed that contains an array of
    structures with caps application/x-srtp. Each structure will contain the
    SRTP caps, currently it only contains "ssrc" and "roc" fields.
    
    srtpenc only handles one SSRC right now, so currently the array
    mentioned above will only contain one element.
Comment 1 Aleix Conchillo Flaqué 2014-07-17 10:33:15 UTC
Created attachment 280946 [details] [review]
remove get-rollover-counter and add stats fixup

In the previous patch I was forcing the SSRC in the SRTP policy. I now leave it to what it was before:

  policy.ssrc.value = 0;
  policy.ssrc.type = ssrc_any_outbound;

Because srtp_protect can handle multiple SSRC in a single stream.
Comment 2 Aleix Conchillo Flaqué 2014-10-30 22:55:19 UTC
Created attachment 289703 [details] [review]
remove get-rollover-counter and add stats 2nd fixup + leak fixes

This patch uses proper boxed types with GArray.
Comment 3 Jan Schmidt 2015-09-03 14:25:44 UTC
Ping? Wtay - was there something you didn't like about this patch, or it just dropped out of sight?
Comment 4 Aleix Conchillo Flaqué 2015-09-03 16:41:01 UTC
As additional information. We've been using this patch (and the other srtp related ones) since last year without any issues.
Comment 5 Olivier Crête 2015-09-03 17:00:16 UTC
Review of attachment 289703 [details] [review]:

::: ext/srtp/gstsrtpenc.c
@@ +611,3 @@
+
+  if (filter->session) {
+    stream = srtp_get_stream (filter->session, htonl (filter->current_ssrc));

Why only the current SSRC? Why not keep an array of seen SSRCs since the key was last changed and just return the ROC for all of them?

@@ +639,3 @@
+
+  s = gst_structure_new ("application/x-multiplexed",
+      "streams", G_TYPE_ARRAY, streams, NULL);

a GstStructure containing a GArray of GstStructures?? Why such a monstruosity?
Also, you can'T use a GArray in element properties as they're sadly not introspectable. You may want to us a GValueArray of GStructures instead.

@@ +807,2 @@
   if (HAS_CRYPTO (filter))
+    gst_structure_set (ps, "roc", G_TYPE_UINT, 0, NULL);

Why put roc=0 in the caps? What's the point?

@@ +1023,3 @@
   if (filter->first_session) {
+    GstCaps *caps = gst_pad_get_current_caps (pad);
+    err_status_t status = gst_srtp_enc_create_session (filter, caps, is_rtcp);

You should take the SSRC from inside the packets, not from the caps. The SSRC in the caps is kind of meaningless because of RTX, FEC, etc. There could be more than one SSRC in the stream.
Comment 6 Sebastian Dröge (slomo) 2015-10-24 12:10:03 UTC
Aleix, are you going to update the patch?
Comment 7 Aleix Conchillo Flaqué 2015-11-04 20:59:57 UTC
(In reply to Sebastian Dröge (slomo) from comment #6)
> Aleix, are you going to update the patch?

Yes, I will but it might take some time. If it's really urgent for someone I could try to speed up things.
Comment 8 Aleix Conchillo Flaqué 2016-04-27 13:36:45 UTC
Created attachment 326870 [details] [review]
remove get-rollover-counter and add stats (1.8.0)

This one still needs work per the above reviews. It just applies to 1.8.0.
Comment 9 Aleix Conchillo Flaqué 2016-06-11 00:33:06 UTC
Created attachment 329597 [details] [review]
remove get-rollover-counter and add stats (1.8.0, revised)

Thanks to Josep Torra on this one for making it more GStreamer-like.
Comment 10 Sebastian Dröge (slomo) 2016-06-11 08:57:30 UTC
Review of attachment 329597 [details] [review]:

Makes sense, yes

::: ext/srtp/gstsrtpenc.c
@@ +617,3 @@
+    while (stream) {
+      GstStructure *ss;
+      guint32 ssrc = ntohl (stream->ssrc);

You probably want to use GUINT32_FROM_BE() or something here, or g_ntohl() at least.

@@ +630,3 @@
+  }
+
+  gst_structure_set_value (s, "streams", &va);

gst_structure_take_value()?
Comment 11 Aleix Conchillo Flaqué 2016-06-13 05:37:54 UTC
Created attachment 329660 [details] [review]
remove get-rollover-counter and add stats (1.8.0, revised 2)
Comment 12 Josep Torra Valles 2016-06-13 13:48:38 UTC
Comment on attachment 329660 [details] [review]
remove get-rollover-counter and add stats (1.8.0, revised 2)

commit 15a3b0f6cee86b9c7cb7a697c7059bba42dba4a9
Author: Aleix Conchillo Flaqué <aleix@oblong.com>
Date:   Mon May 30 14:10:23 2016 +0200

    srtpenc: remove get-rollover-counter signal and add stats property
    
    We remove get-rollover-counter signal in favor of the "stats"
    property. The "stats" property is a GstStructure with caps
    application/x-srtp-encoder-stats that contains an array of
    structures with caps application/x-srtp-stream.
    Each stream structure contains "ssrc" and "roc" fields.