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 795139 - Various patches on rtpsession
Various patches on rtpsession
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 746814 791075 791076 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-04-10 18:38 UTC by Håvard Graff (hgr)
Modified: 2018-11-03 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Running gst-indent on the rtpsession tests (2.02 KB, patch)
2018-04-10 18:38 UTC, Håvard Graff (hgr)
committed Details | Review
patch with test (11.21 KB, patch)
2018-04-10 18:39 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Don't start the RTCP thread until it's needed (8.98 KB, patch)
2018-04-10 18:40 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Allow instant transmission of RTCP packets (4.73 KB, patch)
2018-04-10 18:41 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc (5.17 KB, patch)
2018-04-10 18:41 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Fix on-feedback-rtcp race (4.63 KB, patch)
2018-04-10 18:42 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Avoid unnecessary copy of stats structure (1.48 KB, patch)
2018-04-10 18:42 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: do not emit RBs for internal senders. (5.86 KB, patch)
2018-04-10 18:42 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Add missing lock around sess->ssrcs iteration (989 bytes, patch)
2018-04-10 18:43 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Add "send-bye" action-signal (6.53 KB, patch)
2018-04-10 18:43 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Drop packet if trying to send from non-internal source (3.78 KB, patch)
2018-04-11 08:20 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Send and receive Microsoft x-pli (25.38 KB, patch)
2018-04-11 12:30 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: process RB by internal sources (5.58 KB, patch)
2018-04-11 13:43 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add property "stats-min-interval" and notify "stats" (7.73 KB, patch)
2018-04-11 14:15 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc (6.08 KB, patch)
2018-04-12 11:09 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Fix on-feedback-rtcp race (4.62 KB, patch)
2018-04-12 11:11 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Add "send-bye" action-signal (6.56 KB, patch)
2018-04-12 11:11 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Drop packet if trying to send from non-internal source (3.78 KB, patch)
2018-04-12 11:12 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Send and receive Microsoft x-pli (26.12 KB, patch)
2018-04-12 11:12 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: process RB by internal sources (5.56 KB, patch)
2018-04-12 11:13 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add property "stats-min-interval" and notify "stats" (7.01 KB, patch)
2018-04-12 11:13 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add signals for handling profile-specific extension (11.37 KB, patch)
2018-04-30 07:31 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Avoid unnecessary copy of stats structure (1.46 KB, patch)
2018-04-30 07:32 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: process RB by internal sources (5.60 KB, patch)
2018-04-30 07:36 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add property "stats-min-interval" and notify "stats" (7.16 KB, patch)
2018-04-30 07:38 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add tests for PLI and FIR (8.54 KB, patch)
2018-04-30 07:42 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Fix race when sending PLI, FIR and NACK packets (7.60 KB, patch)
2018-04-30 08:58 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Add signals for handling profile-specific extension (11.47 KB, patch)
2018-05-14 09:21 UTC, Håvard Graff (hgr)
none Details | Review
rtpsession: Don't start the RTCP thread until it's needed (9.04 KB, patch)
2018-05-14 09:22 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Allow instant transmission of RTCP packets (4.74 KB, patch)
2018-05-14 09:22 UTC, Håvard Graff (hgr)
needs-work Details | Review
rtpsession: Avoid unnecessary copy of stats structure (1.46 KB, patch)
2018-05-14 09:29 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Add "send-bye" action-signal (6.66 KB, patch)
2018-05-14 09:30 UTC, Håvard Graff (hgr)
reviewed Details | Review
rtpsession: Drop packet if trying to send from non-internal source (3.87 KB, patch)
2018-05-14 09:31 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: Add tests for PLI and FIR (8.65 KB, patch)
2018-05-14 09:31 UTC, Håvard Graff (hgr)
committed Details | Review
rtpsession: process RB by internal sources (5.61 KB, patch)
2018-05-14 09:32 UTC, Håvard Graff (hgr)
reviewed Details | Review
rtpsession: Add property "stats-min-interval" and notify "stats" (7.16 KB, patch)
2018-05-14 09:32 UTC, Håvard Graff (hgr)
reviewed Details | Review
rtpsession: Fix race when sending PLI, FIR and NACK packets (7.72 KB, patch)
2018-05-14 09:33 UTC, Håvard Graff (hgr)
accepted-commit_now Details | Review

