[vlc-devel] [PATCH] es_out: merge es->i_id with es->fmt.i_id
Thomas Guillem
thomas at gllm.fr
Mon Aug 20 09:43:05 CEST 2018
ahhh, missed the reference counted part. Indeed, it will work.
I summarize what I understood then:
- Create an opaque type to hold ES, like struct vlc_es.
- Make it reference counted and expose vlc_es_Hold(), vlc_es_Release().- Also hold the es_format_t, title, and maybe other infos (to ease
vlc_es propagation through events). These members will be available
via vlc_es_getFmt() and vlc_es_GetTitle()
I can add everything to the input/es_out now, but it won't be used now
(waiting for input manager).API/Users will still be able to select en es via the fmt.i_id but the
new preferred way will be ^^.
When a vlc_es is selected via the future input manager, the vlc_es is
held by the first call, and until the input thread handle this control
Agree?
On Sun, Aug 19, 2018, at 17:24, Rémi Denis-Courmont wrote:
> I don't recall suggesting "void" pointers. I suggested reference-
> counted (and thus, typed) pointers.>
> Le 19 août 2018 11:16:19 GMT+03:00, Thomas Guillem <thomas at gllm.fr>
> a écrit :>> I agree about keeping fmt.id for TS ES and using an unique ID for
>> libvlc or the new input manager.>>
>> Using a void* can be racy when deleting and creating an ES (the es
>> can use the same pointer).>>
>> An integer overflow is very unlikely to happen when creating an ES
>> (and we can still check the overflw and fail if it happens).>>
>> Do you still prefer using void* ?
>>
>> On Fri, Aug 17, 2018, at 19:03, Rémi Denis-Courmont wrote:
>>> You cannot have more than uintptr_t references on an object in
>>> memory (or even all objects).>>>
>>> But as François pointed out, no matter how large the integer, you
>>> can always overflow after long enough.>>>
>>> I just don't see the point in using handles or IDs when you can use
>>> pointers. Pointers are generally the easiest identifier in C.>>>
>>> Le 17 août 2018 17:59:44 GMT+03:00, Thomas Guillem <thomas at gllm.fr>
>>> a écrit :>>>> So, I plan to use a uintptr_t (on the allocated es) as a unique es
>>>> identifier.
>>>>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Aug 17, 2018, at 15:27, Francois Cartegnie wrote:
>>>>
>>>>
>>>>
>>>>
>>>>> Le 17/08/2018 à 15:21, Francois Cartegnie a écrit :
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> You can't track usable ids unless you allocate UINTxx_MAX bits
>>>>>> to
>>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>> reference id usage, and add a worth case time of that number of
>>>>>> bytes - 1.
>>>>>>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> worsT case time
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Hell.....
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> vlc-devel mailing list
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> To unsubscribe or modify your subscription options:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> vlc-devel mailing list
>>>>
>>>>
>>>>
>>>>
>>>> To unsubscribe or modify your subscription options:
>>>>
>>>>
>>>>
>>>>
>>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
>>> excuser ma brièveté.>>> _________________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
> excuser ma brièveté.> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180820/e95041b9/attachment.html>
More information about the vlc-devel
mailing list