[vlc-devel] commit: Implement access_GetParentInput and demux_GetParentInput and use. ( Pierre d'Herbemont )

Laurent Aimar fenrir at via.ecp.fr
Thu Aug 27 14:17:41 CEST 2009


Hi,

On Thu, Aug 27, 2009, Pierre d'Herbemont wrote:
>
> On Aug 27, 2009, at 8:50 AM, Rémi Denis-Courmont wrote:
>
>>
>> On Wed, 26 Aug 2009 22:27:10 +0200, Pierre d'Herbemont
>> <pdherbemont at gmail.com> wrote:
>>> My point is we don't do proper refcounting on some object that
>>> announce it.
>>
>> You still failed to give any concrete example of that.
>
> *All* object, it is a matter of naming. input_thread_t, demux_t,  
> access_t are objects, They all have vlc_object_hold() and some of them  
> may crash on public accessor.
 vlc_object_hold, as its name says, retains a vlc_object_t and only that
unless specified otherwise (idealy).

> I say that demux_t is an object, and using vlc_object_hold() on it is  
> misleading because it's only retaining some part of the structure.
 Yes, the vlc_object_t part and that's all.

>> It is not misleading. It holds an object, not an access/demux/ 
>> whatever.
>> You are misleading.
>
> Come on. access is an object, demux is an object, whatever is an object. 
> Don't use generic misleading term to describe something else. This is 
> misleading.
 access is a sub-class of an object but NOT the other way around.

> The point is, this is not the case with other object (demux, access),  
> and I would like to see a distinction between those. Laurent suggested  
> doc change, which would be nice.
>
> I would like probably to change the API to reflect those different type 
> of reference owning, toward something less generic but more explicit.
 You cannot do that easily. For each specific object you would then need
a different interface and that cannot be generic.

For example, instead of vout_thread_t you would need at least:
 - vlc_object_t for VLC_COMMON_MEMBERS manipulation
 - vout_decoder_interface for usage in input/decoder.c
 - vout_resource_interface for usage in resource
 - vout_external_interface for usage in interfaces/global code.
And of course a bunch of functions to retreive a reference of each interface
type (with all the refcounting, exclusion and ownership management).
Possible but not light.
The same thing would be needed for input_thread_t, aout_instance_t, etc.
IMHO, we can do more productive things with all the time that would require.

-- 
fenrir




More information about the vlc-devel mailing list