Description Håvard Graff (hgr) 2018-04-10 18:38:27 UTC
Created attachment 370740 [details] [review]
Running gst-indent on the rtpsession tests

A collection of patches for rtpsession, to be applied in order.
Comment 1 Håvard Graff (hgr) 2018-04-10 18:39:31 UTC
Created attachment 370741 [details] [review]
patch with test

rtpsession: Add signals for handling profile-specific extension
Comment 2 Håvard Graff (hgr) 2018-04-10 18:40:24 UTC
Created attachment 370742 [details] [review]
rtpsession: Don't start the RTCP thread until it's needed

    rtpsession: Don't start the RTCP thread until it's needed
    
    Always wait with starting the RTCP thread until either a RTP or RTCP
    packet is sent or received. Special handling is needed to make sure the
    RTCP thread is started when requesting an early RTCP packet.
    
    We want to wait with starting the RTCP thread until it's needed in order
    to not send RTCP packets for an inactive source.
Comment 3 Håvard Graff (hgr) 2018-04-10 18:41:04 UTC
Created attachment 370743 [details] [review]
rtpsession: Allow instant transmission of RTCP packets

    rtpsession: Allow instant transmission of RTCP packets
    
    By specifying max_delay of 0, it effectively bypasses the RTCP throttling
    mechanism, and tries to get an RTCP packet on the wire as quickly as
    possible.
Comment 4 Håvard Graff (hgr) 2018-04-10 18:41:33 UTC
Created attachment 370744 [details] [review]
rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc

    rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc
    
    Some RTP stacks out there does not set the sender_ssrc. In order to be
    more robust, try to lookup the media_ssrc before dropping the PLI.
Comment 5 Håvard Graff (hgr) 2018-04-10 18:42:00 UTC
Created attachment 370745 [details] [review]
rtpsession: Fix on-feedback-rtcp race

    rtpsession: Fix on-feedback-rtcp race
    
    If there is an external source which is about to timeout and be removed
    from the source hashtable and we receive feedback RTCP packet with the
    media ssrc of the source, we unlock the session in
    rtp_session_process_feedback before emitting 'on-feedback-rtcp' signal
    allowing rtcp timer to kick in and grab the lock. It will get rid of
    the source and rtp_session_process_feedback will be left with RTPSource
    with ref count 0.
    
    The fix is to grab the ref to the RTPSource object in
    rtp_session_process_feedback.
Comment 6 Håvard Graff (hgr) 2018-04-10 18:42:24 UTC
Created attachment 370746 [details] [review]
rtpsession: Avoid unnecessary copy of stats structure

    rtpsession: Avoid unnecessary copy of stats structure
    
    The code before copied GstStructure twice. The first time inside
    gst_value_set_structure and the second time in g_value_array_append.
    Optimized version does no copies, just transfers ownership to
    GValueArray. It takes advantage of the fact that array has already
    enough elements preallocated and the memory is zero initialized.
Comment 7 Håvard Graff (hgr) 2018-04-10 18:42:50 UTC
Created attachment 370747 [details] [review]
rtpsession: do not emit RBs for internal senders.

    rtpsession: do not emit RBs for internal senders.
    
    These are the sources we send from, so there is no reason to
    report receive statistics for them (as we do not receive on them,
    and the remote side has no knowledge of them).
Comment 8 Håvard Graff (hgr) 2018-04-10 18:43:15 UTC
Created attachment 370748 [details] [review]
rtpsession: Add missing lock around sess->ssrcs iteration

rtpsession: Add missing lock around sess->ssrcs iteration
Comment 9 Håvard Graff (hgr) 2018-04-10 18:43:41 UTC
Created attachment 370749 [details] [review]
rtpsession: Add "send-bye" action-signal

