gst-plugin/src/gstaudiofilter.c
/* You may choose to implement either a copying filter or an
 * in-place filter (or both).  Implementing only one will give
 * full functionality, however, implementing both will cause
 * audiofilter to use the optimal function in every situation,
 * with a minimum of memory copies. */
You may choose to implement either a copying filter or an
in-place filter (or both).  Implementing only one will give
full functionality, however, implementing both will cause
audiofilter to use the optimal function in every situation,
with a minimum of memory copies.
You may choose to implement either a copying filter or an in - place filter ( or both ) . Implementing only one will give full functionality however implementing both will cause audiofilter to use the optimal function in every situation with a minimum of memory copies .
static GstFlowReturn
gst_audio_filter_template_filter (GstBaseTransform * base_transform,
    GstBuffer * inbuf, GstBuffer * outbuf)
{
  GstAudioFilterTemplate *filter = GST_AUDIO_FILTER_TEMPLATE (base_transform);
  GstMapInfo map_in;
  GstMapInfo map_out;
  GST_LOG_OBJECT (filter, "transform buffer");
  if (gst_buffer_map (inbuf, &map_in, GST_MAP_READ)) {
    if (gst_buffer_map (outbuf, &map_out, GST_MAP_WRITE)) {
      g_assert (map_out.size == map_in.size);
      memcpy (map_out.data, map_in.data, map_out.size);
      gst_buffer_unmap (outbuf, &map_out);
    }
    gst_buffer_unmap (inbuf, &map_in);
  }
  return GST_FLOW_OK;
}
static GstFlowReturn gst_audio_filter_template_filter ( GstBaseTransform * base_transform , GstBuffer * inbuf , GstBuffer * outbuf ) { GstAudioFilterTemplate * filter = GST_AUDIO_FILTER_TEMPLATE ( base_transform ) ; GstMapInfo map_in ; GstMapInfo map_out ; GST_LOG_OBJECT ( filter , " " ) ; if ( gst_buffer_map ( inbuf , & map_in , GST_MAP_READ ) ) { if ( gst_buffer_map ( outbuf , & map_out , GST_MAP_WRITE ) ) { g_assert ( map_out . size == map_in . size ) ; memcpy ( map_out . data , map_in . data , map_out . size ) ; gst_buffer_unmap ( outbuf , & map_out ) ; } gst_buffer_unmap ( inbuf , & map_in ) ; } return GST_FLOW_OK ; }
You may choose to implement either a copying filter or an
 in-place filter (or both).
You may choose to implement either a copying filter or an in - place filter ( or both ) .
/* FIXME: do something interesting here.  We simply copy the input data
   * to the output buffer for now. */