[gst-devel] [gst-cvs] slomo gst-plugins-bad: gst-plugins-bad/ gst-plugins-bad/ext/soundtouch/

Stefan Kost ensonic at hora-obscura.de
Sun Jan 27 19:15:02 CET 2008


hi,

slomo at kemper.freedesktop.org schrieb:
> CVS Root:       /cvs/gstreamer
> Module:         gst-plugins-bad
> Changes by:     slomo
> Date:           Sun Jan 27 2008  05:56:18 UTC
> 
> Log message:
> * ext/soundtouch/Makefile.am:
> * ext/soundtouch/gstbpmdetect.cc:
> * ext/soundtouch/gstbpmdetect.hh:
> * ext/soundtouch/plugin.c: (plugin_init):
> Add BPM detection plugin based on SoundTouch's libBPM.
> * ext/soundtouch/gstpitch.cc:
> Allow sample rates until MAX instead of only 48kHz and remove the
> buffer-frames field from that caps.
> Clear the remaining samples completely when necessary to get into
> a clean state again.

cool plugin! some comments for gst_bpm_detect_transform_ip

  if (filter->format.channels == 0 || filter->format.rate == 0) {
    GST_ERROR_OBJECT (bpm_detect, "No channels or rate set yet");
    return GST_FLOW_ERROR;
  }

  nsamples = GST_BUFFER_SIZE (in) / (4 * filter->format.channels);

  if (!bpm_detect->priv->detect)
    bpm_detect->priv->detect =
        new BPMDetect (filter->format.channels, filter->format.rate);

I would change that to

  if (G_UNLIKELY(!bpm_detect->priv->detect)) {
    if (filter->format.channels == 0 || filter->format.rate == 0) {
      GST_ERROR_OBJECT (bpm_detect, "No channels or rate set yet");
      return GST_FLOW_ERROR;
    }
    bpm_detect->priv->detect =
        new BPMDetect (filter->format.channels, filter->format.rate);
  }

  nsamples = GST_BUFFER_SIZE (in) / (4 * filter->format.channels);


Another one:

  data = (gfloat *) g_memdup (GST_BUFFER_DATA (in), GST_BUFFER_SIZE (in));
  bpm_detect->priv->detect->inputSamples (data, nsamples);
  g_free (data);

why do you need to copy?


Stefan

> 
> Modified files:
>     .               : ChangeLog
>     ext/soundtouch  : Makefile.am gstpitch.cc
> Added files:
>     ext/soundtouch  : gstbpmdetect.cc gstbpmdetect.hh plugin.c
> 
> Links:
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3063&r2=1.3064
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/soundtouch/Makefile.am.diff?r1=1.3&r2=1.4
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/soundtouch/gstbpmdetect.cc?rev=1.1&content-type=text/vnd.viewcvs-markup
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/soundtouch/gstbpmdetect.hh?rev=1.1&content-type=text/vnd.viewcvs-markup
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/soundtouch/gstpitch.cc.diff?r1=1.8&r2=1.9
> http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/soundtouch/plugin.c?rev=1.1&content-type=text/vnd.viewcvs-markup
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-cvs mailing list
> gstreamer-cvs at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs





More information about the gstreamer-devel mailing list