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 603376 - rtpsession : g_type_create_instance performance issue : avoid buffer ref
rtpsession : g_type_create_instance performance issue : avoid buffer ref
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.18
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-30 14:21 UTC by Aurelien Grimaud
Modified: 2009-11-30 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
copy csrc in glist. Do not ref buffer (2.76 KB, patch)
2009-11-30 14:21 UTC, Aurelien Grimaud
none Details | Review

Description Aurelien Grimaud 2009-11-30 14:21:51 UTC
Created attachment 148743 [details] [review]
copy csrc in glist. Do not ref buffer

rtpsession always ref the incoming buffer to process csrc after buffer has been pushed (rtp_session_process_rtp).
Problem is that with gstrtpbin, downstream elements include a jitterbuffer which issues a gst_buffer_make_metadata_writable (gst_rtp_jitter_buffer_chain).
This gst_buffer_make_metadata_writable always does a metadata copy, because buffer has been reffed peviously.
This leads to the known performance issue in g_type_create_instance (gst_buffer_create_sub / gst_mini_object_new).

Here is a patch which copies csrc into a glist for further processing, avoiding buffer ref.
Comment 1 Wim Taymans 2009-11-30 15:05:46 UTC
Good idea! I changed it a bit to use an array instead of a GList to avoid some allocations (not that CSRCs are very common).

commit 07f27f0efd5a866721fd83c6873e7eacc989c0fe
Author: Aurelien Grimaud <gstelzz at yahoo dot fr>
Date:   Mon Nov 30 15:59:50 2009 +0100

    rtpsession: avoid buffer ref/unref pairs for CSRCs
    
    We ref the buffer before pushing it downstream in order to get the CSRCs of it
    after pushing. This causes performance problems when downstream elements want to
    change the metadata because the buffer needs to be subbuffered.
    
    Instead, read and store the CSRCs of the buffer in an array before pushing it
    and process the array after pushing the buffer. This allows us to remove the
    ref/unref pair.
    
    Fixes #603376