rtpsession: Add "send-bye" action-signal
Comment 10 Sebastian Dröge (slomo) 2018-04-11 07:31:45 UTC
Awesome!
Comment 11 Håvard Graff (hgr) 2018-04-11 08:20:00 UTC
Created attachment 370781 [details] [review]
rtpsession: Drop packet if trying to send from non-internal source

    If obtain_internal_source() returns a source that is not internal it
    means there exists a non-internal source with the same ssrc. Such an
    ssrc collision should be handled by sending a GstRTPCollision event
    upstream and choose a new ssrc, but for now we simply drop the packet.
    Trying to process the packet further will cause it to be pushed
    usptream (!) since the source is not internal (see source_push_rtp()).
Comment 12 Håvard Graff (hgr) 2018-04-11 12:30:21 UTC
Created attachment 370787 [details] [review]
rtpsession: Send and receive Microsoft x-pli

    rtpsession: Send and receive Microsoft x-pli
    
    This patch checks RTP send and receive caps for
    the field 'rtcp-fb-x-message-x-pli' in the same manner as other
    rtcp feedback key unit methods are checked for.
    
    The only difference from a standard PLI is the extra FCI blob which
    includes a 16bit request id and a 64 bit so called SFR. This patch
    ignores retransmissions of equal request ids when x-pli is turned on.
    
    The patch includes tests for fir, pli and x-pli, as well as
    a fix for making clear-pt-map actually work for gstrtpsession.
Comment 13 Håvard Graff (hgr) 2018-04-11 13:43:28 UTC
Created attachment 370793 [details] [review]
rtpsession: process RB by internal sources

    When we deal with receiver reports containing information about multiple
    internal SSRCs we used to save data only for the SSRC in the last report
    block. Thus the stats would never reflect receiver reports of other
    SSRCs.
    
    For example. Non internal source 0xAAAA receives RR with 3 RBs about
    internal sources 0x1111, 0x2222 and 0x3333. Because 0x3333 was the last
    processed RB we will never see the receiver report of 0x1111 and 0x2222
    in the RTP session stats.
    
    With this patch we save receiver report information in the corresponding
    internal source.
Comment 14 Håvard Graff (hgr) 2018-04-11 14:15:19 UTC
Created attachment 370794 [details] [review]
rtpsession: Add property "stats-min-interval" and notify "stats"

    Notify about changed stats when RTCP is sent. Since notifying on every
    RTCP packet (when early RTCP is used) may introduce significant
    overhead, so the property "stats-min-interval" is added in order to
    control how often this notification can happen.
Comment 15 Håvard Graff (hgr) 2018-04-12 11:09:39 UTC
Created attachment 370842 [details] [review]
rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc
Comment 16 Håvard Graff (hgr) 2018-04-12 11:11:04 UTC
Created attachment 370843 [details] [review]
rtpsession: Fix on-feedback-rtcp race
Comment 17 Håvard Graff (hgr) 2018-04-12 11:11:50 UTC
Created attachment 370844 [details] [review]
rtpsession: Add "send-bye" action-signal
Comment 18 Håvard Graff (hgr) 2018-04-12 11:12:29 UTC
Created attachment 370845 [details] [review]
rtpsession: Drop packet if trying to send from non-internal source
Comment 19 Håvard Graff (hgr) 2018-04-12 11:12:58 UTC
Created attachment 370846 [details] [review]
rtpsession: Send and receive Microsoft x-pli
Comment 20 Håvard Graff (hgr) 2018-04-12 11:13:23 UTC
Created attachment 370847 [details] [review]
rtpsession: process RB by internal sources
Comment 21 Håvard Graff (hgr) 2018-04-12 11:13:56 UTC
Created attachment 370848 [details] [review]
rtpsession: Add property "stats-min-interval" and notify "stats"
Comment 22 Håvard Graff (hgr) 2018-04-12 11:15:23 UTC
I updated some of the patches with fixes for valgrind, autotools, gst-indent, and determinism.
Comment 23 Olivier Crête 2018-04-23 18:21:46 UTC
Review of attachment 370740 [details] [review]:

