[gstreamer-bugs] [Bug 572973] buffer size request event

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Thu Feb 26 00:40:22 PST 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=572973

  GStreamer | gstreamer (core) | Ver: git




------- Comment #2 from Stefan Kost (gstreamer, gtkdoc dev)  2009-02-26 08:40 UTC -------
encoders would want to request a number of samples:
- mp3: a frame that consists of 384, 576, or 1152 samples
 (depends on MPEG version and layer)
- aac: a frame always consists of 1024 samples

dunno if ther eare difference in mono/stereo. problem is that sources work in
bytes (at least if we implement it in basesrc via blocksize). It means the
request needs to be converted when passing it along. there could be even the
case of:
8bitaudiosrc ! audioconvert ! audioenc

if audioenc request 1024 samples a 16bit = 2048 bit from audioconvert, then
audioconvert will request 1024 samples a 8bit from 8bitaudiosrc.

Regarding comment #1. I need to figure when extactly a buffer-size-request
should be sent. In the _chain function the encoder could do:

gst_xxx_chain(GstElement *self,GstBuffer *buf)
{
  GstBuffer *in;

  if((G_LIKELY(gst_adapter_available(self->adapter)==0) &&
(GST_BUFFER_SIZE(buf)==wanted_size)) {
    in=buf;
  } else {
    gst_adapter_push(self->adapter,buf);
    in=gst_adapter_take_buffer(self->adapter,wanted_size);
    if(in==NULL) ... /* need more */
  }

  ...

  gst_buffer_unref(in);
}

It mean the adapter would only be used if we ever get a frame that is no the
wanted size.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=572973.




More information about the Gstreamer-bugs mailing list