[vlc-devel] [vlc-commits] aout: do not use input resource for visualization

Thomas Guillem thomas at gllm.fr
Mon Jan 21 12:50:58 CET 2019


On Mon, Jan 21, 2019, at 12:11, Rémi Denis-Courmont wrote:
> Hi,
> 
> I don't see why filters should need to pass by decoders, or access the clock (which might not even exist - unpaced sout), as they are much better off with original timestamps.
> 
> 
> But more prosaically, I don't see the link with this patch, or even the whole patch series, which affects only visualisations, not audio filters.

OK, audio filters will generally only use original timestamps.
Visualization filters are audio filters, right ? They will need to access the main clock in order to synchronize with it. If the user change the audio delay, the visualization filter need to know it.

If I remember correctly, we discussed about it during last VDD. You first disagreed with me, then when agreed that timestamps should not be touched until output. The problematic point, that you mentioned, was how to synchronize visualization filters.

This is what my patch was trying to solve.

> 
> Le 21 janvier 2019 11:35:54 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>> 
>> On Fri, Jan 18, 2019, at 22:12, Rémi Denis-Courmont wrote:
>>> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jan 
>>> 18 21:13:25 2019 +0200| [abc6132f802ed64cb35d3af74377194e2fd6ea2d] | 
>>> committer: Rémi Denis-Courmont
>>> 
>>> aout: do not use input resource for visualization
>>> 
>>> Since the recycle flag is always false, the video output is never
>>> preserved, so tracking it in input resources is vain.
>>> 
>>> Creating and destroying the video output directly instead of
>>> deferring to decoder callbacks is also more consistent with the
>>> behaviour of the newer OpenGL-based visualizations.
>> 
>> Hello Rémi,
>> Your commit seems a good idea but it breaks my "clock" local branch.
>> cf. https://code.videolan.org/jbk/vlc/commit/5a7b9230ec4912205877f9ffcd7dc690866ab8ee
>> 
>> I need the audio filters to pass by the decoder in order to share the same master clock.
>> That way, delay and synchronization are easily applied for all audio filters (what my commit is doing).
>> 
>> Do you have an idea how to achieve this with your recent changes ? I'll need a way to get access to the decoder, input or es_out somehow.
>> 
>> PS: This is a WIP commit.
>> 
>> 
>> 
>> > 
>>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=abc6132f802ed64cb35d3af74377194e2fd6ea2d
>>>   src/audio_output/filters.c | 17 ++++++-----------
>>>   1 file changed, 6 insertions(+), 11 deletions(-)
>>>  
>>>  diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
>>>  index d1b9dbecf7..3fdb68ca0b 100644
>>>  --- a/src/audio_output/filters.c
>>>  +++ b/src/audio_output/filters.c
>>>  @@ -36,10 +36,9 @@
>>>   #include <vlc_modules.h>
>>>   #include <vlc_aout.h>
>>>   #include <vlc_filter.h>
>>>  -#include <vlc_vout.h>                  /* for vout_Request */
>>>  -
>>>   #include <libvlc.h>
>>>   #include "aout_internal.h"
>>>  +#include "../video_output/vout_internal.h" /* for vout_Request */
>>>   
>>>   static filter_t *CreateFilter (vlc_object_t *obj, const char *type,
>>>                                  const char *name, void *sys,
>>>  @@ -384,22 +383,18 @@ static int VisualizationCallback (vlc_object_t 
>>>  *obj, const char *var,
>>>   
>>>   vout_thread_t *aout_filter_GetVout(filter_t *filter, const video_format_t *fmt)
>>>   {
>>>  -    /* NOTE: This only works from aout_filters_t.
>>>  -     * If you want to use visualization filters from another place, you will
>>>  -     * need to add a new pf_aout_request_vout callback or store a pointer
>>>  -     * to aout_request_vout_t inside filter_t (i.e. a level of indirection). */
>>>  -    const aout_request_vout_t *req = filter->owner.sys;
>>>       video_format_t adj_fmt = *fmt;
>>>  +    vout_configuration_t cfg = { .fmt = &adj_fmt, .dpb_size = 1 };
>>>   
>>>       video_format_AdjustColorSpace(&adj_fmt);
>>>  -    return req->pf_request_vout(req->p_private, NULL, &adj_fmt);
>>>  +
>>>  +    return vout_Request(VLC_OBJECT(filter), &cfg, NULL);
>>>   }
>>>   
>>>   void aout_filter_PutVout(filter_t *filter, vout_thread_t *vout)
>>>   {
>>>  -    const aout_request_vout_t *req = filter->owner.sys;
>>>  -
>>>  -    req->pf_request_vout(req->p_private, vout, NULL);
>>>  +    assert(vout->obj.parent == VLC_OBJECT(filter));
>>>  +    vout_CloseAndRelease(vout);
>>>   }
>>>   
>>>   static int AppendFilter(vlc_object_t *obj, const char *type, const char *name, vlc-commits mailing list
>>>  vlc-commits at videolan.org
>>>  https://mailman.videolan.org/listinfo/vlc-commits
>>> 
>> 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/20190121/471b7662/attachment.html>


More information about the vlc-devel mailing list