Re: [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

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

 



On Mon, Mar 21, 2016 at 07:43:20PM +0100, Francois Gouget wrote:
> A completely different approach to solving this would be to handle it 
> all in the GStreamer encoder code:
>  - Only ref the RedDrawable once but wrap it in a struct with its own 
>    refcount. It's that struct which will track the actual refcounting by 
>    the GstMemory objects.
>  - When that struct's refcount drops to zero, put the RedDrawable into a 
>    GAsyncQueue.
>  - encode_frame() is always called from a safe thread, so unref all the 
>    RedDrawables in the async queue whenever we enter / leave 
>    encode_frame() or destroy the GStreamer encoder.
> 
> The drawback is that we could get up to a 1 frame delay before a 
> RedDrawable is freed.

I forgot to mention that this approach is fine for me if fighting with
glib mainloop stuff is not going well.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]