[gstreamer-bugs] [Bug 590669] [API] need GstByteWriter or GstChunkWriter
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sun Oct 4 08:49:24 PDT 2009
https://bugzilla.gnome.org/show_bug.cgi?id=590669
GStreamer | gstreamer (core) | git
--- Comment #9 from Sebastian Dröge <slomo at circular-chaos.org> 2009-10-04 15:49:19 UTC ---
(In reply to comment #8)
> > #define GST_BYTE_WRITER(writer) ((GstByteWriter *) writer)
>
> Not that I can really think of a plausible case where this would matter, but
> shouldn't it be (writer) ?
Yes, thanks
> > GstByteWriter * gst_byte_writer_new_with_data (guint8 *data, guint size);
> >
> > #define GST_BYTE_WRITER_INIT_WITH_DATA (data, sized) \
> > { {data, size, 0}, TRUE, size }
> > #define GST_BYTE_WRITER_INIT_WITH_BUFFER (buffer) \
> > GST_BYTE_WRITER_INIT_WITH_DATA (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE(buffer))
>
> I thought of this API more as in "write to, but don't realloc or free the
> memory provided", not as in "GstByteWriter takes ownership of the memory
> passed".
>
> I think we need a second flag to signal if the writer owns the memory, so it
> knows whether to free/return or _dup() it when freeing the writer.
Yes and another flag, if the memory is initialized (can be read) or not.
> > #define GST_BYTE_WRITER_INIT_WITH_SIZE (size, fixed) \
> > { {g_malloc (GST_BYTE_READER_MIN_SIZE), 0, 0}, fixed, GST_BYTE_READER_MIN_SIZE }
>
> shouldn't that be 'size' here instead of _MIN_SIZE? I don't think _MIN_SIZE
> should be in the headers btw, the implementation should handle an initial value
> of 0 find and then re-alloc to MIN_SIZE internally as needed IMO. Not sure I
> really like the g_malloc here.
Yes, fixed locally already :)
> Not sure we really need any of the _INIT_WITH* macros, esp. if we have inlined
> init functions.
Ok, I only had them because the reader had them too. I'll remove them then :)
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the Gstreamer-bugs
mailing list