buffer management [was Re: libsoup-2.4 branch merged to trunk]

Wouter Cloetens wrote:
> One thing I'm still missing is application buffer management. I'd like
> to be able to (1) control the maximum size of the chunks and (2) provide
> pre-allocated buffers to eliminate copying data.

Another possibility would be to have a "gst_buffer_set_free_func()" or
something, so that you could have the GstBuffer share the memory with
the SoupBuffer directly, and then free the SoupBuffer when the GstBuffer
is freed.

Benjamin Otte is running into the same problem in swfdec (except worse,
because in some cases he ends up streaming from SoupBuffers to
GstBuffers via SwfdecBuffers). We were talking on #gnome-hackers the
other day about the possibility of having a refcounted buffer type
directly in glib.

Anyway, I'm still trying to figure out exactly how an API like this
would work... currently the code isn't really written with that
possibility in mind, although the addition of GCancellable args to the
SoupSocket calls will make it easier I think...

I'm assuming it would probably involve a new SoupSession subclass with
some methods sort of like neon's
ne_begin_request/ne_read_response_block, but if you have different ideas
of what you want the API to look like, chime in (or write a "this is the
patch I'd like to be able to apply to souphttpsrc" patch. :)

-- Dan

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]