[gstreamer-bugs] [Bug 340362] [PATCH] new plugin - hardlimiter

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Thu May 11 08:14:19 PDT 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=340362
 GStreamer | gst-plugins-bad | Ver: HEAD CVS


Tim-Philipp Müller changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #64646|0                           |1
        is obsolete|                            |




------- Comment #3 from Tim-Philipp Müller  2006-05-11 15:14 UTC -------
Created an attachment (id=65249)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=65249&action=view)
patch against gst-plugins-bad

This looks like very nice and clean code. Attached a modified version as a
patch against gst-plugins-bad.

Some minor things I came across:

 - if the type is called GstHardLimit, functions should be gst_hard_limit_foo
   and not gst_hardlimit_foo as well

 - you don't need GST_BOILERPLATE_FULL here, the debug init stuff is usually
   done in plugin_init or the base init function

 - in gst_hard_limiter_transform_ip() - why just return GST_FLOW_OK if the
   buffer isn't writable? Is that an expected situation? If not, we should
   probably g_assert() it instead.

 - there's a GST_BUFFER_TIMESTAMP_IS_VALID macro as well

 - the HARDLIMITER_DO_LIMIT_FUNCTION macro in hardlimit.h uses 'static inline'
   for the functions but they won't be inlined (I think) because they're
   refered to by address and assigned to filter->do_limit, so the whole
   transform business is highly inefficient at the moment because it involves
   a function call for every single sample in the buffer.

 - might make sense to use the G_UNLIKELY macros in the hardlimiter_limit
   functions

 - also - minor point: the element doesn't actually seem to do anything at
   all no matter what :) I tracked this down to the buffer writable check
   mentioned above. Adding something like
     gstbasetrans_class->passthrough_on_same_caps = TRUE;
   and later
     gst_base_transform_set_in_place (GST_BASE_TRANSFORM (filter), TRUE);
   seems to fix this and give us a writable buffer.


Lastly, could you explain to me the exact difference between 'hard limiting'
and 'clipping'?

Apologies in advance for my ignorance, but it seems to me that all this element
does is actually clip the signal at a certain level. I would have thought that
'hard limiting' involves reducing the signal in general once the limit has been
reached (with a 0-second attack, thus 'hard') or something like that. Please
correct me if I'm wrong :)


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list