[Cogl] [PATCH] cogl-gst: allocate textures synchronously

Robert Bragg robert at sixbynine.org
Fri Jan 10 19:05:14 PST 2014


Yeah that code does seem a bit weird and looks like it could be made a
lot simpler by using cogl_texture_2d_new_from_data() and
cogl_texture_2d_sliced_new_from_data() which both allocate
synchronously too. I can aim to send a follow up patch to simplify
that code.

On a side note; It would be nice at some point to add a
cogl_bitmap_new_from_data_full() function that lets us pass a
destroy_notify callback for when the CoglBitmap is freed to make it
more convenient to wrap ref-counted data such as a GstBuffer.

thanks for looking at the patch,
Robert


On Sat, Jan 11, 2014 at 2:38 AM, Lionel Landwerlin
<llandwerlin at gmail.com> wrote:
> This patch now makes me wonder why we're using this Bitmap to Texture
> trick?
> We need to copy the texture everytime, because the GstBuffer is unref at
> the end of the upload().
> Any idea?
>
> Otherwise the patch makes sense.
>
> -
> Lionel
>
>
> On Sat, 2014-01-11 at 01:54 +0000, Robert Bragg wrote:
>> From: Robert Bragg <robert at linux.intel.com>
>>
>> This makes sure video textures being uploaded via
>> video_texture_new_from_data are allocated before the function returns.
>> This function create a CoglBitmap to wrap the data from gstreamer and
>> by
>> allowing cogl to allocate the texture lazily it's possible that the
>> data
>> being pointed to by the bitmap won't remain valid until we actually
>> come
>> to allocate the texture.
>
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl


More information about the Cogl mailing list