can't object to this!
Comment 24 Olivier Crête 2018-04-23 18:32:43 UTC
Review of attachment 370741 [details] [review]:

Can you add slightly more descriptive signal names? Otherwise looks good

::: gst/rtpmanager/rtpsession.c
@@ +246,3 @@
+   */
+  rtp_session_signals[SIGNAL_ON_SSRC_PSE] =
+      g_signal_new ("on-ssrc-pse", G_TYPE_FROM_CLASS (klass),

maybe on-ssrc-profile-specific-ext ? A couple extra characters are not that expensive!

@@ +309,3 @@
+   */
+  rtp_session_signals[SIGNAL_ON_CREATING_SRRR] =
+      g_signal_new ("on-creating-srrr", G_TYPE_FROM_CLASS (klass),

can we do on-creating-sr-rr? I couldn't guess was srrr was!
Comment 25 Olivier Crête 2018-04-23 18:35:29 UTC
Review of attachment 370743 [details] [review]:

I like this, but can we add some documentation to the property on this special 0 value?
Comment 26 Olivier Crête 2018-04-23 18:41:23 UTC
Review of attachment 370746 [details] [review]:

This is unsafe.. It only works if the array is already big enough.. it should try to grow it.

Instead, you can try to add a new API to GLib.. even though it will be a pain.. Maybe a hack is to add a int GValue copied from the stack, then reset it, then re-init it...
Comment 27 Olivier Crête 2018-04-23 18:41:57 UTC
Review of attachment 370747 [details] [review]:

looks like a good idea
Comment 28 Olivier Crête 2018-04-23 18:45:12 UTC
Review of attachment 370748 [details] [review]:

Indeed
Comment 29 Olivier Crête 2018-04-23 19:15:03 UTC
Review of attachment 370842 [details] [review]:

Looks ok
Comment 30 Olivier Crête 2018-04-23 19:16:42 UTC
Review of attachment 370843 [details] [review]:

Looks ok, but can you add a comment in the code too?
Comment 31 Olivier Crête 2018-04-23 19:17:25 UTC
Review of attachment 370844 [details] [review]:

How is this action signal different from pushing a EOS on the pad?
Comment 32 Olivier Crête 2018-04-23 19:20:29 UTC
Review of attachment 370845 [details] [review]:

I guess this is better than nothing...
Comment 33 Olivier Crête 2018-04-23 19:22:44 UTC
Review of attachment 370847 [details] [review]:

++
Comment 34 Olivier Crête 2018-04-23 19:25:08 UTC
Review of attachment 370848 [details] [review]:

My only problem is the name.. Maybe "stats-notify-min-interval" ?

::: gst/rtpmanager/rtpsession.c
@@ +78,3 @@
 #define DEFAULT_RTP_PROFILE          GST_RTP_PROFILE_AVP
 #define DEFAULT_RTCP_REDUCED_SIZE    FALSE
+#define DEFAULT_STATS_MIN_INTERVAL   3000

I think the default should be 0.. otherwise it's an API change
Comment 35 Olivier Crête 2018-04-23 19:28:41 UTC
Review of attachment 370846 [details] [review]:

::: gst/rtpmanager/rtpsession.c
@@ +2699,3 @@
+    rtp_session_request_local_key_unit (sess, src, media_ssrc, FALSE,
+        current_time);
+  } else if (fci_length == 3 * sizeof (guint32)) {

Any reason to do this recv_xpli thing instead of auto-detecting if it's Microsoft special or standard based on the packet itself?

::: gst/rtpmanager/rtpsource.h
@@ +209,3 @@
   GQueue        *retained_feedback;
 
+  RTPKeyUnitType key_unit_type;

This won't work.. you can currently request a mix of FIR and of PLI, so it you can't pick a single type..
Comment 36 Mikhail Fludkov 2018-04-24 09:14:33 UTC
(In reply to Olivier Crête from comment #26)
> Review of attachment 370746 [details] [review] [review]:
> 
> This is unsafe.. It only works if the array is already big enough.. it
> should try to grow it.
> 
> Instead, you can try to add a new API to GLib.. even though it will be a
> pain.. Maybe a hack is to add a int GValue copied from the stack, then reset
> it, then re-init it...

I agree. Actually, GLib has an API for it. g_value_array_append (arr, NULL) allocates and zero fills the memory for the new value if needed, but does not init it. I will update the patch.
Comment 37 Håvard Graff (hgr) 2018-04-30 07:31:13 UTC
Created attachment 371533 [details] [review]
rtpsession: Add signals for handling profile-specific extension

Name-change as requested
Comment 38 Håvard Graff (hgr) 2018-04-30 07:32:50 UTC
Created attachment 371534 [details] [review]
rtpsession: Avoid unnecessary copy of stats structure

updated as specified
Comment 39 Håvard Graff (hgr) 2018-04-30 07:36:25 UTC
Created attachment 371535 [details] [review]
rtpsession: process RB by internal sources

updated
Comment 40 Håvard Graff (hgr) 2018-04-30 07:38:36 UTC
Created attachment 371536 [details] [review]
rtpsession: Add property "stats-min-interval" and notify "stats"

Updated with name-change and suggested default value. (to mimic old behavior)

I would however suggest to change this default-value, as having thousands of stats
arriving every second (in the extreme cases) is not very useful and can cause
a listening application to halt.
Comment 41 Håvard Graff (hgr) 2018-04-30 07:40:08 UTC
(In reply to Olivier Crête from comment #31)
> Review of attachment 370844 [details] [review] [review]:
> 
> How is this action signal different from pushing a EOS on the pad?

No different, but in terms of application and bindings, being able to trigger
such functionality without having to deal with pads and creating events is
useful.
Comment 42 Håvard Graff (hgr) 2018-04-30 07:42:58 UTC
Created attachment 371537 [details] [review]
rtpsession: Add tests for PLI and FIR

Turns out we don't actually use this patch internally anymore, so instead
I have simply added the tests written for PLI and FIR (as well as the fix
for clear-pt-map that the tests uses).
Comment 43 Håvard Graff (hgr) 2018-04-30 07:48:31 UTC
(In reply to Olivier Crête from comment #25)
> Review of attachment 370743 [details] [review] [review]:
> 
> I like this, but can we add some documentation to the property on this
> special 0 value?

Where would be a good place to document this?
Comment 44 Håvard Graff (hgr) 2018-04-30 08:58:28 UTC
Created attachment 371539 [details] [review]
rtpsession: Fix race when sending PLI, FIR and NACK packets

    Calling rtp_session_send_rtcp before marking the source as requiring a
    pli/fir/nack meant the rtcp_thread could be scheduled and start running
    before the source was updated. This meant the request would not be sent
    early but instead was transmitted with the next regular RTCP packet.
    
    Add test for nack generation.
Comment 45 Sebastian Dröge (slomo) 2018-05-06 15:22:13 UTC
*** Bug 746814 has been marked as a duplicate of this bug. ***
Comment 46 Tim-Philipp Müller 2018-05-13 23:21:28 UTC
*** Bug 791075 has been marked as a duplicate of this bug. ***
Comment 47 Tim-Philipp Müller 2018-05-13 23:21:47 UTC
*** Bug 791076 has been marked as a duplicate of this bug. ***
Comment 48 Håvard Graff (hgr) 2018-05-14 09:21:16 UTC
Created attachment 371992 [details] [review]
rtpsession: Add signals for handling profile-specific extension

Updated patch after rebase
Comment 49 Håvard Graff (hgr) 2018-05-14 09:22:00 UTC
Created attachment 371993 [details] [review]
rtpsession: Don't start the RTCP thread until it's needed

Updated patch after rebase
Comment 50 Håvard Graff (hgr) 2018-05-14 09:22:34 UTC
Created attachment 371994 [details] [review]
rtpsession: Allow instant transmission of RTCP packets

Updated patch after rebase
Comment 51 Håvard Graff (hgr) 2018-05-14 09:29:38 UTC
Created attachment 371995 [details] [review]
rtpsession: Avoid unnecessary copy of stats structure

Updated patch after rebase
Comment 52 Håvard Graff (hgr) 2018-05-14 09:30:32 UTC
Created attachment 371996 [details] [review]
rtpsession: Add "send-bye" action-signal

Updated patch after rebase
Comment 53 Håvard Graff (hgr) 2018-05-14 09:31:14 UTC
Created attachment 371997 [details] [review]
rtpsession: Drop packet if trying to send from non-internal source

Updated patch after rebase
Comment 54 Håvard Graff (hgr) 2018-05-14 09:31:45 UTC
Created attachment 371998 [details] [review]
rtpsession: Add tests for PLI and FIR

Updated patch after rebase
Comment 55 Håvard Graff (hgr) 2018-05-14 09:32:14 UTC
Created attachment 371999 [details] [review]
rtpsession: process RB by internal sources

Updated patch after rebase
Comment 56 Håvard Graff (hgr) 2018-05-14 09:32:44 UTC
Created attachment 372000 [details] [review]
rtpsession: Add property "stats-min-interval" and notify "stats"

Updated patch after rebase
Comment 57 Håvard Graff (hgr) 2018-05-14 09:33:37 UTC
Created attachment 372001 [details] [review]
rtpsession: Fix race when sending PLI, FIR and NACK packets

Updated patch after rebase
Comment 58 Tim-Philipp Müller 2018-05-15 09:22:13 UTC
Comment on attachment 371994 [details] [review]
rtpsession: Allow instant transmission of RTCP packets

Need to add docs about special 0 value. Need to figure out where to add that. (From previous review)
Comment 59 Tim-Philipp Müller 2018-05-15 09:24:40 UTC
Comment on attachment 371996 [details] [review]
rtpsession: Add "send-bye" action-signal

(From previous review comment) Question was how this is different from sending an EOS on the pad. Answer: not functionally different, but nicer API, app doesn't have to mess with pads and events and such.
Comment 60 Tim-Philipp Müller 2018-05-15 10:54:22 UTC
Comment on attachment 371998 [details] [review]
rtpsession: Add tests for PLI and FIR

Split this in two (one for the clear-pt-map fix one for the tests).
Comment 61 Olivier Crête 2018-05-22 06:37:51 UTC
(In reply to Tim-Philipp Müller from comment #59)

Can we write that in the doc then. "This is the same behaviour as sending an EOS event to the pad."
Comment 62 Tim-Philipp Müller 2018-05-22 11:07:28 UTC
Question about this ("send-bye" action signal) though: does it really behave the same way? What happens if data arrives after/while it's been emitted? With an EOS event GstPad will set the EOS flag and all further data will be dropped automatically until the pad gets flushed or STREAM_START arrives. Do we need something similar here too to at least drop data?
Comment 63 Mathieu Duponchelle 2018-07-12 16:36:39 UTC
Review of attachment 371993 [details] [review]:

Looks good to me, tests are passing, and it fixes a race condition I was observing, rebasing and pushing, thanks!
Comment 64 Mathieu Duponchelle 2018-07-12 16:36:44 UTC
Review of attachment 371993 [details] [review]:

Looks good to me, tests are passing, and it fixes a race condition I was observing, rebasing and pushing, thanks!
Comment 65 Mathieu Duponchelle 2018-07-12 16:39:09 UTC
Comment on attachment 371993 [details] [review]
rtpsession: Don't start the RTCP thread until it's needed

Attachment 371993 [details] pushed as ac6e77a - rtpsession: Don't start the RTCP thread until it's needed
Comment 66 Aleix Conchillo Flaqué 2018-09-10 19:28:05 UTC
Just wanted to mention that this patch:

https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/gst/rtpmanager/gstrtpsession.c?id=ac6e77acad79907564c96383f87d50bcf82d9e33

Fixes an issue in webrtcbin where an initial SSRC is negotiated in the offer but then a different SSRC is used in the RTP packets.

I found this on an application that establishes a webrtc connection then closes it and opens another one. The first one succeeds, but after the second one I always hit the issue. From the logs I can see how the ICE connection establishment succeeds earlier in the second time.

I believe this is because a new SSRC from the RTCP was being negotiated instead of the original one coming from the payloader.

Does this make any sense?
Comment 67 Aleix Conchillo Flaqué 2018-09-10 19:40:17 UTC
Also, not sure if you would like to consider this patch to be included in 1.14 since it's a very easy to hit bug.
Comment 68 Tim-Philipp Müller 2018-09-11 08:44:04 UTC
Picked into 1.14 (for 1.14.3) thanks.
Comment 69 Mathieu Duponchelle 2018-09-11 08:52:28 UTC
(In reply to Aleix Conchillo Flaqué from comment #66)
> Just wanted to mention that this patch:
> 
> https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/gst/
> rtpmanager/gstrtpsession.c?id=ac6e77acad79907564c96383f87d50bcf82d9e33
> 
> Fixes an issue in webrtcbin where an initial SSRC is negotiated in the offer
> but then a different SSRC is used in the RTP packets.

That is indeed the issue I was having :)
Comment 70 Mathieu Duponchelle 2018-10-12 14:05:11 UTC
Review of attachment 371992 [details] [review]:

Is the new "on-creating-srrr" strictly necessary, or could "on-sending-rtcp" be used instead? If not, why, and if yes, shouldn't we have a more generic signal emitted when any RTCP packet is created?
Comment 71 Mathieu Duponchelle 2018-10-12 19:16:53 UTC
(In reply to Mathieu Duponchelle from comment #70)
> Review of attachment 371992 [details] [review] [review]:
> 
> Is the new "on-creating-srrr" strictly necessary, or could "on-sending-rtcp"
> be used instead? If not, why, and if yes, shouldn't we have a more generic
> signal emitted when any RTCP packet is created?

this should read: "and in that case, shouldn't we have", my bad
Comment 72 Mathieu Duponchelle 2018-10-12 19:43:58 UTC
Review of attachment 371999 [details] [review]:

This looks like the right thing to do indeed, it's surprising that we did obtain the correct source but then proceeded to update the stats of the sender of the packet. Also I don't think the comment in the commit is correct, afaict we previously used the "SSRC of packet sender" obtained with obtain_source(gst_rtcp_packet_rr_get_ssrc()), not with the ssrc of the last report block.

::: gst/rtpmanager/rtpsession.c
@@ +2273,3 @@
        * the other sender to see if we are better or worse. */
       /* FIXME, need to keep track who the RB block is from */
+      rtp_source_process_rb (src, pinfo->ntpnstime, fractionlost,

Does that mean we can remove the FIXME right above? Also the comment will need updating, as it says "we update the stats of the sender of the RTCP message.", which will no longer be true
Comment 73 Mathieu Duponchelle 2018-10-12 20:16:16 UTC
Review of attachment 372000 [details] [review]:

Only minor comments, this is OK to commit for me once these are addressed

::: gst/rtpmanager/rtpsession.c
@@ +612,3 @@
+      g_param_spec_uint ("stats-notify-min-interval",
+          "Stats notify minimum interval",
+          "Minimum interval between emitting notify signal for stats (in ms)",

between emissions of the notify signal rather?

::: tests/check/elements/rtpsession.c
@@ +1239,3 @@
+count_report_stats (GObject * object, GParamSpec * spec, gint * counter)
+{
+  (void) object;

Any reason not to use G_GNUC_UNUSED?

@@ +1297,3 @@
+
+  /* verify we have generated less than 3 stats for all these packets */
+  fail_unless (stats_callback_count < 3);

Can we not make a strict comparison here?
Comment 74 Mathieu Duponchelle 2018-10-12 20:49:55 UTC
Review of attachment 372001 [details] [review]:

Looks good to me
Comment 75 GStreamer system administrator 2018-11-03 15:28:39 UTC
-- 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/gstreamer/gst-plugins-good/issues/460.